diff --git a/gateway/enforcer/go.mod b/gateway/enforcer/go.mod new file mode 100644 index 0000000000..616f2d5c0d --- /dev/null +++ b/gateway/enforcer/go.mod @@ -0,0 +1,54 @@ +module github.com/wso2/apk/gateway/enforcer + +go 1.23.2 + +require ( + github.com/envoyproxy/gateway v1.2.3 + github.com/go-logr/logr v1.4.2 + github.com/go-logr/zapr v1.3.0 + github.com/kelseyhightower/envconfig v1.4.0 + github.com/stretchr/testify v1.10.0 + go.uber.org/zap v1.27.0 + google.golang.org/grpc v1.67.1 +) + +require ( + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/evanphx/json-patch v5.9.0+incompatible // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect + google.golang.org/protobuf v1.35.1 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/api v0.31.2 // indirect + k8s.io/apiextensions-apiserver v0.31.2 // indirect + k8s.io/apimachinery v0.31.2 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect + k8s.io/utils v0.0.0-20240821151609-f90d01438635 // indirect + sigs.k8s.io/controller-runtime v0.19.1 // indirect + sigs.k8s.io/gateway-api v1.2.1 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) diff --git a/gateway/enforcer/go.sum b/gateway/enforcer/go.sum new file mode 100644 index 0000000000..79ffbbd5dc --- /dev/null +++ b/gateway/enforcer/go.sum @@ -0,0 +1,154 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/gateway v1.2.3 h1:Qne11MOjNPmawTCFi35iuYvwA3kTqmBTFE7wDZkIgmo= +github.com/envoyproxy/gateway v1.2.3/go.mod h1:JkrLVKpgdd3D6Umr6uw1Hu98lCCpxU2pzK32qeM67U0= +github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls= +github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= +github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= +k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= +k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= +k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= +k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= +k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a h1:zD1uj3Jf+mD4zmA7W+goE5TxDkI7OGJjBNBzq5fJtLA= +k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= +k8s.io/utils v0.0.0-20240821151609-f90d01438635 h1:2wThSvJoW/Ncn9TmQEYXRnevZXi2duqHWf5OX9S3zjI= +k8s.io/utils v0.0.0-20240821151609-f90d01438635/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= +sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/gateway-api v1.2.1 h1:fZZ/+RyRb+Y5tGkwxFKuYuSRQHu9dZtbjenblleOLHM= +sigs.k8s.io/gateway-api v1.2.1/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/gateway/enforcer/internal/logging/log.go b/gateway/enforcer/internal/logging/log.go new file mode 100644 index 0000000000..a4fb787f9c --- /dev/null +++ b/gateway/enforcer/internal/logging/log.go @@ -0,0 +1,113 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package logging + +import ( + "io" + "os" + + "github.com/go-logr/logr" + "github.com/go-logr/zapr" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + + egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1" +) + +type Logger struct { + logr.Logger + logging *egv1a1.EnvoyGatewayLogging + sugaredLogger *zap.SugaredLogger +} + +func NewLogger(logging *egv1a1.EnvoyGatewayLogging) Logger { + logger := initZapLogger(os.Stdout, logging, logging.Level[egv1a1.LogComponentGatewayDefault]) + + return Logger{ + Logger: zapr.NewLogger(logger), + logging: logging, + sugaredLogger: logger.Sugar(), + } +} + +func FileLogger(file string, name string, level egv1a1.LogLevel) Logger { + writer, err := os.OpenFile(file, os.O_WRONLY, 0o666) + if err != nil { + panic(err) + } + + logging := egv1a1.DefaultEnvoyGatewayLogging() + logger := initZapLogger(writer, logging, level) + + return Logger{ + Logger: zapr.NewLogger(logger).WithName(name), + logging: logging, + sugaredLogger: logger.Sugar(), + } +} + +func DefaultLogger(level egv1a1.LogLevel) Logger { + logging := egv1a1.DefaultEnvoyGatewayLogging() + logger := initZapLogger(os.Stdout, logging, level) + + return Logger{ + Logger: zapr.NewLogger(logger), + logging: logging, + sugaredLogger: logger.Sugar(), + } +} + +// WithName returns a new Logger instance with the specified name element added +// to the Logger's name. Successive calls with WithName append additional +// suffixes to the Logger's name. It's strongly recommended that name segments +// contain only letters, digits, and hyphens (see the package documentation for +// more information). +func (l Logger) WithName(name string) Logger { + logLevel := l.logging.Level[egv1a1.EnvoyGatewayLogComponent(name)] + logger := initZapLogger(os.Stdout, l.logging, logLevel) + + return Logger{ + Logger: zapr.NewLogger(logger).WithName(name), + logging: l.logging, + sugaredLogger: logger.Sugar(), + } +} + +// WithValues returns a new Logger instance with additional key/value pairs. +// See Info for documentation on how key/value pairs work. +func (l Logger) WithValues(keysAndValues ...interface{}) Logger { + l.Logger = l.Logger.WithValues(keysAndValues...) + return l +} + +// A Sugar wraps the base Logger functionality in a slower, but less +// verbose, API. Any Logger can be converted to a SugaredLogger with its Sugar +// method. +// +// Unlike the Logger, the SugaredLogger doesn't insist on structured logging. +// For each log level, it exposes four methods: +// +// - methods named after the log level for log.Print-style logging +// - methods ending in "w" for loosely-typed structured logging +// - methods ending in "f" for log.Printf-style logging +// - methods ending in "ln" for log.Println-style logging +// +// For example, the methods for InfoLevel are: +// +// Info(...any) Print-style logging +// Infow(...any) Structured logging (read as "info with") +// Infof(string, ...any) Printf-style logging +// Infoln(...any) Println-style logging +func (l Logger) Sugar() *zap.SugaredLogger { + return l.sugaredLogger +} + +func initZapLogger(w io.Writer, logging *egv1a1.EnvoyGatewayLogging, level egv1a1.LogLevel) *zap.Logger { + parseLevel, _ := zapcore.ParseLevel(string(logging.DefaultEnvoyGatewayLoggingLevel(level))) + core := zapcore.NewCore(zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig()), zapcore.AddSync(w), zap.NewAtomicLevelAt(parseLevel)) + + return zap.New(core, zap.AddCaller()) +} diff --git a/gateway/enforcer/internal/logging/log_test.go b/gateway/enforcer/internal/logging/log_test.go new file mode 100644 index 0000000000..999f922759 --- /dev/null +++ b/gateway/enforcer/internal/logging/log_test.go @@ -0,0 +1,77 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package logging + +import ( + "errors" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + + egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1" +) + +func TestZapLogLevel(t *testing.T) { + level, err := zapcore.ParseLevel("warn") + if err != nil { + t.Errorf("ParseLevel error %v", err) + } + zc := zap.NewDevelopmentConfig() + core := zapcore.NewCore(zapcore.NewConsoleEncoder(zc.EncoderConfig), zapcore.AddSync(os.Stdout), zap.NewAtomicLevelAt(level)) + zapLogger := zap.New(core, zap.AddCaller()) + log := zapLogger.Sugar() + log.Info("ok", "k1", "v1") + log.Error(errors.New("new error"), "error") +} + +func TestLogger(t *testing.T) { + logger := NewLogger(egv1a1.DefaultEnvoyGatewayLogging()) + logger.Info("kv msg", "key", "value") + logger.Sugar().Infof("template %s %d", "string", 123) + + logger.WithName(string(egv1a1.LogComponentGlobalRateLimitRunner)).WithValues("runner", egv1a1.LogComponentGlobalRateLimitRunner).Info("msg", "k", "v") + + defaultLogger := DefaultLogger(egv1a1.LogLevelInfo) + assert.NotNil(t, defaultLogger.logging) + assert.NotNil(t, defaultLogger.sugaredLogger) + + fileLogger := FileLogger("/dev/stderr", "fl-test", egv1a1.LogLevelInfo) + assert.NotNil(t, fileLogger.logging) + assert.NotNil(t, fileLogger.sugaredLogger) +} + +func TestLoggerWithName(t *testing.T) { + originalStdout := os.Stdout + r, w, _ := os.Pipe() + os.Stdout = w + + defer func() { + // Restore the original stdout and close the pipe + os.Stdout = originalStdout + err := w.Close() + require.NoError(t, err) + }() + + config := egv1a1.DefaultEnvoyGatewayLogging() + config.Level[egv1a1.LogComponentInfrastructureRunner] = egv1a1.LogLevelDebug + + logger := NewLogger(config).WithName(string(egv1a1.LogComponentInfrastructureRunner)) + logger.Info("info message") + logger.Sugar().Debugf("debug message") + + // Read from the pipe (captured stdout) + outputBytes := make([]byte, 200) + _, err := r.Read(outputBytes) + require.NoError(t, err) + capturedOutput := string(outputBytes) + assert.Contains(t, capturedOutput, string(egv1a1.LogComponentInfrastructureRunner)) + assert.Contains(t, capturedOutput, "info message") + assert.Contains(t, capturedOutput, "debug message") +} diff --git a/gateway/enforcer/internal/settings/settings.go b/gateway/enforcer/internal/settings/settings.go new file mode 100644 index 0000000000..81a5579cbe --- /dev/null +++ b/gateway/enforcer/internal/settings/settings.go @@ -0,0 +1,67 @@ +package settings + +import ( + "github.com/kelseyhightower/envconfig" + "sync" +) + +type Settings struct { + TrustedAdapterCertsPath string `envconfig:"TRUSTED_CA_CERTS_PATH" default:"/home/wso2/security/truststore"` + TrustDefaultCerts string `envconfig:"TRUST_DEFAULT_CERTS" default:"true"` + EnforcerPrivateKeyPath string `envconfig:"ENFORCER_PRIVATE_KEY_PATH" default:"/home/wso2/security/keystore/mg.key"` + EnforcerPublicKeyPath string `envconfig:"ENFORCER_PUBLIC_CERT_PATH" default:"/home/wso2/security/keystore/mg.pem"` + OpaClientPrivateKeyPath string `envconfig:"OPA_CLIENT_PRIVATE_KEY_PATH" default:"/home/wso2/security/keystore/mg.key"` + OpaClientPublicKeyPath string `envconfig:"OPA_CLIENT_PUBLIC_CERT_PATH" default:"/home/wso2/security/keystore/mg.pem"` + AdapterHost string `envconfig:"ADAPTER_HOST" default:"adapter"` + RatelimiterHost string `envconfig:"RATELIMITER_HOST" default:"apk-test-wso2-apk-ratelimiter-service.apk.svc"` + RatelimiterPort string `envconfig:"RATELIMITER_PORT" default:"8091"` + AdapterHostname string `envconfig:"ADAPTER_HOST_NAME" default:"adapter"` + AdapterXdsPort string `envconfig:"ADAPTER_XDS_PORT" default:"18000"` + CommonControllerHost string `envconfig:"COMMON_CONTROLLER_HOST" default:"common-controller"` + CommonControllerHostname string `envconfig:"COMMON_CONTROLLER_HOST_NAME" default:"common-controller"` + CommonControllerXdsPort string `envconfig:"COMMON_CONTROLLER_XDS_PORT" default:"18002"` + CommonControllerRestPort string `envconfig:"COMMON_CONTROLLER_REST_PORT" default:"18003"` + XdsMaxMsgSize string `envconfig:"XDS_MAX_MSG_SIZE" default:"4194304"` + EnforcerRegionId string `envconfig:"ENFORCER_REGION" default:"UNKNOWN"` + XdsMaxRetries string `envconfig:"XDS_MAX_RETRIES" default:"3"` // Change to integer as needed + XdsRetryPeriod string `envconfig:"XDS_RETRY_PERIOD" default:"5000"` // milliseconds + InstanceIdentifier string `envconfig:"HOSTNAME" default:"Unassigned"` + RedisUsername string `envconfig:"REDIS_USERNAME" default:""` + RedisPassword string `envconfig:"REDIS_PASSWORD" default:""` + RedisHost string `envconfig:"REDIS_HOST" default:"redis-master"` + RedisPort int `envconfig:"REDIS_PORT" default:"6379"` + IsRedisTlsEnabled bool `envconfig:"IS_REDIS_TLS_ENABLED" default:"false"` + RevokedTokensRedisChannel string `envconfig:"REDIS_REVOKED_TOKENS_CHANNEL" default:"wso2-apk-revoked-tokens-channel"` + RedisKeyFile string `envconfig:"REDIS_KEY_FILE" default:"/home/wso2/security/redis/redis.key"` + RedisCertFile string `envconfig:"REDIS_CERT_FILE" default:"/home/wso2/security/redis/redis.crt"` + RedisCaCertFile string `envconfig:"REDIS_CA_CERT_FILE" default:"/home/wso2/security/redis/ca.crt"` + RevokedTokenCleanupInterval int `envconfig:"REVOKED_TOKEN_CLEANUP_INTERVAL" default:"3600"` // seconds + ChoreoAnalyticsAuthToken string `envconfig:"CHOREO_ANALYTICS_AUTH_TOKEN" default:""` + ChoreoAnalyticsAuthUrl string `envconfig:"CHOREO_ANALYTICS_AUTH_URL" default:""` + MoesifToken string `envconfig:"MOESIF_TOKEN" default:""` +} + +// package-level variable and mutex for thread safety +var ( + processOnce sync.Once + settingInstance *Settings +) + +// GetSettings initializes and returns a singleton instance of the Settings struct. +// It uses sync.Once to ensure that the initialization logic is executed only once, +// making it safe for concurrent use. If there is an error during the initialization, +// the function will panic. +// +// Returns: +// *Settings - A pointer to the singleton instance of the Settings struct. from environment variables. +func GetSettings() *Settings { + var err error + processOnce.Do(func() { + settingInstance = &Settings{} + err = envconfig.Process("", settingInstance) + }) + if err != nil { + panic(err) + } + return settingInstance +} diff --git a/gateway/enforcer/internal/util/cert.go b/gateway/enforcer/internal/util/cert.go new file mode 100644 index 0000000000..b9fb7fba97 --- /dev/null +++ b/gateway/enforcer/internal/util/cert.go @@ -0,0 +1,37 @@ +package util + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "io/ioutil" +) + +func LoadCertificates(publicKeyPath, privateKeyPath string) (tls.Certificate, error) { + clientCert, err := tls.LoadX509KeyPair(publicKeyPath, privateKeyPath) + if err != nil { + return tls.Certificate{}, fmt.Errorf("failed to load client certificate and key: %v", err) + } + return clientCert, nil +} + +func LoadCACertificates(trustedCertsPath string) (*x509.CertPool, error) { + caCert, err := ioutil.ReadFile(trustedCertsPath) + if err != nil { + return nil, fmt.Errorf("failed to read CA certificate: %v", err) + } + + certPool := x509.NewCertPool() + if !certPool.AppendCertsFromPEM(caCert) { + return nil, fmt.Errorf("failed to append CA certificate") + } + + return certPool, nil +} + +func CreateTLSConfig(cert tls.Certificate, certPool *x509.CertPool) *tls.Config { + return &tls.Config{ + Certificates: []tls.Certificate{cert}, + RootCAs: certPool, + } +} diff --git a/gateway/enforcer/internal/util/grpc.go b/gateway/enforcer/internal/util/grpc.go new file mode 100644 index 0000000000..3543d98d27 --- /dev/null +++ b/gateway/enforcer/internal/util/grpc.go @@ -0,0 +1,21 @@ +package util + +import ( + "context" + "crypto/tls" + "fmt" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +func CreateGRPCConnection(ctx context.Context, host, port string, tlsConfig *tls.Config) (*grpc.ClientConn, error) { + address := fmt.Sprintf("%s:%s", host, port) + + kacp := keepalive.ClientParameters{ + Time: 10 * time.Second, // send pings every 10 seconds if there is no activity + PermitWithoutStream: true, // send pings even without active streams + } + return conn, nil +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/.gitignore b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/.gitignore deleted file mode 100644 index b63da4551b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -.gradle -build/ -!gradle/wrapper/gradle-wrapper.jar -!**/src/main/**/build/ -!**/src/test/**/build/ - -### IntelliJ IDEA ### -.idea/modules.xml -.idea/jarRepositories.xml -.idea/compiler.xml -.idea/libraries/ -*.iws -*.iml -*.ipr -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/build.gradle b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/build.gradle deleted file mode 100644 index a05a644943..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -dependencies { - implementation libs.moesif - implementation libs.azure.messaging - implementation libs.feign.httpclient - implementation libs.gson - implementation libs.ua.parser - implementation libs.commons.lang3 - implementation libs.openfeign.feign.gson - implementation libs.openfeign.feign.slf4j - implementation libs.javax.xml.bind - implementation libs.log4j.slf4j - testImplementation 'org.testng:testng:7.4.0' - testImplementation ('org.mock-server:mockserver-netty:3.10.8'){ - exclude group: 'org.slf4j',module: 'slf4j-api' - exclude group: 'ch.qos.logback',module: 'logback-classic' - exclude group: 'xerces',module: 'xercesImpl' - - } - testImplementation libs.log4j.api - testImplementation libs.log4j.core - testImplementation libs.mockito.core - testImplementation libs.xerces - testImplementation libs.mockito.inline - annotationProcessor libs.log4j.core -} - -test { - useTestNG(){ - suites 'src/test/resources/testng.xml' //location of our suite.xml - } -} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/AuthClient.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/AuthClient.java deleted file mode 100644 index 7cc966d8e9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/AuthClient.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.auth; - -import feign.Feign; -import feign.FeignException; -import feign.RetryableException; -import feign.gson.GsonDecoder; -import feign.gson.GsonEncoder; -import feign.slf4j.Slf4jLogger; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionRecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionUnrecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.util.Map; - -/** - * Auth client to generate SAS token that can use to authenticate with event hub. - */ -public class AuthClient { - public static final String AUTH_HEADER = "Authorization"; - - public static String getSASToken(String authEndpoint, String token, Map properties) - throws ConnectionRecoverableException, ConnectionUnrecoverableException { - - String isProxyEnabled = properties.get(Constants.PROXY_ENABLE); - DefaultApi defaultApi; - - if (Boolean.parseBoolean(isProxyEnabled)) { - defaultApi = Feign.builder().client(AuthProxyUtils.getClient(properties)) - .encoder(new GsonEncoder()) - .decoder(new GsonDecoder()) - .logger(new Slf4jLogger()) - .requestInterceptor(requestTemplate -> requestTemplate.header(AUTH_HEADER, "Bearer " + token)) - .target(DefaultApi.class, authEndpoint); - } else { - defaultApi = Feign.builder() - .encoder(new GsonEncoder()) - .decoder(new GsonDecoder()) - .logger(new Slf4jLogger()) - .requestInterceptor(requestTemplate -> requestTemplate.header(AUTH_HEADER, "Bearer " + token)) - .target(DefaultApi.class, authEndpoint); - } - try { - TokenDetailsDTO dto = defaultApi.tokenGet(); - return dto.getToken(); - } catch (FeignException.Unauthorized e) { - throw new ConnectionUnrecoverableException( - "Invalid/expired user token. Please update apim.analytics" - + ".auth_token in configuration and restart the instance", e); - } catch (RetryableException e) { - throw new ConnectionRecoverableException("Provided authentication endpoint " + authEndpoint + " is not " - + "reachable."); - } catch (IllegalArgumentException e) { - throw new ConnectionUnrecoverableException("Invalid apim.analytics configurations provided. Please update " - + "configurations and restart the instance."); - } catch (FeignException.Forbidden e) { - throw new ConnectionRecoverableException("Publisher has been temporarily revoked."); - } catch (Exception e) { - //we will retry for any other exception - throw new ConnectionRecoverableException("Exception " + e.getClass() + " occurred."); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/AuthProxyUtils.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/AuthProxyUtils.java deleted file mode 100644 index a7a2104af5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/AuthProxyUtils.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.auth; - -import feign.Client; -import feign.httpclient.ApacheHttpClient; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.HttpHost; -import org.apache.http.auth.AuthScope; -import org.apache.http.auth.UsernamePasswordCredentials; -import org.apache.http.client.CredentialsProvider; -import org.apache.http.config.RegistryBuilder; -import org.apache.http.conn.socket.ConnectionSocketFactory; -import org.apache.http.conn.socket.PlainConnectionSocketFactory; -import org.apache.http.conn.ssl.DefaultHostnameVerifier; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.conn.ssl.SSLContexts; -import org.apache.http.impl.client.BasicCredentialsProvider; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.client.ProxyAuthenticationStrategy; -import org.apache.http.impl.conn.DefaultProxyRoutePlanner; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.HttpClientException; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.util.Map; -import javax.net.ssl.SSLContext; - -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.HTTPS_PROTOCOL; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.HTTP_PROTOCOL; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.KEYSTORE_TYPE; - -/** - * Util class to generate http client with proxy configurations. - */ -public class AuthProxyUtils { - - private static final Logger log = LoggerFactory.getLogger(AuthProxyUtils.class); - - public static Client getClient(Map properties) { - return getFeignHttpClient(properties); - } - - private static ApacheHttpClient getFeignHttpClient(Map properties) { - String proxyHost = properties.get(Constants.PROXY_HOST); - int proxyPort = Integer.parseInt(properties.get(Constants.PROXY_PORT)); - String proxyUsername = properties.get(Constants.PROXY_USERNAME); - String proxyPassword = properties.get(Constants.PROXY_PASSWORD); - String proxyProtocol = properties.get(Constants.PROXY_PROTOCOL); - - if (StringUtils.isEmpty(proxyProtocol)) { - proxyProtocol = HTTP_PROTOCOL; - } - - PoolingHttpClientConnectionManager pool = null; - try { - pool = getPoolingHttpClientConnectionManager(properties); - } catch (HttpClientException e) { - log.error("Error while getting http client connection manager", e); - } - - HttpHost host = new HttpHost(proxyHost, proxyPort, proxyProtocol); - DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(host); - HttpClientBuilder clientBuilder = HttpClientBuilder.create() - .setRoutePlanner(routePlanner) - .setConnectionManager(pool); - - if (!StringUtils.isBlank(proxyUsername) && !StringUtils.isBlank(proxyPassword)) { - CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); - credentialsProvider.setCredentials(new AuthScope(proxyHost, proxyPort), - new UsernamePasswordCredentials(proxyUsername, proxyPassword)); - clientBuilder - .setProxyAuthenticationStrategy(new ProxyAuthenticationStrategy()) - .setDefaultCredentialsProvider(credentialsProvider); - } - - return new ApacheHttpClient(clientBuilder.build()); - } - - private static PoolingHttpClientConnectionManager getPoolingHttpClientConnectionManager(Map properties) throws HttpClientException { - SSLConnectionSocketFactory socketFactory = createSocketFactory(properties); - ConnectionSocketFactory httpSocketFactory = new PlainConnectionSocketFactory(); - org.apache.http.config.Registry socketFactoryRegistry = - RegistryBuilder.create() - .register(HTTP_PROTOCOL, httpSocketFactory) - .register(HTTPS_PROTOCOL, socketFactory) - .build(); - return new PoolingHttpClientConnectionManager(socketFactoryRegistry); - } - - private static SSLConnectionSocketFactory createSocketFactory(Map properties) - throws HttpClientException { - SSLContext sslContext; - - String keyStorePassword = properties.get(Constants.KEYSTORE_PASSWORD); - String keyStorePath = properties.get(Constants.KEYSTORE_LOCATION); - try { - KeyStore trustStore = KeyStore.getInstance(KEYSTORE_TYPE); - trustStore.load(Files.newInputStream(Paths.get(keyStorePath)), keyStorePassword.toCharArray()); - sslContext = SSLContexts.custom().loadTrustMaterial(trustStore).build(); - return new SSLConnectionSocketFactory(sslContext, new DefaultHostnameVerifier()); - } catch (KeyStoreException e) { - throw new HttpClientException("Failed to read from Key Store", e); - } catch (IOException e) { - throw new HttpClientException("Key Store not found in " + keyStorePath, e); - } catch (CertificateException e) { - throw new HttpClientException("Failed to read Certificate", e); - } catch (NoSuchAlgorithmException e) { - throw new HttpClientException("Failed to load Key Store from " + keyStorePath, e); - } catch (KeyManagementException e) { - throw new HttpClientException("Failed to load key from" + keyStorePath, e); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/DefaultApi.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/DefaultApi.java deleted file mode 100644 index 59a4946176..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/DefaultApi.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.auth; - -import feign.RequestLine; - -/** - * Analytics Auth API. - * - *

This is a RESTFul API for authenication information to communcate with event hub. - * - */ -public interface DefaultApi { - @RequestLine("GET /token") - TokenDetailsDTO tokenGet(); -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/TokenDetailsDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/TokenDetailsDTO.java deleted file mode 100644 index f8ca28b498..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/auth/TokenDetailsDTO.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.auth; - -import com.google.gson.annotations.SerializedName; - -/** - * TokenDetailsDTO of the Auth API response. - */ -public class TokenDetailsDTO { - - @SerializedName("token") - private String token; - - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/ClientStatus.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/ClientStatus.java deleted file mode 100644 index 2ddab244ff..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/ClientStatus.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.client; - -/** - * Enum to represent the status of Eventhub publisher. - */ -public enum ClientStatus { - CONNECTED, - NOT_CONNECTED, - FLUSHING_FAILED, - RETRYING -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/DataHolder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/DataHolder.java deleted file mode 100644 index 727decfa3f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/DataHolder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.client; - -/** - * Data holder class to generate mock analytics events. - */ -public class DataHolder { - static final String[] NODE_ID = new String[]{"1", "2", "3", "4", "5"}; - static final String[] DEPLOYMENT_ID = - new String[]{"prod", "prod", "prod", "prod", "prod"}; - static final String[] API_UUID = new String[]{"apiUUID1", "apiUUID2", "apiUUID3", "apiUUID4", "apiUUID5"}; - static final String[] REGION_ID = new String[]{"region1", "region2", "region3", "region4", "region5"}; - static final String[] GATEWAY_TYPE = new String[]{"type1", "type2", "type3", "type4", "type5"}; - static final String[] DESTINATION = - new String[]{"destination1", "destination2", "destination3", "destination4", "destination5"}; - static final String[] REQUEST_MED_LATENCY = new String[]{"100", "200", "300", "400", "500"}; - static final String[] RESPONSE_MED_LATENCY = new String[]{"500", "400", "300", "200", "100"}; - static final String[] RESPONSE_LATENCY = new String[]{"100", "200", "300", "400", "500"}; - static final String[] RESPONSE_CODE = new String[]{"100", "200", "300", "400", "500"}; - static final String[] RESPONSE_SIZE = new String[]{"100", "200", "300", "400", "500"}; - static final String[] - API_CREATOR = new String[]{"creator1", "creator2", "creator3", "creator4", "creator5"}; - static final String[] API_METHOD = new String[]{"POST", "GET", "PUT", "DELETE", "PATCH"}; - static final String[] API_RESOURCE_TEMPLATE = new String[]{"/{id}", "/{name}", "/{age}", "/{gender}", "/{country}"}; - static final String[] API_VERSION = new String[]{"1.0.0", "2.0.0", "3.0.0", "4.0.0", "5.0.0"}; - static final String[] API_NAME = new String[]{"api1", "api2", "api3", "api4", "api5"}; - static final String[] - API_CONTEXT = new String[]{"/context1", "/context2", "/context3", "/context4", "/context5"}; - static final String[] APPLICATION_NAME = new String[]{"app1", "app2", "app3", "app4", "app5"}; - static final String[] KEY_TYPE = new String[]{"production", "sandbox"}; - static final String[] - API_CREATOR_TENANT_DOMAIN = new String[]{"carbon.super", "carbon.super", "carbon.super", "carbon.super", - "carbon.super"}; - static final String[] APPLICATION_CONSUMER_KEY = new String[]{"key1", "key2", "key3", "key4", "key5"}; - static final String[] APPLICATION_OWNER = new String[]{"owner1", "owner2", "owner3", "owner4", "owner5"}; - static final String[] USER_AGENT = new String[]{"agent1", "agent2", "agent3", "agent4", "agent5"}; - static final String[] EVENT_TYPE = new String[]{"response", "response", "response", "response", "response"}; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/EventHubClient.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/EventHubClient.java deleted file mode 100644 index 44b6c0c084..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/EventHubClient.java +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.client; - -import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.core.amqp.exception.AmqpErrorCondition; -import com.azure.core.amqp.exception.AmqpException; -import com.azure.messaging.eventhubs.EventData; -import com.azure.messaging.eventhubs.EventDataBatch; -import com.azure.messaging.eventhubs.EventHubProducerClient; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionRecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionUnrecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.DefaultAnalyticsThreadFactory; -import org.wso2.apk.enforcer.analytics.publisher.util.BackoffRetryCounter; - -import java.nio.charset.StandardCharsets; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import javax.xml.bind.DatatypeConverter; - -/** - * Event Hub client is responsible for sending events to - * Azure Event Hub. - */ -public class EventHubClient implements Cloneable { - private static final Logger log = LoggerFactory.getLogger(EventHubClient.class); - private static final String TOKEN_HASH_USER_PROP = "token-hash"; - private final String authEndpoint; - private final String authToken; - private final String authTokenHash; - private final Lock publishingLock; - private final BackoffRetryCounter producerRetryCounter; - private final BackoffRetryCounter eventBatchRetryCounter; - private final Lock threadBarrier; - private final AmqpRetryOptions retryOptions; - private final Condition waitCondition; - private final ScheduledExecutorService scheduledExecutorService; - private EventHubProducerClient producer; - private EventDataBatch batch; - private ClientStatus clientStatus; - private Map properties = new HashMap<>(); - - public EventHubClient(String authEndpoint, String authToken, AmqpRetryOptions retryOptions, - Map properties) { - threadBarrier = new ReentrantLock(); - waitCondition = threadBarrier.newCondition(); - publishingLock = new ReentrantLock(); - scheduledExecutorService = Executors.newScheduledThreadPool(2, new DefaultAnalyticsThreadFactory( - "Reconnection-Service")); - producerRetryCounter = new BackoffRetryCounter(); - eventBatchRetryCounter = new BackoffRetryCounter(); - this.authEndpoint = authEndpoint; - this.authToken = authToken; - this.authTokenHash = toHash(authToken); - this.retryOptions = retryOptions; - this.clientStatus = ClientStatus.NOT_CONNECTED; - this.properties = properties; - createProducerWithRetry(authEndpoint, authToken, retryOptions, true, properties); - } - - private void retryWithBackoff(String authEndpoint, String authToken, - AmqpRetryOptions retryOptions, boolean createBatch) { - scheduledExecutorService.schedule(new Runnable() { - @Override - public void run() { - createProducerWithRetry(authEndpoint, authToken, retryOptions, createBatch, properties); - } - }, producerRetryCounter.getTimeIntervalMillis(), TimeUnit.MILLISECONDS); - producerRetryCounter.increment(); - } - - private void createProducerWithRetry(String authEndpoint, String authToken, AmqpRetryOptions retryOptions, - boolean createBatch, Map properties) { - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "- Creating Eventhub client instance."); - try { - if (producer != null) { - producer.close(); - } - producer = EventHubProducerClientFactory.create(authEndpoint, authToken, retryOptions, properties); - try { - if (createBatch) { - batch = producer.createBatch(); - } - } catch (IllegalStateException e) { - throw new ConnectionRecoverableException("Event batch creation failed. " + e.getMessage() - .replaceAll("[\r\n]", "")); - } catch (AmqpException e) { - throw new ConnectionRecoverableException("Event batch creation failed. " + e.getMessage() - .replaceAll("[\r\n]", "")); - } catch (Exception e) { - throw new ConnectionUnrecoverableException("Event batch creation failed. " + e.getMessage() - .replaceAll("[\r\n]", "")); - } - clientStatus = ClientStatus.CONNECTED; - log.info("[" + Thread.currentThread().getName().replaceAll("[\r\n]", "") + "] " - + "- Eventhub client successfully connected."); - producerRetryCounter.reset(); - try { - threadBarrier.lock(); - waitCondition.signalAll(); - } finally { - threadBarrier.unlock(); - } - } catch (ConnectionRecoverableException e) { - clientStatus = ClientStatus.RETRYING; - log.error("Recoverable error occurred when creating Eventhub Client. Retry attempts will be made in " - + producerRetryCounter.getTimeInterval().replaceAll("[\r\n]", "") + ". Reason :" - + e.getMessage().replaceAll("[\r\n]", "")); - if (log.isDebugEnabled()) { - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] - " - + "Recoverable error occurred when creating Eventhub Client using following " - + "attributes. Auth endpoint: " + authEndpoint.replaceAll("[\r\n]", "") - + ". Retry attempts will be made. Reason : " - + e.getMessage().replaceAll("[\r\n]", ""), e); - } - retryWithBackoff(authEndpoint, authToken, retryOptions, createBatch); - } catch (ConnectionUnrecoverableException e) { - clientStatus = ClientStatus.NOT_CONNECTED; - log.error("Unrecoverable error occurred when creating Eventhub Client. Analytics event publishing will be" - + " disabled until issue is rectified. Reason: " - + e.getMessage().replaceAll("[\r\n]", "")); - if (log.isDebugEnabled()) { - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "- Unrecoverable error occurred when creating Eventhub Client using following " - + "attributes. Auth endpoint: " + authEndpoint.replaceAll("[\r\n]", "") + ". " - + "Analytics event publishing will be disabled until issue is rectified. Reason: " - + e.getMessage().replaceAll("[\r\n]", ""), e); - } - } - } - - public void sendEvent(String event) { - if (clientStatus == ClientStatus.CONNECTED) { - EventData eventData = new EventData(event); - eventData.getProperties().put(TOKEN_HASH_USER_PROP, this.authTokenHash); - try { - publishingLock.lock(); - boolean isAdded = batch.tryAdd(eventData); - if (!isAdded) { - try { - int size = 0; - if (log.isDebugEnabled()) { - size = batch.getCount(); - } - producer.send(batch); - batch = createBatchWithRetry(); - isAdded = batch.tryAdd(eventData); - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "- Published " + size + " events to Analytics cluster."); - - } catch (AmqpException e) { - if (isAuthenticationFailure(e)) { - //if authentication error try to reinitialize publisher. Retrying will deal with any - // network or revocation failures. - log.error("Authentication issue happened. Producer client will be re-initialized " - + "retaining the Event Data Batch"); - this.clientStatus = ClientStatus.RETRYING; - createProducerWithRetry(authEndpoint, authToken, retryOptions, false, properties); - sendEvent(event); - } else if (e.getErrorCondition() == AmqpErrorCondition.RESOURCE_LIMIT_EXCEEDED) { - //If resource limit is exceeded we will retry after a constant delay - log.error("Resource limit exceeded when publishing Event Data Batch. Operation will be " - + "retried after constant delay"); - try { - Thread.sleep(1000 * 60); - } catch (InterruptedException interruptedException) { - Thread.currentThread().interrupt(); - } - sendEvent(event); - } else { - //For any other exception - log.error("AMQP error occurred while publishing Event Data Batch. Producer client will " - + "be re-initialized. Events may be lost in the process."); - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "- AMQP error occurred while " - + "publishing Event Data Batch. Producer client will " - + "be re-initialized. Events may be lost in the process.", e); - this.clientStatus = ClientStatus.RETRYING; - createProducerWithRetry(authEndpoint, authToken, retryOptions, true, properties); - sendEvent(event); - } - } catch (Exception e) { - if (e.getCause() instanceof TimeoutException) { - log.error("Timeout occurred after retrying " + retryOptions.getMaxRetries() + " " - + "times with an timeout of " + retryOptions.getTryTimeout().getSeconds() - + " seconds while trying to publish Event Data Batch. Next retry cycle " - + "will begin shortly."); - sendEvent(event); - } else { - //For any other exception - log.error("Unknown error occurred while publishing Event Data Batch. Producer client will " - + "be re-initialized. Events may be lost in the process."); - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "- Unknown error occurred while publishing Event Data Batch. " - + "Producer client will " - + "be re-initialized. Events may be lost in the process.", e); - this.clientStatus = ClientStatus.RETRYING; - createProducerWithRetry(authEndpoint, authToken, retryOptions, true, properties); - sendEvent(event); - } - } - } - if (isAdded) { - if (log.isTraceEnabled()) { - log.trace("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "- Adding event: " + event.replaceAll("[\r\n]", "")); - } - } else { - if (log.isTraceEnabled()) { - log.trace("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "- Failed to add event: " + event.replaceAll("[\r\n]", "")); - } - } - } finally { - publishingLock.unlock(); - } - } else if (clientStatus == ClientStatus.FLUSHING_FAILED) { - log.debug("client status is FLUSHING_FAILED. Producer client will be re-initialized " - + "retaining the Event Data Batch"); - this.clientStatus = ClientStatus.RETRYING; - createProducerWithRetry(authEndpoint, authToken, retryOptions, false, properties); - sendEvent(event); - } else { - try { - threadBarrier.lock(); - if (log.isDebugEnabled()) { - log.debug(Thread.currentThread().getName().replaceAll("[\r\n]", "") + " will be parked as EventHub " - + "Client is inactive."); - } - waitCondition.await(); - if (log.isDebugEnabled()) { - log.debug(Thread.currentThread().getName().replaceAll("[\r\n]", "") + " will be resumes as " - + "EventHub Client is active."); - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } finally { - threadBarrier.unlock(); - } - sendEvent(event); - } - } - - private boolean isAuthenticationFailure(AmqpException exception) { - AmqpErrorCondition condition = exception.getErrorCondition(); - return (condition == AmqpErrorCondition.UNAUTHORIZED_ACCESS || - condition == AmqpErrorCondition.PUBLISHER_REVOKED_ERROR); - } - - private EventDataBatch createBatchWithRetry() { - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") - + " }] Creating Event Data Batch"); - try { - EventDataBatch batch = producer.createBatch(); - eventBatchRetryCounter.reset(); - return batch; - } catch (IllegalStateException e) { - log.error("Error in creating Event Data Batch. Operation will be retried in " - + eventBatchRetryCounter.getTimeInterval().replaceAll("[\r\n]", "")); - try { - Thread.sleep(eventBatchRetryCounter.getTimeIntervalMillis()); - } catch (InterruptedException interruptedException) { - Thread.currentThread().interrupt(); - } - eventBatchRetryCounter.increment(); - return createBatchWithRetry(); - } - } - - public void flushEvents() { - if (this.clientStatus == ClientStatus.CONNECTED && batch.getCount() > 0) { - if (publishingLock.tryLock()) { - try { - int size = batch.getCount(); - producer.send(batch); - batch = createBatchWithRetry(); - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "Flushed " + size + " events to Analytics cluster."); - } catch (Exception e) { - if (e instanceof AmqpException && isAuthenticationFailure((AmqpException) e)) { - log.error("Marked client status as FLUSHING_FAILED due to AMQP authentication failure."); - this.clientStatus = ClientStatus.FLUSHING_FAILED; - } else if (e.getCause() instanceof ConnectionUnrecoverableException) { - this.clientStatus = ClientStatus.NOT_CONNECTED; - log.error( - "Unrecoverable error occurred when event flushing. Analytics event flushing will be" - + " disabled until issue is rectified. Reason: " + e.getMessage() - .replaceAll("[\r\n]", "")); - return; - } - log.error("Event flushing operation failed. Will be retried again according to the configured " - + "client.flushing.delay. Error will be handled by publishing threads once " - + "Event Data Batch is filled."); - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] " - + "Event flushing operation failed. Will be retried again according to the " - + "configured client.flushing.delay. Error will be handled by publishing " - + "threads once Event Data Batch is filled.", e); - //Dont do anything for any exception. If it is recoverable exception next run will succeed. - //If not recoverable then next run will be filtered by if condition - } finally { - publishingLock.unlock(); - } - } else { - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] Event " - + "flushing operation aborted as publisher threads are trying to send events"); - } - } else { - if (log.isDebugEnabled()) { - log.debug("[{ " + Thread.currentThread().getName().replaceAll("[\r\n]", "") + " }] Event flushing " - + "is aborted as Event Data Batch is empty or connection to Event Hub is not made"); - } - } - } - - public ClientStatus getStatus() { - return clientStatus; - } - - /** - * Returns a clone of this eventhub client. - * - * @return New clone of current object - */ - public EventHubClient clone() { - return new EventHubClient(this.authEndpoint, this.authToken, this.retryOptions, this.properties); - } - - private String toHash(String text) { - if (text == null) { - log.debug("The text trying to hash is empty."); - return null; - } - final MessageDigest messageDigest; - try { - messageDigest = MessageDigest.getInstance("SHA-256"); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException("Error occurred when getting hash algorithm.", e); - } - byte[] digestBytes = messageDigest.digest(text.getBytes(StandardCharsets.UTF_8)); - return DatatypeConverter.printHexBinary(digestBytes).toUpperCase(Locale.ENGLISH); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/EventHubProducerClientFactory.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/EventHubProducerClientFactory.java deleted file mode 100644 index e683e8f165..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/EventHubProducerClientFactory.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.client; - -import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.core.amqp.AmqpTransportType; -import com.azure.core.amqp.ProxyAuthenticationType; -import com.azure.core.amqp.ProxyOptions; -import com.azure.core.credential.TokenCredential; -import com.azure.messaging.eventhubs.EventHubClientBuilder; -import com.azure.messaging.eventhubs.EventHubProducerClient; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.auth.AuthClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionRecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionUnrecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.io.UnsupportedEncodingException; -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.net.SocketAddress; -import java.net.URLDecoder; -import java.util.Map; - -/** - * Factory class to create EventHubProducerClient instance. - */ -public class EventHubProducerClientFactory { - private static final Logger log = LoggerFactory.getLogger(EventHubClient.class); - - public static EventHubProducerClient create(String authEndpoint, String authToken, AmqpRetryOptions retryOptions, - Map properties) - throws ConnectionRecoverableException, ConnectionUnrecoverableException { - TokenCredential tokenCredential = new WSO2TokenCredential(authEndpoint, authToken, properties); - String tempSASToken; - // generate SAS token to get eventhub meta data - tempSASToken = getSASToken(authEndpoint, authToken, properties); - - String resourceURI = getResourceURI(tempSASToken); - String fullyQualifiedNamespace = getNamespace(resourceURI); - String eventhubName = getEventHubName(resourceURI); - - String isProxyEnabled = properties.get(Constants.PROXY_ENABLE); - if (Boolean.parseBoolean(isProxyEnabled)) { - String proxyHost = properties.get(Constants.PROXY_HOST); - int proxyPort = Integer.parseInt(properties.get(Constants.PROXY_PORT)); - String proxyUsername = properties.get(Constants.PROXY_USERNAME); - String proxyPassword = properties.get(Constants.PROXY_PASSWORD); - - SocketAddress address = new InetSocketAddress(proxyHost, proxyPort); - Proxy proxyAddress = new Proxy(Proxy.Type.HTTP, address); - ProxyOptions proxyOptions; - if (!StringUtils.isBlank(proxyUsername) && !StringUtils.isBlank(proxyPassword)) { - proxyOptions = - new ProxyOptions(ProxyAuthenticationType.BASIC, proxyAddress, proxyUsername, proxyPassword); - } else { - proxyOptions = - new ProxyOptions(ProxyAuthenticationType.NONE, proxyAddress, null, null); - } - - return new EventHubClientBuilder() - .credential(fullyQualifiedNamespace, eventhubName, tokenCredential) - .proxyOptions(proxyOptions) - .retry(retryOptions) - .transportType(AmqpTransportType.AMQP_WEB_SOCKETS) - .buildProducerClient(); - } else { - return new EventHubClientBuilder() - .credential(fullyQualifiedNamespace, eventhubName, tokenCredential) - .retry(retryOptions) - .buildProducerClient(); - } - } - - private static String getSASToken(String authEndpoint, String authToken, Map properties) - throws ConnectionRecoverableException, ConnectionUnrecoverableException { - return AuthClient.getSASToken(authEndpoint, authToken, properties); - } - - /** - * Extracts the resource URI from the SAS Token. - * - * @param sasToken SAS token of the user - * @return decoded resource URI from the token - */ - private static String getResourceURI(String sasToken) { - String[] sasAttributes = sasToken.split("&"); - String[] resource = sasAttributes[0].split("="); - String resourceURI = ""; - try { - resourceURI = URLDecoder.decode(resource[1], "UTF-8"); - } catch (UnsupportedEncodingException e) { - //never happens - } - //remove protocol append - return resourceURI.replace("sb://", ""); - } - - private static String getNamespace(String resourceURI) { - return resourceURI.split("/")[0]; - } - - private static String getEventHubName(String resourceURI) { - return resourceURI.split("/", 2)[1]; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/MoesifClient.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/MoesifClient.java deleted file mode 100644 index 2f0d8adab9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/MoesifClient.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.client; - -import com.moesif.api.MoesifAPIClient; -import com.moesif.api.controllers.APIController; -import com.moesif.api.http.client.APICallBack; -import com.moesif.api.http.client.HttpContext; -import com.moesif.api.http.response.HttpResponse; -import com.moesif.api.models.EventModel; -import com.moesif.api.models.EventRequestBuilder; -import com.moesif.api.models.EventRequestModel; -import com.moesif.api.models.EventResponseBuilder; -import com.moesif.api.models.EventResponseModel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.util.MoesifMicroserviceConstants; -import org.wso2.apk.enforcer.analytics.publisher.retriever.MoesifKeyRetriever; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Moesif Client is responsible for sending events to - * Moesif Analytics Dashboard. - */ -public class MoesifClient { - - private final Logger log = LoggerFactory.getLogger(MoesifClient.class); - private final MoesifKeyRetriever keyRetriever; - - public MoesifClient(MoesifKeyRetriever keyRetriever) { - - this.keyRetriever = keyRetriever; - } - - private void doRetry(String orgId, MetricEventBuilder builder) { - - Integer currentAttempt = MoesifClientContextHolder.PUBLISH_ATTEMPTS.get(); - - if (currentAttempt > 0) { - currentAttempt -= 1; - MoesifClientContextHolder.PUBLISH_ATTEMPTS.set(currentAttempt); - try { - Thread.sleep(MoesifMicroserviceConstants.TIME_TO_WAIT_PUBLISH); - publish(builder); - } catch (MetricReportingException e) { - log.error("Failing retry attempt at Moesif client", e); - } catch (InterruptedException e) { - log.error("Failing retry attempt at Moesif client", e); - } - } else if (currentAttempt == 0) { - log.error("Failed all retrying attempts. Event will be dropped for organization {}", - orgId.replaceAll("[\r\n]", "")); - } - } - - /** - * publish method is responsible for checking the availability of relevant moesif key - * and initiating moesif client sdk. - */ - public void publish(MetricEventBuilder builder) throws MetricReportingException { - - Map event = builder.build(); - - String orgId = (String) event.get(Constants.ORGANIZATION_ID); - String eventEnvironment = (String) event.getOrDefault(Constants.ENVIRONMENT_ID, Constants.DEFAULT_ENVIRONMENT); - String moesifKey = keyRetriever.getKey(orgId, eventEnvironment); - - // init moesif api client - MoesifAPIClient client = new MoesifAPIClient(moesifKey); - - // api object is a singleton which will make calls to - // moesif endpoints with the latest MoesifAPI client being provided. - // Hence avoid maintaining a map of MoesifAPIClient against moesif keys. - APIController api = client.getAPI(); - - APICallBack callBack = new APICallBack() { - public void onSuccess(HttpContext context, HttpResponse response) { - - int statusCode = context.getResponse().getStatusCode(); - if (statusCode == 200 || statusCode == 201 || statusCode == 202 || statusCode == 204) { - log.debug("Event successfully published."); - } else if (statusCode >= 400 && statusCode < 500) { - log.error("Event publishing failed for organization: {}. Moesif returned {}.", - orgId.replaceAll("[\r\n]", ""), String.valueOf(statusCode).replaceAll("[\r\n]", "")); - } else { - log.error("Event publishing failed for organization: {}. Retrying.", - orgId.replaceAll("[\r\n]", "")); - doRetry(orgId, builder); - } - } - - public void onFailure(HttpContext context, Throwable error) { - - int statusCode = context.getResponse().getStatusCode(); - - if (statusCode >= 400 && statusCode < 500) { - log.error("Event publishing failed for organization: {}. Moesif returned {}.", - orgId.replaceAll("[\r\n]", ""), String.valueOf(statusCode).replaceAll("[\r\n]", "")); - } else if (error != null) { - log.error("Event publishing failed for organization: {}. Event publishing failed.", - orgId.replaceAll("[\r\n]", ""), - error.getMessage().replaceAll("[\r\n]", "")); - } else { - log.error("Event publishing failed for organization: {}. Retrying.", - orgId.replaceAll("[\r\n]", "")); - doRetry(orgId, builder); - } - } - }; - try { - api.createEventAsync(buildEventResponse(event), callBack); - } catch (IOException e) { - log.error("Analytics event sending failed. Event will be dropped", e); - } - } - - private EventModel buildEventResponse(Map data) throws IOException, MetricReportingException { - // Preprocessing data - final String userIP = (String) data.get(Constants.USER_IP); - final String userName = (String) data.get(Constants.USER_NAME); - final String apiContext = (String) data.get(Constants.API_CONTEXT); - final String apiResourceTemplate = (String) data.get(Constants.API_RESOURCE_TEMPLATE); - final long responseLatency = (long) data.get(Constants.RESPONSE_LATENCY); - final String requestTimeStamp = (String) data.get(Constants.REQUEST_TIMESTAMP); - Map reqHeaders = new HashMap(); - - reqHeaders.put(Constants.MOESIF_USER_AGENT_KEY, - (String) data.getOrDefault(Constants.USER_AGENT_HEADER, Constants.UNKNOWN_VALUE)); - reqHeaders.put(Constants.MOESIF_CONTENT_TYPE_KEY, Constants.MOESIF_CONTENT_TYPE_HEADER); - - Map rspHeaders = new HashMap(); - - rspHeaders.put("Vary", "Accept-Encoding"); - rspHeaders.put("Pragma", "no-cache"); - rspHeaders.put("Expires", "-1"); - rspHeaders.put(Constants.MOESIF_CONTENT_TYPE_KEY, "application/json; charset=utf-8"); - rspHeaders.put("Cache-Control", "no-cache"); - - LinkedHashMap properties = (LinkedHashMap) data.get(Constants.PROPERTIES); - String gwURL = (String) properties.get(Constants.GATEWAY_URL); - String uri = apiContext + apiResourceTemplate; - if (gwURL != null) { - uri = gwURL; - } - Date requestDate = getDate(requestTimeStamp); - Date responseDate = new Date(requestDate.getTime() + responseLatency); - EventRequestModel eventReq = new EventRequestBuilder() - .time(requestDate) - .uri(uri) - .verb((String) data.get(Constants.API_METHOD)) - .apiVersion((String) data.get(Constants.API_VERSION)) - .ipAddress(userIP) - .headers(reqHeaders) - .build(); - - EventResponseModel eventRsp = new EventResponseBuilder() - .time(responseDate) - .status((int) data.get(Constants.PROXY_RESPONSE_CODE)) - .headers(rspHeaders) - .build(); - - EventModel eventModel = new EventModel(); - - eventModel.setRequest(eventReq); - eventModel.setResponse(eventRsp); - eventModel.setUserId(userName); - eventModel.setCompanyId(null); - - return eventModel; - } - - private static Date getDate(String time) { - - OffsetDateTime offsetDateTime = OffsetDateTime.parse(time); - long milliSecondsTime = offsetDateTime.toInstant().toEpochMilli(); - return new Date(milliSecondsTime); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/MoesifClientContextHolder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/MoesifClientContextHolder.java deleted file mode 100644 index f5b9ab7c23..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/MoesifClientContextHolder.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.client; - -import org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.util.MoesifMicroserviceConstants; - -/** - * Holds context of the Moesif client retry mechanism. - */ -public class MoesifClientContextHolder { - public static final ThreadLocal PUBLISH_ATTEMPTS = new ThreadLocal() { - @Override - protected Integer initialValue() { - return Integer.valueOf(MoesifMicroserviceConstants.NUM_RETRY_ATTEMPTS_PUBLISH); - } - - @Override - public Integer get() { - return super.get(); - } - - @Override - public void set(Integer value) { - super.set(value); - } - }; -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/WSO2TokenCredential.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/WSO2TokenCredential.java deleted file mode 100644 index 51d107e030..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/client/WSO2TokenCredential.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.client; - -import com.azure.core.credential.AccessToken; -import com.azure.core.credential.TokenCredential; -import com.azure.core.credential.TokenRequestContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.auth.AuthClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionRecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionUnrecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.util.BackoffRetryCounter; -import reactor.core.publisher.Mono; - -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.util.Arrays; -import java.util.Map; - -/** - * WSO2 SAS token refresh implementation for TokenCredential. - */ -class WSO2TokenCredential implements TokenCredential { - private static final Logger log = LoggerFactory.getLogger(WSO2TokenCredential.class); - private final String authEndpoint; - private final String authToken; - private final Map properties; - private BackoffRetryCounter backoffRetryCounter; - - public WSO2TokenCredential(String authEndpoint, String authToken, Map properties) { - this.authEndpoint = authEndpoint; - this.authToken = authToken; - this.properties = properties; - backoffRetryCounter = new BackoffRetryCounter(); - } - - @Override - public Mono getToken(TokenRequestContext tokenRequestContext) { - log.debug("Trying to retrieving a new SAS token."); - try { - String sasToken = AuthClient.getSASToken(this.authEndpoint, this.authToken, this.properties); - backoffRetryCounter.reset(); - log.debug("New SAS token retrieved."); - // Using lower duration than actual. - OffsetDateTime time = getExpirationTime(sasToken); - return Mono.fromCallable(() -> new AccessToken(sasToken, time)); - } catch (ConnectionRecoverableException e) { - log.error("Error occurred when retrieving SAS token. Connection will be retried in " - + backoffRetryCounter.getTimeInterval().replaceAll("[\r\n]", ""), e); - try { - Thread.sleep(backoffRetryCounter.getTimeIntervalMillis()); - } catch (InterruptedException interruptedException) { - Thread.currentThread().interrupt(); - } - backoffRetryCounter.increment(); - return getToken(tokenRequestContext); - } catch (ConnectionUnrecoverableException e) { - //Do not pass the exception. Publishing threads will encounter authentication issue and then try to - // reinitialize publisher. - log.error("Error occurred when retrieving SAS token.", e); - backoffRetryCounter.reset(); - return Mono.error(e); - } - } - - private OffsetDateTime getExpirationTime(String sharedAccessSignature) { - String[] parts = sharedAccessSignature.split("&"); - return Arrays.stream(parts).map(part -> part.split("=")) - .filter(pair -> pair.length == 2 && pair[0].equalsIgnoreCase("se")) - .findFirst().map(pair -> pair[1]) - .map((expirationTimeStr) -> { - try { - long epochSeconds = Long.parseLong(expirationTimeStr); - return Instant.ofEpochSecond(epochSeconds).atOffset(ZoneOffset.UTC); - } catch (NumberFormatException e) { - log.error("Invalid expiration time format in the SAS token.", e); - return OffsetDateTime.MAX; - } - }) - .orElse(OffsetDateTime.MAX); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/APICallException.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/APICallException.java deleted file mode 100644 index 3a32cea252..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/APICallException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.exception; - -/** - * Exception class for API calls related exceptions. - * Could be used in scenarios where the issue is not strictly due to HTTP Client. - */ -public class APICallException extends Exception { - public APICallException(String msg) { - super(msg); - } - - public APICallException(String msg, Throwable e) { - super(msg, e); - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/AuthenticationException.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/AuthenticationException.java deleted file mode 100644 index 037843b93d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/AuthenticationException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - -package org.wso2.apk.enforcer.analytics.publisher.exception; - -/** - * Exception class for authentication related exceptions. - */ -public class AuthenticationException extends Exception { - public AuthenticationException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/ConnectionRecoverableException.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/ConnectionRecoverableException.java deleted file mode 100644 index c8b6706bbe..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/ConnectionRecoverableException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.exception; - -/** - * Exception to represent any recoverable errors event publishing client encounter. - */ -public class ConnectionRecoverableException extends Exception { - public ConnectionRecoverableException(String msg) { - super(msg); - } - - public ConnectionRecoverableException(String msg, Throwable e) { - super(msg, e); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/ConnectionUnrecoverableException.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/ConnectionUnrecoverableException.java deleted file mode 100644 index f349600646..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/ConnectionUnrecoverableException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.exception; - -/** - * Exception to represent any unrecoverable errors event publishing client encounter. - */ -public class ConnectionUnrecoverableException extends Exception { - public ConnectionUnrecoverableException(String msg) { - super(msg); - } - - public ConnectionUnrecoverableException(String msg, Throwable e) { - super(msg, e); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/HttpClientException.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/HttpClientException.java deleted file mode 100644 index d7a140ef2d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/HttpClientException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - -package org.wso2.apk.enforcer.analytics.publisher.exception; - -/** - * Exception class for HTTP client related exceptions. - */ -public class HttpClientException extends Exception { - public HttpClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/MetricCreationException.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/MetricCreationException.java deleted file mode 100644 index 874903bb7f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/MetricCreationException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.exception; - -/** - * This exception will be thrown if any error happens during Metric Reporter Creation. - */ -public class MetricCreationException extends Exception { - public MetricCreationException(String msg) { - super(msg); - } - - public MetricCreationException(String msg, Throwable e) { - super(msg, e); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/MetricReportingException.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/MetricReportingException.java deleted file mode 100644 index 863da7059f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/exception/MetricReportingException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.exception; - -/** - * This exception will be thrown if any error happens when reporting a metric. - */ -public class MetricReportingException extends Exception { - public MetricReportingException(String msg) { - super(msg); - } - - public MetricReportingException(String msg, Throwable e) { - super(msg, e); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/AbstractMetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/AbstractMetricEventBuilder.java deleted file mode 100644 index 829e40b64d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/AbstractMetricEventBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; - -import java.util.Map; - -/** - * Abstract implementation of {@link MetricEventBuilder}. Ensures that subclasses perform validations when adding - * elements. - */ -public abstract class AbstractMetricEventBuilder implements MetricEventBuilder { - @Override - public Map build() throws MetricReportingException { - if (validate()) { - return buildEvent(); - } - throw new MetricReportingException("Validation failure occurred when building the event"); - } - - /** - * Process the added data and return as a flat {@link Map}. - * - * @return Map representing attributes of Metric Event - */ - protected abstract Map buildEvent(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/AbstractMetricReporter.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/AbstractMetricReporter.java deleted file mode 100644 index 5c61e0b1f3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/AbstractMetricReporter.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; - -import java.util.HashMap; -import java.util.Map; - -/** - * Implementation of {@link MetricReporter}. All concrete implementations should extend this class. Validations and - * metric type creation is enforced using this abstract class - */ -public abstract class AbstractMetricReporter implements MetricReporter { - private static final Logger log = LoggerFactory.getLogger(AbstractMetricReporter.class); - private final Map properties; - private Map metricRegistry; - - protected AbstractMetricReporter(Map properties) throws MetricCreationException { - this.properties = properties; - metricRegistry = new HashMap<>(); - validateConfigProperties(properties); - } - - /** - * Method to validate the configuration properties. Config properties are accepted as a map to increase - * extendability. Hence this method is responsible to sanitize the map - * - * @param properties Configuration properties needed by the implementation - * @throws MetricCreationException Exception will be throw is any of the required fields are missing or no in the - * expected format - */ - protected abstract void validateConfigProperties(Map properties) throws MetricCreationException; - - public Map getConfiguration() { - return properties; - } - - @Override - public CounterMetric createCounterMetric(String name, MetricSchema schema) throws MetricCreationException { - Metric metric = metricRegistry.get(name); - if (metric == null) { - synchronized (this) { - if (metricRegistry.get(name) == null) { - metric = createCounter(name, schema); - metricRegistry.put(name, metric); - } else { - metric = metricRegistry.get(name); - } - } - } else if (!(metric instanceof CounterMetric)) { - throw new MetricCreationException("Timer Metric with the same name already exists. Please use a different" - + " name"); - } else if (metric.getSchema() != schema) { - throw new MetricCreationException("Counter Metric with the same name but different schema already exists." - + " Please use a different name"); - } - return (CounterMetric) metric; - } - - protected abstract CounterMetric createCounter(String name, MetricSchema schema) throws MetricCreationException; - - @Override - public TimerMetric createTimerMetric(String name) { - Metric metric = metricRegistry.get(name); - if (metric == null) { - synchronized (this) { - if (metricRegistry.get(name) == null) { - metric = createTimer(name); - metricRegistry.put(name, metric); - } else { - metric = metricRegistry.get(name); - } - } - } - if (!(metric instanceof TimerMetric)) { - log.error("Counter Metric with the same name already exists. Please use a different name"); - return null; - } else { - return (TimerMetric) metric; - } - } - - protected abstract TimerMetric createTimer(String name); - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/CounterMetric.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/CounterMetric.java deleted file mode 100644 index c7623fb620..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/CounterMetric.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; - -/** - * Interface for Counter Metric. - */ -public interface CounterMetric extends Metric { - /** - * method to increment the count of the metric. Associated properties should be passed along with the method - * invocation. - * - * @param builder {@link MetricEventBuilder} of the this Metric - * @return current counter value - * @throws MetricReportingException Exception will be thrown if expected properties are not present - */ - public int incrementCount(MetricEventBuilder builder) throws MetricReportingException; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/GenericInputValidator.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/GenericInputValidator.java deleted file mode 100644 index 90ddb5ce62..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/GenericInputValidator.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_CONTEXT; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_CREATION; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_CREATOR_TENANT_DOMAIN; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_METHOD; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_NAME; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_RESOURCE_TEMPLATE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_TYPE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_VERSION; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.APPLICATION_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.APPLICATION_NAME; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.APPLICATION_OWNER; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.BACKEND_LATENCY; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.CORRELATION_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.DESTINATION; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ENVIRONMENT_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ERROR_CODE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ERROR_MESSAGE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ERROR_TYPE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.GATEWAY_TYPE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.KEY_TYPE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ORGANIZATION_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.PROPERTIES; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.PROXY_RESPONSE_CODE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.REGION_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.REQUEST_MEDIATION_LATENCY; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.REQUEST_TIMESTAMP; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.RESPONSE_CACHE_HIT; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.RESPONSE_LATENCY; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.RESPONSE_MEDIATION_LATENCY; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.TARGET_RESPONSE_CODE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.USER_AGENT_HEADER; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.USER_IP; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.USER_NAME; - -/** - * Generic Input Validator for any event metric reporter. In default required attributes include userName. - * Validator holds all required attributes against which - * inputs will be validated. - */ -public class GenericInputValidator { - - private static final org.wso2.apk.enforcer.analytics.publisher.reporter.GenericInputValidator INSTANCE = - new org.wso2.apk.enforcer.analytics.publisher.reporter.GenericInputValidator(); - private static final Map defaultResponseEventSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_METHOD, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CONTEXT, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_RESOURCE_TEMPLATE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(DESTINATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(ORGANIZATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_AGENT_HEADER, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_CACHE_HIT, Boolean.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(BACKEND_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(REQUEST_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(USER_IP, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROPERTIES, LinkedHashMap.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - private static final Map elkResponseEventSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_METHOD, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CONTEXT, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_RESOURCE_TEMPLATE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(DESTINATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ORGANIZATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_AGENT_HEADER, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_CACHE_HIT, Boolean.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(BACKEND_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(REQUEST_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(USER_IP, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROPERTIES, LinkedHashMap.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - private static final Map defaultFaultEventSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_MESSAGE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_METHOD, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ORGANIZATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(USER_IP, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_AGENT_HEADER, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROPERTIES, LinkedHashMap.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - private static final Map elkFaultEventSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_MESSAGE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_METHOD, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(USER_IP, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_AGENT_HEADER, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROPERTIES, LinkedHashMap.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - private static final Map choreoResponseEventSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_METHOD, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_RESOURCE_TEMPLATE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CONTEXT, String.class), - new AbstractMap.SimpleImmutableEntry<>(DESTINATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ORGANIZATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_AGENT_HEADER, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_CACHE_HIT, Boolean.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(BACKEND_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(REQUEST_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(USER_IP, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROPERTIES, LinkedHashMap.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - private static final Map choreoFaultEventSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_MESSAGE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_METHOD, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ORGANIZATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(USER_IP, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_AGENT_HEADER, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROPERTIES, LinkedHashMap.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - private static final List configProperties = new ArrayList<>(); - - private GenericInputValidator() { - //private constructor - } - - public static org.wso2.apk.enforcer.analytics.publisher.reporter.GenericInputValidator getInstance() { - - return INSTANCE; - } - - public Map getEventProperties(MetricSchema schema) { - - switch (schema) { - case RESPONSE: - return defaultResponseEventSchema; - case ERROR: - return defaultFaultEventSchema; - case CHOREO_RESPONSE: - return choreoResponseEventSchema; - case CHOREO_ERROR: - return choreoFaultEventSchema; - case ELK_RESPONSE: - return elkResponseEventSchema; - case ELK_ERROR: - return elkFaultEventSchema; - default: - return new HashMap<>(); - } - } - - public List getConfigProperties() { - - return configProperties; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/Metric.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/Metric.java deleted file mode 100644 index 8b12407d51..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/Metric.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -/** - * Base class for {@link CounterMetric} and {@link TimerMetric}. - */ -public interface Metric { - /** - * Returns name of the metric. Name is unique per given Reporter - * - * @return Name of the metric - */ - public String getName(); - - /** - * Method to get schema name. - * - * @return Schema name of this Metric - */ - public MetricSchema getSchema(); - - /** - * Returns the Event Builder which can produce an event conforming to the schema of the {@link Metric}. Users - * should get a builder instance though here, populate the relevant fields and return back to Metric class. - * @return MetricEventBuilder conforming to schema of Metric - */ - public MetricEventBuilder getEventBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricEventBuilder.java deleted file mode 100644 index e3344c893c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricEventBuilder.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; - -import java.util.Map; - -/** - * Main interface class for Metric Event Builders. Metric Event Builders are responsible of collecting metrics, - * validating them and later returning them as a Map<String, Object>. Default builders will be implemented and - * for any custom message building new builders have to be introduced - */ -public interface MetricEventBuilder { - - /** - * Validates the provided attributes and build a flat {@link Map}. Any validation failures will cause - * {@link MetricReportingException}. - * - * @return Map containing all attributes related to Metric Event - * @throws MetricReportingException if validation failed - */ - public Map build() throws MetricReportingException; - - /** - * Checks the validity of the added attributes. If all required attributes are present true will be returned. - * Else {@link MetricReportingException} will be thrown. - * - * @return Validity state of the added data - * @throws MetricReportingException if validation failed - */ - public boolean validate() throws MetricReportingException; - - /** - * Method to add any attribute to the builder. Each concrete implementation can implement validations - * based on the key. - * - * @param key Key of the attribute - * @param number Value of the attribute - * @return Returns itself to support chaining - * @throws MetricReportingException if validation failed - */ - public MetricEventBuilder addAttribute(String key, Object number) throws MetricReportingException; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricReporter.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricReporter.java deleted file mode 100644 index 3aae0e7108..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricReporter.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; - -import java.util.Map; - -/** - * Base interface for all Metric Reporter implementations. {@link AbstractMetricReporter} will implement this - * interface and any concrete implementations should extend {@link AbstractMetricReporter} - */ -public interface MetricReporter { - - /** - * Create and return {@link CounterMetric} to instrument collected metrics. - * - * @param name Name of the metric - * @param schema Metric schema - * @return {@link CounterMetric} - * @throws MetricCreationException if error occurred when creating CounterMetric - */ - CounterMetric createCounterMetric(String name, MetricSchema schema) throws MetricCreationException; - - /** - * Create and return {@link TimerMetric} to instrument collected metrics. - * - * @param name Name of the metric - * @return {@link TimerMetric} - */ - TimerMetric createTimerMetric(String name); - - /** - * Returns the currently set configurations. Setting configurations will be mandated through constructor - * - * @return {@link Map} representing current configurations - */ - Map getConfiguration(); - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricReporterFactory.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricReporterFactory.java deleted file mode 100644 index ad9aed2ccd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricReporterFactory.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.DefaultAnalyticsMetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.elk.ELKMetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.MoesifReporter; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; - -/** - * Factory class to create {@link MetricReporter}. Based on the passed argument relevant concrete implementation will - * be created and returned. Factory will behave in Singleton manner and if same type of instance is requested again - * Factory will return earlier requested instance. - */ -public class MetricReporterFactory { - - private static final Logger log = LoggerFactory.getLogger(MetricReporterFactory.class); - private static final MetricReporterFactory instance = new MetricReporterFactory(); - private static Map reporterRegistry = new HashMap<>(); - - private MetricReporterFactory() { - //private constructor - } - - public MetricReporter createMetricReporter(Map properties) - throws MetricCreationException { - - if (reporterRegistry.get(Constants.DEFAULT_REPORTER) == null) { - synchronized (this) { - if (reporterRegistry.get(Constants.DEFAULT_REPORTER) == null) { - MetricReporter reporterInstance = new DefaultAnalyticsMetricReporter(properties); - reporterRegistry.put(Constants.DEFAULT_REPORTER, reporterInstance); - return reporterInstance; - } - } - } - MetricReporter reporterInstance = reporterRegistry.get(Constants.DEFAULT_REPORTER); - log.info("Metric Reporter of type " + reporterInstance.getClass().toString().replaceAll("[\r\n]", "") + - " is already created. Hence returning same instance"); - return reporterInstance; - } - - public MetricReporter createLogMetricReporter(Map properties) throws MetricCreationException { - - if (reporterRegistry.get(Constants.ELK_REPORTER) == null) { - synchronized (this) { - if (reporterRegistry.get(Constants.ELK_REPORTER) == null) { - MetricReporter reporterInstance = new ELKMetricReporter(properties); - reporterRegistry.put(Constants.ELK_REPORTER, reporterInstance); - return reporterInstance; - } - } - } - - MetricReporter reporterInstance = reporterRegistry.get(Constants.ELK_REPORTER); - log.info("Metric Reporter of type " + reporterInstance.getClass().toString().replaceAll("[\r\n]", "") + - " is already created. Hence returning same instance"); - return reporterInstance; - } - - public MetricReporter createMetricReporter(String fullyQualifiedClassName, Map properties) - throws MetricCreationException { - - if (reporterRegistry.get(fullyQualifiedClassName) == null) { - synchronized (this) { - if (reporterRegistry.get(fullyQualifiedClassName) == null) { - if (fullyQualifiedClassName != null && !fullyQualifiedClassName.isEmpty()) { - try { - Class clazz = - (Class) Class.forName(fullyQualifiedClassName); - Constructor constructor = - clazz.getConstructor(Map.class); - MetricReporter reporterInstance = constructor.newInstance(properties); - reporterRegistry.put(fullyQualifiedClassName, reporterInstance); - return reporterInstance; - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException - | NoSuchMethodException | InvocationTargetException e) { - throw new MetricCreationException("Error occurred while creating a Metric Reporter of type" - + " " + fullyQualifiedClassName, e); - } - } else { - throw new MetricCreationException("Provided class name is either empty or null. Hence cannot " - + "create the Reporter."); - } - } - } - } - MetricReporter reporterInstance = reporterRegistry.get(fullyQualifiedClassName); - log.info("Metric Reporter of type " + reporterInstance.getClass().toString().replaceAll("[\r\n]", "") + - " is already created. Hence returning same instance"); - return reporterInstance; - } - - public MetricReporter createMetricReporterFromType(String type, Map properties) - throws MetricCreationException { - - String fullyQualifiedClassName = DefaultAnalyticsMetricReporter.class.getName(); - if (Constants.ELK_REPORTER.equals(type)) { - fullyQualifiedClassName = ELKMetricReporter.class.getName(); - } else if (Constants.DEFAULT_REPORTER.equals(type)) { - fullyQualifiedClassName = DefaultAnalyticsMetricReporter.class.getName(); - } else if (Constants.MOESIF_REPORTER.equals(type)) { - fullyQualifiedClassName = MoesifReporter.class.getName(); - } - return createMetricReporter(fullyQualifiedClassName , properties); - } - - /** - * Reset the MetricReporterFactory registry. Only intended to be used in testing - */ - public void reset() { - - reporterRegistry.clear(); - } - - public static MetricReporterFactory getInstance() { - - return instance; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricSchema.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricSchema.java deleted file mode 100644 index d7f81d5c6b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricSchema.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -/** - * Enum to represent supported metric schema types by the reporting framework. - */ -public enum MetricSchema { - RESPONSE, - ERROR, - CHOREO_RESPONSE, - CHOREO_ERROR, - ELK_RESPONSE, - ELK_ERROR, - LATENCY, - PAYLOAD -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricType.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricType.java deleted file mode 100644 index f5890f37b0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/MetricType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -/** - * Enum to represent metric types supported by the reporting framework. - */ -public enum MetricType { - COUNTER, - TIMER -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/TimerMetric.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/TimerMetric.java deleted file mode 100644 index a19e51061b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/TimerMetric.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter; - -/** - * Interface for Timer Metric. - */ -public interface TimerMetric extends Metric { -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultAnalyticsMetricReporter.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultAnalyticsMetricReporter.java deleted file mode 100644 index ba2fddc209..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultAnalyticsMetricReporter.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import com.azure.core.amqp.AmqpRetryMode; -import com.azure.core.amqp.AmqpRetryOptions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.TimerMetric; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.time.Duration; -import java.util.List; -import java.util.Map; - -/** - * Choreo Metric Reporter Implementation. This implementation is responsible for sending analytics data into Choreo - * cloud in a secure and reliable way. - */ -public class DefaultAnalyticsMetricReporter extends AbstractMetricReporter { - - private static final Logger log = LoggerFactory.getLogger(DefaultAnalyticsMetricReporter.class); - protected EventQueue eventQueue; - - public DefaultAnalyticsMetricReporter(Map properties) throws MetricCreationException { - super(properties); - int queueSize = Constants.DEFAULT_QUEUE_SIZE; - int workerThreads = Constants.DEFAULT_WORKER_THREADS; - int flushingDelay = Constants.DEFAULT_FLUSHING_DELAY; - if (properties.get(Constants.QUEUE_SIZE) != null) { - queueSize = Integer.parseInt(properties.get(Constants.QUEUE_SIZE)); - } - if (properties.get(Constants.WORKER_THREAD_COUNT) != null) { - workerThreads = Integer.parseInt(properties.get(Constants.WORKER_THREAD_COUNT)); - } - if (properties.get(Constants.CLIENT_FLUSHING_DELAY) != null) { - flushingDelay = Integer.parseInt(properties.get(Constants.CLIENT_FLUSHING_DELAY)); - } - String authToken = properties.get(Constants.AUTH_API_TOKEN); - String authEndpoint = properties.get(Constants.AUTH_API_URL); - AmqpRetryOptions retryOptions = createRetryOptions(properties); - EventHubClient client = new EventHubClient(authEndpoint, authToken, retryOptions, properties); - eventQueue = new EventQueue(queueSize, workerThreads, client, flushingDelay); - } - - private AmqpRetryOptions createRetryOptions(Map properties) { - int maxRetries = Constants.DEFAULT_MAX_RETRIES; - int delay = Constants.DEFAULT_DELAY; - int maxDelay = Constants.DEFAULT_MAX_DELAY; - int tryTimeout = Constants.DEFAULT_TRY_TIMEOUT; - AmqpRetryMode retryMode = AmqpRetryMode.FIXED; - if (properties.get(Constants.EVENTHUB_CLIENT_MAX_RETRIES) != null) { - int tempMaxRetries = Integer.parseInt(properties.get(Constants.EVENTHUB_CLIENT_MAX_RETRIES)); - if (tempMaxRetries > 0) { - maxRetries = tempMaxRetries; - } else { - log.warn("Provided " + Constants.EVENTHUB_CLIENT_MAX_RETRIES + "value is less than 0 and not " - + "acceptable. Hence using the default value."); - } - } - if (properties.get(Constants.EVENTHUB_CLIENT_DELAY) != null) { - int tempDelay = Integer.parseInt(properties.get(Constants.EVENTHUB_CLIENT_DELAY)); - if (tempDelay > 0) { - delay = tempDelay; - } else { - log.warn("Provided " + Constants.EVENTHUB_CLIENT_DELAY + "value is less than 0 and not acceptable. " - + "Hence using the default value."); - } - } - if (properties.get(Constants.EVENTHUB_CLIENT_MAX_DELAY) != null) { - int tempMaxDelay = Integer.parseInt(properties.get(Constants.EVENTHUB_CLIENT_MAX_DELAY)); - if (tempMaxDelay > 0) { - maxDelay = tempMaxDelay; - } else { - log.warn("Provided " + Constants.EVENTHUB_CLIENT_MAX_DELAY + "value is less than 0 and not acceptable. " - + "Hence using the default value."); - } - } - if (properties.get(Constants.EVENTHUB_CLIENT_TRY_TIMEOUT) != null) { - int tempTryTimeout = Integer.parseInt(properties.get(Constants.EVENTHUB_CLIENT_TRY_TIMEOUT)); - if (tempTryTimeout > 0) { - tryTimeout = tempTryTimeout; - } else { - log.warn("Provided " + Constants.EVENTHUB_CLIENT_TRY_TIMEOUT + "value is less than 0 and not " - + "acceptable. Hence using the default value."); - } - } - if (properties.get(Constants.EVENTHUB_CLIENT_RETRY_MODE) != null) { - String tempRetryMode = properties.get(Constants.EVENTHUB_CLIENT_RETRY_MODE); - if (tempRetryMode.equals(Constants.FIXED)) { - //do nothing - } else if (tempRetryMode.equals(Constants.EXPONENTIAL)) { - retryMode = AmqpRetryMode.EXPONENTIAL; - } else { - log.warn("Provided " + Constants.EVENTHUB_CLIENT_RETRY_MODE + "value is not supported. Hence will " - + "using the default value."); - } - } - return new AmqpRetryOptions() - .setDelay(Duration.ofSeconds(delay)) - .setMaxRetries(maxRetries) - .setMaxDelay(Duration.ofSeconds(maxDelay)) - .setTryTimeout(Duration.ofSeconds(tryTimeout)) - .setMode(retryMode); - - } - - @Override - protected void validateConfigProperties(Map properties) throws MetricCreationException { - if (properties != null) { - List requiredProperties = DefaultInputValidator.getInstance().getConfigProperties(); - for (String property : requiredProperties) { - if (properties.get(property) == null || properties.get(property).isEmpty()) { - throw new MetricCreationException(property + " is missing in config data"); - } - } - } else { - throw new MetricCreationException("Configuration properties cannot be null"); - } - } - - @Override - protected CounterMetric createCounter(String name, MetricSchema schema) throws MetricCreationException { - DefaultCounterMetric counterMetric = new DefaultCounterMetric(name, eventQueue, schema); - return counterMetric; - } - - @Override - protected TimerMetric createTimer(String name) { - return null; - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultAnalyticsThreadFactory.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultAnalyticsThreadFactory.java deleted file mode 100644 index 4ae2ae049e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultAnalyticsThreadFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Custom Thread Factory for Analytics publisher impl. - */ -public class DefaultAnalyticsThreadFactory implements ThreadFactory { - private static final AtomicInteger poolNumber = new AtomicInteger(1); - final ThreadGroup group; - final AtomicInteger threadNumber = new AtomicInteger(1); - final String namePrefix; - - public DefaultAnalyticsThreadFactory(String threadPoolExecutorName) { - group = Thread.currentThread().getThreadGroup(); - namePrefix = "Cloud-Analytics-" + threadPoolExecutorName + "-pool-" + poolNumber.getAndIncrement() + - "-thread-"; - } - - public Thread newThread(Runnable r) { - Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0); - if (t.isDaemon()) { - t.setDaemon(false); - } - if (t.getPriority() != Thread.NORM_PRIORITY) { - t.setPriority(Thread.NORM_PRIORITY); - } - return t; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultChoreoFaultMetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultChoreoFaultMetricEventBuilder.java deleted file mode 100644 index a61c7dc791..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultChoreoFaultMetricEventBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; - -/** - * Builder class for fault events. - */ -public class DefaultChoreoFaultMetricEventBuilder extends DefaultFaultMetricEventBuilder { - - public DefaultChoreoFaultMetricEventBuilder() { - super(DefaultInputValidator.getInstance().getEventProperties(MetricSchema.CHOREO_ERROR)); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultChoreoResponseMetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultChoreoResponseMetricEventBuilder.java deleted file mode 100644 index 15d3f5e5bc..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultChoreoResponseMetricEventBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; - -/** - * Default builder for response metric type. Restrictions are set on the key names that uses can set to the builder. - * Allows keys and their validity will be checked when populating and availability of all required properties will be - * checked when building. - */ -public class DefaultChoreoResponseMetricEventBuilder extends DefaultResponseMetricEventBuilder { - - public DefaultChoreoResponseMetricEventBuilder() { - super(DefaultInputValidator.getInstance().getEventProperties(MetricSchema.CHOREO_RESPONSE)); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultCounterMetric.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultCounterMetric.java deleted file mode 100644 index 4b957d53ce..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultCounterMetric.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.client.ClientStatus; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Implementation of {@link CounterMetric} for Choroe Metric Reporter. - */ -public class DefaultCounterMetric implements CounterMetric { - private static final Logger log = LoggerFactory.getLogger(DefaultCounterMetric.class); - private String name; - private EventQueue queue; - private MetricSchema schema; - private ClientStatus status; - private final AtomicInteger failureCount; - - public DefaultCounterMetric(String name, EventQueue queue, MetricSchema schema) throws MetricCreationException { - //Constructor should be made protected. Keeping public till testing plan is finalized - this.name = name; - this.queue = queue; - if (schema == MetricSchema.ERROR || schema == MetricSchema.RESPONSE - || schema == MetricSchema.CHOREO_ERROR || schema == MetricSchema.CHOREO_RESPONSE) { - this.schema = schema; - } else { - throw new MetricCreationException("Default Counter Metric only supports " + MetricSchema.RESPONSE + ", " - + ", " + MetricSchema.ERROR + ", " + MetricSchema.CHOREO_RESPONSE + " and " - + MetricSchema.CHOREO_RESPONSE + " types."); - } - this.status = queue.getClient().getStatus(); - this.failureCount = new AtomicInteger(0); - } - - @Override - public String getName() { - return name; - } - - @Override public MetricSchema getSchema() { - return schema; - } - - @Override - public int incrementCount(MetricEventBuilder builder) { - if (!(status == ClientStatus.NOT_CONNECTED)) { - queue.put(builder); - } else { - if (failureCount.incrementAndGet() % 1000 == 0) { - log.error("Eventhub client is not connected. " + failureCount.incrementAndGet() + " events dropped so " - + "far. Please correct your configuration and restart the instance."); - } - } - return 0; - } - - /** - * Returns Event Builder used for this CounterMetric. Depending on the schema different types of builders will be - * returned. - * - * @return {@link MetricEventBuilder} for this {@link CounterMetric} - */ - @Override - public MetricEventBuilder getEventBuilder() { - switch (schema) { - case RESPONSE: - return new DefaultResponseMetricEventBuilder(); - case ERROR: - return new DefaultFaultMetricEventBuilder(); - case CHOREO_RESPONSE: - return new DefaultChoreoResponseMetricEventBuilder(); - case CHOREO_ERROR: - return new DefaultChoreoFaultMetricEventBuilder(); - default: - // will not happen - return null; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultFaultMetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultFaultMetricEventBuilder.java deleted file mode 100644 index e860fd142b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultFaultMetricEventBuilder.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.util.HashMap; -import java.util.Map; - -/** - * Builder class for fault events. - */ -public class DefaultFaultMetricEventBuilder extends AbstractMetricEventBuilder { - protected final Map requiredAttributes; - protected final Map eventMap; - - public DefaultFaultMetricEventBuilder() { - requiredAttributes = DefaultInputValidator.getInstance().getEventProperties(MetricSchema.ERROR); - eventMap = new HashMap<>(); - } - - protected DefaultFaultMetricEventBuilder(Map requiredAttributes) { - this.requiredAttributes = requiredAttributes; - eventMap = new HashMap<>(); - } - - @Override - public boolean validate() throws MetricReportingException { - for (Map.Entry entry : requiredAttributes.entrySet()) { - Object attribute = eventMap.get(entry.getKey()); - if (attribute == null) { - throw new MetricReportingException(entry.getKey() + " is missing in metric data. This metric event " - + "will not be processed further."); - } else if (!attribute.getClass().equals(entry.getValue())) { - throw new MetricReportingException(entry.getKey() + " is expecting a " + entry.getValue() + " type " - + "attribute while attribute of type " + attribute.getClass() - + " is present"); - } - } - return true; - } - - @Override - public MetricEventBuilder addAttribute(String key, Object value) throws MetricReportingException { - //all validation is moved to validate method to reduce analytics data processing latency - eventMap.put(key, value); - return this; - } - - @Override - protected Map buildEvent() { - eventMap.put(Constants.EVENT_TYPE, Constants.FAULT_EVENT_TYPE); - // properties object is not required and removing - eventMap.remove(Constants.PROPERTIES); - return eventMap; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultInputValidator.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultInputValidator.java deleted file mode 100644 index 83ca4de2bb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultInputValidator.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; - -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_CONTEXT; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_CREATION; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_CREATOR_TENANT_DOMAIN; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_METHOD; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_NAME; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_RESOURCE_TEMPLATE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_TYPE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.API_VERSION; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.APPLICATION_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.APPLICATION_NAME; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.APPLICATION_OWNER; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.BACKEND_LATENCY; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.CORRELATION_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.DESTINATION; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ENVIRONMENT_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ERROR_CODE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ERROR_MESSAGE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ERROR_TYPE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.GATEWAY_TYPE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.KEY_TYPE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.ORGANIZATION_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.PROXY_RESPONSE_CODE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.REGION_ID; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.REQUEST_MEDIATION_LATENCY; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.REQUEST_TIMESTAMP; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.RESPONSE_CACHE_HIT; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.RESPONSE_LATENCY; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.RESPONSE_MEDIATION_LATENCY; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.TARGET_RESPONSE_CODE; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.USER_AGENT_HEADER; -import static org.wso2.apk.enforcer.analytics.publisher.util.Constants.USER_IP; - -/** - * Input Validator for {@link DefaultAnalyticsMetricReporter}. Validator holds all required attributes against which - * inputs will be validated. - */ -public class DefaultInputValidator { - private static final DefaultInputValidator INSTANCE = new DefaultInputValidator(); - private static final Map responseSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_METHOD, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CONTEXT, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_RESOURCE_TEMPLATE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(DESTINATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_AGENT_HEADER, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_CACHE_HIT, Boolean.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(BACKEND_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(REQUEST_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(USER_IP, String.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - - private static final Map faultSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_MESSAGE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - - private static final Map choreoResponseSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_METHOD, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_RESOURCE_TEMPLATE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CONTEXT, String.class), - new AbstractMap.SimpleImmutableEntry<>(DESTINATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ORGANIZATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(USER_AGENT_HEADER, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_CACHE_HIT, Boolean.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(BACKEND_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(REQUEST_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(RESPONSE_MEDIATION_LATENCY, Long.class), - new AbstractMap.SimpleImmutableEntry<>(USER_IP, String.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - - private static final Map choreoFaultSchema = Stream.of( - new AbstractMap.SimpleImmutableEntry<>(REQUEST_TIMESTAMP, String.class), - new AbstractMap.SimpleImmutableEntry<>(CORRELATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(KEY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(ERROR_MESSAGE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_VERSION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATION, String.class), - new AbstractMap.SimpleImmutableEntry<>(API_CREATOR_TENANT_DOMAIN, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_NAME, String.class), - new AbstractMap.SimpleImmutableEntry<>(APPLICATION_OWNER, String.class), - new AbstractMap.SimpleImmutableEntry<>(REGION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ORGANIZATION_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(ENVIRONMENT_ID, String.class), - new AbstractMap.SimpleImmutableEntry<>(GATEWAY_TYPE, String.class), - new AbstractMap.SimpleImmutableEntry<>(PROXY_RESPONSE_CODE, Integer.class), - new AbstractMap.SimpleImmutableEntry<>(TARGET_RESPONSE_CODE, Integer.class)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - - private static final List configProperties = new ArrayList<>(); - - - private DefaultInputValidator() { - //private constructor - } - - public static DefaultInputValidator getInstance() { - return INSTANCE; - } - - public Map getEventProperties(MetricSchema schema) { - switch (schema) { - case RESPONSE: - return responseSchema; - case ERROR: - return faultSchema; - case CHOREO_RESPONSE: - return choreoResponseSchema; - case CHOREO_ERROR: - return choreoFaultSchema; - default: - return new HashMap<>(); - } - } - - public List getConfigProperties() { - return configProperties; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultResponseMetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultResponseMetricEventBuilder.java deleted file mode 100644 index 6e9811e5a2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/DefaultResponseMetricEventBuilder.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; -import org.wso2.apk.enforcer.analytics.publisher.util.EventMapAttributeFilter; -import org.wso2.apk.enforcer.analytics.publisher.util.UserAgentParser; -import ua_parser.Client; - -import java.util.HashMap; -import java.util.Map; - -/** - * Default builder for response metric type. Restrictions are set on the key names that uses can set to the builder. - * Allows keys and their validity will be checked when populating and availability of all required properties will be - * checked when building. - */ -public class DefaultResponseMetricEventBuilder extends AbstractMetricEventBuilder { - private static final Logger log = LoggerFactory.getLogger(DefaultResponseMetricEventBuilder.class); - protected Map requiredAttributes; - protected Map eventMap; - private Boolean isBuilt = false; - - public DefaultResponseMetricEventBuilder() { - requiredAttributes = DefaultInputValidator.getInstance().getEventProperties(MetricSchema.RESPONSE); - eventMap = new HashMap<>(); - } - - protected DefaultResponseMetricEventBuilder(Map requiredAttributes) { - this.requiredAttributes = requiredAttributes; - eventMap = new HashMap<>(); - } - - @Override - public boolean validate() throws MetricReportingException { - if (!isBuilt) { - eventMap.remove(Constants.USER_NAME); - Map propertyMap = (Map) eventMap.remove(Constants.PROPERTIES); - if (propertyMap != null) { - copyDefaultPropertiesToRootLevel(propertyMap); - } - for (Map.Entry entry : requiredAttributes.entrySet()) { - Object attribute = eventMap.get(entry.getKey()); - if (attribute == null) { - throw new MetricReportingException(entry.getKey() + " is missing in metric data. This metric event " - + "will not be processed further."); - } else if (!attribute.getClass().equals(entry.getValue())) { - throw new MetricReportingException(entry.getKey() + " is expecting a " + entry.getValue() + " type " - + "attribute while attribute of type " - + attribute.getClass() + " is present."); - } - } - } - return true; - } - - @Override - public MetricEventBuilder addAttribute(String key, Object value) throws MetricReportingException { - eventMap.put(key, value); - return this; - } - - @Override - protected Map buildEvent() { - if (!isBuilt) { - // util function to filter required attributes - eventMap = EventMapAttributeFilter.getInstance().filter(eventMap, requiredAttributes); - - eventMap.put(Constants.EVENT_TYPE, Constants.RESPONSE_EVENT_TYPE); - // userAgent raw string is not required and removing - String userAgentHeader = (String) eventMap.remove(Constants.USER_AGENT_HEADER); - if (userAgentHeader != null) { - setUserAgentProperties(userAgentHeader); - } - isBuilt = true; - } - return eventMap; - } - - private void setUserAgentProperties(String userAgentHeader) { - String browser = null; - String platform = null; - Client client = UserAgentParser.getInstance().parseUserAgent(userAgentHeader); - if (client != null) { - browser = client.userAgent.family; - platform = client.os.family; - } - - if (browser == null || browser.isEmpty()) { - browser = Constants.UNKNOWN_VALUE; - } - if (platform == null || platform.isEmpty()) { - platform = Constants.UNKNOWN_VALUE; - } - eventMap.put(Constants.USER_AGENT, browser); - eventMap.put(Constants.PLATFORM, platform); - } - - private void copyDefaultPropertiesToRootLevel(Map properties) { - if (properties.get(Constants.API_CONTEXT) != null) { - String apiContext = properties.remove(Constants.API_CONTEXT); - eventMap.put(Constants.API_CONTEXT, apiContext); - } - properties.remove(Constants.USER_NAME); - eventMap.put(Constants.PROPERTIES, properties); - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/EventQueue.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/EventQueue.java deleted file mode 100644 index a57785ae62..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/EventQueue.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Bounded concurrent queue wrapping {@link java.util.concurrent.ArrayBlockingQueue}. - */ -public class EventQueue { - - private static final Logger log = LoggerFactory.getLogger(EventQueue.class); - private final BlockingQueue eventQueue; - private final ExecutorService publisherExecutorService; - private final EventHubClient client; - private final AtomicInteger failureCount; - private final ScheduledExecutorService flushingExecutorService; - - public EventQueue(int queueSize, int workerThreadCount, EventHubClient client, int flushingDelay) { - this.client = client; - // Note : Using a fixed worker thread pool and a bounded queue to control the load on the server - publisherExecutorService = Executors.newFixedThreadPool(workerThreadCount, - new DefaultAnalyticsThreadFactory("Queue-Worker")); - flushingExecutorService = Executors.newScheduledThreadPool(workerThreadCount, - new DefaultAnalyticsThreadFactory("Queue-Flusher")); - eventQueue = new LinkedBlockingQueue<>(queueSize); - failureCount = new AtomicInteger(0); - for (int i = 0; i < workerThreadCount; i++) { - if (i == 0) { - publisherExecutorService.submit(new ParallelQueueWorker(eventQueue, client)); - flushingExecutorService.scheduleWithFixedDelay(new QueueFlusher(eventQueue, client), flushingDelay, - flushingDelay, TimeUnit.SECONDS); - } else { - EventHubClient clonedClient = client.clone(); - publisherExecutorService.submit(new ParallelQueueWorker(eventQueue, clonedClient)); - flushingExecutorService.scheduleWithFixedDelay(new QueueFlusher(eventQueue, clonedClient), - flushingDelay, flushingDelay, TimeUnit.SECONDS); - } - } - } - - public void put(MetricEventBuilder builder) { - try { - if (!eventQueue.offer(builder)) { - int count = failureCount.incrementAndGet(); - if (count == 1) { - log.error("Event queue is full. Starting to drop analytics events."); - } else if (count % 1000 == 0) { - log.error("Event queue is full. " + count + " events dropped so far"); - } - } - } catch (RejectedExecutionException e) { - log.warn("Task submission failed. Task queue might be full", e); - } - - } - - @Override - protected void finalize() throws Throwable { - publisherExecutorService.shutdown(); - super.finalize(); - } - - protected EventHubClient getClient() { - return this.client; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/ParallelQueueWorker.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/ParallelQueueWorker.java deleted file mode 100644 index 47649bc65d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/ParallelQueueWorker.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import com.google.gson.Gson; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; - -import java.util.Map; -import java.util.concurrent.BlockingQueue; - -/** - * Will removes the events from queues and send then to the endpoints. - */ -public class ParallelQueueWorker implements Runnable { - - private static final Logger log = LoggerFactory.getLogger(ParallelQueueWorker.class); - private BlockingQueue eventQueue; - private EventHubClient client; - - public ParallelQueueWorker(BlockingQueue queue, EventHubClient client) { - this.client = client; - this.eventQueue = queue; - } - - public void run() { - if (log.isDebugEnabled()) { - log.debug(eventQueue.size() + " messages in queue before " + - Thread.currentThread().getName().replaceAll("[\r\n]", "") - + " worker has polled queue"); - } - while (true) { - MetricEventBuilder eventBuilder; - String event; - try { - eventBuilder = eventQueue.take(); - if (eventBuilder != null) { - Map eventMap = eventBuilder.build(); - event = new Gson().toJson(eventMap); - client.sendEvent(event); - } - } catch (MetricReportingException e) { - log.error("Builder instance is not duly filled. Event building failed", e); - continue; - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } catch (Exception e) { - log.error("Analytics event sending failed. Event will be dropped", e); - } - - if (log.isDebugEnabled()) { - log.debug(eventQueue.size() + " messages in queue after " + - Thread.currentThread().getName().replaceAll("[\r\n]", "") - + " worker has finished work"); - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/QueueFlusher.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/QueueFlusher.java deleted file mode 100644 index ab66a22185..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/QueueFlusher.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; - -import java.util.concurrent.BlockingQueue; - -/** - * Class to periodically flush event batch. - */ -public class QueueFlusher implements Runnable { - - private final BlockingQueue queue; - private final EventHubClient client; - - public QueueFlusher(BlockingQueue queue, EventHubClient client) { - this.queue = queue; - this.client = client; - } - - @Override public void run() { - if (queue.isEmpty()) { - //For scenarios where no API invocation is happening additional check in the EventHubClient will stop - // empty batch flushing - client.flushEvents(); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/QueueWorker.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/QueueWorker.java deleted file mode 100644 index 712409bbff..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/cloud/QueueWorker.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.cloud; - -import com.google.gson.Gson; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; - -import java.util.Map; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ThreadPoolExecutor; - -/** - * Will removes the events from queues and send then to the endpoints. - */ -public class QueueWorker implements Runnable { - - private static final Logger log = LoggerFactory.getLogger(QueueWorker.class); - private BlockingQueue eventQueue; - private ExecutorService executorService; - private EventHubClient client; - - public QueueWorker(BlockingQueue queue, EventHubClient client, - ExecutorService executorService) { - this.client = client; - this.eventQueue = queue; - this.executorService = executorService; - } - - public void run() { - try { - if (log.isDebugEnabled()) { - log.debug(eventQueue.size() + " messages in queue before " + - Thread.currentThread().getName().replaceAll("[\r\n]", "") - + " worker has polled queue"); - } - ThreadPoolExecutor threadPoolExecutor = ((ThreadPoolExecutor) executorService); - do { - MetricEventBuilder eventBuilder = eventQueue.poll(); - if (eventBuilder != null) { - String event; - try { - Map eventMap = eventBuilder.build(); - event = new Gson().toJson(eventMap); - } catch (MetricReportingException e) { - log.error("Builder instance is not duly filled. Event building failed", e); - continue; - } - client.sendEvent(event); - } else { - break; - } - } while (threadPoolExecutor.getActiveCount() == 1 && eventQueue.size() != 0); - //while condition to handle possible task rejections - if (log.isDebugEnabled()) { - log.debug(eventQueue.size() + " messages in queue after " + - Thread.currentThread().getName().replaceAll("[\r\n]", "") - + " worker has finished work"); - } - } catch (Throwable e) { - log.error("Error in passing events to Event Hub client. Events dropped", e); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKCounterMetric.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKCounterMetric.java deleted file mode 100644 index 6c82328b3b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKCounterMetric.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.elk; - -import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.GenericInputValidator; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; - -import java.util.Map; - -/** - * Log Counter Metrics class, This class can be used to log analytics event to a separate log file. - */ -public class ELKCounterMetric implements CounterMetric { - private static final Log log = LogFactory.getLog(ELKCounterMetric.class); - private final String name; - private final Gson gson; - private MetricSchema schema; - - protected ELKCounterMetric(String name, MetricSchema schema) { - this.name = name; - this.gson = new Gson(); - this.schema = schema; - } - - @Override - public int incrementCount(MetricEventBuilder builder) throws MetricReportingException { - Map event = builder.build(); - String jsonString = gson.toJson(event); - - log.info("apimMetrics: " + name.replaceAll("[\r\n]", "") + ", properties :" + - jsonString.replaceAll("[\r\n]", "")); - return 0; - } - - @Override - public String getName() { - return name; - } - - @Override - public MetricSchema getSchema() { - return schema; - } - - @Override - public MetricEventBuilder getEventBuilder() { - - switch (schema) { - case RESPONSE: - default: - return new ELKMetricEventBuilder( - GenericInputValidator.getInstance().getEventProperties(MetricSchema.ELK_RESPONSE)); - case ERROR: - return new ELKMetricEventBuilder( - GenericInputValidator.getInstance().getEventProperties(MetricSchema.ELK_ERROR)); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKMetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKMetricEventBuilder.java deleted file mode 100644 index e6416e63ef..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKMetricEventBuilder.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.elk; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.GenericInputValidator; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; -import org.wso2.apk.enforcer.analytics.publisher.util.EventMapAttributeFilter; -import org.wso2.apk.enforcer.analytics.publisher.util.UserAgentParser; -import ua_parser.Client; - -import java.util.HashMap; -import java.util.Map; - -/** - * Event builder for log Metric Reporter. - */ -public class ELKMetricEventBuilder extends AbstractMetricEventBuilder { - - protected Map requiredAttributes; - private Map eventMap; - private Boolean isBuilt = false; - - public ELKMetricEventBuilder() { - requiredAttributes = GenericInputValidator.getInstance().getEventProperties(MetricSchema.RESPONSE); - eventMap = new HashMap<>(); - } - - public ELKMetricEventBuilder(Map requiredAttributes) { - this.requiredAttributes = requiredAttributes; - eventMap = new HashMap<>(); - } - - @Override - protected Map buildEvent() { - if (!isBuilt) { - // util function to filter required attributes - eventMap = EventMapAttributeFilter.getInstance().filter(eventMap, requiredAttributes); - - // userAgent raw string is not required and removing - String userAgentHeader = (String) eventMap.remove(Constants.USER_AGENT_HEADER); - if (userAgentHeader != null) { - setUserAgentProperties(userAgentHeader); - } - isBuilt = true; - } - return eventMap; - } - - @Override - public boolean validate() throws MetricReportingException { - if (!isBuilt) { - Map propertyMap = (Map) eventMap.get(Constants.PROPERTIES); - if (propertyMap != null) { - copyDefaultPropertiesToRootLevel(propertyMap); - } - for (Map.Entry entry : requiredAttributes.entrySet()) { - Object attribute = eventMap.get(entry.getKey()); - if (attribute == null) { - throw new MetricReportingException(entry.getKey() + " is missing in metric data. This metric event " - + "will not be processed further."); - } else if (!attribute.getClass().equals(entry.getValue())) { - throw new MetricReportingException(entry.getKey() + " is expecting a " + entry.getValue() + " type " - + "attribute while attribute of type " - + attribute.getClass() + " is present."); - } - } - } - return true; - } - - @Override - public MetricEventBuilder addAttribute(String key, Object value) throws MetricReportingException { - eventMap.put(key, value); - return this; - } - - private void setUserAgentProperties(String userAgentHeader) { - String browser = null; - String platform = null; - Client client = UserAgentParser.getInstance().parseUserAgent(userAgentHeader); - if (client != null) { - browser = client.userAgent.family; - platform = client.os.family; - } - - if (browser == null || browser.isEmpty()) { - browser = Constants.UNKNOWN_VALUE; - } - if (platform == null || platform.isEmpty()) { - platform = Constants.UNKNOWN_VALUE; - } - eventMap.put(Constants.USER_AGENT, browser); - eventMap.put(Constants.PLATFORM, platform); - } - - private void copyDefaultPropertiesToRootLevel(Map properties) { - - if (properties.get(Constants.API_CONTEXT) != null) { - eventMap.put(Constants.API_CONTEXT, properties.get(Constants.API_CONTEXT)); - } - if (properties.get(Constants.USER_NAME) != null) { - eventMap.put(Constants.USER_NAME, properties.get(Constants.USER_NAME)); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKMetricReporter.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKMetricReporter.java deleted file mode 100644 index a98ba41b67..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/elk/ELKMetricReporter.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.elk; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.TimerMetric; - -import java.util.Map; - -/** - * Log Metric Reporter class. Intended for testing only. - */ -public class ELKMetricReporter extends AbstractMetricReporter { - private static final Logger log = LoggerFactory.getLogger(ELKMetricReporter.class); - - public ELKMetricReporter(Map properties) throws MetricCreationException { - super(properties); - log.info("LogMetricReporter successfully initialized"); - } - - @Override - protected void validateConfigProperties(Map properties) throws MetricCreationException { - //nothing to validate - } - - @Override - protected CounterMetric createCounter(String name, MetricSchema schema) { - return new ELKCounterMetric(name, schema); - } - - @Override - protected TimerMetric createTimer(String name) { - return null; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogCounterMetric.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogCounterMetric.java deleted file mode 100644 index ca84e74414..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogCounterMetric.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.log; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; - -import java.util.Map; - -/** - * Log Counter Metrics class, This class can be used to log analytics event to a separate log file. - */ -public class LogCounterMetric implements CounterMetric { - private static final Logger log = LoggerFactory.getLogger(LogCounterMetric.class); - private final String name; - - protected LogCounterMetric(String name) { - this.name = name; - } - - @Override - public int incrementCount(MetricEventBuilder builder) throws MetricReportingException { - Map properties = builder.build(); - log.info("Metric Name: " + name.replaceAll("[\r\n]", "") + " Metric Value: " - + properties.toString().replaceAll("[\r\n]", "")); - return 0; - } - - @Override - public String getName() { - return name; - } - - @Override - public MetricSchema getSchema() { - return null; - } - - @Override - public MetricEventBuilder getEventBuilder() { - return new LogMetricEventBuilder(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogMetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogMetricEventBuilder.java deleted file mode 100644 index 3680f6e585..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogMetricEventBuilder.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.log; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; - -import java.util.HashMap; -import java.util.Map; - -/** - * Event builder for log Metric Reporter. - */ -public class LogMetricEventBuilder extends AbstractMetricEventBuilder { - private Map eventMap = new HashMap<>(); - - @Override - protected Map buildEvent() { - return eventMap; - } - - @Override - public boolean validate() throws MetricReportingException { - for (Object value : eventMap.values()) { - if (!(value instanceof String)) { - throw new MetricReportingException("Only attributes of type String is supported"); - } - } - return true; - } - - @Override public MetricEventBuilder addAttribute(String key, Object value) throws MetricReportingException { - eventMap.put(key, value); - return this; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogMetricReporter.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogMetricReporter.java deleted file mode 100644 index 43438c967b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/log/LogMetricReporter.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.reporter.log; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.TimerMetric; - -import java.util.Map; - -/** - * Log Metric Reporter class. Intended for testing only. - */ -public class LogMetricReporter extends AbstractMetricReporter { - private static final Logger log = LoggerFactory.getLogger(LogMetricReporter.class); - - - public LogMetricReporter(Map properties) throws MetricCreationException { - super(properties); - log.info("LogMetricReporter successfully initialized"); - } - - @Override - protected void validateConfigProperties(Map properties) throws MetricCreationException { - //nothing to validate - } - - @Override - protected CounterMetric createCounter(String name, MetricSchema schema) { - return new LogCounterMetric(name); - } - - @Override - protected TimerMetric createTimer(String name) { - return null; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/EventQueue.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/EventQueue.java deleted file mode 100644 index 972170bb73..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/EventQueue.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.moesif; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.client.MoesifClient; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.DefaultAnalyticsThreadFactory; -import org.wso2.apk.enforcer.analytics.publisher.retriever.MoesifKeyRetriever; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Bounded concurrent queue wrapping for Moesif reporter{@link java.util.concurrent.ArrayBlockingQueue}. - */ -public class EventQueue { - private static final Logger log = LoggerFactory.getLogger(EventQueue.class); - private final BlockingQueue eventQueue; - private final ExecutorService publisherExecutorService; - private final AtomicInteger failureCount; - - public EventQueue(int queueSize, int workerThreadCount, MoesifKeyRetriever moesifKeyRetriever) { - publisherExecutorService = Executors.newFixedThreadPool(workerThreadCount, - new DefaultAnalyticsThreadFactory("Queue-Worker")); - MoesifClient moesifClient = new MoesifClient(moesifKeyRetriever); - eventQueue = new LinkedBlockingQueue<>(queueSize); - failureCount = new AtomicInteger(0); - for (int i = 0; i < workerThreadCount; i++) { - publisherExecutorService.submit(new ParallelQueueWorker(eventQueue, moesifClient)); - } - } - - public void put(MetricEventBuilder builder) { - try { - if (!eventQueue.offer(builder)) { - int count = failureCount.incrementAndGet(); - if (count == 1) { - log.error("Event queue is full. Starting to drop analytics events."); - } else if (count % 1000 == 0) { - log.error("Event queue is full. {} events dropped so far", count); - } - } - } catch (RejectedExecutionException e) { - log.warn("Task submission failed. Task queue might be full", e); - } - } - - @Override - protected void finalize() throws Throwable { - publisherExecutorService.shutdown(); - super.finalize(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifCounterMetric.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifCounterMetric.java deleted file mode 100644 index fc64ad488a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifCounterMetric.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.moesif; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.GenericInputValidator; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; - -/** - * Implementation of {@link CounterMetric} for Moesif Metric Reporter. - */ -public class MoesifCounterMetric implements CounterMetric { - private static final Logger log = LoggerFactory.getLogger(MoesifCounterMetric.class); - private EventQueue queue; - private String name; - private MetricSchema schema; - - public MoesifCounterMetric(String name, EventQueue queue, MetricSchema schema) { - this.name = name; - this.schema = schema; - this.queue = queue; - } - - - @Override - public int incrementCount(MetricEventBuilder metricEventBuilder) throws MetricReportingException { - queue.put(metricEventBuilder); - return 0; - } - - @Override - public String getName() { - return this.name; - } - - @Override - public MetricSchema getSchema() { - return this.schema; - } - - /** - * Returns Event Builder used for this CounterMetric. Depending on the schema different types of builders will be - * returned. - * - * @return {@link MetricEventBuilder} for this {@link CounterMetric} - */ - @Override - public MetricEventBuilder getEventBuilder() { - switch (schema) { - case RESPONSE: - default: - return new MoesifMetricEventBuilder( - GenericInputValidator.getInstance().getEventProperties(MetricSchema.RESPONSE)); - case ERROR: - return new MoesifMetricEventBuilder( - GenericInputValidator.getInstance().getEventProperties(MetricSchema.ERROR)); - case CHOREO_RESPONSE: - return new MoesifMetricEventBuilder( - GenericInputValidator.getInstance().getEventProperties(MetricSchema.CHOREO_RESPONSE)); - case CHOREO_ERROR: - return new MoesifMetricEventBuilder( - GenericInputValidator.getInstance().getEventProperties(MetricSchema.CHOREO_ERROR)); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifMetricEventBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifMetricEventBuilder.java deleted file mode 100644 index 027c35d822..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifMetricEventBuilder.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.moesif; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.GenericInputValidator; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.util.EventMapAttributeFilter; - -import java.util.HashMap; -import java.util.Map; - -/** - * Event builder for Moesif Metric Reporter. Default Event builder has response schema type. - */ -public class MoesifMetricEventBuilder extends AbstractMetricEventBuilder { - - protected Map requiredAttributes; - private Map eventMap; - private Boolean isBuilt = false; - - public MoesifMetricEventBuilder() { - - requiredAttributes = GenericInputValidator.getInstance().getEventProperties(MetricSchema.RESPONSE); - eventMap = new HashMap<>(); - } - - public MoesifMetricEventBuilder(Map requiredAttributes) { - - this.requiredAttributes = requiredAttributes; - eventMap = new HashMap<>(); - } - - @Override - protected Map buildEvent() { - - if (!isBuilt) { - // util function to filter required attributes - eventMap = EventMapAttributeFilter.getInstance().filter(eventMap, requiredAttributes); - - isBuilt = true; - } - return eventMap; - } - - @Override - public boolean validate() throws MetricReportingException { - - if (!isBuilt) { - for (Map.Entry entry : requiredAttributes.entrySet()) { - Object attribute = eventMap.get(entry.getKey()); - if (attribute == null) { - throw new MetricReportingException(entry.getKey() + " is missing in metric data. This metric event " - + "will not be processed further."); - } else if (!attribute.getClass().equals(entry.getValue())) { - throw new MetricReportingException(entry.getKey() + " is expecting a " + entry.getValue() + " type " - + "attribute while attribute of type " - + attribute.getClass() + " is present."); - } - } - } - return true; - } - - @Override - public MetricEventBuilder addAttribute(String key, Object value) throws MetricReportingException { - - eventMap.put(key, value); - return this; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifReporter.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifReporter.java deleted file mode 100644 index 5b4d662ef7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/MoesifReporter.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.moesif; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.AbstractMetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.TimerMetric; -import org.wso2.apk.enforcer.analytics.publisher.retriever.MoesifKeyRetriever; -import org.wso2.apk.enforcer.analytics.publisher.retriever.MoesifKeyRetrieverFactory; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.util.Map; - -/** - * Moesif Metric Reporter Implementation. This implementation is responsible for sending analytics data into Moesif - * dashboard in a secure and reliable way. - */ -public class MoesifReporter extends AbstractMetricReporter { - private static final Logger log = LoggerFactory.getLogger(MoesifReporter.class); - private final EventQueue eventQueue; - - public MoesifReporter(Map properties) throws MetricCreationException { - super(properties); - MoesifKeyRetriever keyRetriever = MoesifKeyRetrieverFactory.getMoesifKeyRetriever(properties); - int queueSize = Constants.DEFAULT_QUEUE_SIZE; - int workerThreads = Constants.DEFAULT_WORKER_THREADS; - if (properties.get(Constants.QUEUE_SIZE) != null) { - queueSize = Integer.parseInt(properties.get(Constants.QUEUE_SIZE)); - } - if (properties.get(Constants.WORKER_THREAD_COUNT) != null) { - workerThreads = Integer.parseInt(properties.get(Constants.WORKER_THREAD_COUNT)); - } - this.eventQueue = new EventQueue(queueSize, workerThreads, keyRetriever); - - } - - @Override - protected void validateConfigProperties(Map map) throws MetricCreationException { - - } - - @Override - public CounterMetric createCounter(String name, MetricSchema metricSchema) throws MetricCreationException { - - return new MoesifCounterMetric(name, eventQueue, metricSchema); - } - - @Override - protected TimerMetric createTimer(String s) { - return null; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/ParallelQueueWorker.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/ParallelQueueWorker.java deleted file mode 100644 index 27d04f0353..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/ParallelQueueWorker.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.moesif; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.client.MoesifClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; - -import java.util.concurrent.BlockingQueue; - -/** - * Will dequeue the events from queues and send then to the moesif client {@link MoesifClient}. - */ -public class ParallelQueueWorker implements Runnable { - private static final Logger log = LoggerFactory.getLogger(ParallelQueueWorker.class); - private BlockingQueue eventQueue; - private MoesifClient client; - - public ParallelQueueWorker(BlockingQueue queue, MoesifClient moesifClient) { - this.eventQueue = queue; - this.client = moesifClient; - } - - public void run() { - - while (true) { - MetricEventBuilder eventBuilder; - try { - eventBuilder = eventQueue.take(); - if (eventBuilder != null) { - client.publish(eventBuilder); - } - } catch (MetricReportingException e) { - log.error("Builder instance is not duly filled. Event building failed", e); - continue; - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } catch (Exception e) { - log.error("Analytics event sending failed. Event will be dropped", e); - } - } - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/util/MoesifKeyEntry.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/util/MoesifKeyEntry.java deleted file mode 100644 index 9a62042d7b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/util/MoesifKeyEntry.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.util; - -import com.google.gson.annotations.SerializedName; - -/** - * POJO to parse the JSON. - */ -public class MoesifKeyEntry { - private String uuid; - @SerializedName("organization_id") - private String organizationID; - @SerializedName("moesif_key") - private String moesifKey; - private String env; - - public MoesifKeyEntry() { - } - - public String getMoesif_key() { - return moesifKey; - } - - public String getOrganization_id() { - return organizationID; - } - - public String getUuid() { - return uuid; - } - - public String getEnv() { - return env; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/util/MoesifMicroserviceConstants.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/util/MoesifMicroserviceConstants.java deleted file mode 100644 index 5bdc89ce51..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/reporter/moesif/util/MoesifMicroserviceConstants.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.util; - -/** - * Class for constants related to external Moesif microservice. - */ -public class MoesifMicroserviceConstants { - public static final String MOESIF_PROTOCOL_WITH_FQDN_KEY = "moesifProtocolWithFQDN"; - public static final String MOESIF_EP_COMMON_PATH = "moesif/moesif_key"; - public static final String MOESIF_MS_VERSIONING_KEY = "moesifMSVersioning"; - public static final String MS_USERNAME_CONFIG_KEY = "moesifMSAuthUsername"; - public static final String MS_PWD_CONFIG_KEY = "moesifMSAuthPwd"; - public static final String CONTENT_TYPE = "application/json"; - public static final String QUERY_PARAM = "org_id"; - public static final int NUM_RETRY_ATTEMPTS = 3; - public static final long TIME_TO_WAIT = 10000; - public static final int NUM_RETRY_ATTEMPTS_PUBLISH = 3; - public static final long TIME_TO_WAIT_PUBLISH = 10000; - public static final int REQUEST_READ_TIMEOUT = 10000; - public static final long PERIODIC_CALL_DELAY = 300000; - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/ConfigBaseMoesifKeyRetriever.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/ConfigBaseMoesifKeyRetriever.java deleted file mode 100644 index 38f498d1f6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/ConfigBaseMoesifKeyRetriever.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.retriever; - -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.util.Map; - -/** - * This Class used to configure moseif config key base retriever. - */ -public class ConfigBaseMoesifKeyRetriever implements MoesifKeyRetriever { - - private final String key; - - public ConfigBaseMoesifKeyRetriever(Map properties) { - - key = properties.get(Constants.MOESIF_KEY_VALUE); - - } - - @Override - public String getKey(String organization, String environment) { - - return key; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetriever.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetriever.java deleted file mode 100644 index c159f90e20..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetriever.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.wso2.apk.enforcer.analytics.publisher.retriever; - -/** - *Interface for moesif KeyRetriever. - */ -public interface MoesifKeyRetriever { - - /** - * Returns Key for given organization and environment - * @param organization - * @param environment - * @return APiKey. - */ - public String getKey(String organization, String environment); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetrieverChoreoClient.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetrieverChoreoClient.java deleted file mode 100644 index 88a882fdff..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetrieverChoreoClient.java +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.analytics.publisher.retriever; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; -import com.google.gson.reflect.TypeToken; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.APICallException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.util.MoesifKeyEntry; -import org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.util.MoesifMicroserviceConstants; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.lang.reflect.Type; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import java.util.Collection; -import java.util.Map; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.ConcurrentHashMap; -import javax.net.ssl.HttpsURLConnection; - -/** - * Responsible for calling the Moesif microservice and refresh/init entire internal map(organization, moesif key) or - * retrieving single moesif key. - */ -public class MoesifKeyRetrieverChoreoClient extends TimerTask implements MoesifKeyRetriever { - - private static final Logger log = LoggerFactory.getLogger(MoesifKeyRetrieverChoreoClient.class); - private static MoesifKeyRetrieverChoreoClient moesifKeyRetriever; - private ConcurrentHashMap orgIDMoesifKeyMap; - private ConcurrentHashMap orgIdEnvMap; - // username of Moesif microservice - private String msAuthUsername; - // password of Moesif microservice - private char[] msAuthPwd; - private String moesifBasePath; - - private MoesifKeyRetrieverChoreoClient(Map properties) { - - String moesifBasePath = properties.get(MoesifMicroserviceConstants.MOESIF_PROTOCOL_WITH_FQDN_KEY) + - properties.get(MoesifMicroserviceConstants.MOESIF_MS_VERSIONING_KEY); - msAuthUsername = properties.get(MoesifMicroserviceConstants.MS_USERNAME_CONFIG_KEY); - msAuthPwd = properties.get(MoesifMicroserviceConstants.MS_PWD_CONFIG_KEY).toCharArray(); - orgIDMoesifKeyMap = new ConcurrentHashMap(); - orgIdEnvMap = new ConcurrentHashMap(); - this.moesifBasePath = moesifBasePath; - Timer timer = new Timer(); - timer.schedule(this, 0, MoesifMicroserviceConstants.PERIODIC_CALL_DELAY); - } - - public static synchronized MoesifKeyRetrieverChoreoClient getInstance(Map properties) { - - if (moesifKeyRetriever == null) { - return new MoesifKeyRetrieverChoreoClient(properties); - } - return moesifKeyRetriever; - } - - /** - * Will initialize the empty orgID-MoesifKey map. - * Will refresh/refill the orgID-MoesifKey map. - */ - public void initOrRefreshOrgIDMoesifKeyMap() { - - int attempts = MoesifMicroserviceConstants.NUM_RETRY_ATTEMPTS; - try { - callListResource(); - } catch (IOException | APICallException ex) { - // TODO: Separate retry logic to a separate class. - log.error("First attempt of refreshing internal map failed,retrying.", ex); - - while (attempts > 0) { - attempts--; - try { - Thread.sleep(MoesifMicroserviceConstants.TIME_TO_WAIT); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - try { - callListResource(); - } catch (IOException | APICallException e) { - log.error("Retry attempt failed.", e); - } - } - } - } - - /** - * Will retrieve single Moesif key corresponding to given organization ID. - * - * @param orgID - * @return Moesif Key corresponding orgID - */ - public String getMoesifKey(String orgID) { - - String response; - int attempts = MoesifMicroserviceConstants.NUM_RETRY_ATTEMPTS; - try { - response = callDetailResource(orgID); - } catch (IOException | APICallException ex) { - // TODO: Separate retry logic to a separate class. - log.error("First attempt of single moesif key fetch failed, retrying.", ex); - - while (attempts > 0) { - attempts--; - try { - Thread.sleep(MoesifMicroserviceConstants.TIME_TO_WAIT); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - try { - response = callDetailResource(orgID); - return response; - } catch (IOException | APICallException e) { - log.error("Retry attempt failed.", e); - } - } - response = null; - } - return response; - } - - /** - * Will remove Moesif key corresponding to organization ID. - * Existing Moesif SDK client associated with the moesif key will be also removed. - * - * @param orgID - */ - public void removeMoesifKeyFromMap(String orgID) { - - orgIDMoesifKeyMap.remove(orgID); - } - - /** - * Fetches all the available orgID - MoesifKey pairs from the microservice. - * - * @throws IOException - * @throws APICallException - */ - private void callListResource() throws IOException, APICallException { - - final URL obj; - String url = this.moesifBasePath + MoesifMicroserviceConstants.MOESIF_EP_COMMON_PATH; - try { - obj = new URL(url); - } catch (MalformedURLException ex) { - log.error("Failed calling Moesif microservice. Attempted to call url: {}", - url.replaceAll("[\r\n]", ""), - ex.getMessage().replaceAll("[\r\n]", "")); - return; - } - String authHeaderValue = getAuthHeader(msAuthUsername, msAuthPwd); - HttpURLConnection con = null; - try { - if (obj.getProtocol().equals("https")) { - con = (HttpsURLConnection) obj.openConnection(); - } else { - con = (HttpURLConnection) obj.openConnection(); - } - con.setRequestMethod("GET"); - con.setRequestProperty("Authorization", authHeaderValue); - con.setRequestProperty("Content-Type", MoesifMicroserviceConstants.CONTENT_TYPE); - con.setReadTimeout(MoesifMicroserviceConstants.REQUEST_READ_TIMEOUT); - int responseCode = con.getResponseCode(); - if (responseCode == HttpURLConnection.HTTP_OK) { - try (BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream(), StandardCharsets.UTF_8));) { - String inputLine; - StringBuffer response = new StringBuffer(); - - while ((inputLine = in.readLine()) != null) { - response.append(inputLine); - } - updateMap(response.toString()); - } - } else if (responseCode >= 400 && responseCode < 500) { - log.error("Getting {} from the microservice.", responseCode); - } else { - throw new APICallException("Getting " + responseCode + " from the Moesif microservice and retrying."); - } - } finally { - if (con != null) { - con.disconnect(); - } - } - } - - /** - * Retrieves moesif key of the given orgID by calling the microservice. - * - * @param orgID - * @return moesif key of the orgID - * @throws IOException - * @throws APICallException - */ - private String callDetailResource(String orgID) throws IOException, APICallException { - - StringBuffer response = new StringBuffer(); - String url = this.moesifBasePath + MoesifMicroserviceConstants.MOESIF_EP_COMMON_PATH; - // Protecting endpoint from SSRF. - if (!orgID.isEmpty()) { - url = url + "/" + "?" + MoesifMicroserviceConstants.QUERY_PARAM + "=" + - orgID; - } else { - log.error("Failed calling Moesif microservice. Organization ID cannot be empty"); - return null; - } - final URL obj; - try { - obj = new URL(url); - } catch (MalformedURLException ex) { - log.error("Failed calling Moesif microservice. Attempted to call url: {}", url.replaceAll("[\r\n]", ""), - ex.getMessage().replaceAll("[\r\n]", "")); - return null; - } - String authHeaderValue = getAuthHeader(msAuthUsername, msAuthPwd); - HttpURLConnection con = null; - try { - con = (HttpURLConnection) obj.openConnection(); - con.setRequestMethod("GET"); - con.setRequestProperty("Content-Type", MoesifMicroserviceConstants.CONTENT_TYPE); - con.setRequestProperty("Authorization", authHeaderValue); - con.setReadTimeout(MoesifMicroserviceConstants.REQUEST_READ_TIMEOUT); - int responseCode = con.getResponseCode(); - if (responseCode == HttpURLConnection.HTTP_OK) { - try (BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream(), StandardCharsets.UTF_8));) { - - String inputLine; - - while ((inputLine = in.readLine()) != null) { - response.append(inputLine); - } - updateMoesifKey(response.toString()); - return response.toString(); - } - } else if (responseCode >= 400 && responseCode < 500) { - log.error("Getting {} from the Moesif microservice.", responseCode); - return null; - } else { - throw new APICallException("Getting " + responseCode + " from the Moesif microservice and retrying."); - } - } finally { - if (con != null) { - con.disconnect(); - } - } - } - - private String getAuthHeader(String msAuthUsername, char[] msAuthPwd) { - - String auth = msAuthUsername + ":" + String.valueOf(msAuthPwd); - String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes(StandardCharsets.UTF_8)); - String authHeaderValue = "Basic " + encodedAuth; - return authHeaderValue; - } - - private synchronized void updateMoesifKey(String response) { - - Gson gson = new Gson(); - String json = response; - MoesifKeyEntry newKey = gson.fromJson(json, MoesifKeyEntry.class); - String orgID = newKey.getOrganization_id(); - String moesifKey = newKey.getMoesif_key(); - String env = newKey.getEnv(); - orgIDMoesifKeyMap.put(orgID, moesifKey); - orgIdEnvMap.put(orgID, env); - } - - private synchronized void updateMap(String response) { - - Gson gson = new Gson(); - JsonParser jsonParser = new JsonParser(); - JsonArray jsonArray; - JsonElement jsonElement = jsonParser.parse(response); - - if (!jsonElement.isJsonArray()) { - jsonArray = new JsonArray(); - jsonArray.add(jsonElement); - } else { - jsonArray = jsonElement.getAsJsonArray(); - } - - Type collectionType = new CustomType().getType(); - Collection newKeys = gson.fromJson(jsonArray, collectionType); - - for (MoesifKeyEntry entry : newKeys) { - String orgID = entry.getOrganization_id(); - String env = entry.getEnv(); - String moesifKey = entry.getMoesif_key(); - orgIDMoesifKeyMap.put(orgID, moesifKey); - orgIdEnvMap.put(orgID, env); - } - } - - /** - * returning orgID-MoesifKey map. - * - * @return orgIDMoesifKeyMap - */ - public ConcurrentHashMap getMoesifKeyMap() { - - return orgIDMoesifKeyMap; - } - - public ConcurrentHashMap getEnvMap() { - - return orgIdEnvMap; - } - - public void clearMoesifKeyMap() { - - if (!orgIDMoesifKeyMap.isEmpty()) { - orgIDMoesifKeyMap.clear(); - } - } - - public void clearEnvMap() { - - if (!orgIdEnvMap.isEmpty()) { - orgIdEnvMap.clear(); - } - } - - @Override - public String getKey(String organization, String environment) { - - String userSelectedEnvironment; - String moesifKey; - - if (orgIDMoesifKeyMap.containsKey(organization)) { - moesifKey = orgIDMoesifKeyMap.get(organization); - if (getEnvMap().containsKey(organization)) { - userSelectedEnvironment = orgIdEnvMap.get(organization); - } else { - return null; - } - } else { - return null; - } - if (Constants.PRODUCTION.equals(userSelectedEnvironment) && !Constants.PRODUCTION.equals(environment)) { - return null; - } - return moesifKey; - } - - static class CustomType extends TypeToken> { - // nothing to add - } - - @Override - public void run() { - // clear the internal map of orgID-MoesifKey - clearMoesifKeyMap(); - // clear the environment map - clearEnvMap(); - // refresh the internal map of orgID-MoesifKey - initOrRefreshOrgIDMoesifKeyMap(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetrieverFactory.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetrieverFactory.java deleted file mode 100644 index 1c785023b0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/retriever/MoesifKeyRetrieverFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.wso2.apk.enforcer.analytics.publisher.retriever; - -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.util.Map; - -/** - * Factory Class to get Moesif Key Retriever. - */ -public class MoesifKeyRetrieverFactory { - - private MoesifKeyRetrieverFactory() { - - } - - public static MoesifKeyRetriever getMoesifKeyRetriever(Map properties) { - - String clientType = properties.get(Constants.MOESIF_KEY_RETRIEVER_CLIENT_TYPE); - - if (Constants.MOESIF_KEY_RETRIEVER_CHOREO_CLIENT.equals(clientType)) { - return MoesifKeyRetrieverChoreoClient.getInstance(properties); - } - return new ConfigBaseMoesifKeyRetriever(properties); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/BackoffRetryCounter.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/BackoffRetryCounter.java deleted file mode 100644 index fdb7c078bc..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/BackoffRetryCounter.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.util; - -/** - * Util class to implement backoff retrying. - */ -public class BackoffRetryCounter { - private final String[] timeIntervalNames = new String[]{"5 sec", "10 sec", "15 sec", "30 sec", "1 min", "1 min", - "2 min", "5 min"}; - private final long[] timeIntervals = new long[]{5000, 10000, 15000, 30000, 60000, 60000, 120000, 300000}; - - private int intervalIndex = 0; - - public synchronized void reset() { - intervalIndex = 0; - } - - public synchronized void increment() { - if (intervalIndex < timeIntervals.length - 1) { - intervalIndex++; - } - } - - public long getTimeIntervalMillis() { - return timeIntervals[intervalIndex]; - } - - - public String getTimeInterval() { - return timeIntervalNames[intervalIndex]; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/Constants.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/Constants.java deleted file mode 100644 index ae55fb1927..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/Constants.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.util; - -/** - * Class to hold String constants. - */ -public class Constants { - //Event attribute names - public static final String CORRELATION_ID = "correlationId"; - public static final String KEY_TYPE = "keyType"; - public static final String API_ID = "apiId"; - public static final String API_NAME = "apiName"; - public static final String API_CONTEXT = "apiContext"; - public static final String USER_NAME = "userName"; - public static final String API_VERSION = "apiVersion"; - public static final String API_CREATION = "apiCreator"; - public static final String API_METHOD = "apiMethod"; - public static final String API_RESOURCE_TEMPLATE = "apiResourceTemplate"; - public static final String API_CREATOR_TENANT_DOMAIN = "apiCreatorTenantDomain"; - public static final String DESTINATION = "destination"; - public static final String APPLICATION_ID = "applicationId"; - public static final String APPLICATION_NAME = "applicationName"; - public static final String APPLICATION_OWNER = "applicationOwner"; - public static final String REGION_ID = "regionId"; - public static final String ORGANIZATION_ID = "organizationId"; - public static final String ENVIRONMENT_ID = "environmentId"; - public static final String GATEWAY_TYPE = "gatewayType"; - public static final String USER_AGENT_HEADER = "userAgentHeader"; - public static final String USER_AGENT = "userAgent"; - public static final String PLATFORM = "platform"; - public static final String PROXY_RESPONSE_CODE = "proxyResponseCode"; - public static final String TARGET_RESPONSE_CODE = "targetResponseCode"; - public static final String RESPONSE_CACHE_HIT = "responseCacheHit"; - public static final String RESPONSE_LATENCY = "responseLatency"; - public static final String BACKEND_LATENCY = "backendLatency"; - public static final String REQUEST_MEDIATION_LATENCY = "requestMediationLatency"; - public static final String RESPONSE_MEDIATION_LATENCY = "responseMediationLatency"; - public static final String REQUEST_TIMESTAMP = "requestTimestamp"; - public static final String EVENT_TYPE = "eventType"; - public static final String API_TYPE = "apiType"; - public static final String USER_IP = "userIp"; - public static final String ERROR_TYPE = "errorType"; - public static final String ERROR_CODE = "errorCode"; - public static final String ERROR_MESSAGE = "errorMessage"; - public static final String PROPERTIES = "properties"; - - //Builder event types - public static final String RESPONSE_EVENT_TYPE = "response"; - public static final String FAULT_EVENT_TYPE = "fault"; - - //Reporter config properties - public static final String AUTH_API_URL = "authURL"; - public static final String AUTH_API_TOKEN = "authToken"; - public static final String MOESIF_TOKEN = "moesifToken"; - - //Proxy configs - public static final String PROXY_ENABLE = "proxy_config_enable"; - public static final String PROXY_HOST = "proxy_config_host"; - public static final String PROXY_PORT = "proxy_config_port"; - public static final String PROXY_USERNAME = "proxy_config_username"; - public static final String PROXY_PASSWORD = "proxy_config_password"; - public static final String PROXY_PROTOCOL = "proxy_config_protocol"; - public static final String KEYSTORE_LOCATION = "keystore_location"; - public static final String KEYSTORE_PASSWORD = "keystore_password"; - public static final String HTTPS_PROTOCOL = "https"; - public static final String HTTP_PROTOCOL = "http"; - public static final String KEYSTORE_TYPE = "JKS"; - - //Reporter constants - public static final String DEFAULT_REPORTER = "default"; - public static final String ELK_REPORTER = "elk"; - public static final String MOESIF_REPORTER = "moesif"; - - //EventHub Client retry options constants - public static final int DEFAULT_MAX_RETRIES = 2; - public static final int DEFAULT_DELAY = 15; - public static final int DEFAULT_MAX_DELAY = 30; - public static final int DEFAULT_TRY_TIMEOUT = 30; - public static final String EVENTHUB_CLIENT_MAX_RETRIES = "eventhub.client.max.retries"; - public static final String EVENTHUB_CLIENT_DELAY = "eventhub.client.delay"; - public static final String EVENTHUB_CLIENT_MAX_DELAY = "eventhub.client.max.delay"; - public static final String EVENTHUB_CLIENT_TRY_TIMEOUT = "eventhub.client.try.timeout"; - public static final String EVENTHUB_CLIENT_RETRY_MODE = "eventhub.client.retry.mode"; - public static final String FIXED = "fixed"; - public static final String EXPONENTIAL = "exponential"; - - public static final String UNKNOWN_VALUE = "UNKNOWN"; - public static final String WORKER_THREAD_COUNT = "worker.thread.count"; - public static final String QUEUE_SIZE = "queue.size"; - public static final String CLIENT_FLUSHING_DELAY = "client.flushing.delay"; - public static final int DEFAULT_QUEUE_SIZE = 20000; - public static final int DEFAULT_WORKER_THREADS = 1; - public static final int DEFAULT_FLUSHING_DELAY = 15; - public static final int USER_AGENT_DEFAULT_CACHE_SIZE = 50; - - // Moesif sdk related constants - public static final String MOESIF_CONTENT_TYPE_HEADER = "application/json"; - public static final String MOESIF_CONTENT_TYPE_KEY = "Content-Type"; - public static final String MOESIF_USER_AGENT_KEY = "User-Agent"; - public static final String GATEWAY_URL = "x-original-gw-url"; - public static final String DEPLOYMENT_TYPE = "deployment-type"; - public static final String PRODUCTION = "PRODUCTION"; - - public static final String MOESIF_KEY_RETRIEVER_CLIENT_TYPE = "moesifKeyRetrieverClientType"; - - public static final String MOESIF_KEY_RETRIEVER_CHOREO_CLIENT = "Choreo"; - public static final String MOESIF_KEY_VALUE = "moesifToken"; - public static final String DEFAULT_ENVIRONMENT = "Default"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/EventMapAttributeFilter.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/EventMapAttributeFilter.java deleted file mode 100644 index 25d81979c2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/EventMapAttributeFilter.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.analytics.publisher.util; - - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -/** - * Utility to filter only the required attributes. - */ -public class EventMapAttributeFilter { - private static final EventMapAttributeFilter INSTANCE = new EventMapAttributeFilter(); - - public static EventMapAttributeFilter getInstance() { - return INSTANCE; - } - - public Map filter(Map source, Map requiredAttributes) { - - Set targetKeys = requiredAttributes.keySet(); - Map filteredEventMap = new HashMap<>(); - - for (String key : targetKeys) { - filteredEventMap.put(key, source.get(key)); - } - - return filteredEventMap; - } - - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/UserAgentParser.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/UserAgentParser.java deleted file mode 100644 index f58303402a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/main/java/org/wso2/apk/enforcer/analytics/publisher/util/UserAgentParser.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ua_parser.Client; -import ua_parser.Parser; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * User agent parser util class. - */ -public class UserAgentParser { - private static final Logger log = LoggerFactory.getLogger(UserAgentParser.class); - private static final UserAgentParser INSTANCE = new UserAgentParser(); - private boolean isInitialized = false; - private Parser uaParser; - private Map clientCache; - - private UserAgentParser() { - uaParser = new Parser(); - isInitialized = true; - clientCache = new LinkedHashMap(Constants.USER_AGENT_DEFAULT_CACHE_SIZE - + Constants.DEFAULT_WORKER_THREADS) { - static final int MAX = Constants.USER_AGENT_DEFAULT_CACHE_SIZE; - @Override - protected boolean removeEldestEntry(Map.Entry eldest) { - return size() > MAX; - } - }; - } - - public static UserAgentParser getInstance() { - return INSTANCE; - } - - public Client parseUserAgent(String userAgentHeader) { - if (isInitialized) { - Client client = clientCache.get(userAgentHeader); - if (client == null) { - client = uaParser.parse(userAgentHeader); - clientCache.put(userAgentHeader, client); - log.debug("user agent added to cache. Current cache size is " + clientCache.size()); - return client; - } else { - log.debug("User agent fetched from cache"); - return client; - } - } else { - return null; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/AuthAPIClientTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/AuthAPIClientTestCase.java deleted file mode 100644 index 9ac33f267b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/AuthAPIClientTestCase.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import org.testng.Assert; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.auth.AuthClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionRecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionUnrecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.util.AuthAPIMockService; - -import java.util.HashMap; -import java.util.UUID; - -public class AuthAPIClientTestCase extends AuthAPIMockService { - - @Test(expectedExceptions = {ConnectionUnrecoverableException.class}, - expectedExceptionsMessageRegExp = "Invalid/expired user token.*") - public void testAuthClientWithAInvalidToken() throws Exception { - - String authToken = UUID.randomUUID().toString(); - mock(401, authToken); - - AuthClient.getSASToken(authApiEndpoint, authToken, new HashMap<>()); - } - - @Test - public void testAuthClientWithAValidToken() throws Exception { - - String authToken = UUID.randomUUID().toString(); - mock(200, authToken); - - String sasToken = AuthClient.getSASToken(authApiEndpoint, authToken, new HashMap<>()); - Assert.assertEquals(sasToken, SAS_TOKEN); - } - - @Test(expectedExceptions = {ConnectionRecoverableException.class}) - public void testAuthClientWithFor500Response() throws Exception { - - String authToken = UUID.randomUUID().toString(); - mock(500, authToken); - - AuthClient.getSASToken(authApiEndpoint, authToken, new HashMap<>()); - } - - @Test(expectedExceptions = {ConnectionRecoverableException.class}) - public void testAuthClientWithFor400Response() throws Exception { - - String authToken = UUID.randomUUID().toString(); - mock(400, authToken); - - AuthClient.getSASToken(authApiEndpoint, authToken, new HashMap<>()); - } - - @Test(expectedExceptions = {ConnectionRecoverableException.class}, - expectedExceptionsMessageRegExp = "Publisher has been temporarily revoked.") - public void testAuthClientWithFor403Response() throws Exception { - - String authToken = UUID.randomUUID().toString(); - mock(403, authToken); - - AuthClient.getSASToken(authApiEndpoint, authToken, new HashMap<>()); - } - - @Test(expectedExceptions = {ConnectionUnrecoverableException.class}, - expectedExceptionsMessageRegExp = "Invalid apim.analytics configurations provided.*") - public void testAuthClientWithForInvalidAuthUrl() throws Exception { - - String authToken = UUID.randomUUID().toString(); - mock(200, authToken); - - String authEndpoint = "invalid/host/auth-api"; - AuthClient.getSASToken(authEndpoint, authToken, new HashMap<>()); - } - - @Test(expectedExceptions = {ConnectionRecoverableException.class}, - expectedExceptionsMessageRegExp = "Provided authentication endpoint.*") - public void testAuthClientWithForNonExistAuthUrl() throws Exception { - - String authToken = UUID.randomUUID().toString(); - mock(200, authToken); - - String authEndpoint = "https://no.such.host/auth-api"; - AuthClient.getSASToken(authEndpoint, authToken, new HashMap<>()); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultChoreoFaultMetricBuilderTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultChoreoFaultMetricBuilderTestCase.java deleted file mode 100644 index d7b9a7206e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultChoreoFaultMetricBuilderTestCase.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import com.azure.core.amqp.AmqpRetryMode; -import com.azure.core.amqp.AmqpRetryOptions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.DefaultCounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.EventQueue; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.time.Clock; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -public class DefaultChoreoFaultMetricBuilderTestCase { - - private static final Logger log = LoggerFactory.getLogger(DefaultChoreoFaultMetricBuilderTestCase.class); - private MetricEventBuilder builder; - - @BeforeMethod - public void createBuilder() throws MetricCreationException { - - AmqpRetryOptions retryOptions = new AmqpRetryOptions() - .setDelay(Duration.ofSeconds(30)) - .setMaxRetries(2) - .setMaxDelay(Duration.ofSeconds(120)) - .setTryTimeout(Duration.ofSeconds(30)) - .setMode(AmqpRetryMode.FIXED); - EventHubClient client = new EventHubClient("some_endpoint", "some_token", retryOptions, - new HashMap<>()); - EventQueue queue = new EventQueue(100, 1, client, 10); - DefaultCounterMetric metric = new DefaultCounterMetric("test.builder.metric", queue, - MetricSchema.CHOREO_ERROR); - builder = metric.getEventBuilder(); - } - - @Test(expectedExceptions = MetricReportingException.class) - public void testMissingAttributes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, System.currentTimeMillis()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.ERROR_TYPE, "backend") - .addAttribute(Constants.ERROR_CODE, 401) - .addAttribute(Constants.ERROR_MESSAGE, "Authentication Error") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, "someString") - .build(); - } - - @Test(expectedExceptions = MetricReportingException.class) - public void testAttributesWithInvalidTypes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, System.currentTimeMillis()) - .addAttribute(Constants.ORGANIZATION_ID, "wso2.com") - .addAttribute(Constants.ENVIRONMENT_ID, "abcd-1234-5678-efgh") - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.ERROR_TYPE, "backend") - .addAttribute(Constants.ERROR_CODE, 401) - .addAttribute(Constants.ERROR_MESSAGE, "Authentication Error") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, "someString") - .build(); - } - - @Test - public void testMetricBuilder() throws MetricCreationException, MetricReportingException { - - Map eventMap = builder - .addAttribute(Constants.REQUEST_TIMESTAMP, OffsetDateTime.now(Clock.systemUTC()).toString()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.ORGANIZATION_ID, "wso2.com") - .addAttribute(Constants.ENVIRONMENT_ID, "abcd-1234-5678-efgh") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.ERROR_TYPE, "backend") - .addAttribute(Constants.ERROR_CODE, 401) - .addAttribute(Constants.ERROR_MESSAGE, "Authentication Error") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_TYPE, "HTTP") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, 401) - .build(); - - Assert.assertFalse(eventMap.isEmpty()); - Assert.assertEquals(eventMap.size(), 23, "Some attributes are missing from the resulting event map"); - Assert.assertEquals(eventMap.get(Constants.EVENT_TYPE), "fault", "Event type should be set to fault"); - Assert.assertEquals(eventMap.get(Constants.ORGANIZATION_ID), "wso2.com", - "Organization ID should be wso2.com"); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultChoreoResponseMetricBuilderTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultChoreoResponseMetricBuilderTestCase.java deleted file mode 100644 index e5f71dab93..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultChoreoResponseMetricBuilderTestCase.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import com.azure.core.amqp.AmqpRetryMode; -import com.azure.core.amqp.AmqpRetryOptions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.DefaultCounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.EventQueue; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.time.Clock; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -public class DefaultChoreoResponseMetricBuilderTestCase { - - private static final Logger log = LoggerFactory.getLogger(DefaultChoreoResponseMetricBuilderTestCase.class); - - private MetricEventBuilder builder; - - @BeforeMethod - public void createBuilder() throws MetricCreationException { - - AmqpRetryOptions retryOptions = new AmqpRetryOptions() - .setDelay(Duration.ofSeconds(30)) - .setMaxRetries(2) - .setMaxDelay(Duration.ofSeconds(120)) - .setTryTimeout(Duration.ofSeconds(30)) - .setMode(AmqpRetryMode.FIXED); - EventHubClient client = new EventHubClient("some_endpoint", "some_token", retryOptions, new HashMap<>()); - EventQueue queue = new EventQueue(100, 1, client, 10); - DefaultCounterMetric metric = new DefaultCounterMetric("test.builder.metric", queue, - MetricSchema.CHOREO_RESPONSE); - builder = metric.getEventBuilder(); - } - - @Test(expectedExceptions = MetricReportingException.class) - public void testMissingAttributes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, System.currentTimeMillis()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT, "Mozilla") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, "someString") - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000) - .addAttribute(Constants.BACKEND_LATENCY, 3000) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, "1000") - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000) - .addAttribute(Constants.USER_IP, "127.0.0.1") - .build(); - } - - @Test(expectedExceptions = MetricReportingException.class) - public void testAttributesWithInvalidTypes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, System.currentTimeMillis()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.ORGANIZATION_ID, "wso2.com") - .addAttribute(Constants.ENVIRONMENT_ID, "abcd-1234-5678-efgh") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CONTEXT, "/v1/") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT, "Mozilla") - .addAttribute(Constants.USER_NAME, "admin") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, "someString") - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000) - .addAttribute(Constants.BACKEND_LATENCY, 3000) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, "1000") - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000) - .addAttribute(Constants.USER_IP, "127.0.0.1") - .build(); - } - - @Test - public void testMetricBuilder() throws MetricCreationException, MetricReportingException { - - String uaString = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, " - + "like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"; - - Map eventMap = builder - .addAttribute(Constants.REQUEST_TIMESTAMP, OffsetDateTime.now(Clock.systemUTC()).toString()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.ORGANIZATION_ID, "wso2.com") - .addAttribute(Constants.ENVIRONMENT_ID, "abcd-1234-5678-efgh") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_TYPE, "HTTP") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CONTEXT, "/v1/") - .addAttribute(Constants.USER_NAME, "admin") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT_HEADER, uaString) - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, 401) - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000L) - .addAttribute(Constants.BACKEND_LATENCY, 3000L) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, 1000L) - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000L) - .addAttribute(Constants.USER_IP, "127.0.0.1") - .build(); - - Assert.assertFalse(eventMap.isEmpty()); - Assert.assertEquals(eventMap.size(), 31, "Some attributes are missing from the resulting event map"); - Assert.assertEquals(eventMap.get(Constants.EVENT_TYPE), "response", "Event type should be set to fault"); - Assert.assertEquals(eventMap.get(Constants.USER_AGENT), "Mobile Safari", - "User agent should be set to Mobile Safari"); - Assert.assertEquals(eventMap.get(Constants.PLATFORM), "iOS", "Platform should be set to iOS"); - Assert.assertEquals(eventMap.get(Constants.ORGANIZATION_ID), "wso2.com", - "Organization ID should be wso2.com"); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultFaultMetricBuilderTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultFaultMetricBuilderTestCase.java deleted file mode 100644 index add60a7cb8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultFaultMetricBuilderTestCase.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import com.azure.core.amqp.AmqpRetryMode; -import com.azure.core.amqp.AmqpRetryOptions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.DefaultCounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.EventQueue; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.time.Clock; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -public class DefaultFaultMetricBuilderTestCase { - - private static final Logger log = LoggerFactory.getLogger(DefaultFaultMetricBuilderTestCase.class); - private MetricEventBuilder builder; - - @BeforeMethod - public void createBuilder() throws MetricCreationException { - - AmqpRetryOptions retryOptions = new AmqpRetryOptions() - .setDelay(Duration.ofSeconds(30)) - .setMaxRetries(2) - .setMaxDelay(Duration.ofSeconds(120)) - .setTryTimeout(Duration.ofSeconds(30)) - .setMode(AmqpRetryMode.FIXED); - EventHubClient client = new EventHubClient("some_endpoint", "some_token", retryOptions, - new HashMap<>()); - EventQueue queue = new EventQueue(100, 1, client, 10); - DefaultCounterMetric metric = new DefaultCounterMetric("test.builder.metric", queue, MetricSchema.ERROR); - builder = metric.getEventBuilder(); - } - - @Test(expectedExceptions = MetricReportingException.class) - public void testMissingAttributes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute("apiName", "PizzaShack"); - builder.build(); - } - - @Test(expectedExceptions = MetricReportingException.class, dependsOnMethods = {"testMissingAttributes"}) - public void testAttributesWithInvalidTypes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, System.currentTimeMillis()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.ERROR_TYPE, "backend") - .addAttribute(Constants.ERROR_CODE, 401) - .addAttribute(Constants.ERROR_MESSAGE, "Authentication Error") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.ENVIRONMENT_ID, "Development") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, "someString") - .build(); - } - - @Test(dependsOnMethods = {"testAttributesWithInvalidTypes"}) - public void testMetricBuilder() throws MetricCreationException, MetricReportingException { - - Map eventMap = builder - .addAttribute(Constants.REQUEST_TIMESTAMP, OffsetDateTime.now(Clock.systemUTC()).toString()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.ERROR_TYPE, "backend") - .addAttribute(Constants.ERROR_CODE, 401) - .addAttribute(Constants.ERROR_MESSAGE, "Authentication Error") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_TYPE, "HTTP") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.ENVIRONMENT_ID, "Development") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, 401) - .build(); - - Assert.assertFalse(eventMap.isEmpty()); - Assert.assertEquals(eventMap.size(), 22, "Some attributes are missing from the resulting event map"); - Assert.assertEquals(eventMap.get(Constants.EVENT_TYPE), "fault", "Event type should be set to fault"); - Assert.assertEquals(eventMap.get(Constants.API_TYPE), "HTTP", "API type should be set to HTTP"); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultResponseMetricBuilderTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultResponseMetricBuilderTestCase.java deleted file mode 100644 index 49c2127d3b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/DefaultResponseMetricBuilderTestCase.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import com.azure.core.amqp.AmqpRetryMode; -import com.azure.core.amqp.AmqpRetryOptions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.DefaultCounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.EventQueue; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.time.Clock; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -public class DefaultResponseMetricBuilderTestCase { - - private static final Logger log = LoggerFactory.getLogger(DefaultResponseMetricBuilderTestCase.class); - - private MetricEventBuilder builder; - - @BeforeMethod - public void createBuilder() throws MetricCreationException { - - AmqpRetryOptions retryOptions = new AmqpRetryOptions() - .setDelay(Duration.ofSeconds(30)) - .setMaxRetries(2) - .setMaxDelay(Duration.ofSeconds(120)) - .setTryTimeout(Duration.ofSeconds(30)) - .setMode(AmqpRetryMode.FIXED); - EventHubClient client = new EventHubClient("some_endpoint", "some_token", retryOptions, new HashMap<>()); - EventQueue queue = new EventQueue(100, 1, client, 10); - DefaultCounterMetric metric = new DefaultCounterMetric("test.builder.metric", queue, MetricSchema.RESPONSE); - builder = metric.getEventBuilder(); - } - - @Test(expectedExceptions = MetricReportingException.class) - public void testMissingAttributes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute("apiName", "PizzaShack"); - builder.build(); - } - - @Test(expectedExceptions = MetricReportingException.class, dependsOnMethods = {"testMissingAttributes"}) - public void testAttributesWithInvalidTypes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, System.currentTimeMillis()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CONTEXT, "/v1/") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.ENVIRONMENT_ID, "Development") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT, "Mozilla") - .addAttribute(Constants.USER_NAME, "admin") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, "someString") - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000) - .addAttribute(Constants.BACKEND_LATENCY, 3000) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, "1000") - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000) - .addAttribute(Constants.USER_IP, "127.0.0.1") - .build(); - } - - @Test(dependsOnMethods = {"testAttributesWithInvalidTypes"}) - public void testMetricBuilder() throws MetricCreationException, MetricReportingException { - - String uaString = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, " - + "like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"; - - Map eventMap = builder - .addAttribute(Constants.REQUEST_TIMESTAMP, OffsetDateTime.now(Clock.systemUTC()).toString()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_TYPE, "HTTP") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CONTEXT, "/v1/") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.ENVIRONMENT_ID, "Development") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT_HEADER, uaString) - .addAttribute(Constants.USER_NAME, "admin") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, 401) - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000L) - .addAttribute(Constants.BACKEND_LATENCY, 3000L) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, 1000L) - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000L) - .addAttribute(Constants.USER_IP, "127.0.0.1") - .build(); - - Assert.assertFalse(eventMap.isEmpty()); - Assert.assertEquals(eventMap.size(), 30, "Some attributes are missing from the resulting event map"); - Assert.assertEquals(eventMap.get(Constants.EVENT_TYPE), "response", "Event type should be set to fault"); - Assert.assertEquals(eventMap.get(Constants.USER_AGENT), "Mobile Safari", - "User agent should be set to Mobile Safari"); - Assert.assertEquals(eventMap.get(Constants.PLATFORM), "iOS", "Platform should be set to iOS"); - Assert.assertEquals(eventMap.get(Constants.API_TYPE), "HTTP", "API type should be set to HTTP"); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/ErrorHandlingTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/ErrorHandlingTestCase.java deleted file mode 100644 index 7363f66524..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/ErrorHandlingTestCase.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.core.LoggerContext; -import org.apache.logging.log4j.core.config.Configuration; -import org.testng.Assert; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubClient; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporterFactory; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; -import org.wso2.apk.enforcer.analytics.publisher.util.TestUtils; -import org.wso2.apk.enforcer.analytics.publisher.util.UnitTestAppender; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ErrorHandlingTestCase { - - @Test - public void testConnectionInvalidURL() throws MetricCreationException, MetricReportingException { - - Logger log = LogManager.getLogger(EventHubClient.class); - LoggerContext context = LoggerContext.getContext(false); - Configuration config = context.getConfiguration(); - UnitTestAppender appender = config.getAppender("UnitTestAppender"); - - Map configMap = new HashMap<>(); - configMap.put(Constants.AUTH_API_URL, "some_url"); - configMap.put(Constants.AUTH_API_TOKEN, "some_token"); - MetricReporter metricReporter = MetricReporterFactory.getInstance().createMetricReporter(configMap); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - List messages = new ArrayList<>(appender.getMessages()); - Assert.assertTrue(TestUtils.isContains(messages, "Unrecoverable error occurred when creating Eventhub " - + "Client"), "Expected error hasn't logged in the " - + "EventHubClientClass"); - } - - @Test(dependsOnMethods = {"testConnectionInvalidURL"}) - public void testConnectionUnavailability() throws Exception { - - Logger log = LogManager.getLogger(EventHubClient.class); - LoggerContext context = LoggerContext.getContext(false); - Configuration config = context.getConfiguration(); - UnitTestAppender appender = config.getAppender("UnitTestAppender"); - log.atLevel(Level.DEBUG); - - Map configMap = new HashMap<>(); - configMap.put(Constants.AUTH_API_URL, "https://localhost:1234/non-existance"); - configMap.put(Constants.AUTH_API_TOKEN, "some_token"); - MetricReporterFactory factory = MetricReporterFactory.getInstance(); - factory.reset(); - MetricReporter metricReporter = factory.createMetricReporter(configMap); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - List messages = appender.getMessages(); - Thread.sleep(1000); - Assert.assertTrue(TestUtils.isContains(messages, "Recoverable error occurred when creating Eventhub Client. " - + "Retry attempts will be made")); - Assert.assertTrue(TestUtils.isContains(messages, "Provided authentication endpoint " - + "https://localhost:1234/non-existance is not " - + "reachable.")); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - metric.incrementCount(builder); - Thread.sleep(1000); - messages = appender.getMessages(); - Assert.assertTrue(TestUtils.isContains(messages, "will be parked as EventHub Client is inactive."), "Thread " - + "waiting log entry has not printed."); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/EventHubClientTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/EventHubClientTestCase.java deleted file mode 100644 index c120c47ce2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/EventHubClientTestCase.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.core.amqp.exception.AmqpErrorCondition; -import com.azure.core.amqp.exception.AmqpException; -import com.azure.messaging.eventhubs.EventData; -import com.azure.messaging.eventhubs.EventDataBatch; -import com.azure.messaging.eventhubs.EventHubProducerClient; -import org.apache.logging.log4j.core.LoggerContext; -import org.apache.logging.log4j.core.config.Configuration; -import org.junit.Ignore; -import org.mockito.MockedStatic; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Optional; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.client.EventHubProducerClientFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.ConnectionUnrecoverableException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.cloud.DefaultAnalyticsMetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.util.AuthAPIMockService; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; -import org.wso2.apk.enforcer.analytics.publisher.util.TestUtils; -import org.wso2.apk.enforcer.analytics.publisher.util.UnitTestAppender; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.TimeoutException; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyMap; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.timeout; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -/** - * Unit tests related to publisher client and AMQP producer. - */ -public class EventHubClientTestCase extends AuthAPIMockService { - - private EventHubProducerClient client; - private Map configs; - private UnitTestAppender appender; - private List messages; - private MockedStatic clientFactoryMocked; - - @BeforeClass - public void init() { - - clientFactoryMocked = Mockito.mockStatic(EventHubProducerClientFactory.class); - } - - @AfterClass - public void finalized() { - - clientFactoryMocked.close(); - } - - @Parameters({"proxyConfigEnabled"}) - @BeforeMethod - public void setup(@Optional("false") String proxyConfigEnabled) { - - client = Mockito.mock(EventHubProducerClient.class); - clientFactoryMocked.when(() -> EventHubProducerClientFactory - .create(anyString(), anyString(), any(AmqpRetryOptions.class), anyMap())) - .thenReturn(client); - - String authToken = UUID.randomUUID().toString(); - mock(200, authToken); - - configs = new HashMap<>(); - configs.put(Constants.AUTH_API_URL, authApiEndpoint); - configs.put(Constants.AUTH_API_TOKEN, authToken); - if (proxyConfigEnabled.equals("true")) { - configs.put(Constants.PROXY_PORT, String.valueOf(3128)); - configs.put(Constants.PROXY_HOST, "localhost"); - configs.put(Constants.PROXY_USERNAME, "admin"); - configs.put(Constants.PROXY_PASSWORD, "admin"); - } - - LoggerContext context = LoggerContext.getContext(false); - Configuration config = context.getConfiguration(); - appender = config.getAppender("UnitTestAppender"); - } - - @Test - public void testEventFlushing() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - EventDataBatch newEventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch).thenReturn(newEventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1); - when(newEventDataBatch.getCount()).thenReturn(0); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting to worker thread adding event to the queue - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - } - - @Test - public void testEventFlushingWithAMQPAuthException() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1); - - doThrow(new AmqpException(false, AmqpErrorCondition.UNAUTHORIZED_ACCESS, "", null)) - .when(client) - .send(any(EventDataBatch.class)); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter1", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting to adding event to the queue - verify(eventDataBatch, timeout(10000).times(1)).tryAdd(any(EventData.class)); - - // waiting to flushing thread try to send - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - - // verify flushing thread identified the auth error when try to send via AMQP - Thread.sleep(1000); - List appenderMessages = appender.getMessages(); - Assert.assertTrue(TestUtils - .isContains(appenderMessages, "Marked client status as FLUSHING_FAILED due to AMQP authentication failure.")); - - // Try to publish another event - metric.incrementCount(builder); - - // verify it is also trying to add event queue, after identified state as FLUSHING_FAILED - verify(eventDataBatch, timeout(10000).times(2)).tryAdd(any(EventData.class)); - - // verify worker thread has already identified the FLUSHING_FAILED state - messages = appender.getMessages(); - Assert.assertTrue(TestUtils.isContains(messages, "client status is FLUSHING_FAILED. Producer client " - + "will be re-initialized retaining the Event Data Batch")); - } - - @Test - public void testEventFlushingWithConnectionUnrecoverableException() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1); - - doThrow(new RuntimeException(new ConnectionUnrecoverableException("ConnectionUnrecoverableException"))) - .when(client).send(any(EventDataBatch.class)); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter2", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting to adding event to the queue - verify(eventDataBatch, timeout(10000).times(1)).tryAdd(any(EventData.class)); - - // waiting to flushing thread try to send - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - - // verify worker thread has already identified the Unrecoverable error - String msg = "Unrecoverable error occurred when event flushing. Analytics event flushing will be disabled " - + "until issue is rectified. Reason: org.wso2.apk.enforcer.analytics.publisher.exception." - + "ConnectionUnrecoverableException: ConnectionUnrecoverableException"; - List appenderMessages = new ArrayList<>(appender.getMessages()); - Assert.assertTrue(TestUtils.isContains(appenderMessages, msg)); - - // try to publish another event - metric.incrementCount(builder); - // waiting to confirm that the event is not added to the queue - verify(eventDataBatch, timeout(10000).times(1)).tryAdd(any(EventData.class)); - } - - @Test - public void testEventPublishingInWorkerThread() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - EventDataBatch newEventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch).thenReturn(newEventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(false); - when(newEventDataBatch.tryAdd(any(EventData.class))).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1); - when(newEventDataBatch.getCount()).thenReturn(1); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting for worker thread flush the queue - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - // waiting for worker thread, adding event to the queue - verify(newEventDataBatch, timeout(10000).times(1)).tryAdd(any(EventData.class)); - } - - @Test - public void testEventPublishingAndAuthExceptionInWorkerThread() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(false).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1).thenReturn(0); - - doThrow(new AmqpException(false, AmqpErrorCondition.UNAUTHORIZED_ACCESS, "", null)) - .when(client) - .send(any(EventDataBatch.class)); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting for worker thread flush the queue - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - // waiting for worker thread, and verify adding event to the queue get succeed second time - verify(eventDataBatch, timeout(10000).times(2)).tryAdd(any(EventData.class)); - - // verify worker thread has already identified the Unrecoverable error - String msg = "Authentication issue happened. Producer client will be re-initialized retaining the Event Data " - + "Batch"; - List appenderMessages = new ArrayList<>(appender.getMessages()); - Assert.assertTrue(TestUtils.isContains(appenderMessages, msg)); - } - - @Test - public void testEventPublishingAndResourceLimitExceededInWorkerThread() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(false).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1).thenReturn(0); - - doThrow(new AmqpException(false, AmqpErrorCondition.RESOURCE_LIMIT_EXCEEDED, "", null)) - .when(client) - .send(any(EventDataBatch.class)); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting for worker thread flush the queue - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - - // waiting for worker thread, and verify adding event to the queue get succeed second time - verify(eventDataBatch, timeout(100000).times(2)).tryAdd(any(EventData.class)); - - // verify worker thread has already identified the Resource limit exceeded error - String msg = "Resource limit exceeded when publishing Event Data Batch. Operation will be retried after " - + "constant delay"; - messages = appender.getMessages(); - Assert.assertTrue(TestUtils.isContains(messages, msg)); - } - - @Ignore - public void testEventPublishingAndAnyAMQPExceptionInWorkerThread() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - EventDataBatch newEventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch).thenReturn(newEventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(false); - when(newEventDataBatch.tryAdd(any(EventData.class))).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1).thenReturn(0); - when(newEventDataBatch.getCount()).thenReturn(1).thenReturn(0); - - doThrow(new AmqpException(false, AmqpErrorCondition.ARGUMENT_ERROR, "", null)) - .when(client) - .send(any(EventDataBatch.class)); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting for worker thread flush the queue - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - - // verify existing producer client is close, before create new producer and batch - verify(client, timeout(10000).times(1)).close(); - - // verify worker thread has already identified the amqp exception - String msg = "AMQP error occurred while publishing Event Data Batch. Producer client will be re-initialized. " - + "Events may be lost in the process."; - messages = appender.getMessages(); - Assert.assertTrue(TestUtils.isContains(messages, msg)); - } - - @Test - public void testEventPublishingAndTimeOutExceptionInWorkerThread() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(false).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1).thenReturn(0); - - doThrow(new RuntimeException(new TimeoutException())) - .when(client) - .send(any(EventDataBatch.class)); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting for worker thread flush the queue - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - - // waiting for worker thread, and verify adding event to the queue get succeed second time - verify(eventDataBatch, timeout(20000).times(2)).tryAdd(any(EventData.class)); - - // verify worker thread has already identified the Timeout exception - String msg = "Timeout occurred after retrying 2 times with an timeout of 30 seconds while trying to publish " - + "Event Data Batch. Next retry cycle will begin shortly."; - messages = appender.getMessages(); - Assert.assertTrue(TestUtils.isContains(messages, msg)); - } - - @Test - public void testEventPublishingAndAnyOtherExceptionInWorkerThread() throws Exception { - - EventDataBatch eventDataBatch = Mockito.mock(EventDataBatch.class); - EventDataBatch newEventDataBatch = Mockito.mock(EventDataBatch.class); - when(client.createBatch()).thenReturn(eventDataBatch).thenReturn(newEventDataBatch); - when(eventDataBatch.tryAdd(any(EventData.class))).thenReturn(false); - when(newEventDataBatch.tryAdd(any(EventData.class))).thenReturn(true); - when(eventDataBatch.getCount()).thenReturn(1).thenReturn(0); - when(newEventDataBatch.getCount()).thenReturn(1).thenReturn(0); - - doThrow(new RuntimeException()) - .when(client) - .send(any(EventDataBatch.class)); - - MetricReporter metricReporter = new DefaultAnalyticsMetricReporter(configs); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - - // try publishing an event - metric.incrementCount(builder); - - // waiting for worker thread flush the queue - verify(client, timeout(20000).times(1)).send(any(EventDataBatch.class)); - - // verify existing producer client is close, before create new producer and batch - verify(client, timeout(10000).times(1)).close(); - - // verify worker thread has already identified the runtime exception - String msg = "Unknown error occurred while publishing Event Data Batch. Producer client will be re-initialized." - + " Events may be lost in the process."; - messages = appender.getMessages(); - Assert.assertTrue(TestUtils.isContains(messages, msg)); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/LogMetricReporterTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/LogMetricReporterTestCase.java deleted file mode 100644 index 2052e2aa0d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/LogMetricReporterTestCase.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.core.LoggerContext; -import org.apache.logging.log4j.core.config.Configuration; -import org.testng.Assert; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporterFactory; -import org.wso2.apk.enforcer.analytics.publisher.reporter.log.LogCounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.util.TestUtils; -import org.wso2.apk.enforcer.analytics.publisher.util.UnitTestAppender; - -import java.util.List; - -public class LogMetricReporterTestCase { - - private static final Logger log = LogManager.getLogger(LogMetricReporterTestCase.class); - - @Test - public void testLogMetricReporter() throws MetricCreationException, MetricReportingException { - - log.info("Running log metric test case"); - Logger log = LogManager.getLogger(LogCounterMetric.class); - LoggerContext context = LoggerContext.getContext(false); - Configuration config = context.getConfiguration(); - UnitTestAppender appender = config.getAppender("UnitTestAppender"); - - MetricReporter metricReporter = MetricReporterFactory.getInstance().createMetricReporter( - "org.wso2.apk.enforcer.analytics.publisher.reporter.log.LogMetricReporter", null); - CounterMetric metric = metricReporter.createCounterMetric("testCounter", null); - MetricEventBuilder builder = metric.getEventBuilder(); - builder.addAttribute("attribute1", "value1").addAttribute("attribute2", "value2").addAttribute("attribute3", - "value3"); - metric.incrementCount(builder); - - List messages = appender.getMessages(); - - Assert.assertTrue(TestUtils.isContains(messages, "testCounter"), "Metric name is not properly logged"); - Assert.assertTrue(TestUtils.isContains(messages, "attribute1=value1"), "Metric attribute is not properly " - + "logged"); - Assert.assertTrue(TestUtils.isContains(messages, "attribute2=value2"), - "Metric attribute is not properly logged"); - Assert.assertTrue(TestUtils.isContains(messages, "attribute3=value3"), - "Metric attribute is not properly logged"); - } - - @Test(expectedExceptions = MetricReportingException.class, dependsOnMethods = {"testLogMetricReporter"}) - public void testLogMetricReporterWithInvalidAttributes() throws MetricCreationException, MetricReportingException { - - MetricReporter metricReporter = MetricReporterFactory.getInstance().createMetricReporter( - "org.wso2.apk.enforcer.analytics.publisher.reporter.log.LogMetricReporter", null); - CounterMetric metric = metricReporter.createCounterMetric("testCounter", null); - MetricEventBuilder builder = metric.getEventBuilder(); - builder.addAttribute("attribute1", 123).addAttribute("attribute2", "value2").addAttribute("attribute3", - "value3"); - metric.incrementCount(builder); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/MetricReporterTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/MetricReporterTestCase.java deleted file mode 100644 index e9b2cef339..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/MetricReporterTestCase.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporterFactory; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; -import org.wso2.apk.enforcer.analytics.publisher.util.TestUtils; - -import java.util.HashMap; -import java.util.Map; - -public class MetricReporterTestCase { - - private static final Logger log = LogManager.getLogger(MetricReporterTestCase.class); - - @Test(enabled = false, expectedExceptions = MetricCreationException.class) - public void testMetricReporterCreationWithoutConfigs() throws MetricCreationException, MetricReportingException { - - try { - createAndPublish(null, null); - } catch (MetricCreationException e) { - log.error(e); - throw e; - } - } - - @Test(enabled = false, expectedExceptions = MetricCreationException.class, dependsOnMethods = - {"testMetricReporterCreationWithoutConfigs"}) - public void testMetricReporterCreationWithMissingConfigs() throws MetricCreationException, - MetricReportingException { - - Map configs = new HashMap<>(); - configs.put("token.api.url", "localhost/token-api"); - configs.put("auth.api.url", "localhost/auth-api"); - configs.put("consumer.secret", "some_secret"); - createAndPublish(configs, null); - } - - @Test(enabled = false, expectedExceptions = MetricCreationException.class, dependsOnMethods = - {"testMetricReporterCreationWithMissingConfigs"}) - public void testMetricReporterCreationWithNullConfigs() throws MetricCreationException, - MetricReportingException { - - Map configs = new HashMap<>(); - configs.put("token.api.url", "localhost/token-api"); - configs.put("auth.api.url", "localhost/auth-api"); - configs.put("consumer.secret", "some_secret"); - configs.put("sas.token", "some_token"); - configs.put("consumer.key", null); - createAndPublish(configs, null); - } - - @Test(enabled = false, expectedExceptions = MetricCreationException.class, dependsOnMethods = - {"testMetricReporterCreationWithNullConfigs"}) - public void testMetricReporterCreationWithEmptyConfigs() throws MetricCreationException, - MetricReportingException { - - Map configs = new HashMap<>(); - configs.put("token.api.url", "localhost/token-api"); - configs.put("auth.api.url", "localhost/auth-api"); - configs.put("sas.token", "some_token"); - configs.put("consumer.secret", "some_secret"); - configs.put("consumer.key", ""); - createAndPublish(configs, null); - } - - @Test - public void testCompleteFlow() throws MetricCreationException, MetricReportingException, InterruptedException { - - Map configMap = new HashMap<>(); - String authURL = System.getenv(Constants.AUTH_API_URL); - String authToken = System.getenv(Constants.AUTH_API_TOKEN); - if (authToken != null && authURL != null) { - configMap.put(Constants.AUTH_API_URL, authURL); - configMap.put(Constants.AUTH_API_TOKEN, authToken); - } else { - return; - } - MetricReporter metricReporter = MetricReporterFactory.getInstance().createMetricReporter(configMap); - CounterMetric metric = metricReporter.createCounterMetric("test-connection-counter", MetricSchema.RESPONSE); - for (int i = 0; i < 5; i++) { - MetricEventBuilder builder = metric.getEventBuilder(); - TestUtils.populateBuilder(builder); - metric.incrementCount(builder); - } - Thread.sleep(2000); - //Assertions will be done after mocking eventhub client - } - - /** - * Helper method to create and publish metrics for testing purposes - * - * @param configs Config map - * @param event Event map - * @throws MetricCreationException Thrown if config properties are missing - * @throws MetricReportingException Thrown if event properties are missing - */ - private void createAndPublish(Map configs, Map event) - throws MetricCreationException, MetricReportingException { - - MetricReporter metricReporter = MetricReporterFactory.getInstance().createMetricReporter(configs); - CounterMetric counterMetric = metricReporter.createCounterMetric("apim.response", MetricSchema.RESPONSE); - MetricEventBuilder builder = counterMetric.getEventBuilder(); - - counterMetric.incrementCount(builder); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/MoesifMetricBuilderTestCase.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/MoesifMetricBuilderTestCase.java deleted file mode 100644 index 27036caa17..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/MoesifMetricBuilderTestCase.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. 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.analytics.publisher; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.EventQueue; -import org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.MoesifCounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.moesif.util.MoesifMicroserviceConstants; -import org.wso2.apk.enforcer.analytics.publisher.retriever.MoesifKeyRetrieverChoreoClient; -import org.wso2.apk.enforcer.analytics.publisher.util.Constants; - -import java.time.Clock; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -public class MoesifMetricBuilderTestCase { - - private static final Logger log = LoggerFactory.getLogger(MoesifMetricBuilderTestCase.class); - - private MetricEventBuilder builder; - - @BeforeMethod - public void createBuilder() throws MetricCreationException { - - Map properties = new HashMap<>(); - properties.put(MoesifMicroserviceConstants.MS_USERNAME_CONFIG_KEY, "some_username"); - properties.put(MoesifMicroserviceConstants.MS_PWD_CONFIG_KEY, "some_password"); - properties.put(MoesifMicroserviceConstants.MOESIF_PROTOCOL_WITH_FQDN_KEY, "abcde"); - properties.put(MoesifMicroserviceConstants.MOESIF_MS_VERSIONING_KEY, "aaa"); - MoesifKeyRetrieverChoreoClient keyRetriever = - MoesifKeyRetrieverChoreoClient.getInstance(properties); - EventQueue queue = new EventQueue(100, 1, keyRetriever); - MoesifCounterMetric metric = - new MoesifCounterMetric("test.builder.metric", queue, MetricSchema.CHOREO_RESPONSE); - builder = metric.getEventBuilder(); - } - - @Test(expectedExceptions = MetricReportingException.class) - public void testMissingAttributes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, System.currentTimeMillis()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT, "Mozilla") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, "someString") - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000) - .addAttribute(Constants.BACKEND_LATENCY, 3000) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, "1000") - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000) - .addAttribute(Constants.USER_IP, "127.0.0.1") - .build(); - } - - @Test(expectedExceptions = MetricReportingException.class) - public void testAttributesWithInvalidTypes() throws MetricCreationException, MetricReportingException { - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, System.currentTimeMillis()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.ORGANIZATION_ID, "wso2.com") - .addAttribute(Constants.ENVIRONMENT_ID, "abcd-1234-5678-efgh") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CONTEXT, "/v1/") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT, "Mozilla") - .addAttribute(Constants.USER_NAME, "admin") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, "someString") - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000) - .addAttribute(Constants.BACKEND_LATENCY, 3000) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, "1000") - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000) - .addAttribute(Constants.USER_IP, "127.0.0.1") - .build(); - } - - @Test - public void testMetricBuilder() throws MetricCreationException, MetricReportingException { - - String uaString = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, " - + "like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"; - - LinkedHashMap values = new LinkedHashMap<>(); - values.put("x-original-gw-url", "foo"); - LinkedHashMap properties = new LinkedHashMap(); - properties.put("properties", values); - - Map eventMap = builder - .addAttribute(Constants.REQUEST_TIMESTAMP, OffsetDateTime.now(Clock.systemUTC()).toString()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.ORGANIZATION_ID, "wso2.com") - .addAttribute(Constants.ENVIRONMENT_ID, "abcd-1234-5678-efgh") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_TYPE, "HTTP") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CONTEXT, "/v1/") - .addAttribute(Constants.USER_NAME, "admin") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT_HEADER, uaString) - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, 401) - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000L) - .addAttribute(Constants.BACKEND_LATENCY, 3000L) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, 1000L) - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000L) - .addAttribute(Constants.USER_IP, "127.0.0.1") - .addAttribute(Constants.PROPERTIES, properties) - .build(); - - Assert.assertFalse(eventMap.isEmpty()); - // We expect only 30 attributes in Moesif scenario unlike in choreo scenario. - // In choreo scenario we parse user agent header, - // and build one additional attribute. - Assert.assertEquals(eventMap.size(), 31, "Some attributes are missing from the resulting event map"); - Assert.assertEquals(eventMap.get(Constants.ORGANIZATION_ID), "wso2.com", - "Organization ID should be wso2.com"); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/AuthAPIMockService.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/AuthAPIMockService.java deleted file mode 100644 index c4e97a7ac7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/AuthAPIMockService.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.util; - -import org.mockserver.integration.ClientAndServer; -import org.mockserver.model.JsonBody; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.wso2.apk.enforcer.analytics.publisher.auth.TokenDetailsDTO; - -import static org.mockserver.model.HttpRequest.request; -import static org.mockserver.model.HttpResponse.response; - -/** - * Mocking auth-api service. - */ -public class AuthAPIMockService { - - protected static final String SAS_TOKEN = "SharedAccessSignature sr=sb://localhost/incoming-hub/publishers" - + "/pub1&sig=signature&se=1641892957&skn=send-policy"; - private static final int TEST_PORT = 9191; - private ClientAndServer mockServer; - protected String authApiEndpoint; - - @BeforeClass - public void startServer() { - - mockServer = ClientAndServer.startClientAndServer(TEST_PORT); - authApiEndpoint = "http://localhost:" + TEST_PORT + "/auth-api"; - } - - @AfterClass - public void stopServer() { - - mockServer.stop(); - } - - protected void mock(int responseCode, String token) { - - TokenDetailsDTO dto = new TokenDetailsDTO(); - dto.setToken(SAS_TOKEN); - mockServer.when( - request() - .withMethod("GET") - .withPath("/auth-api/token") - .withHeader("Authorization", "Bearer " + token) - ) - .respond( - response() - .withStatusCode(responseCode) - .withBody(JsonBody.json(dto)) - ); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/TestUtils.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/TestUtils.java deleted file mode 100644 index 6046f1a07d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/TestUtils.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.util; - -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; - -import java.time.Clock; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.ArrayList; - -/** - * Util class containing helper methods for test - */ -public class TestUtils { - - public static void populateBuilder(MetricEventBuilder builder) throws MetricReportingException { - - String uaString = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, " - + "like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"; - - builder.addAttribute(Constants.REQUEST_TIMESTAMP, OffsetDateTime.now(Clock.systemUTC()).toString()) - .addAttribute(Constants.CORRELATION_ID, "1234-4567") - .addAttribute(Constants.KEY_TYPE, "prod") - .addAttribute(Constants.API_ID, "9876-54f1") - .addAttribute(Constants.API_TYPE, "HTTP") - .addAttribute(Constants.API_NAME, "PizzaShack") - .addAttribute(Constants.API_VERSION, "1.0.0") - .addAttribute(Constants.API_CREATION, "admin") - .addAttribute(Constants.API_METHOD, "POST") - .addAttribute(Constants.API_CONTEXT, "/v1/") - .addAttribute(Constants.API_RESOURCE_TEMPLATE, "/resource/{value}") - .addAttribute(Constants.API_CREATOR_TENANT_DOMAIN, "carbon.super") - .addAttribute(Constants.ENVIRONMENT_ID, "Development") - .addAttribute(Constants.DESTINATION, "localhost:8080") - .addAttribute(Constants.APPLICATION_ID, "3445-6778") - .addAttribute(Constants.APPLICATION_NAME, "default") - .addAttribute(Constants.APPLICATION_OWNER, "admin") - .addAttribute(Constants.REGION_ID, "NA") - .addAttribute(Constants.GATEWAY_TYPE, "Synapse") - .addAttribute(Constants.USER_AGENT_HEADER, uaString) - .addAttribute(Constants.USER_NAME, "admin") - .addAttribute(Constants.PROXY_RESPONSE_CODE, 401) - .addAttribute(Constants.TARGET_RESPONSE_CODE, 401) - .addAttribute(Constants.RESPONSE_CACHE_HIT, true) - .addAttribute(Constants.RESPONSE_LATENCY, 2000L) - .addAttribute(Constants.BACKEND_LATENCY, 3000L) - .addAttribute(Constants.REQUEST_MEDIATION_LATENCY, 1000L) - .addAttribute(Constants.RESPONSE_MEDIATION_LATENCY, 1000L) - .addAttribute(Constants.USER_IP, "127.0.0.1"); - } - - public static boolean isContains(List messages, String message) { - List messagesCopy = new ArrayList<>(messages); - for (String log : messagesCopy) { - if (log.contains(message)) { - return true; - } - } - return false; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/UnitTestAppender.java b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/UnitTestAppender.java deleted file mode 100644 index eb5d01f08b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/java/org/wso2/apk/enforcer/analytics/publisher/util/UnitTestAppender.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics.publisher.util; - -import org.apache.logging.log4j.core.Filter; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.appender.AbstractAppender; -import org.apache.logging.log4j.core.config.plugins.Plugin; -import org.apache.logging.log4j.core.config.plugins.PluginAttribute; -import org.apache.logging.log4j.core.config.plugins.PluginElement; -import org.apache.logging.log4j.core.config.plugins.PluginFactory; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -@Plugin(name = "UnitTestAppender", category = "Core", elementType = "appender", printObject = true) -public class UnitTestAppender extends AbstractAppender { - - private List messages = Collections.synchronizedList(new ArrayList<>()); - - protected UnitTestAppender(String name, Filter filter) { - - super(name, filter, null, false, null); - } - - @PluginFactory - public static UnitTestAppender createAppender( - @PluginAttribute("name") String name, - @PluginElement("Filter") Filter filter) { - - if (name == null) { - LOGGER.error("No name provided for UnitTestAppender"); - return null; - } - return new UnitTestAppender(name, filter); - } - - public List getMessages() { - - return messages; - } - - public boolean checkContains(String message) { - - for (String log : messages) { - if (log.contains(message)) { - return true; - } - } - return false; - } - - @Override - public void append(LogEvent event) { - - messages.add(event.getMessage().getFormattedMessage()); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/resources/log4j2.xml b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/resources/log4j2.xml deleted file mode 100644 index e5452570e8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/resources/log4j2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/resources/testng.xml b/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/resources/testng.xml deleted file mode 100644 index 7903dc653d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.analytics.publishers/src/test/resources/testng.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/build.gradle b/gateway/enforcer/org.wso2.apk.enforcer.commons/build.gradle deleted file mode 100644 index 28bbec357a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -description = 'WSO2 APK Enforcer Common Component' - -dependencies { - implementation libs.commons.lang3 - implementation libs.graphql - implementation libs.httpcomponents.client - implementation libs.log4j.api - implementation libs.log4j.core - implementation libs.minidev.json - testImplementation libs.junit - implementation libs.jackson.databind - implementation libs.nimbus.jose.jwt - implementation libs.json.simple - implementation libs.commons.lang3 - implementation libs.gson - implementation project(':org.wso2.apk.enforcer.analytics.publishers') - annotationProcessor('org.apache.logging.log4j:log4j-core:2.19.0') -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/Filter.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/Filter.java deleted file mode 100644 index ccc4b4d9a0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/Filter.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2020, 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.commons; - -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; - -import java.util.Map; - -/** - * Filters are the request interceptors that applies API Management capabilities at the gateway layer. This is the - * Interface to implement chain of filters at the gateway. - */ -public interface Filter { - - default void init(APIConfig apiConfig, Map configProperties){}; - - boolean handleRequest(RequestContext requestContext); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/AnalyticsCommonConfiguration.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/AnalyticsCommonConfiguration.java deleted file mode 100644 index 5b6d349e7d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/AnalyticsCommonConfiguration.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics; - -import java.util.Map; - -/** - * AnalyticsCommonConfiguration hold the common configurations. - */ -public class AnalyticsCommonConfiguration { - private String type; - private final Map configurations; - private String responseSchema; - private String faultSchema; - - public AnalyticsCommonConfiguration(Map configurations) { - this.configurations = configurations; - } - - public Map getConfigurations() { - return configurations; - } - - public String getResponseSchema() { - return responseSchema; - } - - public void setResponseSchema(String responseSchema) { - this.responseSchema = responseSchema; - } - - public String getFaultSchema() { - return faultSchema; - } - - public void setFaultSchema(String faultSchema) { - this.faultSchema = faultSchema; - } - - public String getType() { - - return type; - } - - public void setType(String type) { - - this.type = type; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/AnalyticsServiceReferenceHolder.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/AnalyticsServiceReferenceHolder.java deleted file mode 100644 index e7d301bace..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/AnalyticsServiceReferenceHolder.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.wso2.apk.enforcer.commons.analytics; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.publishers.impl.AnalyticsDataPublisher; - -/** - * Configuration holder. - */ -public class AnalyticsServiceReferenceHolder { - - private static final Log log = LogFactory.getLog(AnalyticsServiceReferenceHolder.class); - private static final AnalyticsServiceReferenceHolder instance = new AnalyticsServiceReferenceHolder(); - - private AnalyticsServiceReferenceHolder() { - - } - - public static AnalyticsServiceReferenceHolder getInstance() { - - return instance; - } - - public void addAnalyticReporter(AnalyticsCommonConfiguration analyticsCommonConfiguration) { - // initialize data publisher at server start up - AnalyticsDataPublisher.getInstance().initializeReporter(analyticsCommonConfiguration); - log.debug("Analytics data publisher initialized."); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/Constants.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/Constants.java deleted file mode 100644 index adff5ba791..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/Constants.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics; - -/** - * analytics related publisher constants. - */ -public class Constants { - - public static final String RESPONSE_METRIC_NAME = "apim:response"; - public static final String FAULTY_METRIC_NAME = "apim:faulty"; - - public static final String ANONYMOUS_VALUE = "anonymous"; - public static final String UNKNOWN_VALUE = "UNKNOWN"; - public static final int UNKNOWN_INT_VALUE = -1; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/AnalyticsCustomDataProvider.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/AnalyticsCustomDataProvider.java deleted file mode 100644 index f1f88aaa7a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/AnalyticsCustomDataProvider.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors; - -import java.util.Map; - -/** - * Data provider interface to extract custom request data. - */ -public interface AnalyticsCustomDataProvider { - - Map getCustomProperties(Object context); - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/AnalyticsDataProvider.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/AnalyticsDataProvider.java deleted file mode 100644 index 5997cd0318..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/AnalyticsDataProvider.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors; - -import org.wso2.apk.enforcer.commons.analytics.exceptions.DataNotFoundException; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.API; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Error; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Latencies; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.MetaInfo; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Operation; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Target; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.EventCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; - -import java.util.Collections; -import java.util.Map; - -/** - * Data provider interface to extract request data. - */ -public interface AnalyticsDataProvider { - - EventCategory getEventCategory(); - - boolean isAnonymous(); - - boolean isAuthenticated(); - - FaultCategory getFaultType(); - - API getApi() throws DataNotFoundException; - - Application getApplication() throws DataNotFoundException; - - Operation getOperation() throws DataNotFoundException; - - Target getTarget(); - - Latencies getLatencies(); - - MetaInfo getMetaInfo(); - - int getProxyResponseCode(); - - int getTargetResponseCode(); - - long getRequestTime(); - - Error getError(FaultCategory faultCategory); - - String getUserAgentHeader(); - - String getUserName(); - - String getEndUserIP(); - - default Map getProperties() { - return Collections.EMPTY_MAP; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/FaultDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/FaultDataCollector.java deleted file mode 100644 index f7f7f9ac72..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/FaultDataCollector.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors; - -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; - -/** - * Interface to faulty handlers. - */ -public interface FaultDataCollector { - void collectFaultData(Event faultyEvent) throws AnalyticsException; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/RequestDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/RequestDataCollector.java deleted file mode 100644 index 211964fc3d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/RequestDataCollector.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors; - -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; - -/** - * interface to request handlers. - */ -public interface RequestDataCollector { - void collectData() throws AnalyticsException; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/AbstractRequestDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/AbstractRequestDataCollector.java deleted file mode 100644 index aaf2e1f2a7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/AbstractRequestDataCollector.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl; - -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; - -/** - * Abstract request data collector. - */ -public abstract class AbstractRequestDataCollector { - - private AnalyticsDataProvider provider; - - public AbstractRequestDataCollector(AnalyticsDataProvider provider) { - - this.provider = provider; - } - - public AnalyticsDataProvider getProvider() { - - return provider; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/CommonRequestDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/CommonRequestDataCollector.java deleted file mode 100644 index 0e4fee6b6a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/CommonRequestDataCollector.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.Constants; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; - -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; - -/** - * Contain the common data collectors. - */ -public abstract class CommonRequestDataCollector extends AbstractRequestDataCollector { - private static final Log log = LogFactory.getLog(SuccessRequestDataCollector.class); - - public CommonRequestDataCollector(AnalyticsDataProvider provider) { - super(provider); - } - - public Application getAnonymousApp() { - Application application = new Application(); - application.setApplicationId(Constants.ANONYMOUS_VALUE); - application.setApplicationName(Constants.ANONYMOUS_VALUE); - application.setKeyType(Constants.ANONYMOUS_VALUE); - application.setApplicationOwner(Constants.ANONYMOUS_VALUE); - return application; - } - - public Application getUnknownApp() { - Application application = new Application(); - application.setApplicationId(Constants.UNKNOWN_VALUE); - application.setApplicationName(Constants.UNKNOWN_VALUE); - application.setKeyType(Constants.UNKNOWN_VALUE); - application.setApplicationOwner(Constants.UNKNOWN_VALUE); - return application; - } - - public static String getTimeInISO(long time) { - OffsetDateTime offsetDateTime = OffsetDateTime - .ofInstant(Instant.ofEpochMilli(time), ZoneOffset.UTC.normalized()); - return offsetDateTime.toString(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/FaultyRequestDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/FaultyRequestDataCollector.java deleted file mode 100644 index c718e33cfd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/FaultyRequestDataCollector.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.Constants; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.FaultDataCollector; -import org.wso2.apk.enforcer.commons.analytics.collectors.RequestDataCollector; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Latencies; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Operation; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault.AuthFaultDataCollector; -import org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault.TargetFaultDataCollector; -import org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault.ThrottledFaultDataCollector; -import org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault.UnclassifiedFaultDataCollector; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.exceptions.DataNotFoundException; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.API; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.MetaInfo; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Target; - -/** - * Faulty request data collector. - */ -public class FaultyRequestDataCollector extends CommonRequestDataCollector implements RequestDataCollector { - private static final Log log = LogFactory.getLog(FaultyRequestDataCollector.class); - private FaultDataCollector authDataCollector; - private FaultDataCollector throttledDataCollector; - private FaultDataCollector targetDataCollector; - private FaultDataCollector unclassifiedFaultDataCollector; - private AnalyticsDataProvider provider; - - public FaultyRequestDataCollector(AnalyticsDataProvider provider) { - super(provider); - this.provider = provider; - this.authDataCollector = new AuthFaultDataCollector(provider); - this.throttledDataCollector = new ThrottledFaultDataCollector(provider); - this.targetDataCollector = new TargetFaultDataCollector(provider); - this.unclassifiedFaultDataCollector = new UnclassifiedFaultDataCollector(provider); - } - - public void collectData() throws AnalyticsException { - log.debug("Handling faulty analytics types"); - Event faultyEvent = getFaultyEvent(); - - switch (provider.getFaultType()) { - case AUTH: - authDataCollector.collectFaultData(faultyEvent); - break; - case THROTTLED: - throttledDataCollector.collectFaultData(faultyEvent); - break; - case TARGET_CONNECTIVITY: - targetDataCollector.collectFaultData(faultyEvent); - break; - case OTHER: - unclassifiedFaultDataCollector.collectFaultData(faultyEvent); - break; - } - } - - private Event getFaultyEvent() throws DataNotFoundException { - long requestInTime = provider.getRequestTime(); - String offsetDateTime = getTimeInISO(requestInTime); - String userAgent = provider.getUserAgentHeader(); - String userIp = provider.getEndUserIP(); - if (userIp == null) { - userIp = Constants.UNKNOWN_VALUE; - } - if (userAgent == null) { - userAgent = Constants.UNKNOWN_VALUE; - } - Event event = new Event(); - event.setProperties(provider.getProperties()); - API api = provider.getApi(); - Operation operation = provider.getOperation(); - Target target = new Target(); - target.setTargetResponseCode(Constants.UNKNOWN_INT_VALUE); - MetaInfo metaInfo = provider.getMetaInfo(); - - event.setApi(api); - event.setOperation(operation); - event.setTarget(target); - event.setProxyResponseCode(provider.getProxyResponseCode()); - event.setRequestTimestamp(offsetDateTime); - event.setMetaInfo(metaInfo); - event.setLatencies(provider.getLatencies()); - event.setUserAgentHeader(userAgent); - event.setUserIp(userIp); - return event; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/GenericRequestDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/GenericRequestDataCollector.java deleted file mode 100644 index ddb34dfe19..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/GenericRequestDataCollector.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.RequestDataCollector; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.EventCategory; - -/** - * Handle all the request and forward to appropriate sub request handlers. - */ -public class GenericRequestDataCollector implements RequestDataCollector { - private static final Log log = LogFactory.getLog(GenericRequestDataCollector.class); - private RequestDataCollector successDataCollector; - private RequestDataCollector faultDataCollector; - private RequestDataCollector unclassifiedDataCollector; - private AnalyticsDataProvider provider; - - public GenericRequestDataCollector(AnalyticsDataProvider provider) { - this.successDataCollector = new SuccessRequestDataCollector(provider); - this.faultDataCollector = new FaultyRequestDataCollector(provider); - this.unclassifiedDataCollector = new UnclassifiedRequestDataCollector(provider); - this.provider = provider; - } - - public void collectData() throws AnalyticsException { - switch (provider.getEventCategory()) { - case SUCCESS: - successDataCollector.collectData(); - break; - case FAULT: - faultDataCollector.collectData(); - break; - case INVALID: - unclassifiedDataCollector.collectData(); - break; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/SuccessRequestDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/SuccessRequestDataCollector.java deleted file mode 100644 index db328cb7eb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/SuccessRequestDataCollector.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.wso2.apk.enforcer.commons.analytics.collectors.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.Constants; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.RequestDataCollector; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.RequestDataPublisher; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.API; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Latencies; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.MetaInfo; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Operation; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Target; -import org.wso2.apk.enforcer.commons.analytics.publishers.impl.SuccessRequestDataPublisher; - -import java.util.Objects; - -/** - * Success request data collector. - */ -public class SuccessRequestDataCollector extends CommonRequestDataCollector implements RequestDataCollector { - private static final Log log = LogFactory.getLog(SuccessRequestDataCollector.class); - private RequestDataPublisher processor; - private AnalyticsDataProvider provider; - - public SuccessRequestDataCollector(AnalyticsDataProvider provider, RequestDataPublisher processor) { - super(provider); - this.processor = processor; - this.provider = provider; - } - - public SuccessRequestDataCollector(AnalyticsDataProvider provider) { - this(provider, new SuccessRequestDataPublisher()); - } - - public void collectData() throws AnalyticsException { - log.debug("Handling success analytics types"); - - long requestInTime = provider.getRequestTime(); - String offsetDateTime = getTimeInISO(requestInTime); - - Event event = new Event(); - event.setProperties(provider.getProperties()); - API api = provider.getApi(); - Operation operation = provider.getOperation(); - Target target = provider.getTarget(); - - Application application; - if (provider.isAnonymous()) { - application = getAnonymousApp(); - } else { - application = provider.getApplication(); - } - Latencies latencies = provider.getLatencies(); - MetaInfo metaInfo = provider.getMetaInfo(); - String userAgent = provider.getUserAgentHeader(); - String userName = provider.getUserName(); - String userIp = provider.getEndUserIP(); - if (userIp == null) { - userIp = Constants.UNKNOWN_VALUE; - } - if (userAgent == null) { - userAgent = Constants.UNKNOWN_VALUE; - } - - event.setApi(api); - if (Objects.equals(api.getApiType(), "GRPC")) { - operation.setApiMethod("GRPC"); - } - event.setOperation(operation); - event.setTarget(target); - event.setApplication(application); - event.setLatencies(latencies); - event.setProxyResponseCode(provider.getProxyResponseCode()); - event.setRequestTimestamp(offsetDateTime); - event.setMetaInfo(metaInfo); - event.setUserAgentHeader(userAgent); - event.setUserName(userName); - event.setUserIp(userIp); - this.processor.publish(event); - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/UnclassifiedRequestDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/UnclassifiedRequestDataCollector.java deleted file mode 100644 index dda0b6a95e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/UnclassifiedRequestDataCollector.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.RequestDataCollector; - -/** - * Unclassified request data collector. - */ -public class UnclassifiedRequestDataCollector extends CommonRequestDataCollector implements RequestDataCollector { - private static final Log log = LogFactory.getLog(UnclassifiedRequestDataCollector.class); - - public UnclassifiedRequestDataCollector(AnalyticsDataProvider provider) { - super(provider); - } - - public void collectData() { - log.debug("Skipping Unclassified analytics types"); - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/AbstractFaultDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/AbstractFaultDataCollector.java deleted file mode 100644 index f06d8a3cd5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/AbstractFaultDataCollector.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault; - -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.FaultDataCollector; -import org.wso2.apk.enforcer.commons.analytics.collectors.impl.CommonRequestDataCollector; -import org.wso2.apk.enforcer.commons.analytics.exceptions.InvalidCategoryException; -import org.wso2.apk.enforcer.commons.analytics.publishers.RequestDataPublisher; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Error; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultSubCategories; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultSubCategory; - -/** - * Abstract faulty request data collector. - */ -public abstract class AbstractFaultDataCollector extends CommonRequestDataCollector implements FaultDataCollector { - - protected FaultCategory subType; - private RequestDataPublisher processor; - private AnalyticsDataProvider provider; - - public AbstractFaultDataCollector(AnalyticsDataProvider provider, FaultCategory subType, - RequestDataPublisher processor) { - - super(provider); - this.provider = provider; - this.subType = subType; - this.processor = processor; - } - - protected final void processRequest(Event faultyEvent) throws InvalidCategoryException { - - Error error = provider.getError(this.subType); - if (!isValidSubCategory(error.getErrorMessage())) { - throw new InvalidCategoryException(this.subType, faultyEvent.getError().getErrorMessage().toString()); - } - faultyEvent.setErrorType(this.subType.name()); - faultyEvent.setError(error); - this.processor.publish(faultyEvent); - } - - private boolean isValidSubCategory(FaultSubCategory subCategory) { - - if (FaultCategory.AUTH == this.subType) { - return subCategory instanceof FaultSubCategories.Authentication; - } else if (FaultCategory.THROTTLED == this.subType) { - return subCategory instanceof FaultSubCategories.Throttling; - } else if (FaultCategory.TARGET_CONNECTIVITY == this.subType) { - return subCategory instanceof FaultSubCategories.TargetConnectivity; - } else if (FaultCategory.OTHER == this.subType) { - return subCategory instanceof FaultSubCategories.Other; - } - - return false; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/AuthFaultDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/AuthFaultDataCollector.java deleted file mode 100644 index 7f85fe1dfe..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/AuthFaultDataCollector.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.RequestDataPublisher; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.impl.FaultyRequestDataPublisher; - -/** - * Auth faulty request data collector. - */ -public class AuthFaultDataCollector extends AbstractFaultDataCollector { - private static final Log log = LogFactory.getLog(AuthFaultDataCollector.class); - - public AuthFaultDataCollector(AnalyticsDataProvider provider, FaultCategory subType, - RequestDataPublisher processor) { - super(provider, subType, processor); - } - - public AuthFaultDataCollector(AnalyticsDataProvider provider) { - this(provider, FaultCategory.AUTH, new FaultyRequestDataPublisher()); - } - - @Override - public void collectFaultData(Event faultyEvent) throws AnalyticsException { - log.debug("handling auth failure analytics events"); - - Application application = getUnknownApp(); - faultyEvent.setApplication(application); - this.processRequest(faultyEvent); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/MethodNotAllowedFaultDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/MethodNotAllowedFaultDataCollector.java deleted file mode 100644 index 4d930529f7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/MethodNotAllowedFaultDataCollector.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; - -/** - * Method not allowed faulty request data collector. - */ -public class MethodNotAllowedFaultDataCollector extends UnclassifiedFaultDataCollector { - private static final Log log = LogFactory.getLog(MethodNotAllowedFaultDataCollector.class); - - public MethodNotAllowedFaultDataCollector(AnalyticsDataProvider provider) { - super(provider); - } - - @Override - public void collectFaultData(Event faultyEvent) throws AnalyticsException { - log.debug("handling method not allowed failure analytics events"); - Application application = getUnknownApp(); - faultyEvent.setApplication(application); - this.processRequest(faultyEvent); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/ResourceNotFoundFaultDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/ResourceNotFoundFaultDataCollector.java deleted file mode 100644 index b106d0a477..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/ResourceNotFoundFaultDataCollector.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; - -/** - * Resource not found faulty request data collector. - */ -public class ResourceNotFoundFaultDataCollector extends UnclassifiedFaultDataCollector { - private static final Log log = LogFactory.getLog(ResourceNotFoundFaultDataCollector.class); - - public ResourceNotFoundFaultDataCollector(AnalyticsDataProvider provider) { - super(provider); - } - - @Override - public void collectFaultData(Event faultyEvent) throws AnalyticsException { - log.debug("handling method not allowed failure analytics events"); - Application application = getUnknownApp(); - faultyEvent.setApplication(application); - this.processRequest(faultyEvent); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/TargetFaultDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/TargetFaultDataCollector.java deleted file mode 100644 index 6f18ed2b88..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/TargetFaultDataCollector.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.RequestDataPublisher; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.impl.FaultyRequestDataPublisher; - -/** - * Target faulty request data collector. - */ -public class TargetFaultDataCollector extends AbstractFaultDataCollector { - private static final Log log = LogFactory.getLog(TargetFaultDataCollector.class); - private AnalyticsDataProvider provider; - - public TargetFaultDataCollector(AnalyticsDataProvider provider, FaultCategory subType, - RequestDataPublisher processor) { - super(provider, subType, processor); - } - - public TargetFaultDataCollector(AnalyticsDataProvider provider) { - this(provider, FaultCategory.TARGET_CONNECTIVITY, new FaultyRequestDataPublisher()); - this.provider = provider; - } - - @Override - public void collectFaultData(Event faultyEvent) throws AnalyticsException { - log.debug("handling target failure analytics events"); - Application application; - if (provider.isAuthenticated() && provider.isAnonymous()) { - application = getAnonymousApp(); - } else { - application = provider.getApplication(); - } - faultyEvent.setApplication(application); - this.processRequest(faultyEvent); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/ThrottledFaultDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/ThrottledFaultDataCollector.java deleted file mode 100644 index f5c4d16656..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/ThrottledFaultDataCollector.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.RequestDataPublisher; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.impl.FaultyRequestDataPublisher; - -/** - * Throttled faulty request data collector. - */ -public class ThrottledFaultDataCollector extends AbstractFaultDataCollector { - private static final Log log = LogFactory.getLog(ThrottledFaultDataCollector.class); - private AnalyticsDataProvider provider; - - public ThrottledFaultDataCollector(AnalyticsDataProvider provider, FaultCategory subType, - RequestDataPublisher processor) { - super(provider, subType, processor); - } - - public ThrottledFaultDataCollector(AnalyticsDataProvider provider) { - this(provider, FaultCategory.THROTTLED, new FaultyRequestDataPublisher()); - this.provider = provider; - } - - @Override - public void collectFaultData(Event faultyEvent) throws AnalyticsException { - log.debug("handling throttled failure analytics events"); - Application application; - if (provider.isAuthenticated() && provider.isAnonymous()) { - application = getAnonymousApp(); - } else { - application = provider.getApplication(); - } - faultyEvent.setApplication(application); - this.processRequest(faultyEvent); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/UnclassifiedFaultDataCollector.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/UnclassifiedFaultDataCollector.java deleted file mode 100644 index d54b89b20a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/collectors/impl/fault/UnclassifiedFaultDataCollector.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.collectors.impl.fault; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.RequestDataPublisher; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.impl.FaultyRequestDataPublisher; - -/** - * Faulty data collector for un classified request. - */ -public class UnclassifiedFaultDataCollector extends AbstractFaultDataCollector { - private static final Log log = LogFactory.getLog(UnclassifiedFaultDataCollector.class); - private AnalyticsDataProvider provider; - - public UnclassifiedFaultDataCollector(AnalyticsDataProvider provider, FaultCategory subType, - RequestDataPublisher processor) { - super(provider, subType, processor); - } - - public UnclassifiedFaultDataCollector(AnalyticsDataProvider provider) { - this(provider, FaultCategory.OTHER, new FaultyRequestDataPublisher()); - this.provider = provider; - } - - @Override - public void collectFaultData(Event faultyEvent) throws AnalyticsException { - log.debug("handling unclassified failure analytics events"); - Application application; - if (provider.isAuthenticated()) { - if (provider.isAnonymous()) { - application = getAnonymousApp(); - } else { - application = provider.getApplication(); - } - } else { - application = getUnknownApp(); - } - faultyEvent.setApplication(application); - this.processRequest(faultyEvent); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/AnalyticsException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/AnalyticsException.java deleted file mode 100644 index 07c541f487..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/AnalyticsException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.exceptions; - -/** - * Exception class to handler analytics related exceptions. - */ -public class AnalyticsException extends Exception { - public AnalyticsException(String message) { - super(message); - } - - public AnalyticsException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/DataNotFoundException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/DataNotFoundException.java deleted file mode 100644 index 330fa60fc5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/DataNotFoundException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.exceptions; - -/** - * Exception class to handle data not found cases. - */ -public class DataNotFoundException extends AnalyticsException { - public DataNotFoundException(String message) { - super(message); - } - - public DataNotFoundException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/InvalidCategoryException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/InvalidCategoryException.java deleted file mode 100644 index edd0a1be58..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/exceptions/InvalidCategoryException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.exceptions; - -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; - -/** - * Exception class to handler invalid category. - */ -public class InvalidCategoryException extends AnalyticsException { - - public InvalidCategoryException(FaultCategory faultCategory, String faultSubCategory) { - super("Un-Supported subcategory " + faultSubCategory + " provided for " + faultCategory); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/RequestDataPublisher.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/RequestDataPublisher.java deleted file mode 100644 index 1de69f9a3b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/RequestDataPublisher.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.wso2.apk.enforcer.commons.analytics.publishers; - -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; - -import java.util.List; - -/** - * interface for data publisher. - */ -public interface RequestDataPublisher { - - void publish(Event analyticsEvent); - - CounterMetric getCounterMetric(); - - List getMultipleCounterMetrics(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/AIMetadata.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/AIMetadata.java deleted file mode 100644 index ddbc90b56a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/AIMetadata.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * AI metadata in analytics event. - */ -public class AIMetadata { - @JsonProperty("model") - private String model; - - @JsonProperty("vendor_name") - private String vendorName; - - @JsonProperty("vendor_version") - private String vendorVersion; - - public String getModel() { - - return model; - } - - public void setModel(String model) { - - this.model = model; - } - - public String getVendorName() { - - return vendorName; - } - - public void setVendorName(String vendorName) { - - this.vendorName = vendorName; - } - - public String getVendorVersion() { - - return vendorVersion; - } - - public void setVendorVersion(String vendorVersion) { - - this.vendorVersion = vendorVersion; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/AITokenUsage.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/AITokenUsage.java deleted file mode 100644 index 5607fd8bce..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/AITokenUsage.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * AI token usage in analytics event. - */ -public class AITokenUsage { - @JsonProperty("totalTokens") - private Integer totalTokens; - - @JsonProperty("promptTokens") - private Integer promptTokens; - - @JsonProperty("completionTokens") - private Integer completionTokens; - - @JsonProperty("hour") - private Integer hour; - - public Integer getTotalTokens() { - - return totalTokens; - } - - public Integer getHour() { - - return hour; - } - - public void setHour(Integer hour) { - - this.hour = hour; - } - - public void setTotalTokens(Integer totalTokens) { - - this.totalTokens = totalTokens; - } - - public Integer getPromptTokens() { - - return promptTokens; - } - - public void setPromptTokens(Integer promptTokens) { - - this.promptTokens = promptTokens; - } - - public Integer getCompletionTokens() { - - return completionTokens; - } - - public void setCompletionTokens(Integer completionTokens) { - - this.completionTokens = completionTokens; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/API.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/API.java deleted file mode 100644 index 53da9a049b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/API.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -/** - * Api attribute in analytics event. - */ -public class API { - private String apiId; - private String apiType; - private String apiName; - private String apiVersion; - private String apiCreator; - private String apiCreatorTenantDomain; - - public String getApiId() { - return apiId; - } - - public void setApiId(String apiId) { - this.apiId = apiId; - } - - public String getApiType() { - return apiType; - } - - public void setApiType(String apiType) { - this.apiType = apiType; - } - - public String getApiName() { - return apiName; - } - - public void setApiName(String apiName) { - this.apiName = apiName; - } - - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public String getApiCreator() { - return apiCreator; - } - - public void setApiCreator(String apiCreator) { - this.apiCreator = apiCreator; - } - - public String getApiCreatorTenantDomain() { - return apiCreatorTenantDomain; - } - - public void setApiCreatorTenantDomain(String apiCreatorTenantDomain) { - this.apiCreatorTenantDomain = apiCreatorTenantDomain; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Application.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Application.java deleted file mode 100644 index c46de49bbc..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Application.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -/** - * Application attribute in analytics event. - */ -public class Application { - - private String keyType; - private String applicationId; - private String applicationName; - private String applicationOwner; - - public String getKeyType() { - - return keyType; - } - - public void setKeyType(String keyType) { - - this.keyType = keyType; - } - - public String getApplicationId() { - - return applicationId; - } - - public void setApplicationId(String applicationId) { - - this.applicationId = applicationId; - } - - public String getApplicationName() { - - return applicationName; - } - - public void setApplicationName(String applicationName) { - - this.applicationName = applicationName; - } - - public String getApplicationOwner() { - - return applicationOwner; - } - - public void setApplicationOwner(String applicationOwner) { - - this.applicationOwner = applicationOwner; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Error.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Error.java deleted file mode 100644 index c8da4a7c13..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Error.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultSubCategory; - -/** - * Error attribute in analytics event. - */ -public class Error { - - private int errorCode; - private FaultSubCategory errorMessage; - - public int getErrorCode() { - return errorCode; - } - - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - } - - public FaultSubCategory getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(FaultSubCategory errorMessage) { - this.errorMessage = errorMessage; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Event.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Event.java deleted file mode 100644 index 683e7ae611..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Event.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Error; -import java.util.Map; - -/** - * analytics event data. - */ -public class Event { - @JsonUnwrapped - private API api; - @JsonUnwrapped - private Operation operation; - @JsonUnwrapped - private Target target; - @JsonUnwrapped - private Application application; - @JsonUnwrapped - private Latencies latencies; - @JsonUnwrapped - private MetaInfo metaInfo; - @JsonUnwrapped - private Error error; - private int proxyResponseCode; - private String requestTimestamp; - private String userAgentHeader; - - private String userName; - private String userIp; - - private String errorType; - - private Map properties; - - public API getApi() { - return api; - } - - public void setApi(API api) { - this.api = api; - } - - public Operation getOperation() { - return operation; - } - - public void setOperation(Operation operation) { - this.operation = operation; - } - - public Target getTarget() { - return target; - } - - public void setTarget(Target target) { - this.target = target; - } - - public Application getApplication() { - return application; - } - - public void setApplication(Application application) { - this.application = application; - } - - public Latencies getLatencies() { - return latencies; - } - - public void setLatencies(Latencies latencies) { - this.latencies = latencies; - } - - public int getProxyResponseCode() { - return proxyResponseCode; - } - - public void setProxyResponseCode(int proxyResponseCode) { - this.proxyResponseCode = proxyResponseCode; - } - - public String getRequestTimestamp() { - return requestTimestamp; - } - - public void setRequestTimestamp(String requestTimestamp) { - this.requestTimestamp = requestTimestamp; - } - - public Error getError() { - return error; - } - - public void setError(Error error) { - this.error = error; - } - - public String getErrorType() { - return errorType; - } - - public void setErrorType(String errorType) { - this.errorType = errorType; - } - - public MetaInfo getMetaInfo() { - return metaInfo; - } - - public void setMetaInfo(MetaInfo metaInfo) { - this.metaInfo = metaInfo; - } - - public String getUserAgentHeader() { - return userAgentHeader; - } - - public void setUserAgentHeader(String userAgentHeader) { - this.userAgentHeader = userAgentHeader; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getUserIp() { - return userIp; - } - - public void setUserIp(String userIp) { - this.userIp = userIp; - } - - public Map getProperties() { - return properties; - } - - public void setProperties(Map properties) { - this.properties = properties; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/ExtendedAPI.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/ExtendedAPI.java deleted file mode 100644 index 8ab5c77aaf..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/ExtendedAPI.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -/** - * Extended API Object with organization ID. - */ -public class ExtendedAPI extends API { - private String organizationId; - private String environmentId; - private String apiContext; - - public String getOrganizationId() { - return organizationId; - } - - public void setOrganizationId(String organizationId) { - this.organizationId = organizationId; - } - - public String getApiContext() { - return this.apiContext; - } - - public void setApiContext(String apiContext) { - this.apiContext = apiContext; - } - - public String getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(String environmentId) { - this.environmentId = environmentId; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Latencies.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Latencies.java deleted file mode 100644 index 0ffd7cc9ec..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Latencies.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -/** - * Latency attribute in analytics event. - */ -public class Latencies { - private long responseLatency; - private long backendLatency; - private long requestMediationLatency; - private long responseMediationLatency; - - public long getResponseLatency() { - return responseLatency; - } - - public void setResponseLatency(long responseLatency) { - this.responseLatency = responseLatency; - } - - public long getBackendLatency() { - return backendLatency; - } - - public void setBackendLatency(long backendLatency) { - this.backendLatency = backendLatency; - } - - public long getRequestMediationLatency() { - return requestMediationLatency; - } - - public void setRequestMediationLatency(long requestMediationLatency) { - this.requestMediationLatency = requestMediationLatency; - } - - public long getResponseMediationLatency() { - return responseMediationLatency; - } - - public void setResponseMediationLatency(long responseMediationLatency) { - this.responseMediationLatency = responseMediationLatency; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/MetaInfo.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/MetaInfo.java deleted file mode 100644 index 9dd8d17db7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/MetaInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -/** - * Meta info attribute in analytics event. - */ -public class MetaInfo { - private String correlationId; - private String regionId; - private String gatewayType; - - public String getCorrelationId() { - return correlationId; - } - - public void setCorrelationId(String correlationId) { - this.correlationId = correlationId; - } - - public String getRegionId() { - return regionId; - } - - public void setRegionId(String regionId) { - this.regionId = regionId; - } - - public String getGatewayType() { - return gatewayType; - } - - public void setGatewayType(String gatewayType) { - this.gatewayType = gatewayType; - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Operation.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Operation.java deleted file mode 100644 index c3e4c943f6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Operation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -/** - * Operation attribute in analytics event. - */ -public class Operation { - private String apiMethod; - private String apiResourceTemplate; - - public String getApiMethod() { - return apiMethod; - } - - public void setApiMethod(String apiMethod) { - this.apiMethod = apiMethod; - } - - public String getApiResourceTemplate() { - return apiResourceTemplate; - } - - public void setApiResourceTemplate(String apiResourceTemplate) { - this.apiResourceTemplate = apiResourceTemplate; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Target.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Target.java deleted file mode 100644 index 8dbee22dae..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/Target.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto; - -/** - * Target attribute in analytics event. - */ -public class Target { - private int targetResponseCode; - private boolean responseCacheHit; - private String destination; - - public int getTargetResponseCode() { - return targetResponseCode; - } - - public void setTargetResponseCode(int targetResponseCode) { - this.targetResponseCode = targetResponseCode; - } - - public boolean isResponseCacheHit() { - return responseCacheHit; - } - - public void setResponseCacheHit(boolean responseCacheHit) { - this.responseCacheHit = responseCacheHit; - } - - public String getDestination() { - return destination; - } - - public void setDestination(String destination) { - this.destination = destination; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/EventCategory.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/EventCategory.java deleted file mode 100644 index f9d4e3c919..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/EventCategory.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums; - -/** - * enum for event categories. - */ -public enum EventCategory { - SUCCESS, FAULT, INVALID -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultCategory.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultCategory.java deleted file mode 100644 index e6dbe7b358..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultCategory.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums; - -/** - * Enum to denote faulty event types. - */ -public enum FaultCategory { - AUTH, - TARGET_CONNECTIVITY, - THROTTLED, - OTHER -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultSubCategories.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultSubCategories.java deleted file mode 100644 index c4fd129608..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultSubCategories.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums; - -/** - * Enum to denote sub categories of faulty. - */ -public class FaultSubCategories { - /** - * Enum for sub categories of other category. - */ - public enum Other implements FaultSubCategory { - MEDIATION_ERROR, - RESOURCE_NOT_FOUND, - METHOD_NOT_ALLOWED, - UNCLASSIFIED - } - - /** - * Enum for sub categories of Throttling category. - */ - public enum Throttling implements FaultSubCategory { - API_LEVEL_LIMIT_EXCEEDED, - HARD_LIMIT_EXCEEDED, - RESOURCE_LEVEL_LIMIT_EXCEEDED, - APPLICATION_LEVEL_LIMIT_EXCEEDED, - SUBSCRIPTION_LIMIT_EXCEEDED, - BLOCKED, - CUSTOM_POLICY_LIMIT_EXCEEDED, - BURST_CONTROL_LIMIT_EXCEEDED, - QUERY_TOO_DEEP, - QUERY_TOO_COMPLEX, - OTHER - } - - /** - * Enum for sub categories of TargetConnectivity category. - */ - public enum TargetConnectivity implements FaultSubCategory { - CONNECTION_TIMEOUT, - CONNECTION_SUSPENDED, - OTHER - } - - /** - * Enum for sub categories of Authentication category. - */ - public enum Authentication implements FaultSubCategory { - AUTHENTICATION_FAILURE, - AUTHORIZATION_FAILURE, - SUBSCRIPTION_VALIDATION_FAILURE, - OTHER - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultSubCategory.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultSubCategory.java deleted file mode 100644 index e328cfa81c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/enums/FaultSubCategory.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums; - -/** - * SubCategories for fault sub categories enums. - */ -public interface FaultSubCategory { -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/AbstractRequestDataPublisher.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/AbstractRequestDataPublisher.java deleted file mode 100644 index 1242a24823..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/AbstractRequestDataPublisher.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.impl; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricReportingException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricEventBuilder; -import org.wso2.apk.enforcer.commons.analytics.publishers.RequestDataPublisher; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Event; -import java.util.List; -import java.util.Map; - -/** - * Abstract implementation to publish an event. - */ -public abstract class AbstractRequestDataPublisher implements RequestDataPublisher { - - protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - protected static final TypeReference> MAP_TYPE_REFERENCE = - new TypeReference>() { - }; - private static final Log log = LogFactory.getLog(AbstractRequestDataPublisher.class); - - @Override - public void publish(Event analyticsEvent) { - - Map dataMap = OBJECT_MAPPER.convertValue(analyticsEvent, MAP_TYPE_REFERENCE); - List multipleCounterMetrics = this.getMultipleCounterMetrics(); - if (multipleCounterMetrics == null) { - log.error("All the counterMetrics are invalid. Event will be dropped."); - return; - } - - for (CounterMetric counterMetric : multipleCounterMetrics) { - if (counterMetric == null) { - log.error("counterMetric cannot be null."); - } else { - String counterMetricClassName = counterMetric.getClass().toString(). - replaceAll("[\r\n]", "").split(" ")[1]; - boolean caughtException = false; - MetricEventBuilder builder = counterMetric.getEventBuilder(); - for (Map.Entry entry : dataMap.entrySet()) { - try { - builder.addAttribute(entry.getKey(), entry.getValue()); - } catch (MetricReportingException e) { - caughtException = true; - log.error("Error adding data to the event stream. counterMetric: " + counterMetricClassName - , e); - break; - } - } - if (!caughtException) { - try { - counterMetric.incrementCount(builder); - } catch (MetricReportingException e) { - log.error("Error occurred when publishing event.", e); - } - } - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/AnalyticsDataPublisher.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/AnalyticsDataPublisher.java deleted file mode 100644 index 3b5e490677..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/AnalyticsDataPublisher.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.impl; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporter; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricReporterFactory; -import org.wso2.apk.enforcer.analytics.publisher.reporter.MetricSchema; -import org.wso2.apk.enforcer.commons.analytics.AnalyticsCommonConfiguration; -import org.wso2.apk.enforcer.commons.analytics.Constants; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Analytics event publisher for APK. - */ -public class AnalyticsDataPublisher { - - private static final Log log = LogFactory.getLog(AnalyticsDataPublisher.class); - private static final AnalyticsDataPublisher instance = new AnalyticsDataPublisher(); - - private final List successMetricReporters = new ArrayList<>(); - private final List faultyMetricReporters = new ArrayList<>(); - - private AnalyticsDataPublisher() { - - } - - public static AnalyticsDataPublisher getInstance() { - - return instance; - } - - private CounterMetric getSuccessOrFaultyCounterMetrics(MetricReporter metricReporter, String name, - MetricSchema schema) { - - String reporterClassName = metricReporter.getClass().toString().replaceAll("[\r\n]", ""); - try { - CounterMetric counterMetric = metricReporter.createCounterMetric(name, schema); - if (counterMetric == null) { - throw new MetricCreationException("AnalyticsDataPublisher is not initialized."); - } - return counterMetric; - } catch (MetricCreationException | IllegalArgumentException e) { - log.error("Error initializing event publisher for the Reporter of type " + reporterClassName, e); - } - return null; - } - - public void initializeReporter(AnalyticsCommonConfiguration commonConfig) { - - Map configs = commonConfig.getConfigurations(); - String reporterClass = configs.get("publisher.reporter.class"); - - String reporterType = commonConfig.getType(); - try { - MetricReporter metricReporter; - if (reporterClass != null) { - metricReporter = MetricReporterFactory.getInstance() - .createMetricReporter(reporterClass, configs); - } else if (reporterType != null && !"".equals(reporterType)) { - metricReporter = MetricReporterFactory.getInstance().createMetricReporterFromType(reporterType, configs); - } else { - metricReporter = MetricReporterFactory.getInstance().createMetricReporter(configs); - } - - if (!StringUtils.isEmpty(commonConfig.getResponseSchema())) { - - this.successMetricReporters.add( - getSuccessOrFaultyCounterMetrics(metricReporter, Constants.RESPONSE_METRIC_NAME, - MetricSchema.valueOf(commonConfig.getResponseSchema()))); - } else { - this.successMetricReporters.add( - getSuccessOrFaultyCounterMetrics(metricReporter, Constants.RESPONSE_METRIC_NAME, - MetricSchema.RESPONSE)); - } - - if (!StringUtils.isEmpty(commonConfig.getFaultSchema())) { - this.faultyMetricReporters.add( - getSuccessOrFaultyCounterMetrics(metricReporter, Constants.FAULTY_METRIC_NAME, - MetricSchema.valueOf(commonConfig.getFaultSchema()))); - } else { - this.faultyMetricReporters.add( - getSuccessOrFaultyCounterMetrics(metricReporter, Constants.FAULTY_METRIC_NAME, - MetricSchema.ERROR)); - } - - // not necessary to handle IllegalArgumentException here - // since we are handling it in getSuccessOrFaultyCounterMetrics method - } catch (MetricCreationException e) { - log.error("Error while creating the metric reporter", e); - } - } - - public List getSuccessMetricReporters() throws MetricCreationException { - - if (this.successMetricReporters.isEmpty()) { - throw new MetricCreationException("None of AnalyticsDataPublishers are initialized."); - } - return successMetricReporters; - } - - public List getFaultyMetricReporters() throws MetricCreationException { - - if (this.faultyMetricReporters.isEmpty()) { - throw new MetricCreationException("None of AnalyticsDataPublishers are initialized."); - } - return faultyMetricReporters; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/FaultyRequestDataPublisher.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/FaultyRequestDataPublisher.java deleted file mode 100644 index 06134aa679..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/FaultyRequestDataPublisher.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; -import java.util.List; - - -/** - * Fault event publisher implementation. - */ -public class FaultyRequestDataPublisher extends AbstractRequestDataPublisher { - - private static final Log log = LogFactory.getLog(FaultyRequestDataPublisher.class); - - @Override - public CounterMetric getCounterMetric() { - return null; - } - - @Override - public List getMultipleCounterMetrics() { - try { - return AnalyticsDataPublisher.getInstance().getFaultyMetricReporters(); - } catch (MetricCreationException e) { - log.error("Unable to get faulty counter metrics", e); - return null; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/SuccessRequestDataPublisher.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/SuccessRequestDataPublisher.java deleted file mode 100644 index 3b432d2437..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/impl/SuccessRequestDataPublisher.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.wso2.apk.enforcer.commons.analytics.publishers.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.analytics.publisher.exception.MetricCreationException; -import org.wso2.apk.enforcer.analytics.publisher.reporter.CounterMetric; - -import java.util.List; - -/** - * Success event publisher implementation. - */ -public class SuccessRequestDataPublisher extends AbstractRequestDataPublisher { - - private static final Log log = LogFactory.getLog(SuccessRequestDataPublisher.class); - - @Override - public CounterMetric getCounterMetric() { - return null; - } - - @Override - public List getMultipleCounterMetrics() { - try { - return AnalyticsDataPublisher.getInstance().getSuccessMetricReporters(); - } catch (MetricCreationException e) { - log.error("Unable to get success counter metrics", e); - return null; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/configdto/HttpClientConfigurationDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/configdto/HttpClientConfigurationDTO.java deleted file mode 100644 index 72e455758c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/configdto/HttpClientConfigurationDTO.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.commons.configdto; - -import org.apache.http.ssl.SSLContexts; - -import java.util.Arrays; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLContext; - -/** - * Configuration related to Http Clients within gateway. - */ -public class HttpClientConfigurationDTO { - - private int connectionLimit; - private int maximumConnectionsPerRoute; - private boolean proxyEnabled; - private String proxyHost; - private int proxyPort; - private String proxyUsername; - private char[] proxyPassword = new char[]{}; - private String[] nonProxyHosts = new String[]{}; - private String proxyProtocol; - private SSLContext sslContext; - private HostnameVerifier hostnameVerifier; - - public HostnameVerifier getHostnameVerifier() { - return hostnameVerifier; - } - - private HttpClientConfigurationDTO() { - } - - public int getConnectionLimit() { - return connectionLimit; - } - - public int getMaximumConnectionsPerRoute() { - return maximumConnectionsPerRoute; - } - - public boolean isProxyEnabled() { - return proxyEnabled; - } - - public String getProxyHost() { - return proxyHost; - } - - public int getProxyPort() { - return proxyPort; - } - - public String getProxyUsername() { - return proxyUsername; - } - - public char[] getProxyPassword() { - return Arrays.copyOf(proxyPassword, proxyPassword.length); - } - - public String[] getNonProxyHosts() { - return Arrays.copyOf(nonProxyHosts, nonProxyHosts.length); - } - - public String getProxyProtocol() { - return proxyProtocol; - } - - public SSLContext getSslContext() { - return sslContext; - } - - /** - * Builder class for @code{HTTPClientConfigurationDTO} - */ - public static class Builder { - - private int connectionLimit; - private int maximumConnectionsPerRoute; - private boolean proxyEnabled; - private String proxyHost; - private int proxyPort; - private String proxyUsername; - private char[] proxyPassword = new char[]{}; - private String[] nonProxyHosts = new String[]{}; - private String proxyProtocol; - private SSLContext sslContext; - private HostnameVerifier hostnameVerifier; - - public Builder withConnectionParams(int connectionLimit, int maximumConnectionsPerRoute) { - this.connectionLimit = connectionLimit; - this.maximumConnectionsPerRoute = maximumConnectionsPerRoute; - return this; - } - - public Builder withProxy(String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, - String proxyProtocol, String[] nonProxyHosts) { - this.proxyEnabled = true; - this.proxyHost = proxyHost; - this.proxyPort = proxyPort; - this.proxyUsername = proxyUsername; - this.proxyPassword = proxyPassword != null ? proxyPassword.toCharArray() : new char[]{}; - this.proxyProtocol = proxyProtocol; - this.nonProxyHosts = nonProxyHosts != null ? - Arrays.copyOf(nonProxyHosts, nonProxyHosts.length) : new String[]{}; - return this; - } - - public Builder withSSLContext(SSLContext sslContext) { - this.sslContext = sslContext; - return this; - } - - public Builder withSSLContext(SSLContext sslContext, HostnameVerifier hostnameVerifier) { - this.sslContext = sslContext; - this.hostnameVerifier = hostnameVerifier; - return this; - } - - public HttpClientConfigurationDTO build() { - HttpClientConfigurationDTO configuration = new HttpClientConfigurationDTO(); - configuration.connectionLimit = this.connectionLimit; - configuration.maximumConnectionsPerRoute = this.maximumConnectionsPerRoute; - configuration.proxyEnabled = this.proxyEnabled; - configuration.proxyHost = this.proxyHost; - configuration.proxyPort = this.proxyPort; - configuration.proxyUsername = this.proxyUsername; - configuration.proxyPassword = this.proxyPassword; - configuration.proxyProtocol = this.proxyProtocol; - configuration.nonProxyHosts = this.nonProxyHosts; - configuration.hostnameVerifier = this.hostnameVerifier; - if (this.sslContext != null) { - configuration.sslContext = this.sslContext; - } else { - configuration.sslContext = SSLContexts.createDefault(); - } - return configuration; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/constants/GraphQLConstants.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/constants/GraphQLConstants.java deleted file mode 100644 index 1c0751c1d3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/constants/GraphQLConstants.java +++ /dev/null @@ -1,74 +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.commons.constants; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * Constants related to GraphQL operations. - */ -public class GraphQLConstants { - - public static final String QUERY_ANALYSIS_COMPLEXITY = "complexity"; - public static final List QUERY_COMPLEXITY_SLICING_ARGS = Collections.unmodifiableList( - Arrays.asList("first", "last", "limit")); - public static final String GRAPHQL_QUERY = "Query"; - public static final String GRAPHQL_MUTATION = "Mutation"; - public static final String GRAPHQL_SUBSCRIPTION = "Subscription"; - - public static final int GRAPHQL_QUERY_TOO_DEEP = 900820; - public static final String GRAPHQL_QUERY_TOO_DEEP_MESSAGE = "QUERY TOO DEEP"; - - public static final int GRAPHQL_QUERY_TOO_COMPLEX = 900821; - public static final String GRAPHQL_QUERY_TOO_COMPLEX_MESSAGE = "QUERY TOO COMPLEX"; - - public static final int GRAPHQL_INVALID_QUERY = 900422; - public static final String GRAPHQL_API_FAILURE_HANDLER = "_graphql_failure_handler"; - public static final String GRAPHQL_INVALID_QUERY_MESSAGE = "INVALID QUERY"; - - public static final String MAXIMUM_QUERY_COMPLEXITY = "max_query_complexity"; - public static final String MAXIMUM_QUERY_DEPTH = "max_query_depth"; - public static final String GRAPHQL_MAX_DEPTH = "graphQLMaxDepth"; - public static final String GRAPHQL_MAX_COMPLEXITY = "graphQLMaxComplexity"; - - /** - * GraphQL Constants related to GraphQL Subscription operations - */ - public static class SubscriptionConstants { - public static final String HTTP_METHOD_NAME = "SUBSCRIPTION"; - public static final String PAYLOAD_FIELD_NAME_TYPE = "type"; - public static final List PAYLOAD_FIELD_NAME_ARRAY_FOR_SUBSCRIBE = - Collections.unmodifiableList(Arrays.asList("start", "subscribe")); - public static final List PAYLOAD_FIELD_NAME_ARRAY_FOR_DATA = - Collections.unmodifiableList(Arrays.asList("data", "next")); - public static final String PAYLOAD_FIELD_NAME_PAYLOAD = "payload"; - public static final String PAYLOAD_FIELD_NAME_QUERY = "query"; - public static final String PAYLOAD_FIELD_NAME_ID = "id"; - public static final String PAYLOAD_FIELD_TYPE_ERROR = "error"; - } - - /** - * Constants related to WebSocket/GraphQL frame errors. - */ - public static class FrameErrorConstants { - public static final int BLOCKED_REQUEST = 4006; - public static final String BLOCKED_REQUEST_MESSAGE = "Blocked from accessing the API"; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/constants/JWTConstants.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/constants/JWTConstants.java deleted file mode 100644 index 8a1c5b0bb8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/constants/JWTConstants.java +++ /dev/null @@ -1,54 +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.commons.constants; - -/** - * Constants related to jwt generation. - */ -public class JWTConstants { - public static final String EXPIRY_TIME = "exp"; - public static final String ISSUED_TIME = "iat"; - - public static final String SUPER_TENANT_DOMAIN = "carbon.super"; - public static final String TENANT_DOMAIN_COMBINER = "@"; - - public static final String API_NAME = "name"; - public static final String SUBSCRIPTION_TIER = "subscriptionTier"; - public static final String SUBSCRIBER_TENANT_DOMAIN = "subscriberTenantDomain"; - - public static final String APPLICATION = "application"; - public static final String APPLICATION_ID = "id"; - public static final String APPLICATION_NAME = "name"; - public static final String APPLICATION_TIER = "tier"; - public static final String APPLICATION_OWNER = "owner"; - public static final String AUTH_APPLICATION_USER_LEVEL_TOKEN = "Application_User"; - - public static final String REST_API_CONTEXT = "REST_API_CONTEXT"; - public static final String SYNAPSE_REST_API_VERSION = "SYNAPSE_REST_API_VERSION"; - - public static final String CONSUMER_KEY = "consumerKey"; - public static final String AUTHORIZED_PARTY = "azp"; - public static final String SCOPE = "scope"; - public static final String SCOPE_DELIMITER = " "; - public static final String OAUTH2_DEFAULT_SCOPE = "default"; - public static final String AUTHORIZED_USER_TYPE = "aut"; - - public static final String SUB = "sub"; - public static final String ORGANIZATIONS = "organizations"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/APIRequestInfoDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/APIRequestInfoDTO.java deleted file mode 100644 index f4a03a62dc..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/APIRequestInfoDTO.java +++ /dev/null @@ -1,81 +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.commons.dto; - -/** - * Representation of Invoked GW API Request Information of Request/Response. - */ -public class APIRequestInfoDTO { - - String context; - String version; - String username; - String consumerKey; - String apiId; - - public String getApiId() { - - return apiId; - } - - public void setApiId(String apiId) { - - this.apiId = apiId; - } - - public String getContext() { - - return context; - } - - public void setContext(String context) { - - this.context = context; - } - - public String getVersion() { - - return version; - } - - public void setVersion(String version) { - - this.version = version; - } - - public String getUsername() { - - return username; - } - - public void setUsername(String username) { - - this.username = username; - } - - public String getConsumerKey() { - - return consumerKey; - } - - public void setConsumerKey(String consumerKey) { - - this.consumerKey = consumerKey; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ClaimMappingDto.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ClaimMappingDto.java deleted file mode 100644 index 781d77cb0a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ClaimMappingDto.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.commons.dto; - -import com.google.gson.annotations.SerializedName; - -import java.io.Serializable; -import java.util.Objects; - -/** - * Data holder for claim mappings. - */ -public class ClaimMappingDto implements Serializable { - private static final long serialVersionUID = 1L; - - @SerializedName("remoteClaim") - private String remoteClaim; - @SerializedName("localClaim") - private String localClaim; - - public ClaimMappingDto() { - - } - - public ClaimMappingDto(String remoteClaim, String localClaim) { - - this.remoteClaim = remoteClaim; - this.localClaim = localClaim; - } - - public String getRemoteClaim() { - - return remoteClaim; - } - - public void setRemoteClaim(String remoteClaim) { - - this.remoteClaim = remoteClaim; - } - - public String getLocalClaim() { - - return localClaim; - } - - public void setLocalClaim(String localClaim) { - - this.localClaim = localClaim; - } - - @Override - public boolean equals(Object o) { - - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClaimMappingDto that = (ClaimMappingDto) o; - return Objects.equals(localClaim, that.localClaim); - } - - @Override - public int hashCode() { - - return Objects.hash(localClaim); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ClaimValueDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ClaimValueDTO.java deleted file mode 100644 index 920015e484..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ClaimValueDTO.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.wso2.apk.enforcer.commons.dto; - -public class ClaimValueDTO { - private Object value; - private String type; - - public ClaimValueDTO(final Object value, final String type) { - this.value = value; - this.type = type; - } - public Object getValue() { - return value; - } - - public String getType() { - return type; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionResponseDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionResponseDTO.java deleted file mode 100644 index d7b43d7c3d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionResponseDTO.java +++ /dev/null @@ -1,89 +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.commons.dto; - -import java.io.InputStream; -import java.util.Map; - -/** - * Representation of Extension Response Information received after processing the Request/Response. - */ -public class ExtensionResponseDTO { - - // Response Status type. Should be a value of ExtensionResponseStatus enum. - String responseStatus; - // HTTP status code to set - int statusCode; - // Payload to set - InputStream payload; - // Transport headers to set - Map headers; - // customProperty map to set - Map customProperty; - - public int getStatusCode() { - - return statusCode; - } - - public void setStatusCode(int statusCode) { - - this.statusCode = statusCode; - } - - public InputStream getPayload() { - - return payload; - } - - public void setPayload(InputStream payload) { - - this.payload = payload; - } - - public Map getHeaders() { - - return headers; - } - - public void setHeaders(Map headers) { - - this.headers = headers; - } - - public String getResponseStatus() { - - return responseStatus; - } - - public void setResponseStatus(String responseStatus) { - - this.responseStatus = responseStatus; - } - - public Map getCustomProperty() { - - return customProperty; - } - - public void setCustomProperty(Map customProperty) { - - this.customProperty = customProperty; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionResponseStatus.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionResponseStatus.java deleted file mode 100644 index 62bd2f4f5b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionResponseStatus.java +++ /dev/null @@ -1,27 +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.commons.dto; - -/** - * Enum holding values for ExtensionResponseStatus. - */ -public enum ExtensionResponseStatus { - RETURN_RESPONSE, - CONTINUE, - RETURN_ERROR -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionType.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionType.java deleted file mode 100644 index 8ddcba7761..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ExtensionType.java +++ /dev/null @@ -1,26 +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.commons.dto; - -/** - * Enum holding values for extension types. - */ -public enum ExtensionType { - AUTHENTICATION, - THROTTLING -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWKSConfigurationDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWKSConfigurationDTO.java deleted file mode 100644 index fe806fd453..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWKSConfigurationDTO.java +++ /dev/null @@ -1,69 +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.commons.dto; - - -import java.security.cert.Certificate; - -/** - * Holds configurations related to JWKS. - */ -public class JWKSConfigurationDTO { - private String url; - private boolean enabled; - private Certificate certificate; - - public String getUrl() { - - return url; - } - - public void setUrl(String url) { - - this.url = url; - } - - public boolean isEnabled() { - - return enabled; - } - - public void setEnabled(boolean enabled) { - - this.enabled = enabled; - } - - public JWKSConfigurationDTO(String url, boolean enabled) { - - this.url = url; - this.enabled = enabled; - } - - public JWKSConfigurationDTO() { - - } - - public Certificate getCertificate() { - return certificate; - } - - public void setCertificate(Certificate certificate) { - this.certificate = certificate; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTConfigurationDto.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTConfigurationDto.java deleted file mode 100644 index 07a296144c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTConfigurationDto.java +++ /dev/null @@ -1,198 +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.commons.dto; - -import java.security.PrivateKey; -import java.security.cert.Certificate; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * Holds configs related to jwt generation. - */ -public class JWTConfigurationDto { - - private boolean enabled = false; - private String jwtHeader = "X-JWT-Assertion"; - private String consumerDialectUri = "http://wso2.org/claims"; - private String signatureAlgorithm = "SHA256withRSA"; - private String encoding = "Base64"; - private String gatewayJWTGeneratorImpl = "org.wso2.apk.enforcer.commons.jwtgenerator.APIMgtGatewayJWTGeneratorImpl"; - private Map tokenIssuerDtoMap = new HashMap(); - private Set jwtExcludedClaims = new HashSet<>(); - private Certificate publicCert; - private PrivateKey privateKey; - private long ttl; - private Map customClaims = new HashMap<>(); - - private boolean useKid; - - public String getKidValue() { - - return kidValue; - } - - public void setKidValue(String kidValue) { - - this.kidValue = kidValue; - } - - private String kidValue; - public JWTConfigurationDto() { - - } - - public JWTConfigurationDto(final boolean enabled, final String jwtHeader, - final String signatureAlgorithm, final String encoding, - final Certificate publicCert, final PrivateKey privateKey, final long ttl) { - this.enabled = enabled; - this.jwtHeader = jwtHeader; - this.signatureAlgorithm = signatureAlgorithm; - this.encoding = encoding; - this.publicCert = publicCert; - this.privateKey = privateKey; - this.ttl = ttl; - } - - public boolean useKid() { - return useKid; - } - - public void setUseKid(boolean useKid) { - this.useKid = useKid; - } - - public boolean isEnabled() { - - return enabled; - } - - public void setEnabled(boolean enabled) { - - this.enabled = enabled; - } - - public String getJwtHeader() { - - return jwtHeader; - } - - public void setJwtHeader(String jwtHeader) { - - this.jwtHeader = jwtHeader; - } - - public String getConsumerDialectUri() { - - return consumerDialectUri; - } - - public void setConsumerDialectUri(String consumerDialectUri) { - - this.consumerDialectUri = consumerDialectUri; - } - - public String getSignatureAlgorithm() { - - return signatureAlgorithm; - } - - public String getEncoding() { - - return encoding; - } - - public void setSignatureAlgorithm(String signatureAlgorithm) { - - this.signatureAlgorithm = signatureAlgorithm; - } - - public String getGatewayJWTGeneratorImpl() { - - return gatewayJWTGeneratorImpl; - } - - public void setGatewayJWTGeneratorImpl(String gatewayJWTGeneratorImpl) { - - this.gatewayJWTGeneratorImpl = gatewayJWTGeneratorImpl; - } - - public void setEncoding(String encoding) { - - this.encoding = encoding; - } - - public Set getJWTExcludedClaims() { - - return jwtExcludedClaims; - } - - public Certificate getPublicCert() { - - return publicCert; - } - - public void setPublicCert(Certificate publicCert) { - - this.publicCert = publicCert; - } - - public PrivateKey getPrivateKey() { - - return privateKey; - } - - public void setPrivateKey(PrivateKey privateKey) { - - this.privateKey = privateKey; - } - - public void setTtl(long ttl) { - - this.ttl = ttl; - } - - public Map getCustomClaims() { - - return customClaims; - } - - public long getTTL() { - - return ttl; - } - - public void populateConfigValues(final boolean enabled, final String jwtHeader, - final String signatureAlgorithm, final String encoding, - final Certificate publicCert, final PrivateKey privateKey, final long ttl, final Map customClaims,boolean useKid,String kidValue) { - this.enabled = enabled; - this.jwtHeader = jwtHeader; - this.signatureAlgorithm = signatureAlgorithm; - this.encoding = encoding; - this.publicCert = publicCert; - this.privateKey = privateKey; - this.ttl = ttl; - this.customClaims = customClaims; - this.useKid = useKid; - this.kidValue = kidValue; - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTInfoDto.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTInfoDto.java deleted file mode 100644 index 47137e9b79..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTInfoDto.java +++ /dev/null @@ -1,248 +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.commons.dto; - -import org.apache.commons.lang3.SerializationUtils; - -import java.util.HashMap; -import java.util.Map; - -/** - * Holds information related to jwt token. - * - */ -public class JWTInfoDto { - private String applicationTier; - private String keyType; - private String version; - private String applicationName; - private String endUser; - private int endUserTenantId; - private String applicationUUId; - private String subscriber; - private String subscriptionTier; - private String applicationId; - private String apiContext; - private String apiName; - private JWTValidationInfo jwtValidationInfo; - private Map appAttributes = new HashMap<>(); - private String sub; - private String[] organizations; - private Map claims = new HashMap<>(); - - public JWTInfoDto() { - - } - - public JWTInfoDto(JWTInfoDto jwtInfoDto) { - - this.applicationId = jwtInfoDto.getApplicationId(); - this.keyType = jwtInfoDto.getKeyType(); - this.version = jwtInfoDto.getVersion(); - this.applicationName = jwtInfoDto.getApplicationName(); - this.endUser = jwtInfoDto.getEndUser(); - this.endUserTenantId = jwtInfoDto.getEndUserTenantId(); - this.applicationUUId = jwtInfoDto.getApplicationUUId(); - this.subscriber = jwtInfoDto.getSubscriber(); - this.subscriptionTier = jwtInfoDto.getSubscriptionTier(); - this.applicationTier = jwtInfoDto.getApplicationTier(); - this.apiContext = jwtInfoDto.getApiContext(); - this.apiName = jwtInfoDto.getApiName(); - this.jwtValidationInfo = new JWTValidationInfo(jwtInfoDto.getJwtValidationInfo()); - this.appAttributes = jwtInfoDto.getAppAttributes(); - this.sub = jwtInfoDto.getSub(); - this.organizations = SerializationUtils.clone(jwtInfoDto.getOrganizations()); - } - - public String getApplicationTier() { - - return applicationTier; - } - - public void setApplicationTier(String applicationTier) { - - this.applicationTier = applicationTier; - } - - public String getKeyType() { - - return keyType; - } - - public void setKeyType(String keyType) { - - this.keyType = keyType; - } - - public String getVersion() { - - return version; - } - - public void setVersion(String version) { - - this.version = version; - } - - public String getApplicationName() { - - return applicationName; - } - - public void setApplicationName(String applicationName) { - - this.applicationName = applicationName; - } - - public void setClaims(Map claims) { - this.claims = claims; - } - - public Map getClaims() { - return claims; - } - - public String getEndUser() { - - return endUser; - } - - public void setEndUser(String endUser) { - - this.endUser = endUser; - } - - public int getEndUserTenantId() { - - return endUserTenantId; - } - - public void setEndUserTenantId(int endUserTenantId) { - - this.endUserTenantId = endUserTenantId; - } - - public String getApplicationUUId() { - - return applicationUUId; - } - - public void setApplicationUUId(String applicationUUId) { - - this.applicationUUId = applicationUUId; - } - - public String getSubscriber() { - - return subscriber; - } - - public void setSubscriber(String subscriber) { - - this.subscriber = subscriber; - } - - public String getSubscriptionTier() { - - return subscriptionTier; - } - - public void setSubscriptionTier(String subscriptionTier) { - - this.subscriptionTier = subscriptionTier; - } - - public String getApplicationId() { - - return applicationId; - } - - public void setApplicationId(String applicationId) { - - this.applicationId = applicationId; - } - - public String getApiContext() { - - return apiContext; - } - - public void setApiContext(String apiContext) { - - this.apiContext = apiContext; - } - - public JWTValidationInfo getJwtValidationInfo() { - - return jwtValidationInfo; - } - - public void setJwtValidationInfo(JWTValidationInfo jwtValidationInfo) { - - this.jwtValidationInfo = jwtValidationInfo; - } - - /*public MessageContext getMessageContext() { - - return messageContext; - } - - public void setMessageContext(MessageContext messageContext) { - - this.messageContext = messageContext; - }*/ - - public String getApiName() { - - return apiName; - } - - public void setApiName(String apiName) { - - this.apiName = apiName; - } - - public Map getAppAttributes() { - - return appAttributes; - } - - public void setAppAttributes(Map appAttributes) { - - this.appAttributes = appAttributes; - } - - public String getSub() { - return sub; - } - - public void setSub(String sub) { - this.sub = sub; - } - - public String[] getOrganizations() { - - return SerializationUtils.clone(organizations); - } - - public void setOrganizations(String[] organizations) { - - this.organizations = SerializationUtils.clone(organizations); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTValidationInfo.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTValidationInfo.java deleted file mode 100644 index ed818a6f2a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/JWTValidationInfo.java +++ /dev/null @@ -1,175 +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.commons.dto; - -import com.nimbusds.jwt.JWTClaimsSet; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Holds jwt validation related information. - */ -public class JWTValidationInfo implements Serializable { - private static final long serialVersionUID = 1L; - - private String user; - private long expiryTime; - private String consumerKey; - private boolean valid; - private List scopes = new ArrayList<>(); - private Map claims = new HashMap<>(); - private int validationCode; - private String keyManager; - private String identifier; - private JWTClaimsSet jwtClaimsSet; - private String token; - private List audience = new ArrayList<>(); - - public JWTValidationInfo() { - - } - - public JWTValidationInfo(JWTValidationInfo jwtValidationInfo) { - - this.user = jwtValidationInfo.getUser(); - this.expiryTime = jwtValidationInfo.getExpiryTime(); - this.consumerKey = jwtValidationInfo.getConsumerKey(); - this.valid = jwtValidationInfo.isValid(); - this.scopes = jwtValidationInfo.getScopes(); - this.claims = jwtValidationInfo.getClaims(); - this.validationCode = jwtValidationInfo.getValidationCode(); - this.keyManager = jwtValidationInfo.getKeyManager(); - this.audience = jwtValidationInfo.audience; - } - - public List getAudience() { - return audience; - } - - public void setAudience(List audience) { - this.audience = audience; - } - - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public JWTClaimsSet getJwtClaimsSet() { - return jwtClaimsSet; - } - - public void setJwtClaimsSet(JWTClaimsSet jwtClaimsSet) { - this.jwtClaimsSet = jwtClaimsSet; - } - - public String getUser() { - - return user; - } - - public void setUser(String user) { - - this.user = user; - } - - public long getExpiryTime() { - - return expiryTime; - } - - public void setExpiryTime(long expiryTime) { - - this.expiryTime = expiryTime; - } - - public boolean isValid() { - - return valid; - } - - public void setValid(boolean valid) { - - this.valid = valid; - } - - public List getScopes() { - - return scopes; - } - - public void setScopes(List scopes) { - - this.scopes = scopes; - } - - public Map getClaims() { - - return claims; - } - - public void setClaims(Map claims) { - - this.claims = claims; - } - - public String getConsumerKey() { - - return consumerKey; - } - - public void setConsumerKey(String consumerKey) { - - this.consumerKey = consumerKey; - } - - public int getValidationCode() { - - return validationCode; - } - - public void setValidationCode(int validationCode) { - - this.validationCode = validationCode; - } - - public String getKeyManager() { - - return keyManager; - } - - public void setKeyManager(String keyManager) { - - this.keyManager = keyManager; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/MsgInfoDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/MsgInfoDTO.java deleted file mode 100644 index 44a231b17f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/MsgInfoDTO.java +++ /dev/null @@ -1,101 +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.commons.dto; - -import org.wso2.apk.enforcer.commons.extensionlistener.PayloadHandler; - -import java.util.Map; - -/** - * Representation of Message Information of Request/Response. - */ -public class MsgInfoDTO { - - // Transport Headers - Map headers; - // Reference object to consume payload if needed - PayloadHandler payloadHandler; - // invoked resource - String resource; - // resource template - String electedResource; - String httpMethod; - // Unique Id to identify the message - String messageId; - - public PayloadHandler getPayloadHandler() { - - return payloadHandler; - } - - public void setPayloadHandler(PayloadHandler payloadHandler) { - - this.payloadHandler = payloadHandler; - } - - public Map getHeaders() { - - return headers; - } - - public void setHeaders(Map headers) { - - this.headers = headers; - } - - public String getResource() { - - return resource; - } - - public void setResource(String resource) { - - this.resource = resource; - } - - public String getHttpMethod() { - - return httpMethod; - } - - public void setHttpMethod(String httpMethod) { - - this.httpMethod = httpMethod; - } - - public String getMessageId() { - - return messageId; - } - - public void setMessageId(String messageId) { - - this.messageId = messageId; - } - - public String getElectedResource() { - - return electedResource; - } - - public void setElectedResource(String electedResource) { - - this.electedResource = electedResource; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/QueryAnalyzerResponseDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/QueryAnalyzerResponseDTO.java deleted file mode 100644 index 2a6a867520..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/QueryAnalyzerResponseDTO.java +++ /dev/null @@ -1,47 +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.commons.dto; - -import java.util.ArrayList; -import java.util.List; - -/** - * DTO class to hold GraphQL query analyzer response information. - */ -public class QueryAnalyzerResponseDTO { - - boolean isSuccess; - List errorList = new ArrayList<>(); - - public boolean isSuccess() { - return isSuccess; - } - - public void setSuccess(boolean success) { - isSuccess = success; - } - - public List getErrorList() { - return errorList; - } - - public void addErrorToList(String error) { - this.errorList.add(error); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/RequestContextDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/RequestContextDTO.java deleted file mode 100644 index 09e72a7a8e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/RequestContextDTO.java +++ /dev/null @@ -1,68 +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.commons.dto; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import java.util.Map; - -/** - * Representation of Request Information. - */ -public class RequestContextDTO { - private static final Log log = LogFactory.getLog(RequestContextDTO.class); - - // request message information - private MsgInfoDTO msgInfo; - // invoked API request information - private APIRequestInfoDTO apiRequestInfo; - // custom property map used to populate customProperty key template value - private Map customProperty; - - public MsgInfoDTO getMsgInfo() { - - return msgInfo; - } - - public void setMsgInfo(MsgInfoDTO msgInfo) { - - this.msgInfo = msgInfo; - } - - public APIRequestInfoDTO getApiRequestInfo() { - - return apiRequestInfo; - } - - public void setApiRequestInfo(APIRequestInfoDTO apiRequestInfo) { - - this.apiRequestInfo = apiRequestInfo; - } - - public Map getCustomProperty() { - - return customProperty; - } - - public void setCustomProperty(Map customProperty) { - - this.customProperty = customProperty; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ResponseContextDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ResponseContextDTO.java deleted file mode 100644 index fc2a370c5a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/ResponseContextDTO.java +++ /dev/null @@ -1,62 +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.commons.dto; - -/** - * Representation of Response Information. - */ -public class ResponseContextDTO { - - // response message information - MsgInfoDTO msgInfo; - // invoked API request information related to the response - APIRequestInfoDTO apiRequestInfo; - // status code received from backend - int statusCode; - - public APIRequestInfoDTO getApiRequestInfo() { - - return apiRequestInfo; - } - - public void setApiRequestInfo(APIRequestInfoDTO apiRequestInfo) { - - this.apiRequestInfo = apiRequestInfo; - } - - public int getStatusCode() { - - return statusCode; - } - - public void setStatusCode(int statusCode) { - - this.statusCode = statusCode; - } - - public MsgInfoDTO getMsgInfo() { - - return msgInfo; - } - - public void setMsgInfo(MsgInfoDTO msgInfo) { - - this.msgInfo = msgInfo; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/TokenIssuerDto.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/TokenIssuerDto.java deleted file mode 100644 index 8da6bd682d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/dto/TokenIssuerDto.java +++ /dev/null @@ -1,133 +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.commons.dto; - -import java.security.cert.Certificate; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Holds data related to token issuers. - */ -public class TokenIssuerDto { - private String issuer; - private boolean disableDefaultClaimMapping = false; - private Map claimConfigurations = new HashMap<>(); - private JWKSConfigurationDTO jwksConfigurationDTO = new JWKSConfigurationDTO(); - private Certificate certificate; - private String consumerKeyClaim; - private String scopesClaim; - private String audience; - - public TokenIssuerDto() { - } - - public TokenIssuerDto(String issuer) { - - this.issuer = issuer; - } - - public String getIssuer() { - - return issuer; - } - - public void setIssuer(String issuer) { - - this.issuer = issuer; - } - - public Map getClaimConfigurations() { - - return claimConfigurations; - } - - public void addClaimMapping(ClaimMappingDto claimMappingDto) { - claimConfigurations.put(claimMappingDto.getRemoteClaim(), claimMappingDto); - } - - public JWKSConfigurationDTO getJwksConfigurationDTO() { - - return jwksConfigurationDTO; - } - - public boolean isDisableDefaultClaimMapping() { - - return disableDefaultClaimMapping; - } - - public void setDisableDefaultClaimMapping(boolean disableDefaultClaimMapping) { - - this.disableDefaultClaimMapping = disableDefaultClaimMapping; - } - - public void setJwksConfigurationDTO(JWKSConfigurationDTO jwksConfigurationDTO) { - - this.jwksConfigurationDTO = jwksConfigurationDTO; - } - - public String getConsumerKeyClaim() { - - return consumerKeyClaim; - } - - public void setConsumerKeyClaim(String consumerKeyClaim) { - - this.consumerKeyClaim = consumerKeyClaim; - } - - public String getScopesClaim() { - - return scopesClaim; - } - - public void setScopesClaim(String scopesClaim) { - - this.scopesClaim = scopesClaim; - } - - public void addClaimMappings(ClaimMappingDto[] claimMappingDto) { - - for (ClaimMappingDto mappingDto : claimMappingDto) { - addClaimMapping(mappingDto); - } - } - - public Certificate getCertificate() { - - return certificate; - } - - public void setCertificate(Certificate certificate) { - - this.certificate = certificate; - } - - public String getAudience() { - return audience; - } - - public void setAudience(String audience) { - this.audience = audience; - } - public void setClaimMappings(Map claimMappingDtos) { - this.claimConfigurations = claimMappingDtos; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/APISecurityException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/APISecurityException.java deleted file mode 100644 index 8b2b984b7c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/APISecurityException.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2020, 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.commons.exception; - -/** - * Represents an API security violation or a system error that may have occurred - * while validating security requirements. - */ -public class APISecurityException extends Exception { - - private int errorCode; - private int statusCode; - - public APISecurityException(int statusCode, int errorCode, String message) { - super(message); - this.statusCode = statusCode; - this.errorCode = errorCode; - } - - public APISecurityException(int statusCode, int errorCode, String message, Throwable cause) { - super(message, cause); - this.statusCode = statusCode; - this.errorCode = errorCode; - } - - public int getErrorCode() { - return errorCode; - } - - public int getStatusCode() { - return statusCode; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/DataLoadingException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/DataLoadingException.java deleted file mode 100644 index 25cf46c20b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/DataLoadingException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2020, 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.commons.exception; - -/** - * Exception thrown when loading Subscriptions. - */ -public class DataLoadingException extends EnforcerException { - - public DataLoadingException(String message) { - - super(message); - } - - public DataLoadingException(String message, Throwable cause) { - - super(message, cause); - } - - public DataLoadingException(Throwable cause) { - - super(cause); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/DiscoveryException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/DiscoveryException.java deleted file mode 100644 index 6bc1db7d28..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/DiscoveryException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2020, 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.commons.exception; - -/** - * An exception definition for discovery service related errors. - */ -public class DiscoveryException extends EnforcerException { - public DiscoveryException(String msg) { - super(msg); - } - - public DiscoveryException(String msg, Throwable e) { - super(msg, e); - } - - public DiscoveryException(Throwable throwable) { - super(throwable); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/EnforcerException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/EnforcerException.java deleted file mode 100644 index 580a0d018d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/EnforcerException.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2020, 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.commons.exception; - -/** - * This is the custom exception class for API management. - */ -public class EnforcerException extends Exception { - - public EnforcerException(String msg) { - super(msg); - } - - public EnforcerException(String msg, Throwable e) { - super(msg, e); - } - - public EnforcerException(Throwable throwable) { - super(throwable); - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ErrorHandler.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ErrorHandler.java deleted file mode 100644 index de3e382822..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ErrorHandler.java +++ /dev/null @@ -1,59 +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.commons.exception; - -/** - * This error handler interface must use in all exceptions class, for example please see CommonGatewayException class. - */ -public interface ErrorHandler { - /** - * Get error code that defined in the enum. - * - * @return error code - */ - long getErrorCode(); - - /** - * Get error message that defined in the enum. - * - * @return error message - */ - String getErrorMessage(); - - /** - * Get error description that defined in the enum. - * - * @return error description. - */ - String getErrorDescription(); - - /** - * Get Http status code that defined in the enum. - * - * @return error code. - */ - int getHttpStatusCode(); - - /** - * Return true if stack trace to print. - * - * @return - */ - boolean printStackTrace(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ErrorItem.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ErrorItem.java deleted file mode 100644 index df41e8cbfb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ErrorItem.java +++ /dev/null @@ -1,91 +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.commons.exception; - -/** - * ErrorHandler implementation for dynamic error items. - */ -public class ErrorItem implements ErrorHandler { - - private String message; - private String description; - private long errorCode; - private int statusCode; - private boolean stackTrace = false; - - - public ErrorItem(String message, String description, long errorCode, int statusCode, boolean stackTrace) { - this.message = message; - this.errorCode = errorCode; - this.statusCode = statusCode; - this.description = description; - this.stackTrace = stackTrace; - } - - public void setErrorCode(long errorCode) { - this.errorCode = errorCode; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setMessage(String message) { - this.message = message; - } - - public void setStatusCode(int statusCode) { - this.statusCode = statusCode; - } - - public ErrorItem() { - } - - public ErrorItem(String message, String description, long errorCode, int statusCode) { - this.message = message; - this.errorCode = errorCode; - this.statusCode = statusCode; - this.description = description; - } - - @Override - public long getErrorCode() { - return errorCode; - } - - @Override - public String getErrorMessage() { - return message; - } - - @Override - public String getErrorDescription() { - return description; - } - - @Override - public int getHttpStatusCode() { - return statusCode; - } - - @Override - public boolean printStackTrace() { - return stackTrace; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ExceptionCodes.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ExceptionCodes.java deleted file mode 100644 index e6aeb5f2bb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/ExceptionCodes.java +++ /dev/null @@ -1,123 +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.commons.exception; - -import java.util.Arrays; - -/** - * This enum class holds error codes that we need to pass to upper level. For example, to the UI. - * You have to define your custom error codes here. - */ -public enum -ExceptionCodes implements ErrorHandler { - - INTERNAL_ERROR(900967, "General Error", 500, "Server Error Occurred"); - - private final long errorCode; - private final String errorMessage; - private final int httpStatusCode; - private final String errorDescription; - private boolean stackTrace = false; - - /** - * @param errorCode This is unique error code that pass to upper level. - * @param msg The error message that you need to pass along with the error code. - * @param httpErrorCode This HTTP status code which should return from REST API layer. If you don't want to pass - * a http status code keep it blank. - * @param errorDescription The error description. - */ - ExceptionCodes(long errorCode, String msg, int httpErrorCode, String errorDescription, boolean stackTrace) { - this.errorCode = errorCode; - this.errorMessage = msg; - this.httpStatusCode = httpErrorCode; - this.errorDescription = errorDescription; - this.stackTrace = stackTrace; - } - - /** - * @param errorCode This is unique error code that pass to upper level. - * @param msg The error message that you need to pass along with the error code. - * @param httpErrorCode This HTTP status code which should return from REST API layer. If you don't want to pass - * a http status code keep it blank. - * @param errorDescription The error description. - */ - ExceptionCodes(long errorCode, String msg, int httpErrorCode, String errorDescription) { - this.errorCode = errorCode; - this.errorMessage = msg; - this.httpStatusCode = httpErrorCode; - this.errorDescription = errorDescription; - } - - @Override - public long getErrorCode() { - return this.errorCode; - } - - @Override - public String getErrorMessage() { - return this.errorMessage; - } - - @Override - public int getHttpStatusCode() { - return this.httpStatusCode; - } - - @Override - public String getErrorDescription() { - return this.errorDescription; - } - - public boolean printStackTrace() { - - return stackTrace; - } - - /** - * Create an ErrorHandler instance with the provided ExceptionCode filled with some dynamic input values. - * - * @param errorHandler ErrorHandler or ExceptionCode object - * @param params dynamic values to be filled - * @return ErrorHandler instance with the provided ExceptionCode filled with some dynamic input values - */ - public static ErrorHandler from(ErrorHandler errorHandler, String... params) { - String message = errorHandler.getErrorMessage(); - String description = errorHandler.getErrorDescription(); - - if (params != null && params.length > 0) { - int placesToFormatInMessage = message.length() - message.replace("%", "").length(); - int placesToFormatInDescription = description.length() - description.replace("%", ""). - length(); - - String[] part1 = Arrays.copyOfRange(params, 0, placesToFormatInMessage); - String[] part2 = Arrays.copyOfRange(params, placesToFormatInMessage, - placesToFormatInMessage + placesToFormatInDescription); - - if (placesToFormatInMessage > 0) { - message = String.format(message, part1); - } - if (placesToFormatInDescription > 0) { - description = String.format(description, part2); - } - } - return new ErrorItem(message, description, errorHandler.getErrorCode(), errorHandler.getHttpStatusCode(), - errorHandler.printStackTrace()); - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/JWTGeneratorException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/JWTGeneratorException.java deleted file mode 100644 index eb3abdeb80..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/exception/JWTGeneratorException.java +++ /dev/null @@ -1,83 +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.commons.exception; - -/** - * Exception related to jwt generation. - */ -public class JWTGeneratorException extends Exception { - private ErrorHandler errorHandler; - - /** - * Get error handler object. - * - * @return ErrorHandler - */ - public ErrorHandler getErrorHandler() { - return errorHandler; - } - - public JWTGeneratorException(String msg) { - super(msg); - this.errorHandler = ExceptionCodes.INTERNAL_ERROR; - } - - public JWTGeneratorException(String msg, Throwable e) { - super(msg, e); - this.errorHandler = ExceptionCodes.INTERNAL_ERROR; - } - - public JWTGeneratorException(Throwable throwable) { - super(throwable); - this.errorHandler = ExceptionCodes.INTERNAL_ERROR; - } - - /** - * This is a default constructure where you can pass error code to error DTO. - * - * @param message Error message - * @param code Exception code that need to pass to the error DTO - */ - public JWTGeneratorException(String message, ErrorHandler code) { - super(message); - this.errorHandler = code; - } - - /** - * This is a default constructure where you can pass error code to error DTO. - * - * @param code Exception code that need to pass to the error DTO - */ - public JWTGeneratorException(ErrorHandler code) { - super(code.getErrorCode() + ":" + code.getErrorMessage() + "::" + code.getErrorDescription()); - this.errorHandler = code; - } - - /** - * This is a default constructure where you can pass error code to error DTO. - * - * @param message Error message - * @param cause throwable object. - * @param code Exception code that need to pass to the error DTO - */ - public JWTGeneratorException(String message, Throwable cause, ErrorHandler code) { - super(message, cause); - this.errorHandler = code; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/extensionlistener/ExtensionListener.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/extensionlistener/ExtensionListener.java deleted file mode 100644 index 2b5f7ba598..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/extensionlistener/ExtensionListener.java +++ /dev/null @@ -1,67 +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.commons.extensionlistener; - -import org.wso2.apk.enforcer.commons.dto.ExtensionResponseDTO; -import org.wso2.apk.enforcer.commons.dto.RequestContextDTO; -import org.wso2.apk.enforcer.commons.dto.ResponseContextDTO; - -/** - * This Interface is providing functionality to listen and extend request/response - * handler/filter flows in API Gateway. - * You can implement pre-process request, post-process request, pre-process response and post-process response flows - * of gateway handlers/filters by implementing this interface. Furthermore you need to register your implementation as - * an OSGI service for this interface with the type using ExtensionType enum. - * This interface provides a method to read the ExtensionType. - */ -public interface ExtensionListener { - - /*** - * Pre process Request. - * @param requestContextDTO RequestContextDTO - */ - - ExtensionResponseDTO preProcessRequest(RequestContextDTO requestContextDTO); - - /*** - * Post process Request. - * @param requestContextDTO RequestContextDTO - */ - ExtensionResponseDTO postProcessRequest(RequestContextDTO requestContextDTO); - - /*** - * Pre process Response. - * @param responseContextDTO ResponseContextDTO - */ - ExtensionResponseDTO preProcessResponse(ResponseContextDTO responseContextDTO); - - /*** - * Post process Response. - * @param responseContextDTO ResponseContextDTO - */ - ExtensionResponseDTO postProcessResponse(ResponseContextDTO responseContextDTO); - - /** - * Returns the extension listener type. This should be a value from ExtensionType enum. - * - * @return ExtensionType enum value - */ - String getType(); - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/extensionlistener/PayloadHandler.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/extensionlistener/PayloadHandler.java deleted file mode 100644 index b650cdbe2e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/extensionlistener/PayloadHandler.java +++ /dev/null @@ -1,42 +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.commons.extensionlistener; - -import java.io.InputStream; - -/** - * This Interface is provides specific extension points to consume the payload from the related message context. - */ -public interface PayloadHandler { - - /** - * Consume and return the payload as String. - * - * @return String payload - * @throws Exception if an error occurs - */ - String consumeAsString() throws Exception; - - /** - * Consume and return payload as InputStream. - * - * @return InputStream payload - * @throws Exception if an error occurs - */ - InputStream consumeAsStream() throws Exception; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/FieldComplexityCalculatorImpl.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/FieldComplexityCalculatorImpl.java deleted file mode 100644 index 69afb7c3ca..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/FieldComplexityCalculatorImpl.java +++ /dev/null @@ -1,112 +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.commons.graphql; - -import graphql.analysis.FieldComplexityCalculator; -import graphql.analysis.FieldComplexityEnvironment; -import graphql.language.Argument; -import graphql.language.IntValue; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; -import org.wso2.apk.enforcer.commons.constants.GraphQLConstants; - -import java.math.BigInteger; -import java.util.List; -import java.util.Locale; - -/** - * Implementation for GraphQL query field complexity calculator. - */ -public class FieldComplexityCalculatorImpl implements FieldComplexityCalculator { - - private static final Log log = LogFactory.getLog(FieldComplexityCalculatorImpl.class); - protected JSONParser jsonParser = new JSONParser(); - protected JSONObject policyDefinition; - - public FieldComplexityCalculatorImpl(String accessControlPolicy) throws ParseException { - if (accessControlPolicy == null) { - policyDefinition = new JSONObject(); - } else { - JSONObject jsonObject = (JSONObject) jsonParser.parse(accessControlPolicy); - policyDefinition = (JSONObject) jsonObject.get(GraphQLConstants.QUERY_ANALYSIS_COMPLEXITY); - } - } - - /** - * Calculate complexity. - * - * @param fieldComplexityEnvironment FieldComplexityEnvironment - * @param childComplexity Child Complexity value - */ - @Override - public int calculate(FieldComplexityEnvironment fieldComplexityEnvironment, int childComplexity) { - - String fieldName = fieldComplexityEnvironment.getField().getName(); - String parentType = fieldComplexityEnvironment.getParentType().getName(); - List argumentList = fieldComplexityEnvironment.getField().getArguments(); - - int argumentsValue = getArgumentsValue(argumentList); - int customFieldComplexity = getCustomComplexity(fieldName, parentType, policyDefinition); - return (argumentsValue * (customFieldComplexity + childComplexity)); - } - - private int getCustomComplexity(String fieldName, String parentType, JSONObject policyDefinition) { - - JSONObject customComplexity = (JSONObject) policyDefinition.get(parentType); - if (customComplexity != null && customComplexity.get(fieldName) != null) { - return ((Long) customComplexity.get(fieldName)).intValue(); // Returns custom complexity value - } else { - if (log.isDebugEnabled()) { - log.debug("No custom complexity value was assigned for " + fieldName + " under type " + parentType); - } - return 1; // Returns default complexity value - } - } - - private int getArgumentsValue(List argumentList) { - - int argumentValue = 0; - if (argumentList.size() > 0) { - for (Argument object : argumentList) { - String argumentName = object.getName(); - // The below list of slicing arguments (keywords) effect query complexity to multiply by the factor - // given as the value of the argument. - List slicingArguments = GraphQLConstants.QUERY_COMPLEXITY_SLICING_ARGS; - if (slicingArguments.contains(argumentName.toLowerCase(Locale.ROOT))) { - BigInteger value = null; - if (object.getValue() instanceof IntValue) { - value = ((IntValue) object.getValue()).getValue(); - } - int val = 0; - if (value != null) { - val = value.intValue(); - } - argumentValue = argumentValue + val; - } else { - argumentValue += 1; - } - } - } else { - argumentValue = 1; - } - return argumentValue; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/GraphQLProcessorUtil.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/GraphQLProcessorUtil.java deleted file mode 100644 index 34bcf9cbf7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/GraphQLProcessorUtil.java +++ /dev/null @@ -1,92 +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.commons.graphql; - -import graphql.language.Field; -import graphql.language.OperationDefinition; -import graphql.language.Selection; -import graphql.schema.idl.TypeDefinitionRegistry; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import java.util.ArrayList; -import java.util.List; - -/** - * Util class to handle graphQL specific API request processing. - */ -public class GraphQLProcessorUtil { - - private static final Log log = LogFactory.getLog(GraphQLProcessorUtil.class); - - /** - * This method used to extract operation List. - * - * @param operation operation - * @param typeDefinitionRegistry TypeDefinitionRegistry - * @return operationList - */ - public static ArrayList getOperationList(OperationDefinition operation, - TypeDefinitionRegistry typeDefinitionRegistry) { - ArrayList operationArray = new ArrayList<>(); - ArrayList supportedFields = GraphQLSchemaDefinitionUtil.getSupportedFields(typeDefinitionRegistry, - operation.getOperation().toString()); - getNestedLevelOperations(operation.getSelectionSet().getSelections(), supportedFields, operationArray); - return operationArray; - } - - /** - * This method used to extract operation List as a comma seperated string. - * - * @param operation operation - * @param typeDefinitionRegistry TypeDefinitionRegistry - * @return operationList - */ - public static String getOperationListAsString(OperationDefinition operation, - TypeDefinitionRegistry typeDefinitionRegistry) { - ArrayList operationArray = getOperationList(operation, typeDefinitionRegistry); - return String.join(",", operationArray); - } - - /** - * This method support to extracted nested level operations. - * - * @param selectionList selection List - * @param supportedFields supportedFields - * @param operationArray operationArray - */ - public static void getNestedLevelOperations(List selectionList, ArrayList supportedFields, - ArrayList operationArray) { - for (Selection selection : selectionList) { - if (!(selection instanceof Field)) { - continue; - } - Field levelField = (Field) selection; - if (!operationArray.contains(levelField.getName()) && - supportedFields.contains(levelField.getName())) { - operationArray.add(levelField.getName()); - if (log.isDebugEnabled()) { - log.debug("Extracted operation: " + levelField.getName()); - } - } - if (levelField.getSelectionSet() != null) { - getNestedLevelOperations(levelField.getSelectionSet().getSelections(), supportedFields, operationArray); - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/GraphQLSchemaDefinitionUtil.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/GraphQLSchemaDefinitionUtil.java deleted file mode 100644 index a58089650d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/GraphQLSchemaDefinitionUtil.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.wso2.apk.enforcer.commons.graphql; - -import graphql.language.FieldDefinition; -import graphql.language.ObjectTypeDefinition; -import graphql.language.OperationTypeDefinition; -import graphql.language.SchemaDefinition; -import graphql.language.TypeDefinition; -import graphql.schema.idl.SchemaParser; -import graphql.schema.idl.TypeDefinitionRegistry; -import graphql.schema.idl.UnExecutableSchemaGenerator; -import org.wso2.apk.enforcer.commons.constants.GraphQLConstants; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Optional; - -/** - * Contains utils for processing GraphQLSchemaDefinition - */ -public class GraphQLSchemaDefinitionUtil { - - /** - * Extract GraphQL Operations from given schema. - * - * @param typeRegistry graphQL Schema Type Registry - * @param type operation type string - * @return the arrayList of APIOperationsDTO - */ - public static ArrayList getSupportedFields(TypeDefinitionRegistry typeRegistry, String type) { - ArrayList operationArray = new ArrayList<>(); - Map operationList = typeRegistry.types(); - for (Map.Entry entry : operationList.entrySet()) { - Optional schemaDefinition = typeRegistry.schemaDefinition(); - if (schemaDefinition.isPresent()) { - List operationTypeList = schemaDefinition.get().getOperationTypeDefinitions(); - for (OperationTypeDefinition operationTypeDefinition : operationTypeList) { - boolean canAddOperation = entry.getValue().getName() - .equalsIgnoreCase(operationTypeDefinition.getTypeName().getName()) && - (type == null || type.equals(operationTypeDefinition.getName().toUpperCase(Locale.ROOT))); - if (canAddOperation) { - addOperations(entry, operationArray); - break; - } - } - } else { - boolean canAddOperation = (entry.getValue().getName().equalsIgnoreCase(GraphQLConstants.GRAPHQL_QUERY) - || entry.getValue().getName().equalsIgnoreCase(GraphQLConstants.GRAPHQL_MUTATION) - || entry.getValue().getName().equalsIgnoreCase(GraphQLConstants.GRAPHQL_SUBSCRIPTION)) && - (type == null || type.equals(entry.getValue().getName().toUpperCase(Locale.ROOT))); - if (canAddOperation) { - addOperations(entry, operationArray); - } - } - } - return operationArray; - } - - /** - * Check subscription operation availability from given graphql schema. - * - * @param schema graphQL Schema - * @return the boolean value of subscription operation availability - */ - public static boolean isSubscriptionAvailable(String schema) { - SchemaParser schemaParser = new SchemaParser(); - TypeDefinitionRegistry typeRegistry = schemaParser.parse(schema); - return UnExecutableSchemaGenerator.makeUnExecutableSchema(typeRegistry).getSubscriptionType() != null ? - true : false; - } - - /** - * @param entry Entry - */ - private static ArrayList addOperations(Map.Entry entry, - ArrayList operationsArray) { - for (FieldDefinition fieldDef : ((ObjectTypeDefinition) entry.getValue()).getFieldDefinitions()) { - operationsArray.add(fieldDef.getName()); - } - return operationsArray; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/QueryAnalyzer.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/QueryAnalyzer.java deleted file mode 100644 index b7065adf93..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/QueryAnalyzer.java +++ /dev/null @@ -1,157 +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.commons.graphql; - -import graphql.ExecutionResult; -import graphql.GraphQL; -import graphql.GraphQLError; -import graphql.analysis.FieldComplexityCalculator; -import graphql.analysis.MaxQueryComplexityInstrumentation; -import graphql.analysis.MaxQueryDepthInstrumentation; -import graphql.schema.GraphQLSchema; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.json.simple.parser.ParseException; -import org.wso2.apk.enforcer.commons.dto.QueryAnalyzerResponseDTO; -import java.util.List; - -/** - * This class contains methods using for Graphql query depth and complexity analysis. - */ -public class QueryAnalyzer { - - private static final Log log = LogFactory.getLog(QueryAnalyzer.class); - private final GraphQLSchema schema; - - public QueryAnalyzer(GraphQLSchema schema) { - this.schema = schema; - } - - /** - * This method analyses the query depth. - * - * @param maxQueryDepth maximum query depth - * @param payload payload of the request - * @return true, if the query depth does not exceed the maximum value or false, if query depth exceeds the maximum - */ - public QueryAnalyzerResponseDTO analyseQueryDepth(int maxQueryDepth, String payload) { - - if (log.isDebugEnabled()) { - log.debug("Analyzing query depth for " + payload + " and max query depth:" + maxQueryDepth); - } - QueryAnalyzerResponseDTO queryAnalyzerResponseDTO = new QueryAnalyzerResponseDTO(); - - // If maxQueryDepth is a positive value, perform the depth limitation check. Otherwise, bypass the check. - if (maxQueryDepth > 0) { - MaxQueryDepthInstrumentation maxQueryDepthInstrumentation = - new MaxQueryDepthInstrumentation(maxQueryDepth); - GraphQL runtime = GraphQL.newGraphQL(schema).instrumentation(maxQueryDepthInstrumentation).build(); - - ExecutionResult executionResult = runtime.execute(payload); - List errors = executionResult.getErrors(); - if (errors.size() > 0) { - for (GraphQLError error : errors) { - queryAnalyzerResponseDTO.addErrorToList((error.getMessage())); - } - // TODO: https://github.com/wso2/carbon-apimgt/issues/8147 - queryAnalyzerResponseDTO.getErrorList().removeIf(s -> s.contains("non-nullable")); - if (queryAnalyzerResponseDTO.getErrorList().size() == 0) { - if (log.isDebugEnabled()) { - log.debug("Maximum query depth of " + maxQueryDepth + " was not exceeded"); - } - queryAnalyzerResponseDTO.setSuccess(true); - return queryAnalyzerResponseDTO; - } - log.error(queryAnalyzerResponseDTO.getErrorList().toString()); - queryAnalyzerResponseDTO.setSuccess(false); - return queryAnalyzerResponseDTO; - } - } - - queryAnalyzerResponseDTO.setSuccess(true); - return queryAnalyzerResponseDTO; - } - - /** - * This method analyses the query complexity. - * - * @param fieldComplexityCalculator Field Complexity Calculator - * @param maxQueryComplexity Maximum query complexity value - * @param payload payload of the request - * @return true, if query complexity does not exceed the maximum or false, if query complexity exceeds the maximum - */ - public QueryAnalyzerResponseDTO analyseQueryComplexity(int maxQueryComplexity, String payload, - FieldComplexityCalculator fieldComplexityCalculator) { - - if (log.isDebugEnabled()) { - log.debug("Analyzing query complexity for " + payload + " and max complexity: " + maxQueryComplexity); - } - QueryAnalyzerResponseDTO queryAnalyzerResponseDTO = new QueryAnalyzerResponseDTO(); - - // If maxQueryComplexity is a positive value, perform the complexity limitation check. - // Otherwise, bypass the check. - if (maxQueryComplexity > 0) { - MaxQueryComplexityInstrumentation maxQueryComplexityInstrumentation = - new MaxQueryComplexityInstrumentation(maxQueryComplexity, fieldComplexityCalculator); - GraphQL runtime = GraphQL.newGraphQL(schema).instrumentation(maxQueryComplexityInstrumentation).build(); - - ExecutionResult executionResult = runtime.execute(payload); - List errors = executionResult.getErrors(); - if (errors.size() > 0) { - for (GraphQLError error : errors) { - queryAnalyzerResponseDTO.addErrorToList((error.getMessage())); - } - // TODO: https://github.com/wso2/carbon-apimgt/issues/8147 - queryAnalyzerResponseDTO.getErrorList().removeIf(s -> s.contains("non-nullable")); - if (queryAnalyzerResponseDTO.getErrorList().size() == 0) { - if (log.isDebugEnabled()) { - log.debug("Maximum query complexity was not exceeded"); - } - queryAnalyzerResponseDTO.setSuccess(true); - } else { - log.error(queryAnalyzerResponseDTO.getErrorList()); - queryAnalyzerResponseDTO.getErrorList().clear(); - queryAnalyzerResponseDTO.addErrorToList("maximum query complexity exceeded"); - } - queryAnalyzerResponseDTO.setSuccess(false); - return queryAnalyzerResponseDTO; - } - } - - queryAnalyzerResponseDTO.setSuccess(true); - return queryAnalyzerResponseDTO; - } - - /** - * This method analyses the query complexity - * - * @param payload payload of the request - * @param complexityInfoJson gql complexity info in json string format - * @return true, if query complexity does not exceed the maximum or false, if query complexity exceeds the maximum - */ - public QueryAnalyzerResponseDTO analyseQueryMutationComplexity(String payload, int maxQueryComplexity, - String complexityInfoJson) throws ParseException { - FieldComplexityCalculator fieldComplexityCalculator = new FieldComplexityCalculatorImpl(complexityInfoJson); - return analyseQueryComplexity(maxQueryComplexity, payload, fieldComplexityCalculator); - } - - public GraphQLSchema getSchema() { - return schema; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/QueryValidator.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/QueryValidator.java deleted file mode 100644 index 5319e2c88b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/graphql/QueryValidator.java +++ /dev/null @@ -1,66 +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.commons.graphql; - -import graphql.language.Document; -import graphql.schema.GraphQLSchema; -import graphql.validation.ValidationError; -import graphql.validation.Validator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - -/** - * This class contains methods using for Graphql query payload validation using schema. - */ -public class QueryValidator { - - private static final Log log = LogFactory.getLog(QueryValidator.class); - private Validator validator; - - public QueryValidator(Validator validator) { - this.validator = validator; - } - - /** - * Validate query payload. - * - * @param schema GraphQL Schema - * @param document GraphQL payload as a Document - * @return Validation Error Message if any - */ - public String validatePayload(GraphQLSchema schema, Document document) { - - String validationErrorMessage = null; - ArrayList validationErrorMessageList = new ArrayList<>(); - List validationErrors = validator.validateDocument(schema, document, Locale.ENGLISH); - if (validationErrors != null && validationErrors.size() > 0) { - if (log.isDebugEnabled()) { - log.debug("Validation failed for " + document); - } - for (ValidationError error : validationErrors) { - validationErrorMessageList.add(error.getDescription()); - } - validationErrorMessage = String.join(",", validationErrorMessageList); - } - return validationErrorMessage; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/http/BrowserHostnameVerifier.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/http/BrowserHostnameVerifier.java deleted file mode 100644 index a7c946e453..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/http/BrowserHostnameVerifier.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.commons.http; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.conn.ssl.DefaultHostnameVerifier; -import org.apache.http.conn.util.InetAddressUtils; - -import java.security.cert.Certificate; -import java.security.cert.CertificateParsingException; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import java.util.NoSuchElementException; -import javax.naming.InvalidNameException; -import javax.naming.NamingException; -import javax.naming.directory.Attribute; -import javax.naming.directory.Attributes; -import javax.naming.ldap.LdapName; -import javax.naming.ldap.Rdn; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLPeerUnverifiedException; -import javax.net.ssl.SSLSession; -import javax.security.auth.x500.X500Principal; - -/** - * Implement the BrowserHostnameVerifier as the apache http-component library deprecated the existing one. - */ -public class BrowserHostnameVerifier implements HostnameVerifier { - - enum HostNameType { - - IPv4(7), IPv6(7), DNS(2); - - final int subjectType; - - HostNameType(final int subjectType) { - this.subjectType = subjectType; - } - } - - private final Log log = LogFactory.getLog(getClass()); - private static final HostnameVerifier defaultHostNameVerifier = new DefaultHostnameVerifier(); - - @Override - public boolean verify(String hostname, SSLSession session) { - if (defaultHostNameVerifier.verify(hostname, session)) { - return true; - } - final HostNameType hostType = determineHostFormat(hostname); - if (hostType != HostNameType.DNS) { - return false; - } - final Certificate[] certs; - try { - certs = session.getPeerCertificates(); - final X509Certificate x509 = (X509Certificate) certs[0]; - verify(hostname, x509); - return true; - } catch (SSLException e) { - log.debug(e.getMessage(), e); - return false; - } - } - - public void verify( - final String host, final X509Certificate cert) throws SSLException { - final List subjectAlts = getSubjectAltNames(cert); - if (!subjectAlts.isEmpty()) { - matchDNSName(host, subjectAlts); - } else { - // CN matching has been deprecated by rfc2818 and can be used - // as fallback only when no subjectAlts are available - final X500Principal subjectPrincipal = cert.getSubjectX500Principal(); - final String cn = extractCN(subjectPrincipal.getName(X500Principal.RFC2253)); - if (cn == null) { - throw new SSLException("Certificate subject for <" + host + "> doesn't contain " + - "a common name and does not have alternative names"); - } - matchCN(host, cn); - } - } - - static void matchDNSName(final String host, final List subjectAlts) throws SSLException { - final String normalizedHost = host.toLowerCase(Locale.ROOT); - for (final String subjectAlt : subjectAlts) { - final String normalizedSubjectAlt = subjectAlt.toLowerCase(Locale.ROOT); - if (matchIdentity(normalizedHost, normalizedSubjectAlt)) { - return; - } - } - throw new SSLPeerUnverifiedException("Certificate for <" + host + "> doesn't match any " + - "of the subject alternative names: " + subjectAlts); - } - - static List getSubjectAltNames(final X509Certificate cert) { - try { - final Collection> entries = cert.getSubjectAlternativeNames(); - if (entries == null) { - return Collections.emptyList(); - } - final List result = new ArrayList<>(); - for (final List entry : entries) { - final Integer type = entry.size() >= 2 ? (Integer) entry.get(0) : null; - if (type != null) { - if (type == 2) { - final Object o = entry.get(1); - if (o instanceof String) { - result.add((String) o); - } - } - } - } - return result; - } catch (final CertificateParsingException ignore) { - return Collections.emptyList(); - } - } - - static HostNameType determineHostFormat(final String host) { - if (InetAddressUtils.isIPv4Address(host)) { - return HostNameType.IPv4; - } - String s = host; - if (s.startsWith("[") && s.endsWith("]")) { - s = host.substring(1, host.length() - 1); - } - if (InetAddressUtils.isIPv6Address(s)) { - return HostNameType.IPv6; - } - return HostNameType.DNS; - } - - private static boolean matchIdentity(final String host, final String identity) { - - // RFC 2818, 3.1. Server Identity - // "...Names may contain the wildcard - // character * which is considered to match any single domain name - // component or component fragment..." - // Based on this statement presuming only singular wildcard is legal - final int asteriskIdx = identity.indexOf('*'); - if (asteriskIdx != -1) { - final String prefix = identity.substring(0, asteriskIdx); - final String suffix = identity.substring(asteriskIdx + 1); - if (!prefix.isEmpty() && !host.startsWith(prefix)) { - return false; - } - return suffix.isEmpty() || host.endsWith(suffix); - // Additional sanity checks on content selected by wildcard can be done here - } - return host.equalsIgnoreCase(identity); - } - - static String extractCN(final String subjectPrincipal) throws SSLException { - if (subjectPrincipal == null) { - return null; - } - try { - final LdapName subjectDN = new LdapName(subjectPrincipal); - final List rdns = subjectDN.getRdns(); - for (int i = rdns.size() - 1; i >= 0; i--) { - final Rdn rds = rdns.get(i); - final Attributes attributes = rds.toAttributes(); - final Attribute cn = attributes.get("cn"); - if (cn != null) { - try { - final Object value = cn.get(); - if (value != null) { - return value.toString(); - } - } catch (final NoSuchElementException | NamingException ignore) { - // ignore exception - } - } - } - return null; - } catch (final InvalidNameException e) { - throw new SSLException(subjectPrincipal + " is not a valid X500 distinguished name"); - } - } - - static void matchCN(final String host, final String cn) throws SSLException { - final String normalizedHost = host.toLowerCase(Locale.ROOT); - final String normalizedCn = cn.toLowerCase(Locale.ROOT); - if (!matchIdentity(normalizedHost, normalizedCn)) { - throw new SSLPeerUnverifiedException("Certificate for <" + host + "> doesn't match " + - "common name of the certificate subject: " + cn); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/APIMgtGatewayJWTGeneratorImpl.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/APIMgtGatewayJWTGeneratorImpl.java deleted file mode 100644 index 22d8d4bf8a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/APIMgtGatewayJWTGeneratorImpl.java +++ /dev/null @@ -1,130 +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.commons.jwtgenerator; - -import org.apache.commons.lang3.StringUtils; -import org.wso2.apk.enforcer.commons.constants.JWTConstants; -import org.wso2.apk.enforcer.commons.dto.ClaimValueDTO; -import org.wso2.apk.enforcer.commons.dto.JWTInfoDto; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; - - -/** - * Default implementation of backend jwt generation. - */ -public class APIMgtGatewayJWTGeneratorImpl extends AbstractAPIMgtGatewayJWTGenerator { - - @Override - public Map populateStandardClaims(JWTInfoDto jwtInfoDto) { - - long currentTime = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()); - long expireIn = currentTime + super.jwtConfigurationDto.getTTL(); - String dialect = getDialectURI(); - Map claims = new HashMap<>(); - claims.put("iss", API_GATEWAY_ID); - claims.put("exp", String.valueOf(expireIn)); - claims.put("iat", String.valueOf(currentTime)); - // dialect is either empty or '/' do not append a backslash. otherwise append a backslash '/' - if (!"".equals(dialect) && !"/".equals(dialect)) { - dialect = dialect + "/"; - } - if (StringUtils.isNotEmpty(jwtInfoDto.getSubscriber())) { - claims.put(dialect + "subscriber", jwtInfoDto.getSubscriber()); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getApplicationId())) { - claims.put(dialect + "applicationid", jwtInfoDto.getApplicationId()); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getApplicationName())) { - claims.put(dialect + "applicationname", jwtInfoDto.getApplicationName()); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getApplicationTier())) { - claims.put(dialect + "applicationtier", jwtInfoDto.getApplicationTier()); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getApiName())) { - claims.put(dialect + "apiname", jwtInfoDto.getApiName()); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getApiContext())) { - claims.put(dialect + "apicontext", jwtInfoDto.getApiContext()); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getVersion())) { - claims.put(dialect + "version", jwtInfoDto.getVersion()); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getSubscriptionTier())) { - claims.put(dialect + "tier", jwtInfoDto.getSubscriptionTier()); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getKeyType())) { - claims.put(dialect + "keytype", jwtInfoDto.getKeyType()); - } else { - claims.put(dialect + "keytype", "PRODUCTION"); - } - claims.put(dialect + "usertype", JWTConstants.AUTH_APPLICATION_USER_LEVEL_TOKEN); - claims.put(dialect + "enduser", jwtInfoDto.getEndUser()); - claims.put(dialect + "enduserTenantId", String.valueOf(jwtInfoDto.getEndUserTenantId())); - claims.put(dialect + "applicationUUId", jwtInfoDto.getApplicationUUId()); - Map appAttributes = jwtInfoDto.getAppAttributes(); - if (appAttributes != null && !appAttributes.isEmpty()) { - claims.put(dialect + "applicationAttributes", appAttributes); - } - if (StringUtils.isNotEmpty(jwtInfoDto.getSub())) { - claims.put(JWTConstants.SUB, jwtInfoDto.getSub()); - } - if (jwtInfoDto.getOrganizations() != null) { - claims.put(JWTConstants.ORGANIZATIONS, jwtInfoDto.getOrganizations()); - } - return claims; - } - - @Override - public Map populateCustomClaims(JWTInfoDto jwtInfoDto) { - - String[] restrictedClaims = {"iss", "sub", "aud", "exp", "nbf", "iat", "jti", "application", "tierInfo", - "subscribedAPIs", "aut"}; - Map claims = new HashMap<>(); - Set jwtExcludedClaims = jwtConfigurationDto.getJWTExcludedClaims(); - jwtExcludedClaims.addAll(Arrays.asList(restrictedClaims)); - Map jwtToken = jwtInfoDto.getJwtValidationInfo().getClaims(); - if (jwtToken != null) { - for (Map.Entry jwtClaimEntry : jwtToken.entrySet()) { - if (!jwtExcludedClaims.contains(jwtClaimEntry.getKey())) { - ClaimValueDTO claimValue = new ClaimValueDTO(jwtClaimEntry.getValue(), null); - claims.put(jwtClaimEntry.getKey(), claimValue); - } - } - } - Map customClaimsAPI = jwtInfoDto.getClaims(); - if(customClaimsAPI != null) { - for (Map.Entry customClaimEntry : customClaimsAPI.entrySet()) { - ClaimValueDTO claim = new ClaimValueDTO(customClaimEntry.getValue().getValue(), customClaimEntry.getValue().getType()); - if(claims.containsKey(customClaimEntry.getKey())) { - claims.replace(customClaimEntry.getKey(), claim); - } else { - claims.put(customClaimEntry.getKey(), claim); - } - - } - } - return claims; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/APIMgtGatewayUrlSafeJWTGeneratorImpl.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/APIMgtGatewayUrlSafeJWTGeneratorImpl.java deleted file mode 100644 index 30955b95b5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/APIMgtGatewayUrlSafeJWTGeneratorImpl.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.wso2.apk.enforcer.commons.jwtgenerator; - - -import org.apache.commons.codec.binary.Base64; -import org.wso2.apk.enforcer.commons.exception.JWTGeneratorException; - -/** - * Implementation of url safe jwt generator impl. - */ -public class APIMgtGatewayUrlSafeJWTGeneratorImpl extends APIMgtGatewayJWTGeneratorImpl { - - @Override - public String encode(byte[] stringToBeEncoded) throws JWTGeneratorException { - return Base64.encodeBase64URLSafeString(stringToBeEncoded); - - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/AbstractAPIMgtGatewayJWTGenerator.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/AbstractAPIMgtGatewayJWTGenerator.java deleted file mode 100644 index 50f815fef7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/AbstractAPIMgtGatewayJWTGenerator.java +++ /dev/null @@ -1,241 +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.commons.jwtgenerator; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.nimbusds.jose.JOSEObjectType; -import com.nimbusds.jose.JWSAlgorithm; -import com.nimbusds.jose.JWSHeader; -import com.nimbusds.jose.JWSSigner; -import com.nimbusds.jose.PlainHeader; -import com.nimbusds.jose.crypto.RSASSASigner; -import com.nimbusds.jwt.JWTClaimsSet; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.constants.JWTConstants; -import org.wso2.apk.enforcer.commons.dto.ClaimValueDTO; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.dto.JWTInfoDto; -import org.wso2.apk.enforcer.commons.exception.JWTGeneratorException; -import org.wso2.apk.enforcer.commons.util.JWTUtil; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; -import java.security.PrivateKey; -import java.security.cert.Certificate; -import java.time.LocalDate; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -/** - * Abstract class for jwt generation. - */ -public abstract class AbstractAPIMgtGatewayJWTGenerator { - private static final Log log = LogFactory.getLog(AbstractAPIMgtGatewayJWTGenerator.class); - public static final String NONE = "NONE"; - public static final String SHA256_WITH_RSA = "SHA256withRSA"; - public static final String API_GATEWAY_ID = "wso2.org/products/am"; - public JWTConfigurationDto jwtConfigurationDto; - - private static volatile long ttl = -1L; - public String dialectURI; - - public String signatureAlgorithm; - - public AbstractAPIMgtGatewayJWTGenerator() { - } - - public void setJWTConfigurationDto(JWTConfigurationDto jwtConfigurationDto) { - this.jwtConfigurationDto = jwtConfigurationDto; - dialectURI = jwtConfigurationDto.getConsumerDialectUri(); - if (dialectURI == null) { - dialectURI = "http://wso2.org/claims"; - } - signatureAlgorithm = jwtConfigurationDto.getSignatureAlgorithm(); - if (!(NONE.equals(signatureAlgorithm) - || SHA256_WITH_RSA.equals(signatureAlgorithm))) { - signatureAlgorithm = SHA256_WITH_RSA; - } - } - - public JWTConfigurationDto getJWTConfigurationDto() { - return jwtConfigurationDto; - } - public String generateToken(JWTInfoDto jwtInfoDto) throws JWTGeneratorException { - - String jwtHeader = buildHeader(); - String jwtBody = buildBody(jwtInfoDto); - String base64UrlEncodedHeader = ""; - if (jwtHeader != null) { - base64UrlEncodedHeader = encode(jwtHeader.getBytes(Charset.defaultCharset())); - } - String base64UrlEncodedBody = ""; - try { - base64UrlEncodedBody = encode(jwtBody.getBytes("UTF-8")); - } catch (UnsupportedEncodingException e) { - log.debug("Error in encoding jwt body", e); - } - if (SHA256_WITH_RSA.equals(signatureAlgorithm)) { - String assertion = base64UrlEncodedHeader + '.' + base64UrlEncodedBody; - - //get the assertion signed - byte[] signedAssertion = signJWT(assertion); - - if (log.isDebugEnabled()) { - log.debug("signed assertion value : " + new String(signedAssertion, Charset.defaultCharset())); - } - String base64UrlEncodedAssertion = encode(signedAssertion); - - return base64UrlEncodedHeader + '.' + base64UrlEncodedBody + '.' + base64UrlEncodedAssertion; - } else { - return base64UrlEncodedHeader + '.' + base64UrlEncodedBody + '.'; - } - } - - public String buildHeader() throws JWTGeneratorException { - String jwtHeader = null; - - if (NONE.equals(signatureAlgorithm)) { - PlainHeader plainHeader = new PlainHeader.Builder().build(); - jwtHeader= plainHeader.toString(); - - } else if (SHA256_WITH_RSA.equals(signatureAlgorithm)) { - jwtHeader= addCertToHeader(); - } - return jwtHeader; - } - - public byte[] signJWT(String assertion) throws JWTGeneratorException { - - try { - PrivateKey privateKey = jwtConfigurationDto.getPrivateKey(); - return JWTUtil.signJwt(assertion, privateKey, signatureAlgorithm); - } catch (Exception e) { - throw new JWTGeneratorException(e); - } - } - - /** - * Helper method to add public certificate to JWT_HEADER to signature verification. - * - * @throws JWTGeneratorException - */ - protected String addCertToHeader() throws JWTGeneratorException { - - try { - return JWTUtil.generateHeader(jwtConfigurationDto, signatureAlgorithm); - } catch (Exception e) { - String error = "Error in obtaining keystore"; - throw new JWTGeneratorException(error, e); - } - } - - public String buildBody(JWTInfoDto jwtInfoDto) { - - JWTClaimsSet.Builder jwtClaimSetBuilder = new JWTClaimsSet.Builder(); - Map claims = populateStandardClaims(jwtInfoDto); - Map customClaims = populateCustomClaims(jwtInfoDto); - for (Map.Entry claimEntry : customClaims.entrySet()) { - Object val = claimEntry.getValue().getValue(); - final String type = claimEntry.getValue().getType(); - Object claim = val; - if(val instanceof String) { - if(claimEntry.getValue().getType() != null) { - switch (type.toLowerCase()) { - case "bool": - claim = Boolean.parseBoolean(String.valueOf(val)); - break; - case "int": - claim = Integer.parseInt(String.valueOf(val)); - break; - case "long": - claim =Long.parseLong(String.valueOf(val)); - break; - case "float": - claim = Double.parseDouble(String.valueOf(val)); - break; - case "date": - claim = LocalDate.parse(String.valueOf(val)); - break; - } - } - } - if (!claims.containsKey(claimEntry.getKey())) { - claims.put(claimEntry.getKey(),claim); - } else { - claims.replace(claimEntry.getKey(), claim); - } - } - ObjectMapper mapper = new ObjectMapper(); - for (Map.Entry claimEntry : claims.entrySet()) { - Object claimVal = claimEntry.getValue(); - if (claimVal instanceof String && claimEntry.toString().contains("{")) { - try { - Map map = mapper.readValue(claimVal.toString(), Map.class); - jwtClaimSetBuilder.claim(claimEntry.getKey(), map); - } catch (IOException e) { - // Exception isn't thrown in order to generate jwt without claim, even if an error is - // occurred during the retrieving claims. - log.error(String.format("Error while reading claim values for %s", claimVal), e); - } - } else if (claimVal instanceof String && claimVal.toString().contains("[\"") - && claimVal.toString().contains("\"]")) { - - try { - List arrayList = mapper.readValue(claimVal.toString(), List.class); - jwtClaimSetBuilder.claim(claimEntry.getKey(), arrayList); - } catch (IOException e) { - // Exception isn't thrown in order to generate jwt without claim, even if an error is - // occurred during the retrieving claims. - log.error("Error while reading claim values", e); - } - } else if (JWTConstants.EXPIRY_TIME.equals(claimEntry.getKey())) { - long exp = TimeUnit.SECONDS.toMillis(Long.parseLong((String) claimEntry.getValue())); - jwtClaimSetBuilder.claim(claimEntry.getKey(), new Date(exp)); - } else if (JWTConstants.ISSUED_TIME.equals(claimEntry.getKey())) { - long iat = TimeUnit.SECONDS.toMillis(Long.parseLong((String) claimEntry.getValue())); - jwtClaimSetBuilder.claim(claimEntry.getKey(), new Date(iat)); - } else { - jwtClaimSetBuilder.claim(claimEntry.getKey(), claimEntry.getValue()); - } - } - - //Adding JWT standard claim - jwtClaimSetBuilder.jwtID(UUID.randomUUID().toString()); - JWTClaimsSet jwtClaimsSet = jwtClaimSetBuilder.build(); - return jwtClaimsSet.toJSONObject().toString(); - } - - public String encode(byte[] stringToBeEncoded) throws JWTGeneratorException { - return java.util.Base64.getUrlEncoder().withoutPadding().encodeToString(stringToBeEncoded); - } - - public String getDialectURI() { - return dialectURI; - } - - public abstract Map populateStandardClaims(JWTInfoDto jwtInfoDto); - - public abstract Map populateCustomClaims(JWTInfoDto jwtInfoDto); -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/JWTSignatureAlg.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/JWTSignatureAlg.java deleted file mode 100644 index b359740ef4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwtgenerator/JWTSignatureAlg.java +++ /dev/null @@ -1,36 +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.commons.jwtgenerator; - -/** - * Enum for the jwt signature algorithm. - */ -public enum JWTSignatureAlg { - SHA256_WITH_RSA("RS256"), NONE("none"); - - private String jwsCompliantCode; - - JWTSignatureAlg(String s) { - jwsCompliantCode = s; - } - - public String getJwsCompliantCode() { - return jwsCompliantCode; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwttransformer/DefaultJWTTransformer.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwttransformer/DefaultJWTTransformer.java deleted file mode 100644 index 4b8584d3ce..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwttransformer/DefaultJWTTransformer.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.commons.jwttransformer; - -import com.nimbusds.jwt.JWTClaimsSet; -import org.apache.commons.lang3.StringUtils; -import org.wso2.apk.enforcer.commons.constants.JWTConstants; -import org.wso2.apk.enforcer.commons.dto.ClaimMappingDto; -import org.wso2.apk.enforcer.commons.dto.TokenIssuerDto; -import org.wso2.apk.enforcer.commons.exception.JWTGeneratorException; - -import java.text.ParseException; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -/** - * Default implementation of jwt transformer. - */ -public class DefaultJWTTransformer implements JWTTransformer { - - protected TokenIssuerDto tokenIssuer = null; - - @Override - public String getTransformedConsumerKey(JWTClaimsSet jwtClaimsSet) throws JWTGeneratorException { - - try { - if (tokenIssuer.getConsumerKeyClaim() == null) { - if (jwtClaimsSet.getClaim(JWTConstants.CONSUMER_KEY) != null) { - return jwtClaimsSet.getStringClaim(JWTConstants.CONSUMER_KEY); - } else if (jwtClaimsSet.getClaim(JWTConstants.AUTHORIZED_PARTY) != null) { - return jwtClaimsSet.getStringClaim(JWTConstants.AUTHORIZED_PARTY); - } - } else { - if (jwtClaimsSet.getClaim(tokenIssuer.getConsumerKeyClaim()) != null) { - return jwtClaimsSet.getStringClaim(tokenIssuer.getConsumerKeyClaim()); - } - } - } catch (ParseException e) { - throw new JWTGeneratorException("Error while parsing JWT claims", e); - } - - return null; - } - - @Override - public List getTransformedScopes(JWTClaimsSet jwtClaimsSet) throws JWTGeneratorException { - - try { - String scopeClaim = JWTConstants.SCOPE; - if (StringUtils.isNotEmpty(tokenIssuer.getScopesClaim())) { - scopeClaim = tokenIssuer.getScopesClaim(); - } - if (jwtClaimsSet.getClaim(scopeClaim) instanceof String) { - return Arrays.asList(jwtClaimsSet.getStringClaim(scopeClaim) - .split(JWTConstants.SCOPE_DELIMITER)); - } else if (jwtClaimsSet.getClaim(scopeClaim) instanceof List) { - return jwtClaimsSet.getStringListClaim(scopeClaim); - } - } catch (ParseException e) { - throw new JWTGeneratorException("Error while parsing JWT claims", e); - } - return Arrays.asList(JWTConstants.OAUTH2_DEFAULT_SCOPE); - } - - @Override - public JWTClaimsSet transform(JWTClaimsSet jwtClaimsSet) { - - JWTClaimsSet.Builder transformedJWT = new JWTClaimsSet.Builder(); - if (tokenIssuer != null) { - Map claimConfigurations = tokenIssuer.getClaimConfigurations(); - for (Map.Entry claimEntry : jwtClaimsSet.getClaims().entrySet()) { - ClaimMappingDto claimMappingDto = claimConfigurations.get(claimEntry.getKey()); - String claimKey = claimEntry.getKey(); - if (claimMappingDto != null) { - claimKey = claimMappingDto.getLocalClaim(); - } - transformedJWT.claim(claimKey, claimEntry.getValue()); - } - return transformedJWT.build(); - } - return jwtClaimsSet; - } - - @Override - public String getIssuer() { - - return ""; - } - - @Override - public void loadConfiguration(TokenIssuerDto tokenIssuerConfiguration) { - - this.tokenIssuer = tokenIssuerConfiguration; - } - - /** - * Returns whether the token type is Application or not by checking if 'aut' claim is APPLICATION or not. If 'aut' - * claim is not present, returns null. - * - * @param jwtClaimsSet JWT Claim set - * @return Boolean whether Application token type or not - */ - @Override - public Boolean getTransformedIsAppTokenType(JWTClaimsSet jwtClaimsSet) throws JWTGeneratorException { - - try { - if (jwtClaimsSet.getClaim(JWTConstants.AUTHORIZED_USER_TYPE) != null) { - String aut = jwtClaimsSet.getStringClaim(JWTConstants.AUTHORIZED_USER_TYPE); - return StringUtils.equalsIgnoreCase(aut, JWTConstants.APPLICATION); - } - } catch (ParseException e) { - throw new JWTGeneratorException("Error while parsing JWT claims", e); - } - return false; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwttransformer/JWTTransformer.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwttransformer/JWTTransformer.java deleted file mode 100644 index 4fbd0f5b38..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/jwttransformer/JWTTransformer.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.commons.jwttransformer; - -import com.nimbusds.jwt.JWTClaimsSet; -import org.wso2.apk.enforcer.commons.dto.TokenIssuerDto; -import org.wso2.apk.enforcer.commons.exception.JWTGeneratorException; - -import java.util.List; - -/** - * This Class will be used to transform JWT claims to local claims. - */ -public interface JWTTransformer { - - /** - * This method used to retrieve ConsumerKey From JWT. - * @param jwtClaimsSet retrieved JwtClaimSet - * @return consumerKey of JWT - */ - public String getTransformedConsumerKey(JWTClaimsSet jwtClaimsSet) throws JWTGeneratorException; - - /** - * This method used to retrieve Scopes From JWT. - * @param jwtClaimsSet retrieved JwtClaimSet - * @return scopes of JWT - */ - public List getTransformedScopes(JWTClaimsSet jwtClaimsSet) throws JWTGeneratorException; - - - /** - * This method used to transform JWT claimset from given JWT into required format. - * - * @param jwtClaimsSet jwtClaimSet from given JWT - * @return transformed JWT Claims. - */ - public JWTClaimsSet transform(JWTClaimsSet jwtClaimsSet) throws JWTGeneratorException; - - /** - * This method returns issuer name which used the implementation to transform JWT. - * - * @return issuer url. - */ - public String getIssuer(); - - public void loadConfiguration(TokenIssuerDto tokenIssuerConfiguration); - - /** - * This method used to retrieve whether authorized user type of the JWT token is Application or not. The default - * implementation returns null. - * - * @param jwtClaimsSet jwtClaimSet from given JWT - * @return transformed JWT Claims - * @throws JWTGeneratorException if an error occurs while retrieving whether token type is Application - */ - default Boolean getTransformedIsAppTokenType(JWTClaimsSet jwtClaimsSet) throws JWTGeneratorException { - - return false; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/CustomJsonLayout.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/CustomJsonLayout.java deleted file mode 100644 index 9090f49523..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/CustomJsonLayout.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.logging; - -import net.minidev.json.JSONObject; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.core.Layout; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.config.Node; -import org.apache.logging.log4j.core.config.plugins.Plugin; -import org.apache.logging.log4j.core.config.plugins.PluginAttribute; -import org.apache.logging.log4j.core.config.plugins.PluginFactory; -import org.apache.logging.log4j.core.impl.Log4jLogEvent; -import org.apache.logging.log4j.core.layout.AbstractStringLayout; -import org.apache.logging.log4j.message.ParameterizedMessage; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.nio.charset.Charset; -import java.text.SimpleDateFormat; -import java.util.Arrays; - -/** - * This will implement a custom JSON type layout for support JSON format logging - */ -@Plugin(name = "CustomJsonLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = true) -public class CustomJsonLayout extends AbstractStringLayout { - protected CustomJsonLayout(Charset charset) { - super(charset); - } - - @Override - public String toSerializable(LogEvent event) { - StringBuilder throwable = new StringBuilder(); - if (event.getThrown() != null) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - pw.println(); - event.getThrown().printStackTrace(pw); - pw.close(); - throwable.append(sw.toString()); - } - JSONObject obj = new JSONObject(); - StringBuilder retValue = new StringBuilder(); - obj.put(LoggingConstants.LogAttributes.TIMESTAMP, new SimpleDateFormat("dd-MM-yyyy HH:mm:ss:S") - .format(event.getTimeMillis())); - obj.put(LoggingConstants.LogAttributes.LEVEL, event.getLevel().toString()); - obj.put(LoggingConstants.LogAttributes.LOGGER, event.getLoggerName()); - obj.put(LoggingConstants.LogAttributes.MESSAGE, event.getMessage().getFormattedMessage()); - obj.put(LoggingConstants.LogAttributes.TRACE_ID, - event.getContextData().getValue(LoggingConstants.LogAttributes.TRACE_ID)); - obj.put(LoggingConstants.LogAttributes.CONTEXT, event.getContextStack().asList()); - if ((event.getClass() == Log4jLogEvent.class) && (event.getLevel() == Level.ERROR)) { - Log4jLogEvent logEvent = (Log4jLogEvent) event; - if (logEvent.getMessage().getClass() == ParameterizedMessage.class) { - Object[] parameters = ((ParameterizedMessage) logEvent.getMessage()).getParameters(); - if (Arrays.stream(parameters).anyMatch(p -> - p.getClass().getName().equals(ErrorDetails.class.getName()))) { - Arrays.stream(parameters) - .filter(p -> p.getClass().getName().equals(ErrorDetails.class.getName())).forEach((c) -> { - ErrorDetails errorDetails = (ErrorDetails) c; - obj.put(LoggingConstants.LogAttributes.SEVERITY, errorDetails.getSeverity()); - obj.put(LoggingConstants.LogAttributes.ERROR_CODE, errorDetails.getCode()); - }); - } else { - obj.put(LoggingConstants.LogAttributes.SEVERITY, LoggingConstants.Severity.DEFAULT); - obj.put(LoggingConstants.LogAttributes.ERROR_CODE, 0); - } - } else { - obj.put(LoggingConstants.LogAttributes.SEVERITY, LoggingConstants.Severity.DEFAULT); - obj.put(LoggingConstants.LogAttributes.ERROR_CODE, 0); - } - } - retValue.append(obj.toJSONString()).append(throwable).append("\n"); - return retValue.toString(); - } - - @PluginFactory - public static CustomJsonLayout createLayout( - @PluginAttribute(value = "charset", defaultString = "UTF-8") Charset charset) { - return new CustomJsonLayout(charset); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/ErrorDetails.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/ErrorDetails.java deleted file mode 100644 index 2c0428f866..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/ErrorDetails.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.logging; - -/** - * Represents a model for Error logs to hold few additional attributes - */ -public class ErrorDetails { - private String severity; - private int code; - - /** - * @param severity severity level of the error - * @param code unique code to troubleshoot the error - */ - private ErrorDetails(String severity, int code) { - this.severity = severity; - this.code = code; - } - - /** - * static method to initiate a errorLog with details, without 'new' operator - * - * @param severity severity level of the error - * @param code unique code to troubleshoot the error - * @return ErrorDetails object with given parameters - */ - public static ErrorDetails errorLog(String severity, int code) { - return new ErrorDetails(severity, code); - } - - /** - * Get severity of the error - * @return Severity - */ - public String getSeverity() { - return this.severity; - } - - /** - * Set severity of the error - * @param severity - */ - public void setSeverity(String severity) { - this.severity = severity; - } - - /** - * Get error code for logging - * @return error code - */ - public int getCode() { - return this.code; - } - - /** - * Set error code with given value - * @param code - */ - public void setCode(int code) { - this.code = code; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/ErrorLogPatternConverter.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/ErrorLogPatternConverter.java deleted file mode 100644 index 93c3265c32..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/ErrorLogPatternConverter.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.logging; - -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.config.plugins.Plugin; -import org.apache.logging.log4j.core.impl.Log4jLogEvent; -import org.apache.logging.log4j.core.pattern.ConverterKeys; -import org.apache.logging.log4j.core.pattern.LogEventPatternConverter; -import org.apache.logging.log4j.message.ParameterizedMessage; - -import java.util.Arrays; - -/** - * This will create a PatternConverter which is used by log4j PatternConverter - * to format the log event into printable format. - * %errorDetails can be used in pattern of PatternLayout to get error info to the Log Statements. - */ - -@Plugin(name = "ErrorLogPatternConverter", category = "Converter") -@ConverterKeys({"errorDetails"}) -public class ErrorLogPatternConverter extends LogEventPatternConverter { - protected ErrorLogPatternConverter(String name, String style) { - super(name, style); - } - - public ErrorLogPatternConverter(String[] options) { - super("errorDetails", "errorDetails"); - } - - public static ErrorLogPatternConverter newInstance(final String[] options) { - return new ErrorLogPatternConverter(options); - } - - @Override - public void format(LogEvent event, StringBuilder toAppendTo) { - if ((event.getClass() == Log4jLogEvent.class) && (event.getLevel() == Level.ERROR)) { - Log4jLogEvent logEvent = (Log4jLogEvent) event; - if (logEvent.getMessage().getClass() == ParameterizedMessage.class) { - Object[] parameters = ((ParameterizedMessage) logEvent.getMessage()).getParameters(); - if (Arrays.stream(parameters).anyMatch(p -> - p.getClass().getName().equals(ErrorDetails.class.getName()))) { - Arrays.stream(parameters) - .filter(p -> p.getClass().getName().equals(ErrorDetails.class.getName())).forEach((c) -> { - ErrorDetails errorDetails = (ErrorDetails) c; - toAppendTo.append(LoggingConstants.LogAttributes.SEVERITY + ":" + - errorDetails.getSeverity() + " " + LoggingConstants.LogAttributes.ERROR_CODE - + ":" + errorDetails.getCode()); - }); - } else { - toAppendTo.append(LoggingConstants.LogAttributes.SEVERITY + ":" + - LoggingConstants.Severity.DEFAULT + " " + - LoggingConstants.LogAttributes.ERROR_CODE + ":" + 0); - } - } else { - toAppendTo.append(LoggingConstants.LogAttributes.SEVERITY + ":" + - LoggingConstants.Severity.DEFAULT + " " + - LoggingConstants.LogAttributes.ERROR_CODE + ":" + 0); - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/LoggingConstants.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/LoggingConstants.java deleted file mode 100644 index d3a6d45ff0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/logging/LoggingConstants.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.logging; - -/** - * Class to keep constants used for logging - */ -public class LoggingConstants { - /** - * Constants related to log severity - */ - public final class Severity { - public static final String BLOCKER = "Blocker"; - public static final String CRITICAL = "Critical"; - public static final String MAJOR = "Major"; - public static final String MINOR = "Minor"; - public static final String TRIVIAL = "Trivial"; - public static final String DEFAULT = "Default"; - } - - /** - * Constants for log attribute names - */ - public final class LogAttributes { - public static final String SEVERITY = "severity"; - public static final String ERROR_CODE = "error_code"; - public static final String TIMESTAMP = "timestamp"; - public static final String LEVEL = "level"; - public static final String LOGGER = "logger"; - public static final String MESSAGE = "message"; - public static final String TRACE_ID = "traceId"; - public static final String CONTEXT = "context"; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AIProvider.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AIProvider.java deleted file mode 100644 index 4db3b9a16d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AIProvider.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.wso2.apk.enforcer.commons.model; - -// AIProvider is used to provide the AI model to the enforcer -public class AIProvider { - private String providerName; - private String providerAPIVersion; - private String organization; - - private Boolean enabled = false; - - private ValueDetails model; - - private ValueDetails promptTokens; - - private ValueDetails completionToken; - - private ValueDetails totalToken; - - // Get provider name - public String getProviderName() { - return providerName; - } - - // Get provider API version - public String getProviderAPIVersion() { - return providerAPIVersion; - } - - // Get enabled - public Boolean getEnabled() { - return enabled; - } - - // Get organization - public String getOrganization() { - return organization; - } - - // Get model - public ValueDetails getModel() { - return model; - } - - // Get prompt tokens - public ValueDetails getPromptTokens() { - return promptTokens; - } - - // Get completion token - public ValueDetails getCompletionToken() { - return completionToken; - } - - // Get total token - public ValueDetails getTotalToken() { - return totalToken; - } - - // Set provider name - public void setProviderName(String providerName) { - this.providerName = providerName; - } - - // Set provider API version - public void setProviderAPIVersion(String providerAPIVersion) { - this.providerAPIVersion = providerAPIVersion; - } - - // Set enabled - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - // Set organization - public void setOrganization(String organization) { - this.organization = organization; - } - - // Set model - public void setModel(ValueDetails model) { - this.model = model; - } - - // Set prompt tokens - public void setPromptTokens(ValueDetails promptTokens) { - this.promptTokens = promptTokens; - } - - // Set completion token - public void setCompletionToken(ValueDetails completionToken) { - this.completionToken = completionToken; - } - - // Set total token - public void setTotalToken(ValueDetails totalToken) { - this.totalToken = totalToken; - } - -} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/APIConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/APIConfig.java deleted file mode 100644 index 0c2fc25797..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/APIConfig.java +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.model; - -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; - -import java.security.KeyStore; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * APIConfig contains the details related to the MatchedAPI for the inbound request. - */ -public class APIConfig { - private String name; - private String version; - private String vhost; - private String basePath; - private String apiType; -// private Map endpoints; // "PRODUCTION" OR "SANDBOX" -> endpoint cluster - private String envType; - private String apiLifeCycleState; - private String authorizationHeader; - private String organizationId; - private String uuid; - private String tier; - private boolean disableAuthentication; - private boolean disableScopes; - private List resources = new ArrayList<>(); - private boolean isMockedApi; - private KeyStore trustStore; - private String mutualSSL; - private boolean transportSecurity; - private Map applicationSecurity; - private GraphQLSchemaDTO graphQLSchemaDTO; - private JWTConfigurationDto jwtConfigurationDto; - private boolean systemAPI; - private byte[] apiDefinition; - private String environment; - private boolean subscriptionValidation; - private EndpointSecurity[] endpointSecurity; - private EndpointCluster endpoints; - private AIProvider aiProvider; - - public AIProvider getAiProvider() { - return aiProvider; - } - - public void setAiProvider(AIProvider aiProvider) { - this.aiProvider = aiProvider; - } - - public EndpointCluster getEndpoints() { - return endpoints; - } - - public void getEndpointSecurity(EndpointSecurity[] endpointSecurity) { - this.endpointSecurity = endpointSecurity; - } - - /** - * getApiType returns the API type. This could be one of the following. - * HTTP, WS, WEBHOOK - * - * @return the apiType - */ - public String getApiType() { - return apiType; - } - - /** - * getEnvType returns the API's env type - * whether the key type is production or sandbox. - * - * @return getEnvType returns type of the env. Production or Sandbox - */ - public String getEnvType() { - return envType; - } - - /** - * Corresponding API's organization UUID (TenantDomain) is returned. - * - * @return Organization UUID - */ - public String getOrganizationId() { - return organizationId; - } - - /** - * Corresponding API's API UUID is returned. - * @return API UUID - */ - public String getUuid() { - return uuid; - } - - /** - * Corresponding API's API Name is returned. - * @return API name - */ - public String getName() { - return name; - } - - /** - * Corresponding API's API Version is returned. - * @return API version - */ - public String getVersion() { - return version; - } - - /** - * Corresponding API's Host is returned. - * @return API's host - */ - public String getVhost() { - return vhost; - } - - /** - * Corresponding API's Basepath is returned. - * @return basePath of the API - */ - public String getBasePath() { - return basePath; - } - - /** - * Current API Lifecycle state is returned. - * @return lifecycle state - */ - public String getApiLifeCycleState() { - return apiLifeCycleState; - } - - /** - * API level Throttling tier assigned for the corresponding API. - * @return API level throttling tier - */ - public String getTier() { - return tier; - } - - /** - * If the authentication is disabled for the API . - * - * @return true if the authentication is disabled for the API. - */ - public boolean isDisableAuthentication() { - return disableAuthentication; - } - - /** - * If the scopes are disabled for the API . - * - * @return true if the scopes are disabled for the API. - */ - public boolean isDisableScopes() { - return disableScopes; - } - - /** - * Returns the complete list of resources under the corresponding API. - * Each operation in the openAPI definition is listed under here. - * @return Resources of the API. - */ - public List getResources() { - return resources; - } - - /** - * Returns whether a given API is a mocked API or not. - * - * @return boolean value to denote isMockedApi or not. - */ - public boolean isMockedApi() { - return isMockedApi; - } - - /** - * Returns the truststore for the corresponding API. - * - * @return TrustStore - */ - public KeyStore getTrustStore() { - return trustStore; - } - - - /** - * Returns the mTLS optionality for the corresponding API. - * - * @return mTLS optionality - */ - public String getMutualSSL() { - return mutualSSL; - } - - /** - * Returns if transport security (mTLS) is enabled or disabled for the corresponding API. - * - * @return transportSecurity enabled - */ - public boolean isTransportSecurity() { - return transportSecurity; - } - - /** - * Returns the application security optionality for the corresponding API. - * - * @return application security optionality - */ - public Map getApplicationSecurity() { - return applicationSecurity; - } - - /** - * Returns graphQL definitions and schemes. - * - * @return GraphQLSchemaDTO. - */ - public GraphQLSchemaDTO getGraphQLSchemaDTO() { - return graphQLSchemaDTO; - } - - public boolean isSystemAPI() { - return systemAPI; - } - - /** - * Returns the API definition. - * @return byte array of the API definition. - */ - public byte[] getApiDefinition() { - return apiDefinition; - } - - /** - * Returns the subscription validation status. - * @return true if subscription validation is enabled. - */ - public boolean isSubscriptionValidation() { - return subscriptionValidation; - } - - public JWTConfigurationDto getJwtConfigurationDto() { - return jwtConfigurationDto; - } - - /** - * Returns the environment of the API. - * @return String. - */ - public String getEnvironment() { - return environment; - } - - /** - * Implements builder pattern to build an API Config object. - */ - public static class Builder { - - private String name; - private String version; - private String vhost; - private String basePath; - private String apiType; - private String envType; - private String apiLifeCycleState; - private String organizationId; - private String uuid; - private String tier; - private boolean disableAuthentication; - private boolean disableScopes; - private List resources = new ArrayList<>(); - private boolean isMockedApi; - private KeyStore trustStore; - private String mutualSSL; - private Map applicationSecurity; - private GraphQLSchemaDTO graphQLSchemaDTO; - private boolean systemAPI; - private byte[] apiDefinition; - private boolean subscriptionValidation; - private JWTConfigurationDto jwtConfigurationDto; - private String environment; - private boolean transportSecurity; - - private AIProvider aiProvider; - - public Builder(String name) { - this.name = name; - } - - public Builder version(String version) { - this.version = version; - return this; - } - - public Builder vhost(String vhost) { - this.vhost = vhost; - return this; - } - - public Builder aiProvider(AIProvider aiProvider) { - this.aiProvider = aiProvider; - return this; - } - - public Builder basePath(String basePath) { - this.basePath = basePath; - return this; - } - - public Builder apiType(String apiType) { - this.apiType = apiType; - return this; - } - - public Builder apiLifeCycleState(String apiLifeCycleState) { - this.apiLifeCycleState = apiLifeCycleState; - return this; - } - - public Builder tier(String tier) { - this.tier = tier; - return this; - } - - public Builder disableAuthentication(boolean enabled) { - this.disableAuthentication = enabled; - return this; - } - - public Builder disableScopes(boolean enabled) { - this.disableScopes = enabled; - return this; - } - - public Builder resources(List resources) { - this.resources = resources; - return this; - } - - public Builder envType(String envType) { - this.envType = envType; - return this; - } - - public Builder organizationId(String organizationId) { - this.organizationId = organizationId; - return this; - } - - public Builder uuid(String uuid) { - this.uuid = uuid; - return this; - } - - public Builder graphQLSchemaDTO(GraphQLSchemaDTO graphQLSchemaDTO) { - this.graphQLSchemaDTO = graphQLSchemaDTO; - return this; - } - - public Builder mockedApi(boolean isMockedApi) { - this.isMockedApi = isMockedApi; - return this; - } - - public Builder trustStore(KeyStore trustStore) { - this.trustStore = trustStore; - return this; - } - - public Builder mutualSSL(String mutualSSL) { - this.mutualSSL = mutualSSL; - return this; - } - - public Builder applicationSecurity(Map applicationSecurity) { - this.applicationSecurity = applicationSecurity; - return this; - } - - public Builder systemAPI(boolean systemAPI) { - this.systemAPI = systemAPI; - return this; - } - - public Builder jwtConfigurationDto(JWTConfigurationDto jwtConfigurationDto) { - this.jwtConfigurationDto = jwtConfigurationDto; - return this; - } - - public Builder apiDefinition(byte[] apiDefinition) { - this.apiDefinition = apiDefinition; - return this; - } - - public Builder environment(String environment) { - this.environment = environment; - return this; - } - - public Builder subscriptionValidation(boolean subscriptionValidation) { - this.subscriptionValidation = subscriptionValidation; - return this; - } - - public Builder transportSecurity(boolean transportSecurity) { - this.transportSecurity = transportSecurity; - return this; - } - - public APIConfig build() { - APIConfig apiConfig = new APIConfig(); - apiConfig.name = this.name; - apiConfig.vhost = this.vhost; - apiConfig.basePath = this.basePath; - apiConfig.version = this.version; - apiConfig.apiLifeCycleState = this.apiLifeCycleState; - apiConfig.resources = this.resources; - apiConfig.apiType = this.apiType; - apiConfig.envType = this.envType; - apiConfig.tier = this.tier; - apiConfig.disableAuthentication = this.disableAuthentication; - apiConfig.disableScopes = this.disableScopes; - apiConfig.organizationId = this.organizationId; - apiConfig.uuid = this.uuid; - apiConfig.isMockedApi = this.isMockedApi; - apiConfig.trustStore = this.trustStore; - apiConfig.mutualSSL = this.mutualSSL; - apiConfig.transportSecurity = this.transportSecurity; - apiConfig.applicationSecurity = this.applicationSecurity; - apiConfig.graphQLSchemaDTO = this.graphQLSchemaDTO; - apiConfig.systemAPI = this.systemAPI; - apiConfig.jwtConfigurationDto = this.jwtConfigurationDto; - apiConfig.apiDefinition = this.apiDefinition; - apiConfig.environment = this.environment; - apiConfig.subscriptionValidation = this.subscriptionValidation; - apiConfig.aiProvider = this.aiProvider; - return apiConfig; - } - } - - private APIConfig() { - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/APIKeyAuthenticationConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/APIKeyAuthenticationConfig.java deleted file mode 100644 index 2ae1164870..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/APIKeyAuthenticationConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -public class APIKeyAuthenticationConfig { - private String In; - private String Name; - private boolean sendTokenToUpstream; - - public String getIn() { - return In; - } - - public void setIn(String in) { - In = in; - } - - public String getName() { - return Name; - } - - public void setName(String name) { - Name = name; - } - - public boolean isSendTokenToUpstream() { - return sendTokenToUpstream; - } - - public void setSendTokenToUpstream(boolean sendTokenToUpstream) { - this.sendTokenToUpstream = sendTokenToUpstream; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AuthenticationConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AuthenticationConfig.java deleted file mode 100644 index b0c5ff67f1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AuthenticationConfig.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -import java.util.List; - -public class AuthenticationConfig { - private JWTAuthenticationConfig jwtAuthenticationConfig; - private List apiKeyAuthenticationConfigs; - private InternalKeyConfig internalKeyConfig; - private Oauth2AuthenticationConfig oauth2AuthenticationConfig; - private boolean Disabled; - - public JWTAuthenticationConfig getJwtAuthenticationConfig() { - return jwtAuthenticationConfig; - } - - public void setJwtAuthenticationConfig(JWTAuthenticationConfig jwtAuthenticationConfig) { - this.jwtAuthenticationConfig = jwtAuthenticationConfig; - } - - public List getApiKeyAuthenticationConfigs() { - return apiKeyAuthenticationConfigs; - } - - public void setApiKeyAuthenticationConfigs(List apiKeyAuthenticationConfigs) { - this.apiKeyAuthenticationConfigs = apiKeyAuthenticationConfigs; - } - - public boolean isDisabled() { - return Disabled; - } - - public void setDisabled(boolean disabled) { - Disabled = disabled; - } - - public InternalKeyConfig getInternalKeyConfig() { - return internalKeyConfig; - } - - public void setInternalKeyConfig(InternalKeyConfig internalKeyConfig) { - this.internalKeyConfig = internalKeyConfig; - } - - public Oauth2AuthenticationConfig getOauth2AuthenticationConfig() { - - return oauth2AuthenticationConfig; - } - - public void setOauth2AuthenticationConfig(Oauth2AuthenticationConfig oauth2AuthenticationConfig) { - - this.oauth2AuthenticationConfig = oauth2AuthenticationConfig; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AuthenticationContext.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AuthenticationContext.java deleted file mode 100644 index 9870bdd119..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/AuthenticationContext.java +++ /dev/null @@ -1,319 +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.commons.model; - -import java.util.List; - -/** - * AuthenticationContext contains the details populated after applying authentication filter. - */ -public class AuthenticationContext { - private boolean authenticated; - private String username; - private String applicationTier; - private String tier; - private boolean isContentAwareTierPresent; - private String apiKey; - private String callerToken; - private int applicationId; - private String applicationUUID; - private String applicationName; - private String consumerKey; - private String subscriber; - private List throttlingDataList; - private int spikeArrestLimit; - private String subscriberOrganization; - private String spikeArrestUnit; - private boolean stopOnQuotaReach; - private String apiPublisher; - private String apiUUID; - private String rawToken; - private String tokenType; - - public static final String UNKNOWN_VALUE = "__unknown__"; - - public AuthenticationContext() { - this.apiPublisher = UNKNOWN_VALUE; - this.applicationUUID = UNKNOWN_VALUE; - this.applicationId = -1; - this.applicationName = UNKNOWN_VALUE; - this.applicationTier = "Unlimited"; - this.consumerKey = UNKNOWN_VALUE; - this.spikeArrestUnit = ""; - this.subscriber = UNKNOWN_VALUE; - this.subscriberOrganization = UNKNOWN_VALUE; - } - - public List getThrottlingDataList() { - return throttlingDataList; - } - - public void setThrottlingDataList(List throttlingDataList) { - this.throttlingDataList = throttlingDataList; - } - //Following throttle data list can be use to hold throttle data and api level throttle key - //should be its first element. - - /** - * Returns true if there is a content aware throttling tier is present. - * - * @return true if there is a content aware tier is present. - */ - public boolean isContentAwareTierPresent() { - return isContentAwareTierPresent; - } - - public void setIsContentAware(boolean isContentAware) { - this.isContentAwareTierPresent = isContentAware; - } - - /** - * Get Subscriber of the relevant subscription. - * - * @return Subscriber - */ - public String getSubscriber() { - return subscriber; - } - - public void setSubscriber(String subscriber) { - this.subscriber = subscriber; - } - - public boolean isAuthenticated() { - return authenticated; - } - - // Username of the authenticated User - - /** - * Username of the authenticated user. - * @return User - */ - public String getUsername() { - return username; - } - - /** - * Get Subscription level throttling tier. - * - * @return subscription throttling tier. - */ - public String getTier() { - return tier; - } - - /** - * If JWT token is used for authentication, JTI value can be retrieved. - * - * Note: - * If the API is unsecured, this would be assigned with client IP address. - * - * @return Token Identifier (JTI). - */ - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public void setAuthenticated(boolean authenticated) { - this.authenticated = authenticated; - } - - public void setUsername(String username) { - this.username = username; - } - - public void setTier(String tier) { - this.tier = tier; - } - - /** - * Generated Backend JWT Token (If JWT generation is enabled) - * - * @return Backend JWT Token - */ - public String getCallerToken() { - return callerToken; - } - - public void setCallerToken(String callerToken) { - this.callerToken = callerToken; - } - - /** - * Get the assigned application throttling tier assigned for the matched application. - * @return application throttling tier. - */ - public String getApplicationTier() { - return applicationTier; - } - - public void setApplicationTier(String applicationTier) { - this.applicationTier = applicationTier; - } - - /** - * Get the application ID for the matched application. - * - * @return - */ - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - /** - * Get the application Name for the matched application. - * @return - */ - public String getApplicationName() { - return applicationName; - } - - public void setApplicationName(String applicationName) { - this.applicationName = applicationName; - } - - /** - * Get the consumer Key for the matched application. - * - * @return Consumer Key - */ - public String getConsumerKey() { - return consumerKey; - } - - public void setConsumerKey(String consumerKey) { - this.consumerKey = consumerKey; - } - - /** - * Get Spike arrest Limit assigned for the matched subscription. - * - * @return Spike arrest limit. - */ - public int getSpikeArrestLimit() { - return spikeArrestLimit; - } - - public void setSpikeArrestLimit(int spikeArrestLimit) { - this.spikeArrestLimit = spikeArrestLimit; - } - - /** - * Get Subscriber Tenant Domain for the matched subscription. - * - * @return Subscriber Tenant Domain - */ - public String getSubscriberOrganization() { - return subscriberOrganization; - } - - public void setSubscriberOrganization(String subscriberOrganization) { - this.subscriberOrganization = subscriberOrganization; - } - - /** - * Get Spike Arrest Time Unit if provided under the matched subscription. - * (Currently not supported in Throttle Filter) - * - * @return Spike Arrest Time Unit - */ - public String getSpikeArrestUnit() { - return spikeArrestUnit; - } - - public void setSpikeArrestUnit(String spikeArrestUnit) { - this.spikeArrestUnit = spikeArrestUnit; - } - - /** - * Returns true if stop On Quota Reach is set to true for the matched subscription policy. - * (Currently not supported in Throttle Filter) - * - * @return true if stop On Quota Reach is set to true - */ - public boolean isStopOnQuotaReach() { - return stopOnQuotaReach; - } - - public void setStopOnQuotaReach(boolean stopOnQuotaReach) { - this.stopOnQuotaReach = stopOnQuotaReach; - } - - /** - * API Publisher of the matched API. - * - * @return API Publisher - */ - public String getApiPublisher() { - return apiPublisher; - } - - public void setApiPublisher(String apiPublisher) { - this.apiPublisher = apiPublisher; - } - - /** - * API UUID of the corresponding API. - * - * @return API UUID - */ - public String getApiUUID() { - return apiUUID; - } - - public void setApiUUID(String apiUUID) { - this.apiUUID = apiUUID; - } - - /** - * Raw token used to authenticate the API - * @return Raw token - */ - public String getRawToken() { - return rawToken; - } - - public void setRawToken(String rawToken) { - this.rawToken = rawToken; - } - - public String getTokenType() { - return tokenType; - } - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - public String getApplicationUUID() { - return applicationUUID; - } - - public void setApplicationUUID(String applicationUUID) { - this.applicationUUID = applicationUUID; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/EndpointCluster.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/EndpointCluster.java deleted file mode 100644 index 33f3bf930e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/EndpointCluster.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.commons.model; - -import java.util.List; - -/** - * EndpointCluster contains the URLs and the config for a set of Endpoints such as prod, sandbox - */ -public class EndpointCluster { - private List urls; - private RetryConfig retryConfig; - private Integer routeTimeoutInMillis; - private String basePath; - - /** - * @return URLs of the cluster - */ - public List getUrls() { - return urls; - } - - /** - * @param urls URLs of the cluster - */ - public void setUrls(List urls) { - this.urls = urls; - } - - /** - * @return Retry configuration of the cluster - */ - public RetryConfig getRetryConfig() { - return retryConfig; - } - - /** - * @param retryConfig Retry configuration of the cluster - */ - public void setRetryConfig(RetryConfig retryConfig) { - this.retryConfig = retryConfig; - } - - /** - * @return Route timeout of the cluster - */ - public Integer getRouteTimeoutInMillis() { - return routeTimeoutInMillis; - } - - /** - * @param routeTimeoutInMillis Route timeout of the cluster - */ - public void setRouteTimeoutInMillis(Integer routeTimeoutInMillis) { - this.routeTimeoutInMillis = routeTimeoutInMillis; - } - - /** - * @return basepath of the backend endpoint - */ - public String getBasePath() { - return basePath; - } - - /** - * @param basePath of the backend endpoint - */ - public void setBasePath(String basePath) { - this.basePath = basePath; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/EndpointSecurity.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/EndpointSecurity.java deleted file mode 100644 index 779d03eb54..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/EndpointSecurity.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.model; -import java.util.Map; - -/** - * EndpointSecurity holds the EndpointSecurity configuration for an API. - */ -public class EndpointSecurity { - private char[] password; - private String username; - private boolean enabled; - private String securityType; - private Map customParameters; - - /** - * Get the password for endpoint (Basic Auth) - * - * @return password (as a char array) under endpoint security - */ - public char[] getPassword() { - return password; - } - - public void setPassword(char[] password) { - this.password = password; - } - - /** - * Get the username for endpoint (Basic Auth) - * - * @return username under endpoint security - */ - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - /** - * true if Endpoint Security is enabled. - * - * @return whether endpoint security is enabled or not - */ - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - /** - * The endpoint security type for Endpoint Security object. - * - * Note: - * Only supported security type is "Basic" at the moment. - * - * @return security Type - */ - public String getSecurityType() { - return securityType; - } - - public void setSecurityType(String securityType) { - this.securityType = securityType; - } - - /** - * The Custom Parameters listed under endpoint security object are returned as a string. - * - * Note: - * Only supported security type is "Basic" at the moment. - * - * @return security Type - */ - public Map getCustomParameters() { - return customParameters; - } - - public void setCustomParameters(Map customParameters) { - this.customParameters = customParameters; - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/GraphQLCustomComplexityInfoDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/GraphQLCustomComplexityInfoDTO.java deleted file mode 100644 index b815fba41e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/GraphQLCustomComplexityInfoDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * you may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -/** - * Hold graphql complexity info. - */ -public class GraphQLCustomComplexityInfoDTO { - private String type; - private String field; - private int complexityValue; - - public GraphQLCustomComplexityInfoDTO(String type, String field, int complexityValue) { - this.type = type; - this.field = field; - this.complexityValue = complexityValue; - } - - public String getType() { - return type; - } - - public String getField() { - return field; - } - - public int getComplexityValue() { - return complexityValue; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/GraphQLSchemaDTO.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/GraphQLSchemaDTO.java deleted file mode 100644 index 52de589c3c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/GraphQLSchemaDTO.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * you may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -import graphql.schema.GraphQLSchema; -import graphql.schema.idl.TypeDefinitionRegistry; - -import java.util.List; - -/** - * This contains GraphQL Schema related data to deploy in Gateway. - */ -public class GraphQLSchemaDTO { - - private GraphQLSchema graphQLSchema; - private TypeDefinitionRegistry typeDefinitionRegistry; - private List graphQLCustomComplexityInfoDTOList; - - public GraphQLSchemaDTO(GraphQLSchema graphQLSchema, TypeDefinitionRegistry typeDefinitionRegistry, - List graphQLCustomComplexityInfoDTOList) { - this.graphQLSchema = graphQLSchema; - this.typeDefinitionRegistry = typeDefinitionRegistry; - this.graphQLCustomComplexityInfoDTOList = graphQLCustomComplexityInfoDTOList; - } - - public GraphQLSchema getGraphQLSchema() { - return graphQLSchema; - } - - public TypeDefinitionRegistry getTypeDefinitionRegistry() { - return typeDefinitionRegistry; - } - - public List getGraphQLCustomComplexityInfoDTO() { - return graphQLCustomComplexityInfoDTOList; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/InternalKeyConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/InternalKeyConfig.java deleted file mode 100644 index 28e6b224ae..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/InternalKeyConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -public class InternalKeyConfig { - private String Header; - private boolean sendTokenToUpstream; - - public String getHeader() { - return Header; - } - - public void setHeader(String header) { - Header = header; - } - - public boolean isSendTokenToUpstream() { - return sendTokenToUpstream; - } - - public void setSendTokenToUpstream(boolean sendTokenToUpstream) { - this.sendTokenToUpstream = sendTokenToUpstream; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/JWTAuthenticationConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/JWTAuthenticationConfig.java deleted file mode 100644 index bf9973f4d8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/JWTAuthenticationConfig.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -import java.util.List; - -/** - * Defines JWT authentication config structure. - */ -public class JWTAuthenticationConfig { - private String header; - private boolean sendTokenToUpstream; - private List audience; - public String getHeader() { - return header; - } - - public void setHeader(String header) { - this.header = header; - } - - public boolean isSendTokenToUpstream() { - return sendTokenToUpstream; - } - - public void setSendTokenToUpstream(boolean sendTokenToUpstream) { - this.sendTokenToUpstream = sendTokenToUpstream; - } - - public List getAudience() { - return audience; - } - - public void setAudience(List audience) { - this.audience = audience; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedApiConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedApiConfig.java deleted file mode 100644 index d16cd9fd55..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedApiConfig.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; -import java.util.Map; - -/** - * Defines JSON script structure used in the mock API implementations. - */ -public class MockedApiConfig { - private Map responses; // status code => responseconfig - - public Map getResponses() { - return responses; - } - - public void setResponses(Map responses) { - this.responses = responses; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedContentExamples.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedContentExamples.java deleted file mode 100644 index 40b6b1a29d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedContentExamples.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -import java.util.Map; - -/** - * Defines mock API content structure. - */ -public class MockedContentExamples { - - private Map exampleMap; // example reference => example map - - public Map getExampleMap() { - return exampleMap; - } - - public void setExampleMap(Map exampleMap) { - this.exampleMap = exampleMap; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedHeaderConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedHeaderConfig.java deleted file mode 100644 index fb1aa28a6b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedHeaderConfig.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -/** - * Defines mock API response's header structure used in mock API implementations. - */ -public class MockedHeaderConfig { - - private String name; // name of the header - private String value; // value of a given header - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedResponseConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedResponseConfig.java deleted file mode 100644 index a7a4d3d3af..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/MockedResponseConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.model; - -import java.util.List; -import java.util.Map; - -/** - * Defines mock API response structure. - */ -public class MockedResponseConfig { - private List headers; - private Map contentMap; - - public Map getContentMap() { - return contentMap; - } - - public void setContentMap(Map contentMap) { - this.contentMap = contentMap; - } - - public List getHeaders() { - return headers; - } - - public void setHeaders(List headers) { - this.headers = headers; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/Oauth2AuthenticationConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/Oauth2AuthenticationConfig.java deleted file mode 100644 index c58d008451..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/Oauth2AuthenticationConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2024, 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.commons.model; - -/** - * Defines OAuth2 authentication config structure. - */ -public class Oauth2AuthenticationConfig { - private String header; - private boolean sendTokenToUpstream; - - public String getHeader() { - return header; - } - - public void setHeader(String header) { - this.header = header; - } - - public boolean isSendTokenToUpstream() { - return sendTokenToUpstream; - } - - public void setSendTokenToUpstream(boolean sendTokenToUpstream) { - this.sendTokenToUpstream = sendTokenToUpstream; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ParameterResolver.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ParameterResolver.java deleted file mode 100644 index 48897a93b0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ParameterResolver.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.model; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -class ParameterResolver { - - private static final Pattern PARAMETER_PATTERN = Pattern.compile("(\\{[a-zA-Z0-9]+[a-z-_A-Z0-9]*\\})"); - private static final Logger logger = LogManager.getLogger(ParameterResolver.class); - private final List parameterNames = new ArrayList<>(); - private final Pattern pattern; - private String pathTemplate; - - public ParameterResolver(final String parameterTemplate) { - // This formatting is required since /foo and /foo/ are considered to be equal - this.pathTemplate = parameterTemplate; - String formattedPathParamTemplate = parameterTemplate.endsWith("/") ? - parameterTemplate.substring(0, parameterTemplate.length() - 1) : parameterTemplate; - final Matcher matcher = PARAMETER_PATTERN.matcher(formattedPathParamTemplate); - - while (matcher.find()) { - if (matcher.groupCount() == 1) { - final String group = matcher.group(1); - if (group.length() > 2) { - parameterNames.add(group.substring(1, group.length() - 1)); - } else { - parameterNames.add(group); - } - } - } - String regex = Pattern.quote(matcher.replaceAll("_____PARAM_____")) - .replace("_____PARAM_____", "\\E([^/]*)\\Q"); - regex = regex.endsWith("*\\E") ? regex.substring(0, regex.length() - 4) + "\\E($|([/]{1}(.*)))" : regex; - pattern = Pattern.compile(regex); - } - - public Map parametersByName(final String uriString) throws IllegalArgumentException { - // This formatting is required since /foo and /foo/ are considered to be equal - String formattedURI = uriString.endsWith("/") ? - uriString.substring(0, uriString.length() - 1) : uriString; - final Matcher matcher = pattern.matcher(formattedURI); - if (!matcher.matches()) { - // Unlikely to occur as this pair is already matched within router. - logger.debug("PathTemplate: {} and RawPath: {} is mismatched.", pathTemplate, uriString); - return new HashMap<>(); - } - final Map map = new HashMap<>(); - for (int i = 1; i <= matcher.groupCount(); i++) { - // There can be multiple match for trailing wildcard (if available.) - // Those matches will appear in the end. Hence those can be discarded. - // ex: /pet/{id}/* - if (i == parameterNames.size() + 1) { - break; - } - map.put(parameterNames.get(i - 1), matcher.group(i)); - } - return map; - } -// -// private String preProcessPath(String path) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/Policy.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/Policy.java deleted file mode 100644 index c7bab1bf70..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/Policy.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.commons.model; - -import java.util.Map; - -/** - * operational policy. - */ -public class Policy { - - private String action; - private Map parameters; - - public Policy() { - } - - public Policy(String action, Map parameters) { - this.action = action; - this.parameters = parameters; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public Map getParameters() { - return parameters; - } - - public void setParameters(Map parameters) { - this.parameters = parameters; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/PolicyConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/PolicyConfig.java deleted file mode 100644 index d6a4c2d7df..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/PolicyConfig.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.commons.model; - -import java.util.ArrayList; - -/** - * policy configurations - */ -public class PolicyConfig { - - private ArrayList request; - private ArrayList response; - private ArrayList fault; - - public ArrayList getRequest() { - return request; - } - - public void setRequest(ArrayList request) { - this.request = request; - } - - public ArrayList getResponse() { - return response; - } - - public void setResponse(ArrayList response) { - this.response = response; - } - - public ArrayList getFault() { - return fault; - } - - public void setFault(ArrayList fault) { - this.fault = fault; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/RequestContext.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/RequestContext.java deleted file mode 100644 index 1e8dec77f7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/RequestContext.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.model; - -import org.apache.commons.lang3.StringUtils; -import org.apache.http.NameValuePair; -import org.apache.http.client.utils.URLEncodedUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -/** - * Holds the set of meta data related to current request flowing through the gateway. This context should be shared - * through out the complete request flow through the gateway enforcer. - */ -public class RequestContext { - private static final Logger logger = LogManager.getLogger(RequestContext.class); - - private APIConfig matchedAPI; - private String requestPath; - private String requestMethod; - private ArrayList matchedResourcePaths; - private Map headers; - private Map properties = new HashMap<>(); - private AuthenticationContext authenticationContext; - private String requestID; - private String clientIp; - private String requestPayload; - private String clientCertificate; - // Denotes the cluster header name for each environment. Both properties can be null if - // the openAPI has production endpoints alone. - private String clusterHeader; - //Denotes the specific headers which needs to be passed to response object - private Map addHeaders; - private Map metadataMap = new HashMap<>(); - private String requestPathTemplate; - private ArrayList removeHeaders; - // Consist of web socket frame related data like frame length, remote IP -// private WebSocketFrameContext webSocketFrameContext; - private Map queryParameters; - private Map pathParameters; - private ArrayList queryParamsToRemove; - private boolean removeAllQueryParams; - private Map queryParamsToAdd; - - // Request Timestamp is required for analytics - private long requestTimeStamp; - /** - * The dynamic metadata sent from enforcer are stored in this metadata map. - * - * @return dynamic metadata map - */ - public Map getMetadataMap() { - return metadataMap; - } - - /** - * If the dynamic metadata sent from enforcer needs to be updated/ new keys needs to be added, - * the key, value pairs should be updated in this map. - * - * @param key metadata key - * @param value metadata value - */ - public void addMetadataToMap(String key, String value) { - metadataMap.put(key, value); - } - - /** - * Authentication Context for the request. This is populated after auth Filter. - *

- * Note: - * Depending on the authenticator being used, some properties may remain un-initialized. - * Example: Internal-Key authenticator would not populate application details. - * - * @return {@code AuthenticationContext} - */ - public AuthenticationContext getAuthenticationContext() { - return authenticationContext; - } - - /** - * Set Authentication Context for the request. - *

- * Note: - * The content inside this object is used for throttling and analytics. In addition, - * this object is populated within Authentication Filter. Hence adding a filter prior to - * Authentication Filter and modifying it may not work. - */ - public void setAuthenticationContext(AuthenticationContext authenticationContext) { - this.authenticationContext = authenticationContext; - } - - /** - * Returns corresponding requestPathTemplate. - * - * @return path Template - */ - public String getRequestPathTemplate() { - return requestPathTemplate; - } - - /** - * Request timestamp of the request. - * - * @return request timestamp. - */ - public long getRequestTimeStamp() { - return requestTimeStamp; - } - - private RequestContext() { - } - - /** - * Get the path parameters and the assigned values as a map. - *

- * Ex: /pet/{petID} -> /pet/1 - * then, under 'petId' value would be marked as '1' (string format) - *

- * Note: - * Modifying this map does not result in change of path parameter values. This is - * only for read purposes. - * - * @return Map contains path parameter name and assigned path param value in the request. - */ - public Map getPathParameters() { - return pathParameters; - } - - /** - * Request ID for the request. - * This can be used to correlate the router access log entries and the enforcer logs. - * - * @return request id. - */ - public String getRequestID() { - return requestID; - } - - /** - * Returns the client IP address. - * If the x-forwarded-for header is attached, the value of that header would be assigned as - * client IP. - * - * @return Client IP address - */ - public String getClientIp() { - return clientIp; - } - - /** - * Returns the request payload (request data submitted with the request). - * - * @return request payload (data). - */ - public String getRequestPayload() { - return requestPayload; - } - - /** - * Returns the client certificate. - * - * @return Client certificate - */ - public String getClientCertificate() { - return clientCertificate; - } - - /** - * Get Matched API Details for the request. - * - * @return Matched API - */ - public APIConfig getMatchedAPI() { - return matchedAPI; - } - - /** - * Original Request Path where path parameters are provided with parameter values. - *

- * ex: /pet/1?status=available - * - * @return request path - */ - public String getRequestPath() { - return requestPath; - } - - /** - * Request Method. - * - * @return request method. - */ - public String getRequestMethod() { - return requestMethod; - } - - /** - * Get the complete resource configurations for matched graphQL operations. - *

- * Note: - * * ResourceConfig can be null if the request has the method OPTIONS but there is no such method listed - * * in the OpenAPI definition. - * - * @return {@code ArrayList} object - */ - public ArrayList getMatchedResourcePaths() { - return matchedResourcePaths; - } - - /** - * Get the set of request headers. - *

- * Note: Modifying the headers map here does not result in changing the headers. - * It is for reading the headers. - * If you need to add/modify headers, use addHeaders() method and for removing use - * RemoveHeaders() method. - * - * @return request headers map - */ - public Map getHeaders() { - return headers; - } - - /** - * If there are specific properties needs to be maintained across the filters, the property - * map can be used. - * - * @return property map. - */ - public Map getProperties() { - return properties; - } - - /** - * Returns the production cluster header value. - * can be null if the openAPI has production endpoints alone. - * In that case, no header should not be set. - * - * @return prod Cluster name header value - */ - public String getClusterHeader() { - return clusterHeader; - } - - /** - * If a certain header needs to be added/modified within the request from enforcer additionally, - * those header-value pairs should be added from here. - * - * @param key header needs to be added/modified - * @param value headerValue - */ - public void addOrModifyHeaders(String key, String value) { - if (addHeaders == null) { - addHeaders = new TreeMap<>(); - } - addHeaders.put(key, value); - } - - /** - * If there is a set of headers needs to be removed from the request, those headers should - * be added to the arrayList here. - * - * @return header names which are supposed to be removed. - */ - public ArrayList getRemoveHeaders() { - return removeHeaders; - } - - /** - * Returns the set of newly added/modified header values. - * - * @return the added/modified set of headers. - */ - public Map getAddHeaders() { - return addHeaders; - } - - /** - * Retrieve a map of query parameters in the request. - * - * @return query parameters as a map of {@code } - */ - public Map getQueryParameters() { - return queryParameters; - } -// -// /** -// * This is used for websocket specific implementation. -// * When the websocket communication happens, there is a specific filter which sends some metadata -// * related to the websocket frames for throttling and analytics purposes. This publishing happens -// * asynchronously. -// *

-// * Note: -// * This can't be used for modifying/reading websocket frame data. -// * -// * @return {@code WebSocketFrameContext} object -// */ -// public WebSocketFrameContext getWebSocketFrameContext() { -// return webSocketFrameContext; -// } - - /** - * If there is a set of query parameters needs to be removed from the outbound request, those parameters should - * be added to the arrayList here. - * - * @return query parameters which are supposed to be removed. - */ - public ArrayList getQueryParamsToRemove() { - return queryParamsToRemove; - } - - /** - * If all query parameters needs to be removed from the outbound request. - * - * @return if all query params need to be removed. - */ - public boolean isRemoveAllQueryParams() { - return removeAllQueryParams; - } - - /** - * Set if all query parameters needs to be removed from the outbound request. - */ - public void setRemoveAllQueryParams(boolean removeAllQueryParams) { - this.removeAllQueryParams = removeAllQueryParams; - } - - /** - * If there is a set of query parameters needs to be added to the outbound request, those parameters should - * be added to the arrayList here. - * - * @return query parameters which are supposed to be added. - */ - public Map getQueryParamsToAdd() { - return queryParamsToAdd; - } - - /** - * Set the client certificate for the request. - */ - public void setClientCertificate(String clientCertificate) { - this.clientCertificate = clientCertificate; - } - - - /** - * Implements builder pattern to build an {@link RequestContext} object. - */ - public static class Builder { - private APIConfig matchedAPI; - private String requestPath; - private String requestMethod; - private String requestPathTemplate; - private ArrayList matchedResourceConfigs; - private Map headers; - private String clusterHeader; - private long requestTimeStamp; - private Map properties = new HashMap<>(); - private AuthenticationContext authenticationContext = new AuthenticationContext(); - private String requestID; - private String clientIp; - private String requestPayload; - private String clientCertificate; - private WebSocketFrameContext webSocketFrameContext; - - public Builder(String requestPath) { - this.requestPath = requestPath; - } - - public Builder matchedAPI(APIConfig api) { - this.matchedAPI = api; - return this; - } - - public Builder requestMethod(String requestMethod) { - this.requestMethod = requestMethod; - return this; - } - - public Builder matchedResourceConfigs(ArrayList matchedResourcePaths) { - this.matchedResourceConfigs = matchedResourcePaths; - return this; - } - - public Builder headers(Map headers) { - this.headers = headers; - return this; - } - - public Builder clusterHeader(String cluster) { - if (!StringUtils.isEmpty(cluster)) { - this.clusterHeader = cluster; - } - return this; - } - - public Builder requestTimeStamp(long requestTimeStampInMillies) { - this.requestTimeStamp = requestTimeStampInMillies; - return this; - } - - public Builder authenticationContext(AuthenticationContext authenticationContext) { - this.authenticationContext = authenticationContext; - return this; - } - - public Builder requestID(String requestID) { - this.requestID = requestID; - return this; - } - - public Builder address(String address) { - this.clientIp = address; - return this; - } - - public Builder certificate(String certificate) { - this.clientCertificate = certificate; - return this; - } - - public Builder webSocketFrameContext(WebSocketFrameContext webSocketFrameContext) { - this.webSocketFrameContext = webSocketFrameContext; - return this; - } - - public Builder requestPayload(String requestPayload) { - this.requestPayload = requestPayload; - return this; - } - - public RequestContext build() { - RequestContext requestContext = new RequestContext(); - requestContext.matchedResourcePaths = this.matchedResourceConfigs; - requestContext.matchedAPI = this.matchedAPI; - requestContext.requestMethod = this.requestMethod; - requestContext.requestPath = this.requestPath; - requestContext.headers = this.headers; - requestContext.clusterHeader = this.clusterHeader; - requestContext.properties = this.properties; - requestContext.requestPathTemplate = this.requestPathTemplate; - requestContext.requestTimeStamp = this.requestTimeStamp; - requestContext.authenticationContext = this.authenticationContext; - requestContext.requestID = this.requestID; - requestContext.clientIp = this.clientIp; - requestContext.requestPayload = this.requestPayload; - requestContext.clientCertificate = this.clientCertificate; - requestContext.addHeaders = new HashMap<>(); - requestContext.removeHeaders = new ArrayList<>(); - requestContext.queryParamsToRemove = new ArrayList<>(); - requestContext.removeAllQueryParams = false; - requestContext.queryParamsToAdd = new HashMap<>(); - String[] queryParts = this.requestPath.split("\\?"); - String queryParamsString = queryParts.length > 1 ? queryParts[1] : ""; - - requestContext.queryParameters = new HashMap<>(); - List queryParams = URLEncodedUtils.parse(queryParamsString, StandardCharsets.UTF_8); - for (NameValuePair param : queryParams) { - requestContext.queryParameters.put(param.getName(), param.getValue()); - } - - requestContext.pathParameters = populatePathParameters( - matchedAPI.getBasePath(), requestPathTemplate, this.requestPath); - -// if (this.webSocketFrameContext != null) { -// requestContext.webSocketFrameContext = this.webSocketFrameContext; -// } - return requestContext; - } - - public Builder pathTemplate(String requestPathTemplate) { - this.requestPathTemplate = requestPathTemplate; - return this; - } - - /** - * Create and populate path parameters map. - * - * @param basePath basePath of the API - * @param resourceTemplate resourceTemplate (as listed in OpenAPI) - * @param rawPath raw request Path - * @return map which contains path parameters - */ - private Map populatePathParameters(String basePath, String resourceTemplate, - String rawPath) { - if (resourceTemplate == null || rawPath == null) { - logger.debug("Skip populating the path parameters. template: {}, rawPath: {}", resourceTemplate, - rawPath); - return null; - } - // Format the basePath and resourcePath to maintain consistency - String formattedBasePath = basePath.startsWith("/") ? basePath : "/" + basePath; - formattedBasePath = formattedBasePath.endsWith("/") ? - formattedBasePath.substring(0, formattedBasePath.length() - 1) : formattedBasePath; - String formattedResourcePathTemplate = resourceTemplate.startsWith("/") ? - resourceTemplate : "/" + resourceTemplate; - String formattedRawPath = rawPath.split("\\?")[0]; - - String completeResourcePathTemplate = formattedBasePath + formattedResourcePathTemplate; - // rawPath would not have the prefix only when it is a default api - // request. - if (!formattedRawPath.startsWith(formattedBasePath)) { - // formatted basePath does not have a trailing slash. Hence the last slash appears right - // before the version. - String apiContext = formattedBasePath.substring(0, formattedBasePath.lastIndexOf("/")); - completeResourcePathTemplate = apiContext + formattedResourcePathTemplate; - } - final ParameterResolver parameterResolver = new ParameterResolver(completeResourcePathTemplate); - return parameterResolver.parametersByName(formattedRawPath); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ResourceConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ResourceConfig.java deleted file mode 100644 index 27970a96e1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ResourceConfig.java +++ /dev/null @@ -1,168 +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.commons.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Holds the metadata related to the resources/operations of an API. - */ -public class ResourceConfig { - - private String path; - private String matchID; - private HttpMethods method; - private String tier = "Unlimited"; - private EndpointCluster endpoints; - private EndpointSecurity[] endpointSecurity; - private PolicyConfig policyConfig; - private MockedApiConfig mockedApiConfig; - private AuthenticationConfig authenticationConfig; - private String[] scopes; - - /** - * ENUM to hold http operations. - */ - public enum HttpMethods { - GET("get"), POST("post"), PUT("put"), DELETE("delete"), HEAD("head"), - PATCH("patch"), OPTIONS("options"), QUERY("query"), MUTATION("mutation"), - SUBSCRIPTION("subscription"), GRPC("GRPC"); - - private String value; - - private HttpMethods(String value) { - this.value = value; - } - } - - /** - * Get the matching path Template for the request. - * - * @return path Template - */ - public String getMatchID() { - return matchID; - } - - public void setMatchID(String matchID) { - this.matchID = matchID; - } - - /** - * Get the matching path Template for the request. - * - * @return path Template - */ - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - /** - * Get the matching HTTP Method. - * - * @return HTTP method - */ - public HttpMethods getMethod() { - return method; - } - - public void setMethod(HttpMethods method) { - this.method = method; - } - - /** - * Get the resource level throttling tier assigned for the corresponding Resource. - * - * @return resource level throttling tier - */ - public String getTier() { - return tier; - } - - public void setTier(String tier) { - this.tier = tier; - } - - //todo(amali) this don't need to be a map - - /** - * Get the resource level endpoint cluster map for the corresponding Resource - * where the map-key is either "PRODUCTION" or "SANDBOX". - * - * @return resource level endpoint cluster map - */ - public EndpointCluster getEndpoints() { - return endpoints; - } - - public void setEndpoints(EndpointCluster endpoints) { - this.endpoints = endpoints; - } - - /** - * Provides mock API configurations defined in the JSON. - * - * @return MockedApiConfig object with all the configurations defined under operation of a mocked API. - */ - public MockedApiConfig getMockedApiConfig() { - return mockedApiConfig; - } - - public void setMockApiConfig(MockedApiConfig mockedApiConfig) { - this.mockedApiConfig = mockedApiConfig; - } - - public AuthenticationConfig getAuthenticationConfig() { - return authenticationConfig; - } - - public void setAuthenticationConfig(AuthenticationConfig authenticationConfig) { - this.authenticationConfig = authenticationConfig; - } - - public String[] getScopes() { - return scopes; - } - - public void setScopes(String[] scopes) { - this.scopes = scopes; - } - - public PolicyConfig getPolicyConfig() { - return policyConfig; - } - - public void setPolicyConfig(PolicyConfig policyConfig) { - this.policyConfig = policyConfig; - } - - public EndpointSecurity[] getEndpointSecurity() { - return endpointSecurity; - } - - public void setEndpointSecurity(EndpointSecurity[] endpointSecurity) { - this.endpointSecurity = endpointSecurity; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/RetryConfig.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/RetryConfig.java deleted file mode 100644 index 2652b3273e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/RetryConfig.java +++ /dev/null @@ -1,48 +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.commons.model; - -/** - * The Retry configuration of the cluster which will be referred when setting the route headers - */ -public class RetryConfig { - int count; - Integer[] statusCodes; - - /** - * @param count Number of times to retry - * @param statusCodes Http status codes on which retrying must be done - */ - public RetryConfig(int count, Integer[] statusCodes) { - this.count = count; - this.statusCodes = statusCodes; - } - - /** - * @return Number of times to retry - */ - public int getCount() { - return count; - } - - /** - * @return Http status codes on which retrying must be done - */ - public Integer[] getStatusCodes() { - return statusCodes; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ValueDetails.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ValueDetails.java deleted file mode 100644 index 82eed1ebee..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/ValueDetails.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.wso2.apk.enforcer.commons.model; - -// ValueDetails is used to provide the AI model to the enforcer -public class ValueDetails { - private String in; - private String value; - - public ValueDetails(String in, String value) { - this.in = in; - this.value = value; - } - - public String getIn() { - return in; - } - - public String getValue() { - return value; - } - - public void setIn(String in) { - this.in = in; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/WebSocketFrameContext.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/WebSocketFrameContext.java deleted file mode 100644 index ad7bc57992..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/model/WebSocketFrameContext.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.model; - -/** - * WebSocketFrameContext used to handle the stream requests reaching enforcer from websockets - * wasm filter. - */ -public class WebSocketFrameContext { - private String streamId; - private int frameLength; - private String remoteIp; - - public WebSocketFrameContext(String streamId, int frameLength, String remoteIp) { - this.streamId = streamId; - this.frameLength = frameLength; - this.remoteIp = remoteIp; - } - - public String getStreamId() { - return streamId; - } - - public void setStreamId(String streamId) { - this.streamId = streamId; - } - - public int getFrameLength() { - return frameLength; - } - - public void setFrameLength(int frameLength) { - this.frameLength = frameLength; - } - - public String getRemoteIp() { - return remoteIp; - } - - public void setRemoteIp(String remoteIp) { - this.remoteIp = remoteIp; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPAConstants.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPAConstants.java deleted file mode 100644 index 5eb02d1ac6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPAConstants.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.commons.opa; - -/** - * This class represents the constants that are used for OPA mediator. - */ -public class OPAConstants { - /** - * Constants of the AdditionalParameters map. - */ - public static class AdditionalParameters { - public static final String PARAM_SEPARATOR = ","; - public static final String ADDITIONAL_PROPERTIES = "additionalProperties"; - public static final String SEND_ACCESS_TOKEN = "sendAccessToken"; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPARequestGenerator.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPARequestGenerator.java deleted file mode 100644 index f0d58ce446..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPARequestGenerator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.opa; - -import org.wso2.apk.enforcer.commons.model.RequestContext; - -import java.util.Map; - -/** - * OPA request generator interface to handle OPA policy validation payload and validation response. - */ -public interface OPARequestGenerator { - - /** - * Generate the OPA request payload from the provided request context and the additional Properties Map. - * - * @param policyName Name of the policy validated. - * @param rule Rule of the policy. - * @param additionalParameters Advanced properties that can be used to construct the opa payload. - * @param requestContext Request context details to be validated. - * @return json payload as a string be sent to the OPA server for validation. - * @throws OPASecurityException If an authentication failure or system error occurs. - */ - String generateRequest(String policyName, String rule, Map additionalParameters, - RequestContext requestContext) throws OPASecurityException; - - /** - * Validate the OPA response and handle request context based on the response. - * - * @param policyName Name of the policy validated. - * @param rule Rule of the policy. - * @param opaResponse OPA response to be validated. - * @param additionalParameters Advanced properties that can be used to construct the opa payload. - * @param requestContext Request context details to be validated. - * @return true if valid, false otherwise. - * @throws OPASecurityException If an authentication failure or system error occurs. - */ - boolean handleResponse(String policyName, String rule, String opaResponse, Map additionalParameters, - RequestContext requestContext) throws OPASecurityException; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPASecurityException.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPASecurityException.java deleted file mode 100644 index c6ce56c68e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/opa/OPASecurityException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.commons.opa; - -import org.wso2.apk.enforcer.commons.exception.APISecurityException; - -/** - * Represents an Operation Policy Agent security violation or system error that may have occurred - * while validating. - */ -public class OPASecurityException extends APISecurityException { - - public OPASecurityException(int statusCode, int errorCode) { - super(statusCode, errorCode, null); - } - - public OPASecurityException(int statusCode, int errorCode, String message) { - super(statusCode, errorCode, message); - } - - public OPASecurityException(int statusCode, int errorCode, Throwable cause) { - super(statusCode, errorCode, null, cause); - } - - public OPASecurityException(int statusCode, int errorCode, String message, Throwable cause) { - super(statusCode, errorCode, message, cause); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/proxy/ExtendedProxyRoutePlanner.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/proxy/ExtendedProxyRoutePlanner.java deleted file mode 100644 index 78ccd8c36a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/proxy/ExtendedProxyRoutePlanner.java +++ /dev/null @@ -1,99 +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.commons.proxy; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpHost; -import org.apache.http.HttpRequest; -import org.apache.http.impl.conn.DefaultProxyRoutePlanner; -import org.apache.http.protocol.HttpContext; -import org.wso2.apk.enforcer.commons.configdto.HttpClientConfigurationDTO; - -/** - * Extended ProxyRoutePlanner class to handle non proxy hosts implementation - */ -public class ExtendedProxyRoutePlanner extends DefaultProxyRoutePlanner { - private static final Log log = LogFactory.getLog(ExtendedProxyRoutePlanner.class); - private final HttpClientConfigurationDTO configuration; - String[] nonProxyHosts; - String proxyHost; - int proxyPort; - String protocol; - - public ExtendedProxyRoutePlanner(HttpHost host, HttpClientConfigurationDTO configuration) { - super(host); - this.configuration = configuration; - this.nonProxyHosts = configuration.getNonProxyHosts(); - this.proxyHost = configuration.getProxyHost(); - this.proxyPort = configuration.getProxyPort(); - this.protocol = configuration.getProxyProtocol(); - } - - private HttpHost getProxy(String scheme) { - log.debug("Get proxy for scheme: " + scheme); - - String protoProxyHost = proxyHost; - if (protoProxyHost == null) { - return null; - } - - int protoProxyPort = proxyPort; - if (protoProxyPort < 1) { - return null; - } - log.debug("set " + scheme + " proxy '" + protoProxyHost + ":" + protoProxyPort + "'"); - return new HttpHost(protoProxyHost, protoProxyPort, scheme); - } - - private boolean doesTargetMatchNonProxy(HttpHost target) { - String uriHost = target.getHostName(); - String uriScheme = target.getSchemeName(); - String[] nonProxyHosts = configuration.getNonProxyHosts(); - int nphLength = nonProxyHosts != null ? nonProxyHosts.length : 0; - if (nonProxyHosts == null || nphLength < 1) { - log.debug("scheme:'" + uriScheme + "', host:'" + uriHost + "' : DEFAULT (0 non proxy host)"); - return false; - } - for (String nonProxyHost : nonProxyHosts) { - if (uriHost.matches(nonProxyHost)) { - log.debug("scheme:'" + uriScheme + "', host:'" + uriHost + "' matches nonProxyHost '" + - nonProxyHost + "' : NO PROXY"); - return true; - } - } - log.debug("scheme:'" + uriScheme + "', host:'" + uriHost + "' : DEFAULT (no match of " + nphLength + - " non proxy host)"); - return false; - } - - @Override - protected HttpHost determineProxy(HttpHost target, final HttpRequest request, final HttpContext context) { - - if (doesTargetMatchNonProxy(target)) { - return null; - } - if (StringUtils.isNotEmpty(protocol)) { - return getProxy(protocol); - } else { - return getProxy(target.getSchemeName()); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/util/CommonAPIUtil.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/util/CommonAPIUtil.java deleted file mode 100644 index 30e30da994..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/util/CommonAPIUtil.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.commons.util; - -import org.apache.commons.lang3.StringUtils; -import org.apache.http.HttpHost; -import org.apache.http.auth.AuthScope; -import org.apache.http.auth.UsernamePasswordCredentials; -import org.apache.http.client.CredentialsProvider; -import org.apache.http.client.HttpClient; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.config.Registry; -import org.apache.http.config.RegistryBuilder; -import org.apache.http.conn.socket.ConnectionSocketFactory; -import org.apache.http.conn.socket.PlainConnectionSocketFactory; -import org.apache.http.conn.ssl.DefaultHostnameVerifier; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.impl.client.BasicCredentialsProvider; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.DefaultProxyRoutePlanner; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.wso2.apk.enforcer.commons.configdto.HttpClientConfigurationDTO; -import org.wso2.apk.enforcer.commons.http.BrowserHostnameVerifier; -import org.wso2.apk.enforcer.commons.proxy.ExtendedProxyRoutePlanner; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLContext; - -/** - * Utility Functions for Common gateway component. - */ -public class CommonAPIUtil { - public static final String STRICT = "Strict"; - public static final String ALLOW_ALL = "AllowAll"; - public static final String HOST_NAME_VERIFIER = "httpclient.hostnameVerifier"; - public static final String HTTPS_PROTOCOL = "https"; - public static final String HTTP_PROTOCOL = "http"; - - private static final HostnameVerifier strictHostNameVerifier = new DefaultHostnameVerifier(); - private static final HostnameVerifier browserHostNameVerifier = new BrowserHostnameVerifier(); - - private static PoolingHttpClientConnectionManager getPoolingHttpClientConnectionManager( - HttpClientConfigurationDTO clientConfiguration) { - - SSLConnectionSocketFactory socketFactory = createSocketFactory(clientConfiguration.getSslContext(), - clientConfiguration.getHostnameVerifier()); - Registry socketFactoryRegistry = - RegistryBuilder.create() - .register(HTTP_PROTOCOL, PlainConnectionSocketFactory.getSocketFactory()) - .register(HTTPS_PROTOCOL, socketFactory) - .build(); - return new PoolingHttpClientConnectionManager(socketFactoryRegistry); - } - - private static SSLConnectionSocketFactory createSocketFactory(SSLContext sslContext, - HostnameVerifier hostnameVerifier) { - return new SSLConnectionSocketFactory(sslContext, hostnameVerifier); - } - - /** - * Return a http client instance - * - * @param protocol - service endpoint protocol http/https - * @return {@link HttpClient} with all proxy, TLS, ConnectionPooling related configurations - */ - public static HttpClient getHttpClient(String protocol, HttpClientConfigurationDTO clientConfiguration) { - - int maxTotal = clientConfiguration.getConnectionLimit(); - int defaultMaxPerRoute = clientConfiguration.getMaximumConnectionsPerRoute(); - - boolean proxyEnabled = clientConfiguration.isProxyEnabled(); - String proxyHost = clientConfiguration.getProxyHost(); - int proxyPort = clientConfiguration.getProxyPort(); - String proxyUsername = clientConfiguration.getProxyUsername(); - char[] proxyPassword = clientConfiguration.getProxyPassword(); - String[] nonProxyHosts = clientConfiguration.getNonProxyHosts(); - String proxyProtocol = clientConfiguration.getProxyProtocol(); - - if (proxyProtocol != null) { - protocol = proxyProtocol; - } - - PoolingHttpClientConnectionManager pool = getPoolingHttpClientConnectionManager(clientConfiguration); - - pool.setMaxTotal(maxTotal); - pool.setDefaultMaxPerRoute(defaultMaxPerRoute); - - RequestConfig params = RequestConfig.custom().build(); - HttpClientBuilder clientBuilder = HttpClients.custom().setConnectionManager(pool) - .setDefaultRequestConfig(params); - - if (proxyEnabled) { - HttpHost host = new HttpHost(proxyHost, proxyPort, protocol); - DefaultProxyRoutePlanner routePlanner; - if (nonProxyHosts.length > 0) { - routePlanner = new ExtendedProxyRoutePlanner(host, clientConfiguration); - } else { - routePlanner = new DefaultProxyRoutePlanner(host); - } - clientBuilder.setRoutePlanner(routePlanner); - if (!StringUtils.isBlank(proxyUsername) && proxyPassword.length > 0) { - CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); - credentialsProvider.setCredentials(new AuthScope(proxyHost, proxyPort), - new UsernamePasswordCredentials(proxyUsername, String.valueOf(proxyPassword))); - clientBuilder.setDefaultCredentialsProvider(credentialsProvider); - } - } - return clientBuilder.build(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/util/JWTUtil.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/util/JWTUtil.java deleted file mode 100644 index 48d1655167..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/util/JWTUtil.java +++ /dev/null @@ -1,237 +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.commons.util; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.JsonParser; -import com.nimbusds.jose.JOSEObjectType; -import com.nimbusds.jose.JWSAlgorithm; -import com.nimbusds.jose.JWSHeader; -import com.nimbusds.jose.PlainHeader; -import com.nimbusds.jose.util.Base64URL; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.exception.JWTGeneratorException; - -import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.security.InvalidKeyException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.Signature; -import java.security.SignatureException; -import java.security.cert.Certificate; -import java.security.cert.CertificateEncodingException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - -/** - * Helper class for util related to jwt generation. - */ -public final class JWTUtil { - - private static final Log log = LogFactory.getLog(JWTUtil.class); - - /** - * Utility method to generate JWT header with public certificate thumbprint for signature verification. - * - * @param signatureAlgorithm signature algorithm which needs to include in the header - * @throws JWTGeneratorException - */ - - public static String generateHeader(JWTConfigurationDto jwtConfigurationDto, String signatureAlgorithm) throws - JWTGeneratorException { - if ("NONE".equals(signatureAlgorithm)){ - PlainHeader.Builder plainHeader = new PlainHeader.Builder().type(JOSEObjectType.JWT); - return plainHeader.build().toString(); - } - JWSHeader.Builder jwsHeaderBuilder = new JWSHeader.Builder(JWSAlgorithm.RS256).type(JOSEObjectType.JWT); - - /* - * Sample header - * {"typ":"JWT", "alg":"SHA256withRSA", "x5t":"a_jhNus21KVuoFx65LmkW2O_l10", - * "kid":"a_jhNus21KVuoFx65LmkW2O_l10"} - * {"typ":"JWT", "alg":"[2]", "x5t":"[1]", "x5t":"[1]"} - * */ - try { - if (jwtConfigurationDto.useKid()) { - jwsHeaderBuilder = jwsHeaderBuilder.keyID(jwtConfigurationDto.getKidValue()); - } else { - jwsHeaderBuilder = jwsHeaderBuilder.x509CertThumbprint(new Base64URL(generateThumbprint("SHA-1", jwtConfigurationDto.getPublicCert(), true))); - } - return jwsHeaderBuilder.build().toString(); - } catch (NoSuchAlgorithmException | CertificateEncodingException | UnsupportedEncodingException e) { - throw new JWTGeneratorException("Error in generating public certificate thumbprint", e); - } - } - - public static String generateThumbprint(String hashType, Certificate publicCert, boolean usePadding) - throws CertificateEncodingException, - UnsupportedEncodingException, NoSuchAlgorithmException { - MessageDigest digestValue; - byte[] der = publicCert.getEncoded(); - digestValue = MessageDigest.getInstance(hashType); - digestValue.update(der); - byte[] digestInBytes = digestValue.digest(); - String publicCertThumbprint = hexify(digestInBytes); - String base64UrlEncodedThumbPrint; - if (usePadding) { - base64UrlEncodedThumbPrint = java.util.Base64.getUrlEncoder() - .encodeToString(publicCertThumbprint.getBytes(StandardCharsets.UTF_8)); - } else { - base64UrlEncodedThumbPrint = java.util.Base64.getUrlEncoder().withoutPadding() - .encodeToString(publicCertThumbprint.getBytes(StandardCharsets.UTF_8)); - } - return base64UrlEncodedThumbPrint; - } - - /** - * Helper method to hexify a byte array. - * - * @param bytes - The input byte array - * @return hexadecimal representation - */ - public static String hexify(byte bytes[]) { - - char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; - - StringBuilder buf = new StringBuilder(bytes.length * 2); - for (byte aByte : bytes) { - buf.append(hexDigits[(aByte & 0xf0) >> 4]); - buf.append(hexDigits[aByte & 0x0f]); - } - return buf.toString(); - } - - /** - * Utility method to sign a JWT assertion with a particular signature algorithm. - * - * @param assertion valid JWT assertion - * @param privateKey private key which use to sign the JWT assertion - * @param signatureAlgorithm signature algorithm which use to sign the JWT assertion - * @return byte array of the JWT signature - * @throws JWTGeneratorException - */ - public static byte[] signJwt(String assertion, PrivateKey privateKey, String signatureAlgorithm) throws - JWTGeneratorException { - - try { - //initialize signature with private key and algorithm - Signature signature = Signature.getInstance(signatureAlgorithm); - signature.initSign(privateKey); - - //update signature with data to be signed - byte[] dataInBytes = assertion.getBytes(Charset.defaultCharset()); - signature.update(dataInBytes); - - //sign the assertion and return the signature - return signature.sign(); - } catch (NoSuchAlgorithmException e) { - //do not log - throw new JWTGeneratorException("Signature algorithm not found", e); - } catch (InvalidKeyException e) { - //do not log - throw new JWTGeneratorException("Invalid private key provided for signing", e); - } catch (SignatureException e) { - //do not log - throw new JWTGeneratorException("Error while signing JWT", e); - } - } - - /** - * Parse a jwt assertion provided in string format and returns set of claims - * defined in the assertion. - * - * @param jwt jwt assertion - * @return claims as a {@link Map}. if jwt is not parse-able null will be returned. - */ - public static Map getJWTClaims(String jwt) { - - if (StringUtils.isNotEmpty(jwt)) { - Map jwtClaims = new HashMap<>(); - String[] jwtTokenArray = jwt.split(Pattern.quote(".")); - // decoding JWT - try { - byte[] jwtByteArray = Base64.decodeBase64(jwtTokenArray[1].getBytes(StandardCharsets.UTF_8)); - String jwtAssertion = new String(jwtByteArray, StandardCharsets.UTF_8); - JsonElement parsedJson = new JsonParser().parse(jwtAssertion); - if (parsedJson.isJsonObject()) { - JsonObject rootObject = parsedJson.getAsJsonObject(); - for (Map.Entry rootElement : rootObject.entrySet()) { - if (rootElement.getValue().isJsonPrimitive()) { - jwtClaims.put(rootElement.getKey(), rootElement.getValue().getAsString()); - } else if (rootElement.getValue().isJsonArray()) { - JsonArray arrayElement = rootElement.getValue().getAsJsonArray(); - List element = new ArrayList<>(); - for (JsonElement jsonElement : arrayElement) { - element.add(jsonElement.getAsString()); - } - jwtClaims.put(rootElement.getKey(), String.join("|", element)); - } else if (rootElement.getValue().isJsonObject()) { - getJWTClaimsArray(jwtClaims, (JsonObject) rootElement.getValue(), rootElement.getKey()); - } - } - } - } catch (JsonParseException e) { - // gson throws runtime exceptions for parsing errors. We don't want to throw - // errors and break the flow from this util method. Therefore logging and - // returning null for error case - log.error("Error occurred while parsing jwt claims"); - } - return jwtClaims; - } else { - return null; - } - - } - - private static void getJWTClaimsArray(Map jwtClaims, JsonObject jsonObject, String parent) { - - if (jsonObject.isJsonObject()) { - JsonObject rootObject = jsonObject.getAsJsonObject(); - for (Map.Entry rootElement : rootObject.entrySet()) { - String claimKey = parent.concat(".").concat(rootElement.getKey()); - if (rootElement.getValue().isJsonPrimitive()) { - jwtClaims.put(claimKey, rootElement.getValue().getAsString()); - } else if (rootElement.getValue().isJsonArray()) { - JsonArray arrayElement = rootElement.getValue().getAsJsonArray(); - List element = new ArrayList<>(); - for (JsonElement jsonElement : arrayElement) { - element.add(jsonElement.getAsString()); - } - jwtClaims.put(claimKey, String.join("|", element)); - } else if (rootElement.getValue().isJsonObject()) { - getJWTClaimsArray(jwtClaims, (JsonObject) rootElement.getValue(), claimKey); - } - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/test/java/org/wso2/apk/enforcer/commons/model/RequestContextTest.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/test/java/org/wso2/apk/enforcer/commons/model/RequestContextTest.java deleted file mode 100644 index 4a76546e42..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/test/java/org/wso2/apk/enforcer/commons/model/RequestContextTest.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org). - * - * 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.commons.model; - -import org.junit.Assert; -import org.junit.Test; - -public class RequestContextTest { - - public RequestContextTest() {} - - @Test - public void testPathParameterGenerationBasic() { - testPathParamValues("/v2/pet/12", "/v2", "/pet/{petId}", - "petId", "12"); - } - - @Test - public void testPathParameterGenerationMultiple() { - testPathParamValues("/v2/pet/12/status/available", "/v2", "/pet/{petId}/status/{statusType}", - "petId", "12"); - testPathParamValues("/v2/pet/12/status/available", "/v2", "/pet/{petId}/status/{statusType}", - "statusType", "available"); - } - - @Test - public void testPathParametersWithTrailingSlashInTemplate() { - testPathParamValues("/v2/pet/12/status/available", "/v2", "/pet/{petId}/status/{statusType}/", - "petId", "12"); - } - - @Test - public void testPathParametersWithTrailingSlashInRawPath() { - testPathParamValues("/v2/pet/12/status/available/", "/v2", "/pet/{petId}/status/{statusType}", - "petId", "12"); - } - - @Test - public void testPathParametersWithHyphen() { - testPathParamValues("/v2/pet/12/status/available", "/v2", "/pet/{pet-Id}/status/{statusType}", - "pet-Id", "12"); - } - - @Test - public void testPathParametersWithUnderscore() { - testPathParamValues("/v2/pet/12/status/available", "/v2", "/pet/{pet_Id}/status/{statusType}", - "pet_Id", "12"); - } - - @Test - public void testPathParametersWithNumbers() { - testPathParamValues("/v2/pet/12/status/available", "/v2", "/pet/{petId2}/status/{statusType}", - "petId2", "12"); - } - - @Test - public void testPathParameterGenerationWithWildcard() { - testPathParamValues("/v2/pet/12/2/random/random2", "/v2", "/pet/{petId}/{imageId}/*", - "petId", "12"); - testPathParamValues("/v2/pet/12/2/random/random2/random3", "/v2", "/pet/{petId}/{imageId}/*", - "petId", "12"); - testPathParamValues("/v2/pet/12/image/2/random/random2", "/v2", "/pet/{petId}/image/{imageId}/*", - "imageId", "2"); - testPathParamValues("/v2/pet/12/2/image", "/v2", "/pet/{petId}/{imageId}/image/*", - "petId", "12"); - testPathParamValues("/v2/pet/pet-1/image/*", "/v2", "/pet/{imageId}/image/*", - "imageId", "pet-1"); - testMismatchedPaths("/v2/pet/12/2/image123", "/v2", "/pet/{petId}/{imageId}/image/*"); - } - - @Test - public void testPathParameterGenerationWithQueryParam() { - testPathParamValues("/v2/pet/12?abc=xyz", "/v2", "/pet/{petId}", - "petId", "12"); - } - - @Test - public void testPathParameterGenerationWithSuffixedPath() { - testPathParamValues("/v2/pet/12.api", "/v2", "/pet/{petId}.api", - "petId", "12"); - } - - @Test - public void testPathParameterGenerationWithPrefixedPath() { - testPathParamValues("/v2/pet/api12", "/v2", "/pet/api{petId}", - "petId", "12"); - } - - @Test - public void testPathParameterWithDefaultAPIRequests() { - testPathParamValues("/testapi/pet/12", "/testapi/v1", "/pet/{petId}", - "petId", "12"); - } - - private void testPathParamValues(String rawPath, String basePath, String pathTemplate, String pathParamName, - String expectedValue) { - RequestContext.Builder builder = new RequestContext.Builder(rawPath); - builder.matchedAPI(new APIConfig.Builder("Petstore").basePath(basePath).build()); - builder.pathTemplate(pathTemplate); - RequestContext requestContext = builder.build(); - Assert.assertNotNull(requestContext.getPathParameters()); - Assert.assertTrue(requestContext.getPathParameters().containsKey(pathParamName)); - Assert.assertEquals("Path Parameter mismatch for the template" + pathTemplate, - requestContext.getPathParameters().get(pathParamName), expectedValue); - } - - private void testMismatchedPaths(String rawPath, String basePath, String pathTemplate) { - RequestContext.Builder builder = new RequestContext.Builder(rawPath); - builder.matchedAPI(new APIConfig.Builder("Petstore").basePath(basePath).build()); - builder.pathTemplate(pathTemplate); - RequestContext requestContext = builder.build(); - Assert.assertNotNull(requestContext.getPathParameters()); - Assert.assertEquals(0, requestContext.getPathParameters().size()); - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/build.gradle b/gateway/enforcer/org.wso2.apk.enforcer/build.gradle deleted file mode 100644 index 94b5a29298..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/build.gradle +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -description = 'WSO2 APK Enforcer' - -sourceSets { - test { - resources { - srcDirs("src/test/java") - } - } -} - -dependencies { - compileOnly libs.tomcat - implementation libs.azure.applicationinsights - implementation(libs.azure.messaging) { - exclude group: 'org.codehaus.woodstox', module: 'woodstox-core' - } - implementation libs.azure.monitor.opentelemetry - implementation (libs.azure.okhttp) { - exclude group: 'com.squareup.okhttp3', module: 'okhttp' - } - - implementation libs.commons.lang3 - implementation libs.commons.pool - implementation libs.commons.io - implementation libs.envoyproxy.controlplane - implementation libs.fasterxml.woodstox - implementation libs.geronimo - implementation libs.graphql - implementation libs.grpc.netty - implementation libs.grpc.protobuf - implementation libs.grpc.stub - implementation libs.gson - implementation libs.guava - implementation libs.httpcomponents.client - implementation libs.jackson.annotations - implementation libs.jackson.databind - implementation libs.javax.validation.api - implementation libs.javax.xml.soap - implementation libs.json - implementation libs.lmax.disruptor - implementation libs.log4j.api - implementation libs.log4j.core - implementation libs.log4j.jcl - implementation libs.log4j.slf4j - implementation libs.log4j.slf4j.simple - implementation libs.minidev.json - implementation libs.netty.http - implementation libs.netty.http2 - implementation libs.nimbus.jose.jwt - implementation libs.opentelemetry.api - implementation libs.opentelemetry.exporter.jaeger.thrift - implementation libs.opentelemetry.exporter.otlp - implementation libs.opentelemetry.exporter.zipkin - implementation libs.opentelemetry.extension.trace.propagators - implementation libs.opentelemetry.sdk - implementation libs.opentelemetry.semconv - implementation libs.prometheus - implementation libs.snakeyaml - implementation libs.sun.saaj.impl - implementation libs.swagger.core.v3 - implementation libs.toml - implementation libs.websocket - implementation libs.json.simple - implementation project(':org.wso2.apk.enforcer.commons') - // Added as direct dependency for transitive dependency version upgrades - implementation libs.reactor.netty.http - implementation libs.protobuf.java - implementation libs.jedis - implementation libs.feign.httpclient - implementation libs.gson - implementation libs.ua.parser - implementation libs.commons.lang3 - implementation libs.commons.compress - implementation libs.openfeign.feign.gson - implementation libs.openfeign.feign.slf4j - - test { - implementation libs.junit - implementation libs.mockito.inline - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AccessLoggingService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AccessLoggingService.java deleted file mode 100644 index faa844bf19..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AccessLoggingService.java +++ /dev/null @@ -1,124 +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.analytics; - -import io.envoyproxy.envoy.service.accesslog.v3.AccessLogServiceGrpc; -import io.envoyproxy.envoy.service.accesslog.v3.StreamAccessLogsMessage; -import io.envoyproxy.envoy.service.accesslog.v3.StreamAccessLogsResponse; -import io.grpc.Server; -import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; -import io.grpc.netty.shaded.io.netty.channel.EventLoopGroup; -import io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoopGroup; -import io.grpc.netty.shaded.io.netty.channel.socket.nio.NioServerSocketChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.dto.AnalyticsReceiverConfigDTO; -import org.wso2.apk.enforcer.metrics.MetricsUtils; -import org.wso2.apk.enforcer.server.Constants; -import org.wso2.apk.enforcer.server.EnforcerThreadPoolExecutor; -import org.wso2.apk.enforcer.server.NativeThreadFactory; -import org.wso2.apk.enforcer.util.TLSUtils; - -import java.io.IOException; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - -/** - * This is the gRPC streaming server written to match with the envoy grpc access logger filter proto file. - * Envoy proxy call this service. - * This will gather data required for analytics. - */ -public class AccessLoggingService extends AccessLogServiceGrpc.AccessLogServiceImplBase { - - private static final Logger logger = LogManager.getLogger(AccessLoggingService.class); - - public void init() throws IOException { - // Initialize analytics Filter - if (ConfigHolder.getInstance().getConfig().getAnalyticsConfig().isEnabled()) { - AnalyticsFilter.getInstance(); - } - startAccessLoggingServer(); - } - - @Override - public StreamObserver streamAccessLogs - (StreamObserver responseObserver) { - return new StreamObserver<>() { - @Override - public void onNext(StreamAccessLogsMessage message) { - if (ConfigHolder.getInstance().getConfig().getAnalyticsConfig().isEnabled()) { - AnalyticsFilter.getInstance().handleGRPCLogMsg(message); - } - if (ConfigHolder.getInstance().getConfig().getMetricsConfig().isMetricsEnabled()) { - MetricsUtils.handlePublishingMetrics(message); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error while receiving access log entries from router. " + throwable.getMessage(), - ErrorDetails.errorLog(LoggingConstants.Severity.CRITICAL, 5101)); - responseObserver.onCompleted(); - } - - @Override - public void onCompleted() { - responseObserver.onNext(StreamAccessLogsResponse.newBuilder().build()); - responseObserver.onCompleted(); - logger.info("Access Log processing is completed."); - } - }; - } - - private void startAccessLoggingServer() throws IOException { - AnalyticsReceiverConfigDTO serverConfig = - ConfigHolder.getInstance().getConfig().getAnalyticsConfig().getServerConfig(); - final EventLoopGroup bossGroup = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors()); - final EventLoopGroup workerGroup = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors() * 2); - int blockingQueueLength = serverConfig.getThreadPoolConfig().getQueueSize(); - final BlockingQueue blockingQueue = new LinkedBlockingQueue(blockingQueueLength); - final Executor executor = - new EnforcerThreadPoolExecutor(serverConfig.getThreadPoolConfig().getCoreSize(), - serverConfig.getThreadPoolConfig().getMaxSize(), - serverConfig.getThreadPoolConfig().getKeepAliveTime(), - TimeUnit.SECONDS, - blockingQueue, - new NativeThreadFactory(new ThreadGroup(Constants.ANALYTICS_THREAD_GROUP), - Constants.ANALYTICS_THREAD_ID)); - - Server accessLoggerService = NettyServerBuilder - .forPort(serverConfig.getPort()) - .keepAliveTime(serverConfig.getKeepAliveTime(), TimeUnit.SECONDS) - .maxInboundMessageSize(serverConfig.getMaxMessageSize()) - .bossEventLoopGroup(bossGroup) - .workerEventLoopGroup(workerGroup) - .addService(this) - .sslContext(TLSUtils.buildGRPCServerSSLContext()) - .channelType(NioServerSocketChannel.class).executor(executor).build(); - - accessLoggerService.start(); - logger.info("Access log Receiver started Listening in port : " + serverConfig.getPort()); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsConstants.java deleted file mode 100644 index 70969eeb0a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsConstants.java +++ /dev/null @@ -1,42 +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.analytics; - -/** - * AnalyticsConstants holds the pre determined configuration keys provided. - */ -public class AnalyticsConstants { - - public static final String PUBLISHER_IMPL_CONFIG_KEY = "publisherImpl"; - protected static final String IS_CHOREO_DEPLOYMENT_CONFIG_KEY = "isChoreoDeployment"; - protected static final String TYPE_CONFIG_KEY = "type"; - protected static final String PUBLISHER_REPORTER_CLASS_CONFIG_KEY = "publisher.reporter.class"; - - public static final String RESPONSE_SCHEMA = "RESPONSE"; - public static final String ERROR_SCHEMA = "ERROR"; - protected static final String CHOREO_RESPONSE_SCHEMA = "CHOREO_RESPONSE"; - protected static final String CHOREO_FAULT_SCHEMA = "CHOREO_ERROR"; - - protected static final String ELK_TYPE = "elk"; - protected static final String DEFAULT_ELK_PUBLISHER_REPORTER_CLASS = "org.wso2.apk.enforcer.analytics.publisher.reporter.elk.ELKMetricReporter"; - - protected static final String GATEWAY_TYPE_CONFIG_KEY = "gatewayType"; - protected static final String DEFAULT_GATEWAY_TYPE = "Onprem"; - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsEventPublisher.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsEventPublisher.java deleted file mode 100644 index 0febcf0f1c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsEventPublisher.java +++ /dev/null @@ -1,94 +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.analytics; - -import io.envoyproxy.envoy.service.accesslog.v3.StreamAccessLogsMessage; -import org.wso2.apk.enforcer.config.dto.AnalyticsPublisherConfigDTO; -//import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest; - -import java.util.List; -import java.util.Map; - -/** - * AnalyticsEventPublisher interface should be used to write a custom analytics publisher. - */ -public interface AnalyticsEventPublisher { - - /** - * The method body should include about how to handle the gRPC log message received from the router. - * - * In addition to the access log entry content, following information would be available within - * dynamic metadata which is populated within router (envoy.filters.http.ext_authz). - * - * APIID - * APIName - * APIVersion - * APICreator - * APIType - * APICreatorTenantDomain - * - * ApplicationKeyType - * ApplicationID - * ApplicationName - * ApplicationOwner - * - * CorrelationID (fetched from requestID) - * Region - * APIResourceTemplate - * Destination (The upstream endpoint of the request) - * - * @param message gRPC Stream access log message from router. - */ - void handleGRPCLogMsg(StreamAccessLogsMessage message); - -// /** -// * The method body should include about how to handle the websocket framereqeust received from the router's -// * wasm filter for websockets. -// * -// * Following information would be available within -// * dynamic metadata which is populated within router (envoy.filters.http.ext_authz). -// * -// * APIID -// * APIName -// * APIVersion -// * APICreator -// * APIType -// * APICreatorTenantDomain -// * -// * ApplicationKeyType -// * ApplicationID -// * ApplicationName -// * ApplicationOwner -// * -// * CorrelationID (fetched from requestID) -// * Region -// * APIResourceTemplate -// * Destination (The upstream endpoint of the request) -// * -// * @param webSocketFrameRequest -// */ -// void handleWebsocketFrameRequest(WebSocketFrameRequest webSocketFrameRequest); - - /** - * Initialize the analytics publisher with configurations map. - * - * @param analyticsPublisherConfigDTOList Analytics Configurations - */ - void init(List analyticsPublisherConfigDTOList); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsFilter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsFilter.java deleted file mode 100644 index d12c92fa15..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsFilter.java +++ /dev/null @@ -1,262 +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.analytics; - -import io.envoyproxy.envoy.service.accesslog.v3.StreamAccessLogsMessage; -import io.opentelemetry.context.Scope; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsCustomDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.impl.GenericRequestDataCollector; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.dto.AnalyticsDTO; -import org.wso2.apk.enforcer.config.dto.AnalyticsPublisherConfigDTO; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.AnalyticsConstants; -import org.wso2.apk.enforcer.constants.MetadataConstants; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingSpan; -import org.wso2.apk.enforcer.tracing.TracingTracer; -import org.wso2.apk.enforcer.tracing.Utils; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import static org.wso2.apk.enforcer.analytics.AnalyticsConstants.CHOREO_FAULT_SCHEMA; -import static org.wso2.apk.enforcer.analytics.AnalyticsConstants.CHOREO_RESPONSE_SCHEMA; -import static org.wso2.apk.enforcer.analytics.AnalyticsConstants.IS_CHOREO_DEPLOYMENT_CONFIG_KEY; - -/** - * This is the filter is for Analytics. - * If the request is failed at enforcer (due to throttling, authentication failures) the analytics event is - * published by the filter itself. - * If the request is allowed to proceed, the dynamic metadata will be populated so that the analytics event can be - * populated from grpc access logs within AccessLoggingService. - */ -public class AnalyticsFilter { - - private static final Logger logger = LogManager.getLogger(AnalyticsFilter.class); - private static AnalyticsFilter analyticsFilter; - private static AnalyticsEventPublisher publisher; - private static AnalyticsCustomDataProvider analyticsDataProvider; - - private AnalyticsFilter() { - - AnalyticsDTO analyticsConfig = ConfigHolder.getInstance().getConfig().getAnalyticsConfig(); - Map properties = analyticsConfig.getProperties(); - publisher = new DefaultAnalyticsEventPublisher(); - boolean choreoDeployment = false; - if (properties != null){ - choreoDeployment = (boolean) properties.getOrDefault(IS_CHOREO_DEPLOYMENT_CONFIG_KEY,false); - } - if (choreoDeployment){ - publisher = new DefaultAnalyticsEventPublisher(CHOREO_RESPONSE_SCHEMA, CHOREO_FAULT_SCHEMA); - } - List analyticsPublisherConfigDTOList = - ConfigHolder.getInstance().getConfig().getAnalyticsConfig().getAnalyticsPublisherConfigDTOList(); - publisher.init(analyticsPublisherConfigDTOList); - } - - public static AnalyticsFilter getInstance() { - - if (analyticsFilter == null) { - synchronized (new Object()) { - if (analyticsFilter == null) { - analyticsFilter = new AnalyticsFilter(); - } - } - } - return analyticsFilter; - } - - public void handleGRPCLogMsg(StreamAccessLogsMessage message) { - - if (publisher != null) { - publisher.handleGRPCLogMsg(message); - } else { - logger.error("Cannot publish the analytics event as analytics publisher is null.", - ErrorDetails.errorLog(LoggingConstants.Severity.CRITICAL, 5102)); - } - } - -// public void handleWebsocketFrameRequest(WebSocketFrameRequest frameRequest) { -// if (publisher != null) { -// publisher.handleWebsocketFrameRequest(frameRequest); -// } else { -// logger.error("Cannot publish the analytics event as analytics publisher is null.", -// ErrorDetails.errorLog(LoggingConstants.Severity.CRITICAL, 5102)); -// } -// } - - public static AnalyticsCustomDataProvider getAnalyticsCustomDataProvider() { - - return analyticsDataProvider; - } - - public void handleSuccessRequest(RequestContext requestContext) { - - TracingSpan analyticsSpan = null; - Scope analyticsSpanScope = null; - try { - if (Utils.tracingEnabled()) { - TracingTracer tracer = Utils.getGlobalTracer(); - analyticsSpan = Utils.startSpan(TracingConstants.ANALYTICS_SPAN, tracer); - analyticsSpanScope = analyticsSpan.getSpan().makeCurrent(); - Utils.setTag(analyticsSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - String apiName = requestContext.getMatchedAPI().getName(); - String apiVersion = requestContext.getMatchedAPI().getVersion(); - String apiType = requestContext.getMatchedAPI().getApiType(); - boolean isMockAPI = requestContext.getMatchedAPI().isMockedApi(); - AuthenticationContext authContext = AnalyticsUtils.getAuthenticationContext(requestContext); - requestContext.addMetadataToMap(MetadataConstants.API_ID_KEY, AnalyticsUtils.getAPIId(requestContext)); - requestContext.addMetadataToMap(MetadataConstants.API_CREATOR_KEY, - AnalyticsUtils.setDefaultIfNull(authContext.getApiPublisher())); - requestContext.addMetadataToMap(MetadataConstants.API_NAME_KEY, apiName); - requestContext.addMetadataToMap(MetadataConstants.API_VERSION_KEY, apiVersion); - requestContext.addMetadataToMap(MetadataConstants.API_TYPE_KEY, apiType); - requestContext.addMetadataToMap(MetadataConstants.IS_MOCK_API, String.valueOf(isMockAPI)); - - String tenantDomain = requestContext.getMatchedAPI().getOrganizationId(); - requestContext.addMetadataToMap(MetadataConstants.API_CREATOR_TENANT_DOMAIN_KEY, - tenantDomain == null ? APIConstants.SUPER_TENANT_DOMAIN_NAME : tenantDomain); - - // Default Value would be PRODUCTION - requestContext.addMetadataToMap(MetadataConstants.APP_KEY_TYPE_KEY, - requestContext.getMatchedAPI().getEnvType()); - requestContext.addMetadataToMap(MetadataConstants.APP_UUID_KEY, - AnalyticsUtils.setDefaultIfNull(authContext.getApplicationUUID())); - requestContext.addMetadataToMap(MetadataConstants.APP_NAME_KEY, - AnalyticsUtils.setDefaultIfNull(authContext.getApplicationName())); - requestContext.addMetadataToMap(MetadataConstants.APP_OWNER_KEY, - AnalyticsUtils.setDefaultIfNull(authContext.getSubscriber())); - - requestContext.addMetadataToMap(MetadataConstants.CORRELATION_ID_KEY, requestContext.getRequestID()); - requestContext.addMetadataToMap(MetadataConstants.REGION_KEY, - ConfigHolder.getInstance().getEnvVarConfig().getEnforcerRegionId()); - - // As in the matched API, only the resources under the matched resource template are selected. - ArrayList resourceTemplate = new ArrayList<>(); - for (ResourceConfig resourceConfig : requestContext.getMatchedResourcePaths()) { - resourceTemplate.add(resourceConfig.getPath()); - } - requestContext.addMetadataToMap(MetadataConstants.API_RESOURCE_TEMPLATE_KEY, - String.join(",", resourceTemplate)); - - requestContext.addMetadataToMap(MetadataConstants.DESTINATION, resolveEndpoint(requestContext)); - - requestContext.addMetadataToMap(MetadataConstants.API_ORGANIZATION_ID, - requestContext.getMatchedAPI().getOrganizationId()); - requestContext.addMetadataToMap(MetadataConstants.CLIENT_IP_KEY, requestContext.getClientIp()); - requestContext.addMetadataToMap(MetadataConstants.USER_AGENT_KEY, - AnalyticsUtils.setDefaultIfNull(requestContext.getHeaders().get("user-agent"))); - - // Adding UserName and the APIContext - String endUserName = authContext.getUsername(); - requestContext.addMetadataToMap(MetadataConstants.API_USER_NAME_KEY, - endUserName == null ? APIConstants.END_USER_UNKNOWN : endUserName); - requestContext.addMetadataToMap(MetadataConstants.API_CONTEXT_KEY, - requestContext.getMatchedAPI().getBasePath()); - requestContext.addMetadataToMap(MetadataConstants.API_ENVIRONMENT, - requestContext.getMatchedAPI().getEnvironment() == null - ? APIConstants.DEFAULT_ENVIRONMENT_NAME - : requestContext.getMatchedAPI().getEnvironment()); - // Adding Gateway URL - String gatewayUrl = requestContext.getHeaders().get(AnalyticsConstants.GATEWAY_URL); - if (!StringUtils.isNotEmpty(gatewayUrl)) { - String protocol = requestContext.getHeaders().getOrDefault(AnalyticsConstants.X_FORWARD_PROTO_HEADER, - APIConstants.HTTPS_PROTOCOL); - String port = requestContext.getHeaders().getOrDefault(AnalyticsConstants.X_FORWARD_PORT_HEADER, ""); - String host = requestContext.getMatchedAPI().getVhost(); - String path = requestContext.getRequestPath(); - gatewayUrl = protocol.concat("://").concat(host).concat(":").concat(port).concat(path); - } - requestContext.addMetadataToMap(MetadataConstants.GATEWAY_URL, gatewayUrl); - } finally { - if (Utils.tracingEnabled()) { - analyticsSpanScope.close(); - Utils.finishSpan(analyticsSpan); - } - } - } - - public String resolveEndpoint(RequestContext requestContext) { - - // For MockAPIs there is no backend, Hence "MockImplementation" is added as the destination. - if (requestContext.getMatchedAPI() != null && requestContext.getMatchedAPI().isMockedApi()) { - return "MockImplementation"; - } - // This does not cause problems at the moment Since the current microgateway supports only one URL - try { - return requestContext.getMatchedResourcePaths().get(0).getEndpoints().getUrls().get(0); - } catch (Exception e) { - return ""; - } - } - - public void handleFailureRequest(RequestContext requestContext) { - - TracingSpan analyticsSpan = null; - Scope analyticsSpanScope = null; - - try { - if (Utils.tracingEnabled()) { - TracingTracer tracer = Utils.getGlobalTracer(); - analyticsSpan = Utils.startSpan(TracingConstants.ANALYTICS_FAILURE_SPAN, tracer); - analyticsSpanScope = analyticsSpan.getSpan().makeCurrent(); - Utils.setTag(analyticsSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - if (publisher == null) { - logger.error("Cannot publish the failure event as analytics publisher is null.", - ErrorDetails.errorLog(LoggingConstants.Severity.CRITICAL, 5103)); - return; - } - ChoreoFaultAnalyticsProvider provider = new ChoreoFaultAnalyticsProvider(requestContext); - // To avoid incrementing counter for options call - if (provider.getProxyResponseCode() == 200 || provider.getProxyResponseCode() == 204) { - return; - } - GenericRequestDataCollector dataCollector = new GenericRequestDataCollector(provider); - try { - dataCollector.collectData(); - logger.debug("Analytics event for failure event is published."); - } catch (AnalyticsException e) { - logger.error("Error while publishing the analytics event. ", e); - } - } finally { - if (Utils.tracingEnabled()) { - analyticsSpanScope.close(); - Utils.finishSpan(analyticsSpan); - } - } - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsUtils.java deleted file mode 100644 index d9499ea5be..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/AnalyticsUtils.java +++ /dev/null @@ -1,106 +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.analytics; - -import io.envoyproxy.envoy.data.accesslog.v3.HTTPAccessLogEntry; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AnalyticsConstants; -import org.wso2.apk.enforcer.constants.MetadataConstants; -import org.wso2.apk.enforcer.models.API; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Map; - -import static org.wso2.apk.enforcer.analytics.AnalyticsConstants.GATEWAY_TYPE_CONFIG_KEY; -import static org.wso2.apk.enforcer.analytics.AnalyticsConstants.DEFAULT_GATEWAY_TYPE; - -/** - * Common Utility functions - */ -public class AnalyticsUtils { - private static final Logger logger = LogManager.getLogger(AnalyticsUtils.class); - - public static String getAPIId(RequestContext requestContext) { - return requestContext.getMatchedAPI().getUuid(); - } - public static String getOrganization(RequestContext requestContext) { - return requestContext.getMatchedAPI().getOrganizationId(); - } - public static String setDefaultIfNull(String value) { - return value == null ? AnalyticsConstants.DEFAULT_FOR_UNASSIGNED : value; - } - - public static String getGatewayType() { - Map properties = ConfigHolder.getInstance().getConfig().getAnalyticsConfig().getProperties(); - String gatewayType = DEFAULT_GATEWAY_TYPE; - if (properties != null) { - gatewayType = (String) properties.getOrDefault(GATEWAY_TYPE_CONFIG_KEY, DEFAULT_GATEWAY_TYPE); - } - return gatewayType; - } - - /** - * Extracts Authentication Context from the request Context. If Authentication Context is not available, - * new Authentication Context object will be created with authenticated property is set to false. - * - * @param requestContext {@code RequestContext} object - * @return {@code AuthenticationContext} object - */ - public static AuthenticationContext getAuthenticationContext(RequestContext requestContext) { - AuthenticationContext authContext = requestContext.getAuthenticationContext(); - // When authentication failure happens authContext remains null - if (authContext == null) { - authContext = new AuthenticationContext(); - authContext.setAuthenticated(false); - } - return authContext; - } - - /** - * Decides if the logEntry corresponds to a mock API. The "x-wso2-is-mock-api" is only set when - * handling mock-api-request. - * - * @param logEntry Access Log Entry - * @return true if the logEntry has the metadata called "x-wso2-is-mock-api" and its value is true - */ - public static boolean isMockAPISuccessRequest(HTTPAccessLogEntry logEntry) { - - return (!StringUtils.isEmpty(logEntry.getResponse().getResponseCodeDetails())) && - logEntry.getResponse().getResponseCodeDetails() - .equals(AnalyticsConstants.EXT_AUTH_DENIED_RESPONSE_DETAIL) && - logEntry.hasCommonProperties() && - logEntry.getCommonProperties().hasMetadata() && - logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() - .get(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY) != null && - logEntry.getCommonProperties().getMetadata() - .getFilterMetadataMap().get(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY).getFieldsMap() - .containsKey(MetadataConstants.IS_MOCK_API) && - Boolean.parseBoolean(logEntry.getCommonProperties().getMetadata() - .getFilterMetadataMap().get(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY).getFieldsMap() - .get(MetadataConstants.IS_MOCK_API).getStringValue()); - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsForWSProvider.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsForWSProvider.java deleted file mode 100644 index 7931113c80..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsForWSProvider.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.analytics.Constants; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.exceptions.DataNotFoundException; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.API; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Error; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Latencies; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.MetaInfo; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Operation; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Target; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.EventCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultSubCategory; -import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.AnalyticsConstants; -import org.wso2.apk.enforcer.constants.MetadataConstants; - -import java.util.Map; - -/** - * Analytics Data Provider for Websocket frame requests. - */ -public class ChoreoAnalyticsForWSProvider implements AnalyticsDataProvider { - - private static final Logger logger = LogManager.getLogger(ChoreoAnalyticsForWSProvider.class); - public static final int THROTTLE_CODE_UPPER_BOUND = 900900; - public static final int THROTTLE_CODE_LOWER_BOUND = 900800; - - private WebSocketFrameRequest webSocketFrameRequest; - private Map extAuthMetadata; - - public ChoreoAnalyticsForWSProvider(WebSocketFrameRequest webSocketFrameRequest) { - this.webSocketFrameRequest = webSocketFrameRequest; - extAuthMetadata = webSocketFrameRequest.getMetadata().getExtAuthzMetadataMap(); - } - - @Override - public EventCategory getEventCategory() { - if (isSuccessRequest()) { - return EventCategory.SUCCESS; - } else if (isFaultRequest()) { - return EventCategory.FAULT; - } else { - return EventCategory.INVALID; - } - } - - private boolean isSuccessRequest() { - return 0 == webSocketFrameRequest.getApimErrorCode(); - } - - private boolean isFaultRequest() { - return !isSuccessRequest(); - } - - @Override - public boolean isAnonymous() { - return AnalyticsConstants.DEFAULT_FOR_UNASSIGNED - .equals(webSocketFrameRequest.getMetadata().getExtAuthzMetadataMap() - .get(MetadataConstants.APP_UUID_KEY)); - } - - @Override - public boolean isAuthenticated() { - return true; - } - - @Override - public FaultCategory getFaultType() { - if (webSocketFrameRequest.getApimErrorCode() >= THROTTLE_CODE_LOWER_BOUND - && webSocketFrameRequest.getApimErrorCode() < THROTTLE_CODE_UPPER_BOUND) { - return FaultCategory.THROTTLED; - } - // When the Websocket Messages are blocked due to enforcer connections would result in - // sending 102500 status code. Those errors would be listed under faultCategory Other. - return FaultCategory.OTHER; - } - - @Override - public API getApi() throws DataNotFoundException { - - API api = new API(); - - String apiVersion = extAuthMetadata.get(MetadataConstants.API_VERSION_KEY); - String apiName = extAuthMetadata.get(MetadataConstants.API_NAME_KEY); - String apiId = extAuthMetadata.get(MetadataConstants.API_ID_KEY); - String apiCreator = extAuthMetadata.get(MetadataConstants.API_CREATOR_KEY); - String apiCreatorTenantDomain = extAuthMetadata.get(MetadataConstants.API_CREATOR_TENANT_DOMAIN_KEY); - api.setApiType(APIConstants.ApiType.WEB_SOCKET); - api.setApiId(apiId); - api.setApiName(apiName); - api.setApiVersion(apiVersion); - api.setApiCreatorTenantDomain(apiCreatorTenantDomain); - api.setApiCreator(apiCreator); - return api; - } - - @Override - public Application getApplication() throws DataNotFoundException { - Application application = new Application(); - application.setApplicationId(extAuthMetadata.get(MetadataConstants.APP_UUID_KEY)); - application.setApplicationName(extAuthMetadata.get(MetadataConstants.APP_NAME_KEY)); - application.setApplicationOwner(extAuthMetadata.get(MetadataConstants.APP_OWNER_KEY)); - application.setKeyType(extAuthMetadata.get(MetadataConstants.APP_KEY_TYPE_KEY)); - return application; - } - - @Override - public Operation getOperation() throws DataNotFoundException { - Operation operation = new Operation(); - String method = webSocketFrameRequest.getDirection().name(); - operation.setApiMethod(method); - String matchingResource = extAuthMetadata.get(MetadataConstants.API_RESOURCE_TEMPLATE_KEY); - if (WebSocketFrameRequest.MessageDirection.HANDSHAKE.name() - .equals(webSocketFrameRequest.getDirection().name())) { - matchingResource = AnalyticsConstants.WEBSOCKET_HANDSHAKE_RESOURCE_PREFIX + matchingResource; - } - operation.setApiResourceTemplate(matchingResource); - return operation; - } - - @Override - public Target getTarget() { - Target target = new Target(); - - // These properties are not applicable for WS API - target.setResponseCacheHit(false); - target.setTargetResponseCode(0); - String endpointAddress = extAuthMetadata.get(MetadataConstants.DESTINATION); - target.setDestination(endpointAddress); - return target; - } - - @Override - public Latencies getLatencies() { - return new Latencies(); - } - - @Override - public MetaInfo getMetaInfo() { - MetaInfo metaInfo = new MetaInfo(); - // Correlation ID is as same as X-Request-ID - metaInfo.setCorrelationId(extAuthMetadata.get(MetadataConstants.CORRELATION_ID_KEY)); - metaInfo.setGatewayType(AnalyticsUtils.getGatewayType()); - metaInfo.setRegionId(extAuthMetadata.get(MetadataConstants.REGION_KEY)); - return metaInfo; - } - - @Override - public int getProxyResponseCode() { - if (isSuccessRequest()) { - return 200; - } - - // This is required by the analytics endpoint in order to display the errors properly. - if (webSocketFrameRequest.getApimErrorCode() >= THROTTLE_CODE_LOWER_BOUND - && webSocketFrameRequest.getApimErrorCode() < THROTTLE_CODE_UPPER_BOUND) { - return 429; - } - return Constants.UNKNOWN_INT_VALUE; - } - - @Override - public int getTargetResponseCode() { - if (isSuccessRequest()) { - return 200; - } - return Constants.UNKNOWN_INT_VALUE; - } - - @Override - public long getRequestTime() { - return 0; - } - - @Override - public Error getError(FaultCategory faultCategory) { - int errorCode = webSocketFrameRequest.getApimErrorCode(); - FaultCodeClassifier faultCodeClassifier = new FaultCodeClassifier(errorCode); - FaultSubCategory faultSubCategory = faultCodeClassifier.getFaultSubCategory(faultCategory); - Error error = new Error(); - error.setErrorCode(errorCode); - error.setErrorMessage(faultSubCategory); - return error; - } - - @Override - public String getUserAgentHeader() { - return extAuthMetadata.get(MetadataConstants.USER_AGENT_KEY); - } - - @Override - public String getUserName() { - return extAuthMetadata.get(MetadataConstants.API_USER_NAME_KEY); - } - - @Override - public String getEndUserIP() { - return extAuthMetadata.get(MetadataConstants.CLIENT_IP_KEY); - } - - @Override - public Map getProperties() { - return AnalyticsDataProvider.super.getProperties(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsProvider.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsProvider.java deleted file mode 100644 index bf92c8927b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsProvider.java +++ /dev/null @@ -1,371 +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.analytics; - -import com.google.protobuf.Struct; -import com.google.protobuf.Timestamp; -import com.google.protobuf.Value; -import io.envoyproxy.envoy.data.accesslog.v3.AccessLogCommon; -import io.envoyproxy.envoy.data.accesslog.v3.HTTPAccessLogEntry; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsCustomDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.AIMetadata; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.AITokenUsage; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.API; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Error; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.ExtendedAPI; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Latencies; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.MetaInfo; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Operation; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Target; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.EventCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultSubCategory; -import org.wso2.apk.enforcer.constants.AnalyticsConstants; -import org.wso2.apk.enforcer.constants.MetadataConstants; - -import java.time.Instant; -import java.time.ZoneOffset; -import java.time.ZonedDateTime; -import java.util.HashMap; -import java.util.Map; - -/** - * Analytics Data Provider of Microgateway - */ -public class ChoreoAnalyticsProvider implements AnalyticsDataProvider { - - private static final Logger logger = LogManager.getLogger(ChoreoAnalyticsProvider.class); - private static Map customProperties = new HashMap<>(); - protected final HTTPAccessLogEntry logEntry; - - public ChoreoAnalyticsProvider(HTTPAccessLogEntry logEntry) { - - this.logEntry = logEntry; - if (AnalyticsFilter.getAnalyticsCustomDataProvider() != null) { - setCustomPropertiesMap(logEntry, customProperties); - } - } - - @Override - public EventCategory getEventCategory() { - - if (logEntry.getResponse() != null && AnalyticsConstants.UPSTREAM_SUCCESS_RESPONSE_DETAIL.equals( - logEntry.getResponse().getResponseCodeDetails())) { - logger.debug("Is success event"); - return EventCategory.SUCCESS; - } else if (logEntry.hasResponse() - && logEntry.getResponse().hasResponseCode() - && logEntry.getResponse().getResponseCode().getValue() != 200 - && logEntry.getResponse().getResponseCode().getValue() != 204) { - logger.debug("Is fault event"); - return EventCategory.FAULT; - } else { - logger.debug("Is invalid event"); - return EventCategory.INVALID; - } - } - - @Override - public boolean isAnonymous() { - - Map fieldsMap = getFieldsMapFromLogEntry(); - // If appId is unknown, subscriptions are not validated. - return AnalyticsConstants.DEFAULT_FOR_UNASSIGNED - .equals(getValueAsString(fieldsMap, MetadataConstants.APP_ID_KEY)); - } - - @Override - public boolean isAuthenticated() { - // Authentication failed requests are already published. - return true; - } - - @Override - public FaultCategory getFaultType() { - - if (isTargetFaultRequest()) { - return FaultCategory.TARGET_CONNECTIVITY; - } else { - return FaultCategory.OTHER; - } - } - - public boolean isTargetFaultRequest() { - - String responseCodeDetail = logEntry.getResponse().getResponseCodeDetails(); - return (!AnalyticsConstants.UPSTREAM_SUCCESS_RESPONSE_DETAIL.equals(responseCodeDetail)) - && (!AnalyticsConstants.EXT_AUTH_DENIED_RESPONSE_DETAIL.equals(responseCodeDetail)) - && (!AnalyticsConstants.EXT_AUTH_ERROR_RESPONSE_DETAIL.equals(responseCodeDetail)) - && (!AnalyticsConstants.ROUTE_NOT_FOUND_RESPONSE_DETAIL.equals(responseCodeDetail)); - } - - @Override - public API getApi() { - - Map fieldsMap = getFieldsMapFromLogEntry(); - ExtendedAPI api = new ExtendedAPI(); - api.setApiType(getValueAsString(fieldsMap, MetadataConstants.API_TYPE_KEY)); - api.setApiId(getValueAsString(fieldsMap, MetadataConstants.API_ID_KEY)); - api.setApiCreator(getValueAsString(fieldsMap, MetadataConstants.API_CREATOR_KEY)); - api.setApiName(getValueAsString(fieldsMap, MetadataConstants.API_NAME_KEY)); - api.setApiVersion(getValueAsString(fieldsMap, MetadataConstants.API_VERSION_KEY)); - api.setApiCreatorTenantDomain(getValueAsString(fieldsMap, MetadataConstants.API_CREATOR_TENANT_DOMAIN_KEY)); - api.setOrganizationId(getValueAsString(fieldsMap, MetadataConstants.API_ORGANIZATION_ID)); - api.setApiContext(getValueAsString(fieldsMap, MetadataConstants.API_CONTEXT_KEY)); - api.setEnvironmentId(getValueAsString(fieldsMap, MetadataConstants.API_ENVIRONMENT)); - - return api; - } - - @Override - public Application getApplication() { - - Map fieldsMap = getFieldsMapFromLogEntry(); - Application application = new Application(); - application.setApplicationOwner(getValueAsString(fieldsMap, MetadataConstants.APP_OWNER_KEY)); - application.setApplicationName(getValueAsString(fieldsMap, MetadataConstants.APP_NAME_KEY)); - application.setKeyType(getValueAsString(fieldsMap, MetadataConstants.APP_KEY_TYPE_KEY)); - application.setApplicationId(getValueAsString(fieldsMap, MetadataConstants.APP_UUID_KEY)); - return application; - } - - @Override - public Operation getOperation() { - - Map fieldsMap = getFieldsMapFromLogEntry(); - Operation operation = new Operation(); - operation.setApiResourceTemplate(getValueAsString(fieldsMap, MetadataConstants.API_RESOURCE_TEMPLATE_KEY)); - operation.setApiMethod(logEntry.getRequest().getRequestMethod().name()); - return operation; - } - - @Override - public Target getTarget() { - - Map fieldsMap = getFieldsMapFromLogEntry(); - Target target = new Target(); - // As response caching is not configured at the moment. - target.setResponseCacheHit(false); - target.setTargetResponseCode(logEntry.getResponse().getResponseCode().getValue()); - target.setDestination(getValueAsString(fieldsMap, MetadataConstants.DESTINATION)); - return target; - } - - @Override - public Latencies getLatencies() { - // This method is only invoked for success requests. Hence all these properties will be available. - // The cors requests responded from the CORS filter are already filtered at this point. - AccessLogCommon properties = logEntry.getCommonProperties(); - long backendResponseRecvTimestamp = properties.getTimeToLastUpstreamRxByte().getSeconds() * 1000 + - properties.getTimeToLastUpstreamRxByte().getNanos() / 1000000; - long backendRequestSendTimestamp = properties.getTimeToFirstUpstreamTxByte().getSeconds() * 1000 + - properties.getTimeToFirstUpstreamTxByte().getNanos() / 1000000; - long downstreamResponseSendTimestamp = properties.getTimeToLastDownstreamTxByte().getSeconds() * 1000 + - properties.getTimeToLastDownstreamTxByte().getNanos() / 1000000; - - Latencies latencies = new Latencies(); - latencies.setBackendLatency(backendResponseRecvTimestamp - backendRequestSendTimestamp); - latencies.setRequestMediationLatency(backendRequestSendTimestamp); - latencies.setResponseLatency(downstreamResponseSendTimestamp); - latencies.setResponseMediationLatency(downstreamResponseSendTimestamp - backendResponseRecvTimestamp); - return latencies; - } - - @Override - public MetaInfo getMetaInfo() { - - Map fieldsMap = getFieldsMapFromLogEntry(); - MetaInfo metaInfo = new MetaInfo(); - metaInfo.setCorrelationId(getValueAsString(fieldsMap, MetadataConstants.CORRELATION_ID_KEY)); - metaInfo.setGatewayType(AnalyticsUtils.getGatewayType()); - metaInfo.setRegionId(getValueAsString(fieldsMap, MetadataConstants.REGION_KEY)); - return metaInfo; - } - - @Override - public int getProxyResponseCode() { - // As the response is not modified - return getTargetResponseCode(); - } - - @Override - public int getTargetResponseCode() { - - return logEntry.getResponse().getResponseCode().getValue(); - } - - @Override - public long getRequestTime() { - - return logEntry.getCommonProperties().getStartTime().getSeconds() * 1000 + - logEntry.getCommonProperties().getStartTime().getNanos() / 1000000; - } - - @Override - public Error getError(FaultCategory faultCategory) { - - FaultCodeClassifier faultCodeClassifier = new FaultCodeClassifier(logEntry); - FaultSubCategory faultSubCategory = faultCodeClassifier.getFaultSubCategory(faultCategory); - Error error = new Error(); - // TODO: (VirajSalaka) Check against -1 values. - error.setErrorCode(faultCodeClassifier.getErrorCode()); - error.setErrorMessage(faultSubCategory); - return error; - } - - @Override - public String getUserAgentHeader() { - - return logEntry.getRequest().getUserAgent(); - } - - @Override - public String getUserName() { - - Map fieldsMap = getFieldsMapFromLogEntry(); - return getValueAsString(fieldsMap, MetadataConstants.API_USER_NAME_KEY); - } - - @Override - public String getEndUserIP() { - - return logEntry.getCommonProperties().getDownstreamRemoteAddress().getSocketAddress().getAddress(); - } - - @Override - public Map getProperties() { - - AnalyticsCustomDataProvider customDataProvider = AnalyticsFilter.getAnalyticsCustomDataProvider(); - Map map = new HashMap(); - Map fieldsMap = getFieldsMapFromLogEntry(); - String gwURL = getValueAsString(fieldsMap, MetadataConstants.GATEWAY_URL); - Integer totalTokenCount = getValueAsInteger(fieldsMap, MetadataConstants.TOTAL_TOKEN_COUNT); - Integer completionTokenCount = getValueAsInteger(fieldsMap, MetadataConstants.COMPLETION_TOKEN_COUNT); - Integer promptTokenCount = getValueAsInteger(fieldsMap, MetadataConstants.PROMPT_TOKEN_COUNT); - String model = getValueAsString(fieldsMap, MetadataConstants.MODEL); - String providerName = getValueAsString(fieldsMap, MetadataConstants.AI_PROVIDER_NAME); - String providerAPIVersion = getValueAsString(fieldsMap, MetadataConstants.AI_PROVIDER_API_VERSION); - - // AI Token Usage - AITokenUsage aiTokenUsage = new AITokenUsage(); - if (totalTokenCount != null) aiTokenUsage.setTotalTokens(totalTokenCount); - if (promptTokenCount != null) aiTokenUsage.setPromptTokens(promptTokenCount); - if (completionTokenCount != null) aiTokenUsage.setCompletionTokens(completionTokenCount); - if (logEntry != null && logEntry.getCommonProperties() != null && logEntry.getCommonProperties().getStartTime() != null) { - aiTokenUsage.setHour(getUtcHour(logEntry.getCommonProperties().getStartTime())); - } - if (aiTokenUsage.getTotalTokens() != null || aiTokenUsage.getPromptTokens() != null || aiTokenUsage.getCompletionTokens() != null) { - map.put("aiTokenUsage", aiTokenUsage); - } - - // AI Metadata - AIMetadata aiMetadata = new AIMetadata(); - if (model != null) aiMetadata.setModel(model); - if (providerName != null) aiMetadata.setVendorName(providerName); - if (providerAPIVersion != null) aiMetadata.setVendorVersion(providerAPIVersion); - - if (aiMetadata.getModel() != null || aiMetadata.getVendorName() != null || aiMetadata.getVendorVersion() != null) { - map.put("aiMetadata", aiMetadata); - } - map.put(AnalyticsConstants.GATEWAY_URL, gwURL); - if (customDataProvider != null && customDataProvider.getCustomProperties(customProperties) != null) { - Map customPropertiesFromProvider = customDataProvider.getCustomProperties(customProperties); - map.putAll(customPropertiesFromProvider); - } else { - map.putAll(this.customProperties); - } - - - return map; - } - - private String getValueAsString(Map fieldsMap, String key) { - - if (fieldsMap == null || !fieldsMap.containsKey(key)) { - return null; - } - return fieldsMap.get(key).getStringValue(); - } - - private Integer getValueAsInteger(Map fieldsMap, String key) { - - if (fieldsMap == null || !fieldsMap.containsKey(key)) { - return null; - } - Double d = fieldsMap.get(key).getNumberValue(); - return d.intValue(); - } - - private Map getFieldsMapFromLogEntry() { - - if (logEntry.getCommonProperties() == null - || logEntry.getCommonProperties().getMetadata() == null - || logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() == null - || !logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() - .containsKey(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY)) { - return new HashMap<>(0); - } - Map metadataFromExtProc = new HashMap<>(); - if (logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() - .get(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY) != null) { - metadataFromExtProc = logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() - .get(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY).getFieldsMap(); - } - Map metadataFromExtAuthz = new HashMap<>(); - if (logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() - .get(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY) != null) { - metadataFromExtAuthz = logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() - .get(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY).getFieldsMap(); - } - Map mergedMetadata = new HashMap<>(metadataFromExtProc); - mergedMetadata.putAll(metadataFromExtAuthz); - return mergedMetadata; - } - - private void addMetadata(Struct.Builder structBuilder, String key, String value) { - structBuilder.putFields(key, Value.newBuilder().setStringValue(value).build()); - } - - private void addMetadata(Struct.Builder structBuilder, String key, double value) { - structBuilder.putFields(key, Value.newBuilder().setNumberValue(value).build()); - } - - public static int getUtcHour(Timestamp timestamp) { - Instant instant = Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos()); - ZonedDateTime utcDateTime = instant.atZone(ZoneOffset.UTC); - return utcDateTime.getHour(); - } - - private void setCustomPropertiesMap(HTTPAccessLogEntry logEntry, Map customProperties) { - - if (logEntry.getRequest().getRequestHeadersMap() != null) { - customProperties.putAll(logEntry.getRequest().getRequestHeadersMap()); - } - if (logEntry.getResponse().getResponseHeadersMap() != null) { - customProperties.putAll(logEntry.getResponse().getResponseHeadersMap()); - } - if (logEntry.getResponse().getResponseTrailersMap() != null) { - customProperties.putAll(logEntry.getResponse().getResponseTrailersMap()); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsProviderForMockAPISuccess.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsProviderForMockAPISuccess.java deleted file mode 100644 index 1b93e3ec93..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoAnalyticsProviderForMockAPISuccess.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.analytics; - -import io.envoyproxy.envoy.data.accesslog.v3.AccessLogCommon; -import io.envoyproxy.envoy.data.accesslog.v3.HTTPAccessLogEntry; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Error; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Latencies; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.EventCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; - -import java.util.concurrent.TimeUnit; - -/** - * Analytics Data Provider for MockAPIs Successful requests. - *

- * Note: MockAPI call failures is no different compared to regular api call failures. Hence, they are also handled - * via the {@code ChoreoFaultAnalyticsProvider}. - */ -public class ChoreoAnalyticsProviderForMockAPISuccess extends ChoreoAnalyticsProvider { - private static final Logger logger = LogManager.getLogger(ChoreoAnalyticsProviderForMockAPISuccess.class); - - public ChoreoAnalyticsProviderForMockAPISuccess(HTTPAccessLogEntry logEntry) { - super(logEntry); - } - - @Override - public EventCategory getEventCategory() { - return EventCategory.SUCCESS; - } - - @Override - public FaultCategory getFaultType() { - // Unreachable condition as this provider is only handling successful mock api events. - return null; - } - - @Override - public Latencies getLatencies() { - // This method is only invoked for success requests. Hence all these properties will be available. - // The cors requests responded from the CORS filter are already filtered at this point. - AccessLogCommon properties = logEntry.getCommonProperties(); - Latencies latencies = new Latencies(); - - long downstreamResponseSendTimeFromStart = - TimeUnit.SECONDS.toMillis(properties.getTimeToLastDownstreamTxByte().getSeconds()) + - TimeUnit.NANOSECONDS.toMillis(properties.getTimeToLastDownstreamTxByte().getNanos()); - // Mock APIs does not have a backend. Hence, backend latency remains 0. - latencies.setResponseLatency(downstreamResponseSendTimeFromStart); - latencies.setBackendLatency(0); - latencies.setRequestMediationLatency(downstreamResponseSendTimeFromStart); - latencies.setResponseMediationLatency(0); - return latencies; - - } - - @Override - public Error getError(FaultCategory faultCategory) { - // Since this provider only handles success requests, getError method does not get called. - return null; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoFaultAnalyticsProvider.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoFaultAnalyticsProvider.java deleted file mode 100644 index db1d5ac5a9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/ChoreoFaultAnalyticsProvider.java +++ /dev/null @@ -1,275 +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.analytics; - -import org.apache.commons.lang3.StringUtils; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsCustomDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.API; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Application; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Error; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.ExtendedAPI; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Latencies; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.MetaInfo; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Operation; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Target; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.EventCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultSubCategory; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.AnalyticsConstants; -import org.wso2.apk.enforcer.constants.GeneralErrorCodeConstants; -import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -/** - * Generate FaultDTO for the errors generated from enforcer. - */ -public class ChoreoFaultAnalyticsProvider implements AnalyticsDataProvider { - - private final RequestContext requestContext; - private static final Map customProperties = new HashMap<>(); - private final boolean isWebsocketUpgradeRequest; - - public ChoreoFaultAnalyticsProvider(RequestContext requestContext) { - - this.requestContext = requestContext; - // sets all the headers available in the request context - customProperties.putAll(requestContext.getHeaders()); - isWebsocketUpgradeRequest = - APIConstants.WEBSOCKET.equals(requestContext.getHeaders().get(APIConstants.UPGRADE_HEADER)); - } - - @Override - public EventCategory getEventCategory() { - - return EventCategory.FAULT; - } - - @Override - public boolean isAnonymous() { - - return requestContext.getAuthenticationContext() == null || StringUtils.isEmpty(requestContext.getAuthenticationContext().getApplicationUUID()); - } - - @Override - public boolean isAuthenticated() { - - AuthenticationContext authenticationContext = requestContext.getAuthenticationContext(); - return authenticationContext != null && authenticationContext.isAuthenticated(); - } - - @Override - public FaultCategory getFaultType() { - - if (requestContext.getProperties().containsKey(APIConstants.MessageFormat.STATUS_CODE)) { - int statusCode = - Integer.parseInt(requestContext.getProperties().get(APIConstants.MessageFormat.STATUS_CODE).toString()); - switch (statusCode) { - case 401: - case 403: - // For Denied policies, the status code remains 403, but it is categorized - // under throttling - if (requestContext.getProperties().containsKey(APIConstants.MessageFormat.ERROR_CODE)) { - if (AnalyticsConstants.BLOCKED_ERROR_CODE == Integer.parseInt(requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE).toString())) { - return FaultCategory.THROTTLED; - } - } - return FaultCategory.AUTH; - case 429: - return FaultCategory.THROTTLED; - case 503: - // for API Blocked Scenario, it is considered as an Auth Failure although the status code - // is 503 - if (requestContext.getProperties().containsKey(APIConstants.MessageFormat.ERROR_CODE) && GeneralErrorCodeConstants.API_BLOCKED_CODE == Integer.parseInt(requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE).toString())) { - return FaultCategory.AUTH; - } - return FaultCategory.OTHER; - default: - return FaultCategory.OTHER; - } - } - return FaultCategory.OTHER; - } - - @Override - public API getApi() { - - ExtendedAPI api = new ExtendedAPI(); - String apiUUID = AnalyticsUtils.getAPIId(requestContext); - api.setApiId(apiUUID); - api.setApiType(requestContext.getMatchedAPI().getApiType()); - api.setApiName(requestContext.getMatchedAPI().getName()); - api.setApiVersion(requestContext.getMatchedAPI().getVersion()); - String tenantDomain = FilterUtils.getTenantDomainFromRequestURL(requestContext.getMatchedAPI().getBasePath()); - api.setApiCreatorTenantDomain(tenantDomain == null ? APIConstants.SUPER_TENANT_DOMAIN_NAME : tenantDomain); - api.setOrganizationId(requestContext.getMatchedAPI().getOrganizationId()); - api.setEnvironmentId(requestContext.getMatchedAPI().getEnvironment()); - return api; - } - - @Override - public Application getApplication() { - - AuthenticationContext authContext = AnalyticsUtils.getAuthenticationContext(requestContext); - Application application = new Application(); - // Default Value would be PRODUCTION - application.setKeyType(requestContext.getMatchedAPI().getEnvType()); - application.setApplicationId(AnalyticsUtils.setDefaultIfNull(authContext.getApplicationUUID())); - application.setApplicationOwner(AnalyticsUtils.setDefaultIfNull(authContext.getSubscriber())); - application.setApplicationName(AnalyticsUtils.setDefaultIfNull(authContext.getApplicationName())); - return application; - } - - @Override - public Operation getOperation() { - // This could be null if OPTIONS request comes - if (requestContext.getMatchedResourcePaths() != null) { - Operation operation = new Operation(); - if (isWebsocketUpgradeRequest) { - operation.setApiMethod(WebSocketFrameRequest.MessageDirection.HANDSHAKE.name()); - operation.setApiResourceTemplate(AnalyticsConstants.WEBSOCKET_HANDSHAKE_RESOURCE_PREFIX + requestContext.getMatchedResourcePaths().get(0).getPath()); - return operation; - } - operation.setApiMethod(requestContext.getMatchedResourcePaths().get(0).getMethod().name()); - ArrayList resourceTemplate = new ArrayList<>(); - for (ResourceConfig resourceConfig : requestContext.getMatchedResourcePaths()) { - resourceTemplate.add(resourceConfig.getPath()); - } - operation.setApiResourceTemplate(String.join(",", resourceTemplate)); - return operation; - } - return null; - } - - @Override - public Target getTarget() { - - Target target = new Target(); - target.setResponseCacheHit(false); - target.setTargetResponseCode(Integer.parseInt(requestContext.getProperties().get(APIConstants.MessageFormat.STATUS_CODE).toString())); - // Destination is not included in the fault event scenario - return target; - } - - @Override - public Latencies getLatencies() { - // Latencies information are not required. - - Latencies latencies = new Latencies(); - latencies.setResponseLatency(System.currentTimeMillis() - getRequestTime()); - return latencies; - } - - @Override - public MetaInfo getMetaInfo() { - - MetaInfo metaInfo = new MetaInfo(); - metaInfo.setRegionId(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerRegionId()); - metaInfo.setGatewayType(AnalyticsUtils.getGatewayType()); - metaInfo.setCorrelationId(requestContext.getRequestID()); - return metaInfo; - } - - @Override - public int getProxyResponseCode() { - - return Integer.parseInt(requestContext.getProperties().get(APIConstants.MessageFormat.STATUS_CODE).toString()); - } - - @Override - public int getTargetResponseCode() { - - return Integer.parseInt(requestContext.getProperties().get(APIConstants.MessageFormat.STATUS_CODE).toString()); - } - - @Override - public long getRequestTime() { - - return requestContext.getRequestTimeStamp(); - } - - @Override - public Error getError(FaultCategory faultCategory) { - // All the messages should have the error_code - if (requestContext.getProperties().containsKey(APIConstants.MessageFormat.ERROR_CODE)) { - FaultCodeClassifier faultCodeClassifier = - new FaultCodeClassifier(Integer.parseInt(requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE).toString())); - FaultSubCategory faultSubCategory = faultCodeClassifier.getFaultSubCategory(faultCategory); - Error error = new Error(); - error.setErrorCode(faultCodeClassifier.getErrorCode()); - error.setErrorMessage(faultSubCategory); - return error; - } - return null; - } - - @Override - public String getUserAgentHeader() { - - Map headers = requestContext.getHeaders(); - // UserAgent header is not validated for fault events. - return AnalyticsUtils.setDefaultIfNull(headers.get("user-agent")); - } - - @Override - public String getUserName() { - - return null; - } - - @Override - public String getEndUserIP() { - // EndUserIP is not validated for fault events. - return null; - } - - @Override - public Map getProperties() { - - Map map = new HashMap<>(); - // Adding Gateway URL - String gatewayUrl = requestContext.getHeaders().get(AnalyticsConstants.GATEWAY_URL); - if (!StringUtils.isNotEmpty(gatewayUrl)) { - String protocol = requestContext.getHeaders().getOrDefault(AnalyticsConstants.X_FORWARD_PROTO_HEADER, - APIConstants.HTTPS_PROTOCOL); - String port = requestContext.getHeaders().getOrDefault(AnalyticsConstants.X_FORWARD_PORT_HEADER, ""); - String host = requestContext.getMatchedAPI().getVhost(); - String path = requestContext.getRequestPath(); - gatewayUrl = protocol.concat("://").concat(host).concat(":").concat(port).concat(path); - } - map.put(AnalyticsConstants.GATEWAY_URL, gatewayUrl); - AnalyticsCustomDataProvider customDataProvider = AnalyticsFilter.getAnalyticsCustomDataProvider(); - if (customDataProvider != null && customDataProvider.getCustomProperties(customProperties) != null) { - Map retrievedProperties = customDataProvider.getCustomProperties(customProperties); - map.putAll(retrievedProperties); - } else { - map.putAll(customProperties); - } - return map; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/DefaultAnalyticsEventPublisher.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/DefaultAnalyticsEventPublisher.java deleted file mode 100644 index 6049e73acd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/DefaultAnalyticsEventPublisher.java +++ /dev/null @@ -1,177 +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.analytics; - -import io.envoyproxy.envoy.data.accesslog.v3.HTTPAccessLogEntry; -import io.envoyproxy.envoy.service.accesslog.v3.StreamAccessLogsMessage; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.analytics.AnalyticsCommonConfiguration; -import org.wso2.apk.enforcer.commons.analytics.AnalyticsServiceReferenceHolder; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.collectors.impl.GenericRequestDataCollector; -import org.wso2.apk.enforcer.commons.analytics.exceptions.AnalyticsException; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.EventCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.config.dto.AnalyticsPublisherConfigDTO; -import org.wso2.apk.enforcer.constants.AnalyticsConstants; - -import java.util.List; - -import static org.wso2.apk.enforcer.analytics.AnalyticsConstants.ERROR_SCHEMA; -import static org.wso2.apk.enforcer.analytics.AnalyticsConstants.RESPONSE_SCHEMA; - -/** - * Default Analytics Event publisher to the analytics cloud. - */ -public class DefaultAnalyticsEventPublisher implements AnalyticsEventPublisher { - - public final String responseSchema; - public final String faultSchema; - - private static final Logger logger = LogManager.getLogger(DefaultAnalyticsEventPublisher.class); - - public DefaultAnalyticsEventPublisher() { - - this.responseSchema = RESPONSE_SCHEMA; - this.faultSchema = ERROR_SCHEMA; - } - - public DefaultAnalyticsEventPublisher(String responseSchema, String faultSchema) { - - this.responseSchema = responseSchema; - this.faultSchema = faultSchema; - } - - @Override - public void handleGRPCLogMsg(StreamAccessLogsMessage message) { - - for (int i = 0; i < message.getHttpLogs().getLogEntryCount(); i++) { - HTTPAccessLogEntry logEntry = message.getHttpLogs().getLogEntry(i); - logger.trace("Received logEntry from Router " + message.getIdentifier().getNode() + - " : " + message.toString()); - if (doNotPublishEvent(logEntry)) { - logger.debug("LogEntry is ignored as it is already published by the enforcer."); - continue; - } - AnalyticsDataProvider provider; - if (AnalyticsUtils.isMockAPISuccessRequest(logEntry)) { - provider = new ChoreoAnalyticsProviderForMockAPISuccess(logEntry); - } else { - provider = new ChoreoAnalyticsProvider(logEntry); - } - // If the APIName is not available, the event should not be published. - // 404 errors are not logged due to this. - if (provider.getEventCategory() == EventCategory.FAULT - && provider.getFaultType() == FaultCategory.OTHER) { - continue; - } - collectDataToPublish(provider); - } - } - -// @Override -// public void handleWebsocketFrameRequest(WebSocketFrameRequest webSocketFrameRequest) { -// AnalyticsDataProvider provider = new ChoreoAnalyticsForWSProvider(webSocketFrameRequest); -// collectDataToPublish(provider); -// } - - @Override - public void init(List analyticsPublisherConfigDTOList) { - - if (analyticsPublisherConfigDTOList != null) { - for (AnalyticsPublisherConfigDTO analyticsPublisherConfigDTO : analyticsPublisherConfigDTOList) { - AnalyticsCommonConfiguration commonConfiguration = new AnalyticsCommonConfiguration(analyticsPublisherConfigDTO.getConfigProperties()); - commonConfiguration.setType(analyticsPublisherConfigDTO.getType()); - if (!StringUtils.isEmpty(responseSchema)) { - commonConfiguration.setResponseSchema(responseSchema); - } - if (!StringUtils.isEmpty(faultSchema)) { - commonConfiguration.setFaultSchema(faultSchema); - } - AnalyticsServiceReferenceHolder.getInstance().addAnalyticReporter(commonConfiguration); - - } - } - - } - - private boolean doNotPublishEvent(HTTPAccessLogEntry logEntry) { - - // If the logEntry corresponds to success mock api request, it should be published using logEntry. - // IsMockAPI flag is only set when it corresponds to a success request. - if (AnalyticsUtils.isMockAPISuccessRequest(logEntry)) { - return false; - } - - // If ext_auth_denied request comes, the event is already published from the enforcer. - // There is a chance that the analytics event is published from enforcer and then result in ext_authz_error - // responseCodeDetail due to some error/exception within enforcer implementation. This scenario is not - // handled as it should be fixed from enforcer. - return (!StringUtils.isEmpty(logEntry.getResponse().getResponseCodeDetails())) - && logEntry.getResponse().getResponseCodeDetails() - .equals(AnalyticsConstants.EXT_AUTH_DENIED_RESPONSE_DETAIL) - // Token endpoint calls needs to be removed as well - || (AnalyticsConstants.TOKEN_ENDPOINT_PATH.equals(logEntry.getRequest().getOriginalPath())) - // Health endpoint calls are not published - || (AnalyticsConstants.HEALTH_ENDPOINT_PATH.equals(logEntry.getRequest().getOriginalPath()) - // already published websocket log entries should not be published to the analytics again. -// || alreadyPublishedWebsocketHttpLogEntry(logEntry); - || (AnalyticsConstants.JWKS_ENDPOINT_PATH.equals(logEntry.getRequest().getOriginalPath()))); - } - -// // If the access log entry has the status code of 101 and it is a websocket related log entry, -// // it corresponds to the successful websocket upgrade. And that event is handled via the -// // WebsocketResponseObserver. -// private boolean alreadyPublishedWebsocketHttpLogEntry(HTTPAccessLogEntry logEntry) { -// if (logEntry.hasCommonProperties() && logEntry.getCommonProperties().hasMetadata() -// && logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() -// .get(EXT_AUTH_METADATA_CONTEXT_KEY) != null && -// logEntry.getCommonProperties().getMetadata() -// .getFilterMetadataMap().get(EXT_AUTH_METADATA_CONTEXT_KEY).getFieldsMap() -// .get(MetadataConstants.API_TYPE_KEY) != null) { -// return APIConstants.ApiType.WEB_SOCKET.equals(logEntry.getCommonProperties().getMetadata() -// .getFilterMetadataMap().get(EXT_AUTH_METADATA_CONTEXT_KEY).getFieldsMap() -// .get(MetadataConstants.API_TYPE_KEY).getStringValue()) && -// logEntry.getResponse().getResponseCode().getValue() == 101; -// } -// return false; -// } - - private void collectDataToPublish(AnalyticsDataProvider provider) { - - GenericRequestDataCollector dataCollector = new GenericRequestDataCollector(provider); - String correlationID = ""; - if (provider.getMetaInfo() != null) { - correlationID = provider.getMetaInfo().getCorrelationId(); - } - try { - dataCollector.collectData(); - logger.debug("Event is published. : " + correlationID); - } catch (AnalyticsException e) { - logger.error("Error while publishing the event to the analytics portal. : " - + correlationID, - ErrorDetails.errorLog(LoggingConstants.Severity.CRITICAL, 5100), e); - } - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/FaultCodeClassifier.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/FaultCodeClassifier.java deleted file mode 100644 index 0b21be16d9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/analytics/FaultCodeClassifier.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2020, 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.analytics; - -import io.envoyproxy.envoy.data.accesslog.v3.HTTPAccessLogEntry; -import io.envoyproxy.envoy.data.accesslog.v3.ResponseFlags; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultCategory; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultSubCategories; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.enums.FaultSubCategory; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.constants.AnalyticsConstants; -import org.wso2.apk.enforcer.constants.GeneralErrorCodeConstants; - -/** - * FaultCodeClassifier classifies the fault and returns error code. - */ -public class FaultCodeClassifier { - private static final Logger log = LogManager.getLogger(FaultCodeClassifier.class); - private HTTPAccessLogEntry logEntry; - private int errorCode; - - public FaultCodeClassifier(HTTPAccessLogEntry logEntry) { - this.logEntry = logEntry; - errorCode = getErrorCodeFromFlags(); - } - - public FaultCodeClassifier(int errorCode) { - this.errorCode = errorCode; - } - - public FaultSubCategory getFaultSubCategory(FaultCategory faultCategory) { - switch (faultCategory) { - case AUTH: - return getAuthFaultSubCategory(); - case THROTTLED: - return getThrottledFaultSubCategory(); - case TARGET_CONNECTIVITY: - return getTargetFaultSubCategory(); - case OTHER: - return getOtherFaultSubCategory(); - } - return null; - } - - protected FaultSubCategory getAuthFaultSubCategory() { - switch (errorCode) { - case APISecurityConstants.API_AUTH_GENERAL_ERROR: - case APISecurityConstants.API_AUTH_INVALID_CREDENTIALS: - case APISecurityConstants.API_AUTH_MISSING_CREDENTIALS: - case APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED: - case APISecurityConstants.API_AUTH_ACCESS_TOKEN_INACTIVE: - return FaultSubCategories.Authentication.AUTHENTICATION_FAILURE; - case APISecurityConstants.API_AUTH_INCORRECT_ACCESS_TOKEN_TYPE: - case APISecurityConstants.INVALID_SCOPE: - case APISecurityConstants.OPA_AUTH_FORBIDDEN: - return FaultSubCategories.Authentication.AUTHORIZATION_FAILURE; - case GeneralErrorCodeConstants.API_BLOCKED_CODE: - case APISecurityConstants.API_SUBSCRIPTION_BLOCKED: - case APISecurityConstants.API_AUTH_FORBIDDEN: - case APISecurityConstants.SUBSCRIPTION_INACTIVE: - return FaultSubCategories.Authentication.SUBSCRIPTION_VALIDATION_FAILURE; - default: - return FaultSubCategories.Authentication.OTHER; - } - } - - protected FaultSubCategory getTargetFaultSubCategory() { - switch (errorCode) { - case AnalyticsConstants.NHTTP_CONNECTION_TIMEOUT: - case AnalyticsConstants.NHTTP_CONNECT_TIMEOUT: - return FaultSubCategories.TargetConnectivity.CONNECTION_TIMEOUT; - default: - return FaultSubCategories.TargetConnectivity.OTHER; - } - } - - protected FaultSubCategory getThrottledFaultSubCategory() { - switch (errorCode) { - case AnalyticsConstants.API_THROTTLE_OUT_ERROR_CODE: - return FaultSubCategories.Throttling.API_LEVEL_LIMIT_EXCEEDED; - case AnalyticsConstants.HARD_LIMIT_EXCEEDED_ERROR_CODE: - return FaultSubCategories.Throttling.HARD_LIMIT_EXCEEDED; - case AnalyticsConstants.RESOURCE_THROTTLE_OUT_ERROR_CODE: - return FaultSubCategories.Throttling.RESOURCE_LEVEL_LIMIT_EXCEEDED; - case AnalyticsConstants.APPLICATION_THROTTLE_OUT_ERROR_CODE: - return FaultSubCategories.Throttling.APPLICATION_LEVEL_LIMIT_EXCEEDED; - case AnalyticsConstants.SUBSCRIPTION_THROTTLE_OUT_ERROR_CODE: - return FaultSubCategories.Throttling.SUBSCRIPTION_LIMIT_EXCEEDED; - case AnalyticsConstants.BLOCKED_ERROR_CODE: - return FaultSubCategories.Throttling.BLOCKED; - case AnalyticsConstants.CUSTOM_POLICY_THROTTLE_OUT_ERROR_CODE: - return FaultSubCategories.Throttling.CUSTOM_POLICY_LIMIT_EXCEEDED; - default: - return FaultSubCategories.Throttling.OTHER; - } - } - - protected FaultSubCategory getOtherFaultSubCategory() { - if (isMethodNotAllowed()) { - errorCode = 405; - return FaultSubCategories.Other.METHOD_NOT_ALLOWED; - } else if (isResourceNotFound()) { - errorCode = 404; - return FaultSubCategories.Other.RESOURCE_NOT_FOUND; - } else { - return FaultSubCategories.Other.UNCLASSIFIED; - } - } - - public boolean isResourceNotFound() { - // isResourceNotFound is not used when logEntry is not null, since 404 related events are published based on - // logEntries (not based on requestContext) - if (logEntry == null) { - return false; - } - ResponseFlags responseFlags = logEntry.getCommonProperties().getResponseFlags(); - if (responseFlags == null) { - return false; - } - return responseFlags.getNoRouteFound(); - } - - public boolean isMethodNotAllowed() { - // Method not allowed event will be as same as resource not found in microgateway case - // To implement method not allowed involves a design complexity as well as can cause a performance hit - // to the enforcer because the method validation needs to be done at enforcer level if we are to support - // this specifically. - return false; - } - - // TODO: (VirajSalaka) Following method will be reused with next release of envoy -// private int getErrorCodeFromMetadata() { -// int errorCode = -1; -// if (logEntry.getCommonProperties().getMetadata() != null -// && logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() != null -// && logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() -// .containsKey(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY) -// && logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() -// .get(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY).getFieldsMap() -// .get(MetadataConstants.ERROR_CODE_KEY) != null) { -// errorCode = Integer.parseInt(logEntry.getCommonProperties().getMetadata().getFilterMetadataMap() -// .get(MetadataConstants.EXT_AUTH_METADATA_CONTEXT_KEY).getFieldsMap() -// .get(MetadataConstants.ERROR_CODE_KEY) -// .getStringValue()); -// } -// return errorCode; -// } - - private int getErrorCodeFromFlags() { - if (logEntry == null || logEntry.getCommonProperties().getResponseFlags() == null) { - return -1; - } - ResponseFlags responseFlags = logEntry.getCommonProperties().getResponseFlags(); - - if (responseFlags.getFailedLocalHealthcheck() || responseFlags.getNoHealthyUpstream()) { - return AnalyticsConstants.NHTTP_CONNECTION_FAILED; - } - if (responseFlags.getUpstreamRequestTimeout()) { - return AnalyticsConstants.NHTTP_CONNECTION_TIMEOUT; - } - if (responseFlags.getLocalReset()) { - return AnalyticsConstants.NHTTP_RECEIVER_INPUT_OUTPUT_ERROR_RECEIVING; - } - if (responseFlags.getUpstreamRemoteReset()) { - return AnalyticsConstants.NHTTP_CONNECTION_FAILED; - } - if (responseFlags.getUpstreamConnectionFailure()) { - return AnalyticsConstants.NHTTP_SENDER_INPUT_OUTPUT_ERROR_SENDING; - } - if (responseFlags.getUpstreamConnectionTermination()) { - return AnalyticsConstants.NHTTP_CONNECTION_CLOSED; - } - if (responseFlags.getDownstreamConnectionTermination()) { - return AnalyticsConstants.NHTTP_RECEIVER_INPUT_OUTPUT_ERROR_RECEIVING; - } - if (responseFlags.getStreamIdleTimeout()) { - return AnalyticsConstants.NHTTP_CONNECTION_TIMEOUT; - } - if (responseFlags.getDownstreamProtocolError()) { - return AnalyticsConstants.NHTTP_PROTOCOL_VIOLATION; - } - // https://www.envoyproxy.io/docs/envoy/latest/faq/configuration/timeouts - if (responseFlags.getUpstreamMaxStreamDurationReached()) { - return AnalyticsConstants.NHTTP_CONNECTION_TIMEOUT; - } - if (responseFlags.getDurationTimeout()) { - return AnalyticsConstants.NHTTP_RECEIVER_INPUT_OUTPUT_ERROR_SENDING; - } - return -1; - - // UpstreamOverflow - // DelayInjected - // FaultInjected - // RateLimited - // UnauthorizedDetails - // RateLimitServiceError - // UpstreamRetryLimitExceeded - // InvalidEnvoyRequestHeaders - // ResponseFromCacheFilter - // NoRouteFound // Not used under connectivity issues - } - - public int getErrorCode() { - return errorCode; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/API.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/API.java deleted file mode 100644 index 87b1b20af8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/API.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2020, 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.api; - -import org.wso2.apk.enforcer.discovery.api.Api; -import org.wso2.apk.enforcer.commons.Filter; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; - -import java.util.List; - -/** - * Interface to hold different API types. This can REST, gRPC, graphql and etc. - */ -public interface API { - List getFilters(); - - String init(Api api); - - ResponseObject process(RequestContext requestContext); - - APIConfig getAPIConfig(); - - default boolean executeFilterChain(RequestContext requestContext) { - boolean proceed; - for (Filter filter : getFilters()) { - proceed = filter.handleRequest(requestContext); - if (!proceed) { - return false; - } - } - return true; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/APIFactory.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/APIFactory.java deleted file mode 100644 index 609c340c13..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/APIFactory.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2020, 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.api; - -import io.envoyproxy.envoy.service.auth.v3.CheckRequest; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.common.CacheProviderUtil; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.discovery.api.Api; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.discovery.ApiDiscoveryClient; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Holds the meta data of all the APIS deployed in the gateway node. Adding/Updating API requires to register the - * API with this factory class. When requests are received this factory instance will be queried to find the matching - * API, and then request will be dispatched to that API. - */ -public class APIFactory { - private static final Logger logger = LogManager.getLogger(APIFactory.class); - - private static APIFactory apiFactory; - private Map apis = new ConcurrentHashMap<>(); - - private APIFactory() { - } - - public static APIFactory getInstance() { - if (apiFactory == null) { - apiFactory = new APIFactory(); - } - return apiFactory; - } - - public void init() { - ApiDiscoveryClient ads = ApiDiscoveryClient.getInstance(); - ads.watchApis(); - } - - public void addApi(API api) { - String apiKey = getApiKey(api); - apis.put(apiKey, api); - } - - public void addApis(List apis) { - //TODO: (Praminda) Use apiId as the map key. Need to add the apiId to envoy context meta - Map newApis = new ConcurrentHashMap<>(); - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - for (Api api : apis) { -// if (APIConstants.ApiType.WEB_SOCKET.equals(api.getApiType())) { -// WebSocketAPI webSocketAPI = new WebSocketAPI(); -// webSocketAPI.init(api); -// String apiKey = getApiKey(webSocketAPI); -// newApis.put(apiKey, webSocketAPI); -// } else - if (APIConstants.ApiType.GRAPHQL.equals(api.getApiType())) { - GraphQLAPI graphQLAPI = new GraphQLAPI(); - graphQLAPI.init(api); - String apiKey = getApiKey(graphQLAPI); - newApis.put(apiKey, graphQLAPI); - } else if (APIConstants.ApiType.GRPC.equals(api.getApiType())) { - GRPCAPI grpcAPI = new GRPCAPI(); - grpcAPI.init(api); - String apiKey = getApiKey(grpcAPI); - newApis.put(apiKey, grpcAPI); - } else { - RestAPI enforcerApi = new RestAPI(); - enforcerApi.init(api); - if (enforcerConfig.getEnableGatewayClassController()) { - for (String httpRouteID : api.getHttpRouteIDsList()) { - newApis.put(httpRouteID, enforcerApi); - } - } else { - String apiKey = getApiKey(enforcerApi); - newApis.put(apiKey, enforcerApi); - } - } - } - - if (logger.isDebugEnabled()) { - logger.debug("Total APIs in new cache: {}", newApis.size()); - } - this.apis = newApis; - CacheProviderUtil.initializeCacheHolder(newApis); - } - - public void removeApi(API api) { - String apiKey = getApiKey(api); - apis.remove(apiKey); - } - - public API getMatchedAPI(CheckRequest request) { - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - if (enforcerConfig.getEnableGatewayClassController()) { - String routeName = request.getAttributes().getContextExtensionsMap().get(APIConstants.ROUTE_NAME_PARAM); - String apikey = routeName.split("rule/")[0]; - return apis.get(apikey); - } - String vHost = request.getAttributes().getContextExtensionsMap().get(APIConstants.GW_VHOST_PARAM); - String basePath = request.getAttributes().getContextExtensionsMap().get(APIConstants.GW_BASE_PATH_PARAM); - String version = request.getAttributes().getContextExtensionsMap().get(APIConstants.GW_VERSION_PARAM); - String apiKey = getApiKey(vHost, basePath, version); - if (logger.isDebugEnabled()) { - logger.debug("Looking for matching API with basepath: {} and version: {}", basePath, version); - } - - return apis.get(apiKey); - } - - public byte[] getAPIDefinition(final String basePath, final String version, final String vHost) { - String apiKey = getApiKey(vHost, basePath, version); - API api = apis.get(apiKey); - if (api == null) { - return null; - } - return api.getAPIConfig().getApiDefinition(); - } - -// public WebSocketAPI getMatchedAPI(WebSocketFrameRequest webSocketFrameRequest) { -// Map extAuthMetadata = webSocketFrameRequest.getMetadata().getExtAuthzMetadataMap(); -// String vHost = extAuthMetadata.get(APIConstants.GW_VHOST_PARAM); -// String basePath = extAuthMetadata.get(APIConstants.GW_BASE_PATH_PARAM); -// String version = extAuthMetadata.get(APIConstants.GW_VERSION_PARAM); -// String apiKey = getApiKey(vHost, basePath, version); -// if (logger.isDebugEnabled()) { -// logger.debug("Looking for matching API with basepath: {} and version: {}", basePath, version); -// } -// return (WebSocketAPI) apis.get(apiKey); -// } - - public ResourceConfig getMatchedResource(API api, String routeName) { - List resourceConfigList = api.getAPIConfig().getResources(); - return resourceConfigList.stream() - .filter(resourceConfig -> routeName.startsWith(resourceConfig.getMatchID()+"/")).findFirst().orElse(null); - } - - public ResourceConfig getMatchedResource(API api, String matchedResourcePath, String method) { - List resourceConfigList = api.getAPIConfig().getResources(); - if (APIConstants.ApiType.GRPC.equals(api.getAPIConfig().getApiType())) { - return resourceConfigList.stream() - .filter(resourceConfig -> resourceConfig.getPath().equals(matchedResourcePath)) - .findFirst().orElse(null); - } - return resourceConfigList.stream() - .filter(resourceConfig -> resourceConfig.getPath().equals(matchedResourcePath)) - .filter(resourceConfig -> (method == null) || resourceConfig.getMethod() - .equals(ResourceConfig.HttpMethods.valueOf(method))) - .findFirst().orElse(null); - } - -// // For WebSocket APIs since there are no resources in WebSocket APIs. -// public ResourceConfig getMatchedBasePath(API api, String basePath) { -// ResourceConfig resourceConfig = new ResourceConfig(); -// if (api.getAPIConfig().getBasePath().equals(basePath)) { -// resourceConfig.setPath(basePath); -// resourceConfig.setMethod(ResourceConfig.HttpMethods.GET); -// resourceConfig.setSecuritySchemas(api.getAPIConfig().getApiSecurity()); -// } -// return resourceConfig; -// } - - private String getApiKey(API api) { - APIConfig apiConfig = api.getAPIConfig(); - return getApiKey(apiConfig.getVhost(), apiConfig.getBasePath(), apiConfig.getVersion()); - } - - private String getApiKey(String vhost, String basePath, String version) { - return String.format("%s:%s:%s", vhost, basePath, version); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/APIProcessUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/APIProcessUtils.java deleted file mode 100644 index fc87c1fdad..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/APIProcessUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2020, 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.api; - -import java.util.List; - -import org.wso2.apk.enforcer.commons.model.EndpointSecurity; - -/** - * APIProcessUtils is used to convert the Endpoint Security DTO used in proto files into Enforcer specific - * Object. - */ -public class APIProcessUtils { - public static EndpointSecurity[] convertProtoEndpointSecurity - (List protoSecurityInfo) { - EndpointSecurity[] securityInfo = new EndpointSecurity[protoSecurityInfo.size()]; - for (int i = 0; i < protoSecurityInfo.size(); i++) { - EndpointSecurity security = new EndpointSecurity(); - security.setSecurityType(protoSecurityInfo.get(i).getSecurityType()); - security.setUsername(protoSecurityInfo.get(i).getUsername()); - security.setPassword(protoSecurityInfo.get(i).getPassword().toCharArray()); - security.setCustomParameters(protoSecurityInfo.get(i).getCustomParametersMap()); - security.setEnabled(protoSecurityInfo.get(i).getEnabled()); - securityInfo[i] = security; - } - return securityInfo; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/GRPCAPI.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/GRPCAPI.java deleted file mode 100644 index f1457fe09f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/GRPCAPI.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.wso2.apk.enforcer.api; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.analytics.AnalyticsFilter; -import org.wso2.apk.enforcer.commons.Filter; -import org.wso2.apk.enforcer.commons.dto.ClaimValueDTO; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.commons.model.EndpointSecurity; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.EndpointCluster; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.HttpConstants; -import org.wso2.apk.enforcer.cors.CorsFilter; -import org.wso2.apk.enforcer.discovery.api.Api; -import org.wso2.apk.enforcer.discovery.api.Resource; -import org.wso2.apk.enforcer.discovery.api.Operation; -import org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo; -import org.wso2.apk.enforcer.discovery.api.Claim; -import org.wso2.apk.enforcer.security.AuthFilter; -import org.wso2.apk.enforcer.security.mtls.MtlsUtils; -import org.wso2.apk.enforcer.util.EndpointUtils; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class GRPCAPI implements API { - - private static final Logger logger = LogManager.getLogger(GRPCAPI.class); - private final List filters = new ArrayList<>(); - private APIConfig apiConfig; - - @Override - public List getFilters() { - return filters; - } - - @Override - public String init(Api api) { - String vhost = api.getVhost(); - String basePath = api.getBasePath(); - String name = api.getTitle(); - String version = api.getVersion(); - String apiType = api.getApiType(); - List resources = new ArrayList<>(); - - String mutualSSL = api.getMutualSSL(); - Map applicationSecurity = api.getApplicationSecurityMap(); - - EndpointCluster endpoints = Utils.processEndpoints(api.getEndpoints()); - EndpointSecurity[] endpointSecurity = APIProcessUtils.convertProtoEndpointSecurity( - api.getEndpointSecurityList()); - - for (Resource res : api.getResourcesList()) { - for (Operation operation : res.getMethodsList()) { - ResourceConfig resConfig = Utils.buildResource(operation, res.getPath(), endpointSecurity); - resConfig.setEndpoints(endpoints); - resConfig.setPolicyConfig(Utils.genPolicyConfig(operation.getPolicies())); - resources.add(resConfig); - } - } - - KeyStore trustStore; - try { - trustStore = MtlsUtils.createTrustStore(api.getClientCertificatesList()); - } catch (KeyStoreException e) { - throw new SecurityException(e); - } - - BackendJWTTokenInfo backendJWTTokenInfo = api.getBackendJWTTokenInfo(); - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - - // If backendJWTTokeInfo is available - if (api.hasBackendJWTTokenInfo()) { - Map claims = backendJWTTokenInfo.getCustomClaimsMap(); - Map claimsMap = new HashMap<>(); - for (Map.Entry claimEntry : claims.entrySet()) { - Claim claim = claimEntry.getValue(); - ClaimValueDTO claimVal = new ClaimValueDTO(claim.getValue(), claim.getType()); - claimsMap.put(claimEntry.getKey(), claimVal); - } - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - jwtConfigurationDto.populateConfigValues(backendJWTTokenInfo.getEnabled(), - backendJWTTokenInfo.getHeader(), backendJWTTokenInfo.getSigningAlgorithm(), - backendJWTTokenInfo.getEncoding(), enforcerConfig.getJwtConfigurationDto().getPublicCert(), - enforcerConfig.getJwtConfigurationDto().getPrivateKey(), backendJWTTokenInfo.getTokenTTL(), - claimsMap, enforcerConfig.getJwtConfigurationDto().useKid(), - enforcerConfig.getJwtConfigurationDto().getKidValue()); - } - - byte[] apiDefinition = api.getApiDefinitionFile().toByteArray(); - String apiLifeCycleState = api.getApiLifeCycleState(); - this.apiConfig = new APIConfig.Builder(name).uuid(api.getId()).vhost(vhost).basePath(basePath).version(version) - .resources(resources).apiType(apiType).apiLifeCycleState(apiLifeCycleState).tier(api.getTier()) - .envType(api.getEnvType()).disableAuthentication(api.getDisableAuthentications()) - .disableScopes(api.getDisableScopes()).trustStore(trustStore).organizationId(api.getOrganizationId()) - .mutualSSL(mutualSSL) - .applicationSecurity(applicationSecurity).jwtConfigurationDto(jwtConfigurationDto) - .apiDefinition(apiDefinition).environment(api.getEnvironment()) - .subscriptionValidation(api.getSubscriptionValidation()).transportSecurity(api.getTransportSecurity()) - .build(); - initFilters(); - logger.info("APIConfig: " + this.apiConfig); - return basePath; - } - - @Override - public ResponseObject process(RequestContext requestContext) { - - ResponseObject responseObject = new ResponseObject(requestContext.getRequestID()); - responseObject.setRequestPath(requestContext.getRequestPath()); - boolean analyticsEnabled = ConfigHolder.getInstance().getConfig().getAnalyticsConfig().isEnabled(); - - Utils.handleCommonHeaders(requestContext); - boolean isExistsMatchedOperations = requestContext.getMatchedResourcePaths() != null && - requestContext.getMatchedResourcePaths().size() > 0; - // This flag is used to apply CORS filter - boolean isOptionCall = requestContext.getRequestMethod().contains(HttpConstants.OPTIONS); - - // handle other not allowed && non option request && not yet handled error - // scenarios. - if ((!isOptionCall && !isExistsMatchedOperations) && !requestContext.getProperties() - .containsKey(APIConstants.MessageFormat.ERROR_CODE)) { - requestContext.getProperties() - .put(APIConstants.MessageFormat.STATUS_CODE, APIConstants.StatusCodes.NOTFOUND.getCode()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, - APIConstants.StatusCodes.NOTFOUND.getValue()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, - APIConstants.NOT_FOUND_MESSAGE); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - APIConstants.NOT_FOUND_DESCRIPTION); - } - - if ((isExistsMatchedOperations || isOptionCall) && executeFilterChain(requestContext)) { - EndpointUtils.updateClusterHeaderAndCheckEnv(requestContext); - responseObject.setOrganizationId(requestContext.getMatchedAPI().getOrganizationId()); - responseObject.setRemoveHeaderMap(requestContext.getRemoveHeaders()); - responseObject.setQueryParamsToRemove(requestContext.getQueryParamsToRemove()); - responseObject.setRemoveAllQueryParams(requestContext.isRemoveAllQueryParams()); - responseObject.setQueryParamsToAdd(requestContext.getQueryParamsToAdd()); - responseObject.setQueryParamMap(requestContext.getQueryParameters()); - responseObject.setStatusCode(APIConstants.StatusCodes.OK.getCode()); - if (requestContext.getAddHeaders() != null && requestContext.getAddHeaders().size() > 0) { - responseObject.setHeaderMap(requestContext.getAddHeaders()); - } - if (analyticsEnabled) { - AnalyticsFilter.getInstance().handleSuccessRequest(requestContext); - } - // set metadata for interceptors - responseObject.setMetaDataMap(requestContext.getMetadataMap()); - } else { - // If enforcer stops with a false, it will be passed directly to the client. - responseObject.setDirectResponse(true); - responseObject.setStatusCode(Integer.parseInt( - requestContext.getProperties().get(APIConstants.MessageFormat.STATUS_CODE).toString())); - if (requestContext.getProperties().containsKey(APIConstants.MessageFormat.ERROR_CODE)) { - responseObject.setErrorCode( - requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE).toString()); - } - if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_MESSAGE) != null) { - responseObject.setErrorMessage(requestContext.getProperties() - .get(APIConstants.MessageFormat.ERROR_MESSAGE).toString()); - } - if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_DESCRIPTION) != null) { - responseObject.setErrorDescription(requestContext.getProperties() - .get(APIConstants.MessageFormat.ERROR_DESCRIPTION).toString()); - } - if (requestContext.getAddHeaders() != null && requestContext.getAddHeaders().size() > 0) { - responseObject.setHeaderMap(requestContext.getAddHeaders()); - } - if (analyticsEnabled && !FilterUtils.isSkippedAnalyticsFaultEvent(responseObject.getErrorCode())) { - AnalyticsFilter.getInstance().handleFailureRequest(requestContext); - responseObject.setMetaDataMap(new HashMap<>(0)); - } - } - - return responseObject; - } - - @Override - public APIConfig getAPIConfig() { - return this.apiConfig; - } - - private void initFilters() { - AuthFilter authFilter = new AuthFilter(); - authFilter.init(apiConfig, null); - this.filters.add(authFilter); - - // CORS filter is added as the first filter, and it is not customizable. - CorsFilter corsFilter = new CorsFilter(); - this.filters.add(0, corsFilter); - } -} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/GraphQLAPI.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/GraphQLAPI.java deleted file mode 100644 index 7f8ac1278f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/GraphQLAPI.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.api; - -import graphql.schema.GraphQLSchema; -import graphql.schema.idl.SchemaParser; -import graphql.schema.idl.TypeDefinitionRegistry; -import graphql.schema.idl.UnExecutableSchemaGenerator; -import java.io.IOException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.dto.ClaimValueDTO; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.discovery.api.Api; -import org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo; -import org.wso2.apk.enforcer.discovery.api.Claim; -import org.wso2.apk.enforcer.discovery.api.Operation; -import org.wso2.apk.enforcer.discovery.api.Resource; -import org.wso2.apk.enforcer.analytics.AnalyticsFilter; -import org.wso2.apk.enforcer.commons.Filter; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.EndpointCluster; -import org.wso2.apk.enforcer.commons.model.EndpointSecurity; -import org.wso2.apk.enforcer.commons.model.GraphQLSchemaDTO; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.HttpConstants; -import org.wso2.apk.enforcer.cors.CorsFilter; -import org.wso2.apk.enforcer.graphql.GraphQLPayloadUtils; -import org.wso2.apk.enforcer.graphql.GraphQLQueryAnalysisFilter; -import org.wso2.apk.enforcer.security.AuthFilter; -import org.wso2.apk.enforcer.security.mtls.MtlsUtils; -import org.wso2.apk.enforcer.server.swagger.APIDefinitionUtils; -import org.wso2.apk.enforcer.util.EndpointUtils; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Specific implementation for a Rest API type APIs. - */ -public class GraphQLAPI implements API { - private static final Logger logger = LogManager.getLogger(GraphQLAPI.class); - private final List filters = new ArrayList<>(); - private APIConfig apiConfig; - - @Override - public List getFilters() { - return filters; - } - - @Override - public String init(Api api) { - String vhost = api.getVhost(); - String basePath = api.getBasePath(); - String name = api.getTitle(); - String version = api.getVersion(); - String apiType = api.getApiType(); - List resources = new ArrayList<>(); - String mutualSSL = api.getMutualSSL(); - Map applicationSecurity = api.getApplicationSecurityMap(); - - EndpointCluster endpoints = Utils.processEndpoints(api.getEndpoints()); - EndpointSecurity[] endpointSecurity = APIProcessUtils.convertProtoEndpointSecurity( - api.getEndpointSecurityList()); - - for (Resource res : api.getResourcesList()) { - for (Operation operation : res.getMethodsList()) { - ResourceConfig resConfig = Utils.buildResource(operation, res.getPath(), endpointSecurity); - resConfig.setEndpoints(endpoints); - resConfig.setPolicyConfig(Utils.genPolicyConfig(operation.getPolicies())); - resources.add(resConfig); - } - } - - KeyStore trustStore; - try { - trustStore = MtlsUtils.createTrustStore(api.getClientCertificatesList()); - } catch (KeyStoreException e) { - throw new SecurityException(e); - } - - BackendJWTTokenInfo backendJWTTokenInfo = api.getBackendJWTTokenInfo(); - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - - // If backendJWTTokeInfo is available - if (api.hasBackendJWTTokenInfo()) { - Map claims = backendJWTTokenInfo.getCustomClaimsMap(); - Map claimsMap = new HashMap<>(); - for (Map.Entry claimEntry : claims.entrySet()) { - Claim claim = claimEntry.getValue(); - ClaimValueDTO claimVal = new ClaimValueDTO(claim.getValue(), claim.getType()); - claimsMap.put(claimEntry.getKey(), claimVal); - } - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - jwtConfigurationDto.populateConfigValues(backendJWTTokenInfo.getEnabled(), - backendJWTTokenInfo.getHeader(), backendJWTTokenInfo.getSigningAlgorithm(), - backendJWTTokenInfo.getEncoding(), enforcerConfig.getJwtConfigurationDto().getPublicCert(), - enforcerConfig.getJwtConfigurationDto().getPrivateKey(), backendJWTTokenInfo.getTokenTTL(), - claimsMap, enforcerConfig.getJwtConfigurationDto().useKid(), - enforcerConfig.getJwtConfigurationDto().getKidValue()); - } - - SchemaParser schemaParser = new SchemaParser(); - - byte[] apiDefinition = api.getApiDefinitionFile().toByteArray(); - TypeDefinitionRegistry registry; - try { - String scheme = APIDefinitionUtils.ReadGzip(apiDefinition); - registry = schemaParser.parse(scheme); - } catch (IOException e) { - logger.error("Error while parsing the GQL schema definition of the API: " + name, e); - throw new RuntimeException(e); - } - GraphQLSchema schema = UnExecutableSchemaGenerator.makeUnExecutableSchema(registry); - - GraphQLSchemaDTO graphQLSchemaDTO = new GraphQLSchemaDTO(schema, registry, - GraphQLPayloadUtils.parseComplexityDTO(api.getGraphqlComplexityInfoList())); - String apiLifeCycleState = api.getApiLifeCycleState(); - this.apiConfig = new APIConfig.Builder(name).uuid(api.getId()).vhost(vhost).basePath(basePath).version(version) - .resources(resources).apiType(apiType).apiLifeCycleState(apiLifeCycleState).tier(api.getTier()) - .envType(api.getEnvType()).disableAuthentication(api.getDisableAuthentications()) - .disableScopes(api.getDisableScopes()).trustStore(trustStore).organizationId(api.getOrganizationId()) - .mutualSSL(mutualSSL).transportSecurity(api.getTransportSecurity()) - .applicationSecurity(applicationSecurity).jwtConfigurationDto(jwtConfigurationDto) - .apiDefinition(apiDefinition).environment(api.getEnvironment()) - .subscriptionValidation(api.getSubscriptionValidation()).graphQLSchemaDTO(graphQLSchemaDTO).build(); - initFilters(); - return basePath; - } - - @Override - public ResponseObject process(RequestContext requestContext) { - - ResponseObject responseObject = new ResponseObject(requestContext.getRequestID()); - responseObject.setRequestPath(requestContext.getRequestPath()); - boolean analyticsEnabled = ConfigHolder.getInstance().getConfig().getAnalyticsConfig().isEnabled(); - - Utils.handleCommonHeaders(requestContext); - boolean isExistsMatchedOperations = requestContext.getMatchedResourcePaths() != null && - requestContext.getMatchedResourcePaths().size() > 0; - // This flag is used to apply CORS filter - boolean isOptionCall = requestContext.getRequestMethod().contains(HttpConstants.OPTIONS); - - // handle other not allowed && non option request && not yet handled error - // scenarios. - if ((!isOptionCall && !isExistsMatchedOperations) && !requestContext.getProperties() - .containsKey(APIConstants.MessageFormat.ERROR_CODE)) { - requestContext.getProperties() - .put(APIConstants.MessageFormat.STATUS_CODE, APIConstants.StatusCodes.NOTFOUND.getCode()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, - APIConstants.StatusCodes.NOTFOUND.getValue()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, - APIConstants.NOT_FOUND_MESSAGE); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - APIConstants.NOT_FOUND_DESCRIPTION); - } - - if ((isExistsMatchedOperations || isOptionCall) && executeFilterChain(requestContext)) { - EndpointUtils.updateClusterHeaderAndCheckEnv(requestContext); - responseObject.setOrganizationId(requestContext.getMatchedAPI().getOrganizationId()); - responseObject.setRemoveHeaderMap(requestContext.getRemoveHeaders()); - responseObject.setQueryParamsToRemove(requestContext.getQueryParamsToRemove()); - responseObject.setRemoveAllQueryParams(requestContext.isRemoveAllQueryParams()); - responseObject.setQueryParamsToAdd(requestContext.getQueryParamsToAdd()); - responseObject.setQueryParamMap(requestContext.getQueryParameters()); - responseObject.setStatusCode(APIConstants.StatusCodes.OK.getCode()); - if (requestContext.getAddHeaders() != null && requestContext.getAddHeaders().size() > 0) { - responseObject.setHeaderMap(requestContext.getAddHeaders()); - } - if (analyticsEnabled) { - AnalyticsFilter.getInstance().handleSuccessRequest(requestContext); - } - // set metadata for interceptors - responseObject.setMetaDataMap(requestContext.getMetadataMap()); - } else { - // If enforcer stops with a false, it will be passed directly to the client. - responseObject.setDirectResponse(true); - responseObject.setStatusCode(Integer.parseInt( - requestContext.getProperties().get(APIConstants.MessageFormat.STATUS_CODE).toString())); - if (requestContext.getProperties().containsKey(APIConstants.MessageFormat.ERROR_CODE)) { - responseObject.setErrorCode( - requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE).toString()); - } - if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_MESSAGE) != null) { - responseObject.setErrorMessage(requestContext.getProperties() - .get(APIConstants.MessageFormat.ERROR_MESSAGE).toString()); - } - if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_DESCRIPTION) != null) { - responseObject.setErrorDescription(requestContext.getProperties() - .get(APIConstants.MessageFormat.ERROR_DESCRIPTION).toString()); - } - if (requestContext.getAddHeaders() != null && requestContext.getAddHeaders().size() > 0) { - responseObject.setHeaderMap(requestContext.getAddHeaders()); - } - if (analyticsEnabled && !FilterUtils.isSkippedAnalyticsFaultEvent(responseObject.getErrorCode())) { - AnalyticsFilter.getInstance().handleFailureRequest(requestContext); - responseObject.setMetaDataMap(new HashMap<>(0)); - } - } - - return responseObject; - } - - @Override - public APIConfig getAPIConfig() { - return this.apiConfig; - } - - private void initFilters() { - AuthFilter authFilter = new AuthFilter(); - authFilter.init(apiConfig, null); - this.filters.add(authFilter); - - GraphQLQueryAnalysisFilter queryAnalysisFilter = new GraphQLQueryAnalysisFilter(); - queryAnalysisFilter.init(apiConfig, null); - this.filters.add(queryAnalysisFilter); - - // CORS filter is added as the first filter, and it is not customizable. - CorsFilter corsFilter = new CorsFilter(); - this.filters.add(0, corsFilter); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/ResponseObject.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/ResponseObject.java deleted file mode 100644 index 3b5d7201ce..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/ResponseObject.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2020, 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.api; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -/** - * Holds the response data to build the response object to be sent to the envoy proxy. - */ -public class ResponseObject { - private final String correlationID; - private int statusCode; - private String errorCode; - private String errorMessage; - private String errorDescription; - private Map headerMap = new HashMap<>(); - private ArrayList removeHeaderMap = new ArrayList<>(); - private Map metaDataMap; - private boolean isDirectResponse = false; - private ArrayList queryParamsToRemove = new ArrayList<>(); - private boolean removeAllQueryParams = false; - private Map queryParamsToAdd; - private Map queryParams; - private String requestPath; - private String responseContent; - private String organizationId; - - public String getOrganizationId() { - return organizationId; - } - - public void setOrganizationId(String organizationId) { - this.organizationId = organizationId; - } - public ArrayList getRemoveHeaderMap() { - return removeHeaderMap; - } - - public void setRemoveHeaderMap(ArrayList removeHeaderMap) { - this.removeHeaderMap = removeHeaderMap; - } - - public ResponseObject(String correlationID) { - this.correlationID = correlationID; - } - - public ResponseObject() { - this.correlationID = "xxxxx"; - } - - public void setHeaderMap(Map headerMap) { - this.headerMap = headerMap; - } - - public Map getHeaderMap() { - return headerMap; - } - - public int getStatusCode() { - return statusCode; - } - - public void setStatusCode(int statusCode) { - this.statusCode = statusCode; - } - - public String getErrorCode() { - return errorCode; - } - - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public String getErrorDescription() { - return errorDescription; - } - - public void setErrorDescription(String errorDescription) { - this.errorDescription = errorDescription; - } - - public boolean isDirectResponse() { - return isDirectResponse; - } - - public void setDirectResponse(boolean directResponse) { - isDirectResponse = directResponse; - } - - public String getCorrelationID() { - return correlationID; - } - - public Map getMetaDataMap() { - return metaDataMap; - } - - public void setMetaDataMap(Map metaDataMap) { - this.metaDataMap = metaDataMap; - } - - public ArrayList getQueryParamsToRemove() { - return queryParamsToRemove; - } - public Map getQueryParamsToAdd() { - return queryParamsToAdd; - } - - public void setQueryParamsToRemove(ArrayList queryParamsToRemove) { - this.queryParamsToRemove = queryParamsToRemove; - } - - public void setRemoveAllQueryParams(boolean queryParamsToRemove) { - this.removeAllQueryParams = queryParamsToRemove; - } - - public boolean isRemoveAllQueryParams() { - return removeAllQueryParams; - } - - public void setQueryParamsToAdd(Map queryParamsToAdd) { - this.queryParamsToAdd = queryParamsToAdd; - } - - public Map getQueryParamMap() { - return queryParams; - } - - public void setQueryParamMap(Map queryParams) { - this.queryParams = queryParams; - } - - public String getRequestPath() { - return requestPath; - } - - public void setRequestPath(String requestPath) { - this.requestPath = requestPath; - } - - public String getResponsePayload() { - return responseContent; - } - - public void setResponseContent(String responseContent) { - this.responseContent = responseContent; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/RestAPI.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/RestAPI.java deleted file mode 100644 index 058d4008e4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/RestAPI.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2020, 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.api; - -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.analytics.AnalyticsFilter; -import org.wso2.apk.enforcer.commons.Filter; -import org.wso2.apk.enforcer.commons.dto.ClaimValueDTO; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.HttpConstants; -import org.wso2.apk.enforcer.cors.CorsFilter; -import org.wso2.apk.enforcer.discovery.api.*; -import org.wso2.apk.enforcer.interceptor.MediationPolicyFilter; -import org.wso2.apk.enforcer.security.AuthFilter; -import org.wso2.apk.enforcer.security.mtls.MtlsUtils; -import org.wso2.apk.enforcer.util.EndpointUtils; -import org.wso2.apk.enforcer.util.FilterUtils; -import org.wso2.apk.enforcer.util.MockImplUtils; - -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Specific implementation for a Rest API type APIs. - */ -public class RestAPI implements API { - - private static final Logger logger = LogManager.getLogger(RestAPI.class); - private final List filters = new ArrayList<>(); - private APIConfig apiConfig; - - @Override - public List getFilters() { - - return filters; - } - - @Override - public String init(Api api) { - - String vhost = api.getVhost(); - String basePath = api.getBasePath(); - String name = api.getTitle(); - String version = api.getVersion(); - String apiType = api.getApiType(); - List resources = new ArrayList<>(); - String mutualSSL = api.getMutualSSL(); - Map applicationSecurity = api.getApplicationSecurityMap(); - - for (Resource res : api.getResourcesList()) { - for (Operation operation : res.getMethodsList()) { - ResourceConfig resConfig = Utils.buildResource(operation, res.getPath(), - APIProcessUtils.convertProtoEndpointSecurity(res.getEndpointSecurityList())); - resConfig.setPolicyConfig(Utils.genPolicyConfig(operation.getPolicies())); - resConfig.setEndpoints(Utils.processEndpoints(res.getEndpoints())); - resources.add(resConfig); - } - } - - KeyStore trustStore; - try { - trustStore = MtlsUtils.createTrustStore(api.getClientCertificatesList()); - } catch (KeyStoreException e) { - throw new SecurityException(e); - } - - BackendJWTTokenInfo backendJWTTokenInfo = api.getBackendJWTTokenInfo(); - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - - // If backendJWTTokeInfo is available - if (api.hasBackendJWTTokenInfo()) { - Map claims = backendJWTTokenInfo.getCustomClaimsMap(); - Map claimsMap = new HashMap<>(); - for (Map.Entry claimEntry : claims.entrySet()) { - Claim claim = claimEntry.getValue(); - ClaimValueDTO claimVal = new ClaimValueDTO(claim.getValue(), claim.getType()); - claimsMap.put(claimEntry.getKey(), claimVal); - } - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - jwtConfigurationDto.populateConfigValues(backendJWTTokenInfo.getEnabled(), - backendJWTTokenInfo.getHeader(), backendJWTTokenInfo.getSigningAlgorithm(), - backendJWTTokenInfo.getEncoding(), enforcerConfig.getJwtConfigurationDto().getPublicCert(), - enforcerConfig.getJwtConfigurationDto().getPrivateKey(), backendJWTTokenInfo.getTokenTTL(), - claimsMap, enforcerConfig.getJwtConfigurationDto().useKid(), - enforcerConfig.getJwtConfigurationDto().getKidValue()); - } - - org.wso2.apk.enforcer.commons.model.AIProvider aiProvider = new org.wso2.apk.enforcer.commons.model.AIProvider(); - if (api.getAiprovider().getEnabled()) { - aiProvider.setProviderName(api.getAiprovider().getProviderName()); - aiProvider.setProviderAPIVersion(api.getAiprovider().getProviderAPIVersion()); - aiProvider.setOrganization(api.getAiprovider().getOrganization()); - aiProvider.setEnabled(api.getAiprovider().getEnabled()); - aiProvider.setModel(new org.wso2.apk.enforcer.commons.model.ValueDetails( - api.getAiprovider().getModel().getIn(), api.getAiprovider().getModel().getValue())); - aiProvider.setPromptTokens(new org.wso2.apk.enforcer.commons.model.ValueDetails( - api.getAiprovider().getPromptTokens().getIn(), api.getAiprovider().getPromptTokens().getValue())); - aiProvider.setCompletionToken(new org.wso2.apk.enforcer.commons.model.ValueDetails( - api.getAiprovider().getCompletionToken().getIn(), api.getAiprovider().getCompletionToken().getValue())); - aiProvider.setTotalToken(new org.wso2.apk.enforcer.commons.model.ValueDetails( - api.getAiprovider().getTotalToken().getIn(), api.getAiprovider().getTotalToken().getValue())); - } - byte[] apiDefinition = api.getApiDefinitionFile().toByteArray(); - - this.apiConfig = new APIConfig.Builder(name).uuid(api.getId()).vhost(vhost).basePath(basePath).version(version) - .resources(resources).apiType(apiType).tier(api.getTier()) - .envType(api.getEnvType()).disableAuthentication(api.getDisableAuthentications()) - .disableScopes(api.getDisableScopes()).trustStore(trustStore).organizationId(api.getOrganizationId()) - .mutualSSL(mutualSSL).systemAPI(api.getSystemAPI()) - .applicationSecurity(applicationSecurity).jwtConfigurationDto(jwtConfigurationDto) - .apiDefinition(apiDefinition).environment(api.getEnvironment()) - .subscriptionValidation(api.getSubscriptionValidation()).transportSecurity(api.getTransportSecurity()) - .aiProvider(aiProvider) - .build(); - - initFilters(); - return basePath; - } - - @Override - public ResponseObject process(RequestContext requestContext) { - - ResponseObject responseObject = new ResponseObject(requestContext.getRequestID()); - responseObject.setRequestPath(requestContext.getRequestPath()); - boolean analyticsEnabled = ConfigHolder.getInstance().getConfig().getAnalyticsConfig().isEnabled(); - - Utils.handleCommonHeaders(requestContext); - boolean isExistsMatchedResourcePath = requestContext.getMatchedResourcePaths() != null && - requestContext.getMatchedResourcePaths().size() > 0; - // This flag is used to apply CORS filter - boolean isOptionCall = requestContext.getRequestMethod().contains(HttpConstants.OPTIONS); - if (!isExistsMatchedResourcePath && !isOptionCall) { - // handle other not allowed non option calls - requestContext.getProperties() - .put(APIConstants.MessageFormat.STATUS_CODE, APIConstants.StatusCodes.NOTFOUND.getCode()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, - APIConstants.StatusCodes.NOTFOUND.getValue()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, - APIConstants.NOT_FOUND_MESSAGE); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - APIConstants.NOT_FOUND_DESCRIPTION); - } - if ((isExistsMatchedResourcePath || isOptionCall) && executeFilterChain(requestContext)) { - EndpointUtils.updateClusterHeaderAndCheckEnv(requestContext); - responseObject.setOrganizationId(requestContext.getMatchedAPI().getOrganizationId()); - responseObject.setRemoveHeaderMap(requestContext.getRemoveHeaders()); - responseObject.setQueryParamsToRemove(requestContext.getQueryParamsToRemove()); - responseObject.setRemoveAllQueryParams(requestContext.isRemoveAllQueryParams()); - responseObject.setQueryParamsToAdd(requestContext.getQueryParamsToAdd()); - responseObject.setQueryParamMap(requestContext.getQueryParameters()); - responseObject.setStatusCode(APIConstants.StatusCodes.OK.getCode()); - if (requestContext.getAddHeaders() != null && requestContext.getAddHeaders().size() > 0) { - responseObject.setHeaderMap(requestContext.getAddHeaders()); - } - if (analyticsEnabled) { - AnalyticsFilter.getInstance().handleSuccessRequest(requestContext); - } - // set metadata for interceptors - responseObject.setMetaDataMap(requestContext.getMetadataMap()); - if (requestContext.getMatchedAPI().isMockedApi()) { - MockImplUtils.processMockedApiCall(requestContext, responseObject); - return responseObject; - } - } else { - // If enforcer stops with a false, it will be passed directly to the client. - responseObject.setDirectResponse(true); - responseObject.setStatusCode(Integer.parseInt( - requestContext.getProperties().get(APIConstants.MessageFormat.STATUS_CODE).toString())); - if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE) != null) { - responseObject.setErrorCode( - requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE).toString()); - } - if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_MESSAGE) != null) { - responseObject.setErrorMessage(requestContext.getProperties() - .get(APIConstants.MessageFormat.ERROR_MESSAGE).toString()); - } - if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_DESCRIPTION) != null) { - responseObject.setErrorDescription(requestContext.getProperties() - .get(APIConstants.MessageFormat.ERROR_DESCRIPTION).toString()); - } - if (requestContext.getAddHeaders() != null && requestContext.getAddHeaders().size() > 0) { - responseObject.setHeaderMap(requestContext.getAddHeaders()); - } - if (analyticsEnabled && !FilterUtils.isSkippedAnalyticsFaultEvent(responseObject.getErrorCode())) { - AnalyticsFilter.getInstance().handleFailureRequest(requestContext); - responseObject.setMetaDataMap(new HashMap<>(0)); - } - } - - return responseObject; - } - - @Override - public APIConfig getAPIConfig() { - - return this.apiConfig; - } - - private void initFilters() { - - AuthFilter authFilter = new AuthFilter(); - authFilter.init(apiConfig, null); - this.filters.add(authFilter); - - if (!apiConfig.isSystemAPI()) { - MediationPolicyFilter mediationPolicyFilter = new MediationPolicyFilter(); - this.filters.add(mediationPolicyFilter); - } - - // CORS filter is added as the first filter, and it is not customizable. - CorsFilter corsFilter = new CorsFilter(); - this.filters.add(0, corsFilter); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/Utils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/Utils.java deleted file mode 100644 index c43997aab2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/Utils.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org). - * - * 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.api; - -import org.wso2.apk.enforcer.commons.model.APIKeyAuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.AuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.JWTAuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.Oauth2AuthenticationConfig; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.discovery.api.APIKey; -import org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig; -import org.wso2.apk.enforcer.discovery.api.Operation; -import org.wso2.apk.enforcer.discovery.api.OperationPolicies; -import org.wso2.apk.enforcer.commons.model.EndpointCluster; -import org.wso2.apk.enforcer.commons.model.EndpointSecurity; -import org.wso2.apk.enforcer.commons.model.Policy; -import org.wso2.apk.enforcer.commons.model.PolicyConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.commons.model.RetryConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.AdapterConstants; - -import java.util.ArrayList; -import java.util.List; - -/** - * Utility Methods used across different APIs. - */ -public class Utils { - - /** - * Construct Enforcer Specific DTOs for endpoints from XDS specific DTOs. - * - * @param rpcEndpointCluster XDS specific EndpointCluster Instance - * @return Enforcer Specific XDS cluster instance - */ - public static EndpointCluster processEndpoints(org.wso2.apk.enforcer.discovery.api.EndpointCluster - rpcEndpointCluster) { - if (rpcEndpointCluster == null || rpcEndpointCluster.getUrlsCount() == 0) { - return null; - } - List urls = new ArrayList<>(1); - rpcEndpointCluster.getUrlsList().forEach(endpoint -> { - String url = endpoint.getURLType().toLowerCase() + "://" + - endpoint.getHost() + ":" + endpoint.getPort() + endpoint.getBasepath(); - urls.add(url); - }); - EndpointCluster endpointCluster = new EndpointCluster(); - endpointCluster.setUrls(urls); - - // Getting the first endpoint's basepath would be enough, - // as all endpoints in the cluster should have the same basepath as of now - endpointCluster.setBasePath(rpcEndpointCluster.getUrlsList().get(0).getBasepath()); - if (rpcEndpointCluster.hasConfig()) { - EndpointClusterConfig endpointClusterConfig = rpcEndpointCluster.getConfig(); - if (endpointClusterConfig.hasRetryConfig()) { - org.wso2.apk.enforcer.discovery.api.RetryConfig rpcRetryConfig - = endpointClusterConfig.getRetryConfig(); - RetryConfig retryConfig = new RetryConfig(rpcRetryConfig.getCount(), - rpcRetryConfig.getStatusCodesList().toArray(new Integer[0])); - endpointCluster.setRetryConfig(retryConfig); - } - if (endpointClusterConfig.hasTimeoutConfig()) { - org.wso2.apk.enforcer.discovery.api.TimeoutConfig timeoutConfig - = endpointClusterConfig.getTimeoutConfig(); - endpointCluster.setRouteTimeoutInMillis(timeoutConfig.getRouteTimeoutInMillis()); - } - } - return endpointCluster; - } - - public static ResourceConfig buildResource(Operation operation, String resPath, EndpointSecurity[] endpointSecurity) { - ResourceConfig resource = new ResourceConfig(); - resource.setMatchID(operation.getMatchID()); - resource.setPath(resPath); - resource.setMethod(ResourceConfig.HttpMethods.valueOf(operation.getMethod().toUpperCase())); - resource.setTier(operation.getTier()); - resource.setEndpointSecurity(endpointSecurity); - AuthenticationConfig authenticationConfig = new AuthenticationConfig(); - - if (ConfigHolder.getInstance().getConfig() - .getMandateInternalKeyValidation()) { - JWTAuthenticationConfig jwtAuthenticationConfig = getDefaultJwtAuthenticationConfig(); - authenticationConfig.setJwtAuthenticationConfig(jwtAuthenticationConfig); - } - - if (operation.hasApiAuthentication()) { - authenticationConfig.setDisabled(operation.getApiAuthentication().getDisabled()); - if (operation.getApiAuthentication().hasOauth2()) { - Oauth2AuthenticationConfig oAuth2AuthenticationConfig = new Oauth2AuthenticationConfig(); - oAuth2AuthenticationConfig.setHeader(operation.getApiAuthentication().getOauth2().getHeader()); - oAuth2AuthenticationConfig.setSendTokenToUpstream(operation.getApiAuthentication().getOauth2() - .getSendTokenToUpstream()); - authenticationConfig.setOauth2AuthenticationConfig(oAuth2AuthenticationConfig); - } - if (operation.getApiAuthentication().hasJwt()) { - JWTAuthenticationConfig jwtAuthenticationConfig = getJwtAuthenticationConfig(operation); - authenticationConfig.setJwtAuthenticationConfig(jwtAuthenticationConfig); - } - List apiKeyAuthenticationConfigs = getApiKeyAuthenticationConfigs(operation); - authenticationConfig.setApiKeyAuthenticationConfigs(apiKeyAuthenticationConfigs); - } - resource.setAuthenticationConfig(authenticationConfig); - resource.setScopes(operation.getScopesList().toArray(new String[0])); - return resource; - } - - private static List getApiKeyAuthenticationConfigs(Operation operation) { - List apiKeyAuthenticationConfigs = new ArrayList<>(); - for (APIKey apiKey : operation.getApiAuthentication().getApikeyList()) { - APIKeyAuthenticationConfig apiKeyAuthenticationConfig = new APIKeyAuthenticationConfig(); - apiKeyAuthenticationConfig.setIn(apiKey.getIn()); - apiKeyAuthenticationConfig.setName(apiKey.getName()); - apiKeyAuthenticationConfig.setSendTokenToUpstream(apiKey.getSendTokenToUpstream()); - apiKeyAuthenticationConfigs.add(apiKeyAuthenticationConfig); - } - return apiKeyAuthenticationConfigs; - } - - private static JWTAuthenticationConfig getJwtAuthenticationConfig(Operation operation) { - JWTAuthenticationConfig jwtAuthenticationConfig = new JWTAuthenticationConfig(); - jwtAuthenticationConfig.setHeader(operation.getApiAuthentication().getJwt().getHeader()); - jwtAuthenticationConfig.setSendTokenToUpstream(operation.getApiAuthentication().getJwt() - .getSendTokenToUpstream()); - List audience = new ArrayList<>(); - for (int i = 0; i < operation.getApiAuthentication().getJwt().getAudienceCount(); i++) { - audience.add(operation.getApiAuthentication().getJwt().getAudience(i)); - } - jwtAuthenticationConfig.setAudience(audience); - return jwtAuthenticationConfig; - } - - private static JWTAuthenticationConfig getDefaultJwtAuthenticationConfig() { - JWTAuthenticationConfig jwtAuthenticationConfig = new JWTAuthenticationConfig(); - jwtAuthenticationConfig.setHeader(APIConstants.TEST_CONSOLE_KEY_HEADER); - jwtAuthenticationConfig.setSendTokenToUpstream(false); - return jwtAuthenticationConfig; - } - - public static PolicyConfig genPolicyConfig(OperationPolicies operationPolicies) { - PolicyConfig policyConfig = new PolicyConfig(); - if (operationPolicies.getRequestCount() > 0) { - policyConfig.setRequest(genPolicyList(operationPolicies.getRequestList())); - } - if (operationPolicies.getResponseCount() > 0) { - policyConfig.setResponse(genPolicyList(operationPolicies.getResponseList())); - } - if (operationPolicies.getFaultCount() > 0) { - policyConfig.setFault(genPolicyList(operationPolicies.getFaultList())); - } - return policyConfig; - } - - private static ArrayList genPolicyList - (List operationPoliciesList) { - ArrayList policyList = new ArrayList<>(); - for (org.wso2.apk.enforcer.discovery.api.Policy policy : operationPoliciesList) { - policyList.add(new Policy(policy.getAction(), policy.getParametersMap())); - } - return policyList; - } - - /** - * Set common authentication headers as headers to be removed and protected headers, - * so that they will be removed by the router before being sent to the backend. - * - * @param requestContext requestContext - */ - public static void handleCommonHeaders(RequestContext requestContext) { - // not allow clients to set cluster header manually - requestContext.getRemoveHeaders().add(AdapterConstants.CLUSTER_HEADER); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/WebSocketAPI.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/WebSocketAPI.java deleted file mode 100644 index 847aa11500..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/api/WebSocketAPI.java +++ /dev/null @@ -1,290 +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.api; -// -//import org.apache.logging.log4j.LogManager; -//import org.apache.logging.log4j.Logger; -//import org.wso2.apk.enforcer.discovery.api.Api; -//import org.wso2.apk.enforcer.discovery.api.Operation; -//import org.wso2.apk.enforcer.discovery.api.Resource; -//import org.wso2.apk.enforcer.discovery.api.Scopes; -//import org.wso2.apk.enforcer.discovery.api.SecurityList; -//import org.wso2.apk.enforcer.discovery.api.SecurityScheme; -//import org.wso2.apk.enforcer.analytics.AnalyticsFilter; -//import org.wso2.apk.enforcer.commons.Filter; -//import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -//import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -//import org.wso2.apk.enforcer.commons.model.APIConfig; -//import org.wso2.apk.enforcer.commons.model.EndpointCluster; -//import org.wso2.apk.enforcer.commons.model.EndpointSecurity; -//import org.wso2.apk.enforcer.commons.model.RequestContext; -//import org.wso2.apk.enforcer.commons.model.ResourceConfig; -//import org.wso2.apk.enforcer.commons.model.SecuritySchemaConfig; -//import org.wso2.apk.enforcer.config.ConfigHolder; -//import org.wso2.apk.enforcer.constants.APIConstants; -//import org.wso2.apk.enforcer.cors.CorsFilter; -//import org.wso2.apk.enforcer.interceptor.MediationPolicyFilter; -//import org.wso2.apk.enforcer.security.AuthFilter; -//import org.wso2.apk.enforcer.throttle.ThrottleConstants; -//import org.wso2.apk.enforcer.throttle.ThrottleFilter; -//import org.wso2.apk.enforcer.util.FilterUtils; -//import org.wso2.apk.enforcer.websocket.WebSocketMetaDataFilter; -//import org.wso2.apk.enforcer.websocket.WebSocketThrottleFilter; -//import org.wso2.apk.enforcer.websocket.WebSocketThrottleResponse; -// -//import java.util.ArrayList; -//import java.util.HashMap; -//import java.util.List; -//import java.util.Map; -// -///** -// * Specific implementation for a WebSocket API type APIs. Contains 2 filter chains to process initial HTTP request and -// * WebSocket frame data. -// */ -//public class WebSocketAPI implements API { -// -// private static final Logger logger = LogManager.getLogger(WebSocketAPI.class); -// private APIConfig apiConfig; -// private final List filters = new ArrayList<>(); -// private final List upgradeFilters = new ArrayList<>(); -// private String apiLifeCycleState; -// -// @Override -// public List getFilters() { -// return null; -// } -// -// @Override -// public String init(Api api) { -// String vhost = api.getVhost(); -// String basePath = api.getBasePath(); -// String name = api.getTitle(); -// String version = api.getVersion(); -// String apiType = api.getApiType(); -// Map securitySchemes = new HashMap<>(); -// Map> apiSecurity = new HashMap<>(); -// Map endpoints = new HashMap<>(); -// List resources = new ArrayList<>(); -// -// EndpointCluster productionEndpoints = Utils.processEndpoints(api.getProductionEndpoints()); -// EndpointCluster sandboxEndpoints = Utils.processEndpoints(api.getSandboxEndpoints()); -// if (productionEndpoints != null) { -// endpoints.put(APIConstants.API_KEY_TYPE_PRODUCTION, productionEndpoints); -// } -// if (sandboxEndpoints != null) { -// endpoints.put(APIConstants.API_KEY_TYPE_SANDBOX, sandboxEndpoints); -// } -// -// for (SecurityScheme securityScheme : api.getSecuritySchemeList()) { -// if (securityScheme.getType() != null) { -// String schemaType = securityScheme.getType(); -// SecuritySchemaConfig securitySchemaConfig = new SecuritySchemaConfig(); -// securitySchemaConfig.setDefinitionName(securityScheme.getDefinitionName()); -// securitySchemaConfig.setType(schemaType); -// securitySchemaConfig.setName(securityScheme.getName()); -// securitySchemaConfig.setIn(securityScheme.getIn()); -// securitySchemes.put(schemaType, securitySchemaConfig); -// } -// } -// -// for (SecurityList securityList : api.getSecurityList()) { -// for (Map.Entry entry : securityList.getScopeListMap().entrySet()) { -// apiSecurity.put(entry.getKey(), new ArrayList<>()); -// if (entry.getValue() != null && entry.getValue().getScopesList().size() > 0) { -// List scopeList = new ArrayList<>(entry.getValue().getScopesList()); -// apiSecurity.replace(entry.getKey(), scopeList); -// } -// // only supports security scheme OR combinations. Example - -// // Security: -// // - api_key: [] -// // oauth: [] <-- AND operation is not supported hence ignoring oauth here. -// break; -// } -// } -// -// EndpointSecurity endpointSecurity = new EndpointSecurity(); -// if (api.getEndpointSecurity().hasProductionSecurityInfo()) { -// endpointSecurity.setProductionSecurityInfo( -// APIProcessUtils.convertProtoEndpointSecurity( -// api.getEndpointSecurity().getProductionSecurityInfo())); -// } -// if (api.getEndpointSecurity().hasSandBoxSecurityInfo()) { -// endpointSecurity.setSandBoxSecurityInfo( -// APIProcessUtils.convertProtoEndpointSecurity( -// api.getEndpointSecurity().getSandBoxSecurityInfo())); -// } -// for (Resource res : api.getResourcesList()) { -// for (Operation operation : res.getMethodsList()) { -// ResourceConfig resConfig = Utils.buildResource(operation, res.getPath(), apiSecurity); -// resConfig.setPolicyConfig(Utils.genPolicyConfig(operation.getPolicies())); -// resConfig.setTier(api.getTier()); -// resources.add(resConfig); -// } -// } -// -// this.apiLifeCycleState = api.getApiLifeCycleState(); -// this.apiConfig = new APIConfig.Builder(name).uuid(api.getId()).vhost(vhost).basePath(basePath).version(version) -// .apiType(apiType).apiLifeCycleState(apiLifeCycleState) -// .apiSecurity(apiSecurity).tier(api.getTier()).endpointSecurity(endpointSecurity) -// .authHeader(api.getAuthorizationHeader()).disableSecurity(api.getDisableSecurity()) -// .organizationId(api.getOrganizationId()).endpoints(endpoints).resources(resources) -// .securitySchemeDefinitions(securitySchemes).build(); -// initFilters(); -// initUpgradeFilters(); -// return basePath; -// } -// -// @Override -// public ResponseObject process(RequestContext requestContext) { -// ResponseObject responseObject = new ResponseObject(); -// responseObject.setRequestPath(requestContext.getRequestPath()); -// boolean analyticsEnabled = ConfigHolder.getInstance().getConfig().getAnalyticsConfig().isEnabled(); -// Utils.removeCommonAuthHeaders(requestContext); -// if (executeFilterChain(requestContext)) { -// if (analyticsEnabled) { -// AnalyticsFilter.getInstance().handleSuccessRequest(requestContext); -// } -// responseObject.setStatusCode(APIConstants.StatusCodes.OK.getCode()); -// responseObject.setQueryParamsToAdd(requestContext.getQueryParamsToAdd()); -// if (requestContext.getAddHeaders() != null && requestContext.getAddHeaders().size() > 0) { -// responseObject.setHeaderMap(requestContext.getAddHeaders()); -// } -// logger.debug("ext_authz metadata: {}", requestContext.getMetadataMap()); -// responseObject.setMetaDataMap(requestContext.getMetadataMap()); -// } else { -// // If a enforcer stops with a false, it will be passed directly to the client. -// responseObject.setDirectResponse(true); -// responseObject.setStatusCode(Integer.parseInt( -// requestContext.getProperties().get(APIConstants.MessageFormat.STATUS_CODE).toString())); -// if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE) != null) { -// responseObject.setErrorCode( -// requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_CODE).toString()); -// } -// if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_MESSAGE) != null) { -// responseObject.setErrorMessage(requestContext.getProperties() -// .get(APIConstants.MessageFormat.ERROR_MESSAGE).toString()); -// } -// if (requestContext.getProperties().get(APIConstants.MessageFormat.ERROR_DESCRIPTION) != null) { -// responseObject.setErrorDescription(requestContext.getProperties() -// .get(APIConstants.MessageFormat.ERROR_DESCRIPTION).toString()); -// } -// if (requestContext.getAddHeaders() != null && requestContext.getAddHeaders().size() > 0) { -// responseObject.setHeaderMap(requestContext.getAddHeaders()); -// } -// if (analyticsEnabled && !FilterUtils.isSkippedAnalyticsFaultEvent(responseObject.getErrorCode())) { -// AnalyticsFilter.getInstance().handleFailureRequest(requestContext); -// responseObject.setMetaDataMap(new HashMap<>(0)); -// } -// } -// return responseObject; -// } -// -// @Override -// public APIConfig getAPIConfig() { -// return this.apiConfig; -// } -// -// @Override -// public boolean executeFilterChain(RequestContext requestContext) { -// boolean proceed; -// for (Filter filter : getHttpFilters()) { -// proceed = filter.handleRequest(requestContext); -// if (!proceed) { -// return false; -// } -// } -// return true; -// } -// -// public boolean executeUpgradeFilterChain(RequestContext requestContext) { -// boolean proceed; -// for (Filter filter : getUpgradeFilters()) { -// proceed = filter.handleRequest(requestContext); -// if (!proceed) { -// return false; -// } -// } -// return true; -// } -// -// public List getUpgradeFilters() { -// return upgradeFilters; -// } -// -// public List getHttpFilters() { -// return filters; -// } -// -// public void initFilters() { -// // Cors Filter -// CorsFilter corsFilter = new CorsFilter(); -// this.filters.add(corsFilter); -// // PathRewriteFilter -// MediationPolicyFilter mediationPolicyFilter = new MediationPolicyFilter(); -// this.filters.add(mediationPolicyFilter); -// // Auth Filter -// AuthFilter authFilter = new AuthFilter(); -// authFilter.init(apiConfig, null); -// this.filters.add(authFilter); -// // Throttle Filter if throttling is enabled -// if (ConfigHolder.getInstance().getConfig().getThrottleConfig().isGlobalPublishingEnabled()) { -// ThrottleFilter throttleFilter = new ThrottleFilter(); -// throttleFilter.init(apiConfig, null); -// this.filters.add(throttleFilter); -// } -// // WebSocketMetadata filter -// WebSocketMetaDataFilter metaDataFilter = new WebSocketMetaDataFilter(); -// metaDataFilter.init(apiConfig, null); -// this.filters.add(metaDataFilter); -// } -// -// public void initUpgradeFilters() { -// // TODO (LahiruUdayanga) - Initiate upgrade filter chain. -// // WebSocket throttle filter -// // WebSocket analytics filter -// if (ConfigHolder.getInstance().getConfig().getThrottleConfig().isGlobalPublishingEnabled()) { -// WebSocketThrottleFilter webSocketThrottleFilter = new WebSocketThrottleFilter(); -// webSocketThrottleFilter.init(apiConfig, null); -// this.upgradeFilters.add(webSocketThrottleFilter); -// } -// } -// -// public WebSocketThrottleResponse processFramedata(RequestContext requestContext) { -// logger.trace("processFramedata called for websocket frame with basepath : {}", requestContext -// .getMatchedAPI().getBasePath()); -// if (executeUpgradeFilterChain(requestContext)) { -// WebSocketThrottleResponse webSocketThrottleResponse = new WebSocketThrottleResponse(); -// webSocketThrottleResponse.setOkState(); -// return webSocketThrottleResponse; -// } -// WebSocketThrottleResponse webSocketThrottleResponse = new WebSocketThrottleResponse(); -// webSocketThrottleResponse.setOverLimitState(); -// if (requestContext.getProperties().containsKey(APIConstants.MessageFormat.ERROR_CODE)) { -// webSocketThrottleResponse.setApimErrorCode(Integer.parseInt(requestContext.getProperties() -// .get(APIConstants.MessageFormat.ERROR_CODE).toString())); -// } else { -// webSocketThrottleResponse.setApimErrorCode(ThrottleConstants.THROTTLE_CONDITION_UNKNOWN); -// logger.error("Error code is not assigned for the websocket throttle response. : " + requestContext -// .getMatchedAPI().getBasePath(), -// ErrorDetails.errorLog(LoggingConstants.Severity.MAJOR, 5200)); -// } -// webSocketThrottleResponse.setThrottlePeriod( -// (Long) requestContext.getProperties().get(ThrottleConstants.HEADER_RETRY_AFTER)); -// return webSocketThrottleResponse; -// } -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheProvider.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheProvider.java deleted file mode 100644 index ee217886a0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheProvider.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2020, 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.common; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import org.wso2.apk.enforcer.commons.dto.JWTValidationInfo; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.dto.CacheDto; -import org.wso2.apk.enforcer.security.jwt.validator.JWTConstants; - -import java.util.concurrent.TimeUnit; - -/** - * Class for initiating and returning caches. - */ -public class CacheProvider { - // gatewayKeyCache contains valid tokens -> key: token, value: JWTValidationInfo - private LoadingCache gatewayKeyCache; - // invalidTokenCache contains invalid tokens -> key: token, value: true - private LoadingCache invalidTokenCache; - // gatewayJWTTokenCache contains backendJWT generated by gateway -> key: id, value: JWTValidationInfo - - //todo(amali) revisit apikey caches - private LoadingCache gatewayJWTTokenCache; - private LoadingCache getGatewayInternalKeyCache; - private LoadingCache getInvalidGatewayInternalKeyCache; - private LoadingCache getGatewayInternalKeyDataCache; - private LoadingCache getGatewayAPIKeyCache; - private LoadingCache getInvalidGatewayAPIKeyCache; - private LoadingCache getGatewayAPIKeyDataCache; - - private static boolean cacheEnabled = true; - public void init() { - CacheDto cacheDto = ConfigHolder.getInstance().getConfig().getCacheDto(); - cacheEnabled = cacheDto.isEnabled(); - int maxSize = cacheDto.getMaximumSize(); - int expiryTime = cacheDto.getExpiryTime(); - gatewayKeyCache = initCache(maxSize, expiryTime); - invalidTokenCache = initCache(maxSize, expiryTime); - gatewayJWTTokenCache = initCache(maxSize, expiryTime); - getGatewayInternalKeyCache = initCache(maxSize, expiryTime); - getGatewayInternalKeyDataCache = initCache(maxSize, expiryTime); - getInvalidGatewayInternalKeyCache = initCache(maxSize, expiryTime); - getGatewayAPIKeyCache = initCache(maxSize, expiryTime); - getInvalidGatewayAPIKeyCache = initCache(maxSize, expiryTime); - getGatewayAPIKeyDataCache = initCache(maxSize, expiryTime); - - } - - private static LoadingCache initCache(int maxSize, int expiryTime) { - return CacheBuilder.newBuilder() - .maximumSize(maxSize) // maximum 10000 tokens can be cached - .expireAfterAccess(expiryTime, TimeUnit.MINUTES) // cache will expire after 15 minutes of access - .build(new CacheLoader() { // build the cacheloader - @Override public String load(String s) throws Exception { - return JWTConstants.UNAVAILABLE; - } - - }); - } - - - /** - * @return Gateway Internal Key cache - */ - public LoadingCache getGatewayInternalKeyCache() { - return getGatewayInternalKeyCache; - } - - /** - * @return Gateway Internal Key data cache - */ - public LoadingCache getGatewayInternalKeyDataCache() { - return getGatewayInternalKeyDataCache; - } - - /** - * @return Gateway Internal Key invalid data cache - */ - public LoadingCache getInvalidGatewayInternalKeyCache() { - return getInvalidGatewayInternalKeyCache; - } - - /** - * @return gateway key cache - */ - public LoadingCache getGatewayKeyCache() { - return gatewayKeyCache; - } - - /** - * @return gateway invalid token cache - */ - public LoadingCache getInvalidTokenCache() { - return invalidTokenCache; - } - - /** - * @return JWT token cache - */ - public LoadingCache getGatewayJWTTokenCache() { - return gatewayJWTTokenCache; - } - - /** - * @return Gateway API key cache - */ - public LoadingCache getGatewayAPIKeyCache() { - return getGatewayAPIKeyCache; - } - - /** - * @return Gateway API key data cache - */ - public LoadingCache getGatewayAPIKeyDataCache() { - return getGatewayAPIKeyDataCache; - } - - /** - * @return Gateway API key invalid data cache - */ - public LoadingCache getInvalidGatewayAPIKeyCache() { - return getInvalidGatewayAPIKeyCache; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheProviderUtil.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheProviderUtil.java deleted file mode 100644 index ad6191d7f3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheProviderUtil.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.common; - -import org.wso2.apk.enforcer.api.API; - -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -/** - * This Class used to keep Organization level cache maps. - */ -public class CacheProviderUtil { - - private final static Map organizationCache = new ConcurrentHashMap<>(); - - private CacheProviderUtil() { - - } - - private static void initializeOrgLevelCache(String organization) { - - String syncKey = organization + "-InitializeCache"; - if (!organizationCache.containsKey(organization)) { - synchronized (syncKey.intern()) { - if (!organizationCache.containsKey(organization)) { - CacheProvider cacheProvider = new CacheProvider(); - cacheProvider.init(); - organizationCache.put(organization, cacheProvider); - } - } - } - } - - /** - * initialize Cache map from APIS - * @param apis APIS available in cluster - */ - public static void initializeCacheHolder(Map apis) { - - Set organizations = new HashSet<>(); - for (Map.Entry api : apis.entrySet()) { - organizations.add(api.getValue().getAPIConfig().getOrganizationId()); - } - for (String organization : organizations) { - initializeOrgLevelCache(organization); - } - organizationCache.keySet().removeIf(organization -> !organizations.contains(organization)); - } - - /** - * This method used to get Organization level cache. - * @param organization organization Name - * @return CacheProvider if exists - */ - public static CacheProvider getOrganizationCache(String organization) { - - return organizationCache.get(organization); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheableEntity.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheableEntity.java deleted file mode 100644 index 3e817b0a5d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/common/CacheableEntity.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2020, 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.common; - -/** - * An interface to indicate that an entity provides a cacheKey. - * - * @param Type of the CacheKey - */ -public interface CacheableEntity { - - String DELEM_PERIOD = ":"; - - /** - * Gets the Cache Key of an entity. - * - * @return K - */ - public K getCacheKey(); -} 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 deleted file mode 100644 index 2adaf15633..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Copyright (c) 2020, 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; - -import com.nimbusds.jose.Algorithm; -import com.nimbusds.jose.JOSEException; -import com.nimbusds.jose.JWSAlgorithm; -import com.nimbusds.jose.jwk.JWK; -import com.nimbusds.jose.jwk.KeyUse; -import com.nimbusds.jose.jwk.RSAKey; -import com.nimbusds.jose.util.X509CertUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -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.AnalyticsDTO; -import org.wso2.apk.enforcer.config.dto.AnalyticsPublisherConfigDTO; -import org.wso2.apk.enforcer.config.dto.AnalyticsReceiverConfigDTO; -import org.wso2.apk.enforcer.config.dto.AuthServiceConfigurationDto; -import org.wso2.apk.enforcer.config.dto.CacheDto; -import org.wso2.apk.enforcer.config.dto.ClientConfigDto; -import org.wso2.apk.enforcer.config.dto.FilterDTO; -import org.wso2.apk.enforcer.config.dto.ManagementCredentialsDto; -import org.wso2.apk.enforcer.config.dto.MetricsDTO; -import org.wso2.apk.enforcer.config.dto.MutualSSLDto; -import org.wso2.apk.enforcer.config.dto.SoapErrorResponseConfigDto; -import org.wso2.apk.enforcer.config.dto.ThreadPoolConfig; -import org.wso2.apk.enforcer.config.dto.TracingDTO; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.constants.JwtConstants; -import org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer; -import org.wso2.apk.enforcer.discovery.config.enforcer.Analytics; -import org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher; -import org.wso2.apk.enforcer.discovery.config.enforcer.Cache; -import org.wso2.apk.enforcer.discovery.config.enforcer.Config; -import org.wso2.apk.enforcer.discovery.config.enforcer.Filter; -import org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient; -import org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator; -import org.wso2.apk.enforcer.discovery.config.enforcer.Keypair; -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.Service; -import org.wso2.apk.enforcer.discovery.config.enforcer.Soap; -import org.wso2.apk.enforcer.discovery.config.enforcer.Tracing; -import org.wso2.apk.enforcer.jmx.MBeanRegistrator; -import org.wso2.apk.enforcer.jwks.BackendJWKSDto; -import org.wso2.apk.enforcer.util.FilterUtils; -import org.wso2.apk.enforcer.util.JWTUtils; -import org.wso2.apk.enforcer.util.TLSUtils; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.security.interfaces.RSAPublicKey; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.net.ssl.TrustManagerFactory; - -/** - * Configuration holder class for Microgateway. - */ -public class ConfigHolder { - - // TODO: Resolve default configs - private static final Logger logger = LogManager.getLogger(ConfigHolder.class); - - private static ConfigHolder configHolder; - private final EnvVarConfig envVarConfig = EnvVarConfig.getInstance(); - EnforcerConfig config = new EnforcerConfig(); - - private KeyStore keyStore = null; - private KeyStore trustStore = null; - private KeyStore trustStoreForJWT = null; - private KeyStore opaKeyStore = null; - private TrustManagerFactory trustManagerFactory = null; - private static final String dtoPackageName = EnforcerConfig.class.getPackageName(); - - private ConfigHolder() { - - loadTrustStore(); - loadOpaClientKeyStore(); - loadKeyStore(); - } - - private void loadKeyStore() { - String certPath = getEnvVarConfig().getEnforcerPublicKeyPath(); - String keyPath = getEnvVarConfig().getEnforcerPrivateKeyPath(); - keyStore = TLSUtils.getKeyStore(certPath, keyPath); - } - - public static ConfigHolder getInstance() { - - if (configHolder != null) { - return configHolder; - } - - configHolder = new ConfigHolder(); - return configHolder; - } - - /** - * Initialize the configuration provider class by parsing the cds configuration. - * - * @param cdsConfig configuration fetch from CDS - */ - public static ConfigHolder load(Config cdsConfig) { - - configHolder.parseConfigs(cdsConfig); - return configHolder; - } - - /** - * Parse configurations received from the CDS to internal configuration DTO. - * This is done inorder to prevent complicated code changes during the initial development - * of the mgw. Later we can switch to CDS data models directly. - */ - private void parseConfigs(Config config) { - // load auth service - populateAuthService(config.getAuthService()); - - // Read jwt token configuration - - // Read backend jwt generation configurations - populateJWTGeneratorConfigurations(config.getJwtGenerator()); - - // Read tracing configurations - populateTracingConfig(config.getTracing()); - - // Read tracing configurations - populateMetricsConfig(config.getMetrics()); - - // Read token caching configs - populateCacheConfigs(config.getCache()); - - // Populate Analytics Configuration Values - populateAnalyticsConfig(config.getAnalytics()); - - populateMTLSConfigurations(config.getSecurity().getMutualSSL()); - - populateManagementCredentials(config.getManagement()); - - // Populates the SOAP error response related configs (SoapErrorInXMLEnabled). - populateSoapErrorResponseConfigs(config.getSoap()); - - // Populates the custom filter configurations applied along with enforcer filters. - populateCustomFilters(config.getFiltersList()); - populateAPIKeyIssuer(config.getSecurity().getApiKey()); - populateInternalTokenIssuer(config.getSecurity().getRuntimeToken()); - populateMandateSubscriptionValidationConfig(config.getMandateSubscriptionValidation()); - populateMandateInternalKeyValidationConfig(config.getMandateInternalKeyValidation()); - populateHttpClientConfig(config.getHttpClient()); - this.config.setEnableGatewayClassController(config.getEnableGatewayClassController()); - // resolve string variables provided as environment variables. - resolveConfigsWithEnvs(this.config); - } - - private void populateHttpClientConfig(HttpClient httpClient) { - - ClientConfigDto clientConfigDto = new ClientConfigDto(); - clientConfigDto.setEnableSslVerification(httpClient.getSkipSSl()); - clientConfigDto.setHostnameVerifier(httpClient.getHostnameVerifier()); - clientConfigDto.setConnectionTimeout(httpClient.getConnectTimeout()); - clientConfigDto.setSocketTimeout(httpClient.getSocketTimeout()); - clientConfigDto.setMaxConnections(httpClient.getMaxTotalConnections()); - clientConfigDto.setMaxConnectionsPerRoute(httpClient.getMaxConnectionsPerRoute()); - config.setHttpClientConfigDto(clientConfigDto); - } - - private void populateInternalTokenIssuer(APIKeyEnforcer runtimeToken) { - - APIKeyIssuerDto apiKeyIssuerDto = new APIKeyIssuerDto(); - apiKeyIssuerDto.setEnabled(runtimeToken.getEnabled()); - try { - apiKeyIssuerDto.setPublicCertificate(TLSUtils.getCertificate(runtimeToken.getCertificateFilePath())); - config.setRuntimeTokenIssuerDto(apiKeyIssuerDto); - } catch (CertificateException | IOException e) { - logger.error("Error occurred while configuring RuntimeToken Issuer", e); - } - } - - private void populateAPIKeyIssuer(APIKeyEnforcer apiKey) { - - APIKeyIssuerDto apiKeyIssuerDto = new APIKeyIssuerDto(); - apiKeyIssuerDto.setEnabled(apiKey.getEnabled()); - try { - apiKeyIssuerDto.setPublicCertificate(TLSUtils.getCertificate(apiKey.getCertificateFilePath())); - config.setApiKeyIssuerDto(apiKeyIssuerDto); - } catch (CertificateException | IOException e) { - logger.error("Error occurred while configuring APIKey Issuer", e); - } - } - - private void populateSoapErrorResponseConfigs(Soap soap) { - - SoapErrorResponseConfigDto soapErrorResponseConfigDto = new SoapErrorResponseConfigDto(); - soapErrorResponseConfigDto.setEnable(soap.getSoapErrorInXMLEnabled()); - config.setSoapErrorResponseConfigDto(soapErrorResponseConfigDto); - } - - private void populateMandateSubscriptionValidationConfig(boolean mandateSubscriptionValidation) { - config.setMandateSubscriptionValidation(mandateSubscriptionValidation); - } - - private void populateMandateInternalKeyValidationConfig(boolean mandateInternalKeyValidation) { - config.setMandateInternalKeyValidation(mandateInternalKeyValidation); - } - - private void populateManagementCredentials(Management management) { - - ManagementCredentialsDto managementCredentialsDto = new ManagementCredentialsDto(); - managementCredentialsDto.setPassword(management.getPassword().toCharArray()); - managementCredentialsDto.setUserName(management.getUsername()); - config.setManagement(managementCredentialsDto); - } - - private void populateMTLSConfigurations(MutualSSL mtlsInfo) { - - MutualSSLDto mutualSSLDto = new MutualSSLDto(); - mutualSSLDto.setCertificateHeader(mtlsInfo.getCertificateHeader()); - mutualSSLDto.setEnableClientValidation(mtlsInfo.getEnableClientValidation()); - mutualSSLDto.setClientCertificateEncode(mtlsInfo.getClientCertificateEncode()); - mutualSSLDto.setEnableOutboundCertificateHeader(mtlsInfo.getEnableOutboundCertificateHeader()); - config.setMtlsInfo(mutualSSLDto); - } - - private void populateAuthService(Service cdsAuth) { - - AuthServiceConfigurationDto authDto = new AuthServiceConfigurationDto(); - authDto.setKeepAliveTime(cdsAuth.getKeepAliveTime()); - authDto.setPort(cdsAuth.getPort()); - authDto.setMaxHeaderLimit(cdsAuth.getMaxHeaderLimit()); - authDto.setMaxMessageSize(cdsAuth.getMaxMessageSize()); - - ThreadPoolConfig threadPool = new ThreadPoolConfig(); - MBeanRegistrator.registerMBean(threadPool); - - threadPool.setCoreSize(cdsAuth.getThreadPool().getCoreSize()); - threadPool.setKeepAliveTime(cdsAuth.getThreadPool().getKeepAliveTime()); - threadPool.setMaxSize(cdsAuth.getThreadPool().getMaxSize()); - threadPool.setQueueSize(cdsAuth.getThreadPool().getQueueSize()); - authDto.setThreadPool(threadPool); - - config.setAuthService(authDto); - } - - private void populateTracingConfig(Tracing tracing) { - - TracingDTO tracingConfig = new TracingDTO(); - tracingConfig.setTracingEnabled(tracing.getEnabled()); - tracingConfig.setExporterType(tracing.getType()); - tracingConfig.setConfigProperties(tracing.getConfigPropertiesMap()); - config.setTracingConfig(tracingConfig); - } - - private void populateMetricsConfig(Metrics metrics) { - - MetricsDTO metricsConfig = new MetricsDTO(); - metricsConfig.setMetricsEnabled(metrics.getEnabled()); - metricsConfig.setMetricsType(metrics.getType()); - config.setMetricsConfig(metricsConfig); - } - - private void loadTrustStore() { - - try { - - trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); - trustStore.load(null); - - if (getEnvVarConfig().isTrustDefaultCerts()) { - TLSUtils.loadDefaultCertsToTrustStore(trustStore); - } - loadTrustedCertsToTrustStore(); - - trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - trustManagerFactory.init(trustStore); - - } catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | IOException e) { - logger.error("Error in loading certs to the trust store.", e); - } - } - - private void loadTrustedCertsToTrustStore() throws IOException { - - String truststoreFilePath = getEnvVarConfig().getTrustedAdapterCertsPath(); - String certificatePath = "/home/wso2/security/truststore/ratelimiter.crt"; - TLSUtils.addCertsToTruststore(trustStore, certificatePath); - TLSUtils.addCertsToTruststore(trustStore, truststoreFilePath); - } - - private void loadOpaClientKeyStore() { - - String certPath = getEnvVarConfig().getOpaClientPublicKeyPath(); - String keyPath = getEnvVarConfig().getOpaClientPrivateKeyPath(); - opaKeyStore = FilterUtils.createClientKeyStore(certPath, keyPath); - } - - private void populateJWTGeneratorConfigurations(JWTGenerator jwtGenerator) { - - List keypairs = jwtGenerator.getKeypairsList(); - // Validation is done at the adapter to ensure that only one signing keypair is available - Keypair signingKey = getSigningKey(keypairs); - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - try { - jwtConfigurationDto.setPublicCert(TLSUtils.getCertificate(signingKey.getPublicCertificatePath())); - jwtConfigurationDto.setPrivateKey(JWTUtils.getPrivateKey(signingKey.getPrivateKeyPath())); - } catch (EnforcerException | CertificateException | IOException e) { - String err = "Error in loading keypair for Backend JWTs: " + e; - logger.error(err); - } - jwtConfigurationDto.setUseKid(true); - config.setJwtConfigurationDto(jwtConfigurationDto); - populateBackendJWKSConfiguration(jwtGenerator); - } - - public KeyStore getKeyStore() { - - return keyStore; - } - - public void setKeyStore(KeyStore keyStore) { - - this.keyStore = keyStore; - } - - private void populateBackendJWKSConfiguration(JWTGenerator jwtGenerator) { - - BackendJWKSDto backendJWKSDto = new BackendJWKSDto(); - List keypairs = jwtGenerator.getKeypairsList(); - ArrayList jwks = new ArrayList<>(); - try { - for (Keypair keypair : keypairs) { - X509Certificate cert = X509CertUtils - .parse(TLSUtils.getCertificate(keypair.getPublicCertificatePath()).getEncoded()); - RSAPublicKey publicKey = RSAKey.parse(cert).toRSAPublicKey(); - RSAKey jwk = new RSAKey.Builder(publicKey) - .keyUse(KeyUse.SIGNATURE) - .algorithm(JWSAlgorithm.RS256) - .keyIDFromThumbprint() - .build().toPublicJWK(); - jwks.add(jwk); - if (keypair.getUseForSigning()) { - config.getJwtConfigurationDto().setKidValue(jwk.getKeyID()); - } - } - } catch (JOSEException | CertificateException | IOException e) { - logger.error("Error in loading additional public certificates for JWKS: " + e); - } - backendJWKSDto.setJwks(jwks); - config.setBackendJWKSDto(backendJWKSDto); - } - - private Keypair getSigningKey(List keypairs) { - - for (Keypair keypair : keypairs) { - if (keypair.getUseForSigning()) { - return keypair; - } - } - return null; - } - - private Algorithm getJWKSAlgorithm(String alg) { - - switch (alg) { - case JwtConstants.RS384: - return JWSAlgorithm.RS384; - case JwtConstants.RS512: - return JWSAlgorithm.RS512; - default: - return JWSAlgorithm.RS256; - } - } - - private void populateCacheConfigs(Cache cache) { - - CacheDto cacheDto = new CacheDto(); - cacheDto.setEnabled(cache.getEnable()); - cacheDto.setMaximumSize(cache.getMaximumSize()); - cacheDto.setExpiryTime(cache.getExpiryTime()); - config.setCacheDto(cacheDto); - } - - private void populateAnalyticsConfig(Analytics analyticsConfig) { - - AnalyticsReceiverConfigDTO serverConfig = new AnalyticsReceiverConfigDTO(); - serverConfig.setKeepAliveTime(analyticsConfig.getService().getKeepAliveTime()); - serverConfig.setMaxHeaderLimit(analyticsConfig.getService().getMaxHeaderLimit()); - serverConfig.setMaxMessageSize(analyticsConfig.getService().getMaxMessageSize()); - serverConfig.setPort(analyticsConfig.getService().getPort()); - - ThreadPoolConfig threadPoolConfig = new ThreadPoolConfig(); - threadPoolConfig.setCoreSize(analyticsConfig.getService().getThreadPool().getCoreSize()); - threadPoolConfig.setMaxSize(analyticsConfig.getService().getThreadPool().getMaxSize()); - threadPoolConfig.setKeepAliveTime(analyticsConfig.getService().getThreadPool().getKeepAliveTime()); - threadPoolConfig.setQueueSize(analyticsConfig.getService().getThreadPool().getQueueSize()); - serverConfig.setThreadPoolConfig(threadPoolConfig); - - AnalyticsDTO analyticsDTO = new AnalyticsDTO(); - analyticsDTO.setServerConfig(serverConfig); - analyticsDTO.setEnabled(analyticsConfig.getEnabled()); - Map propertiesMap = analyticsConfig.getPropertiesMap(); - Map resolvedProperties = new HashMap<>(); - for (Map.Entry propertiesEntry : propertiesMap.entrySet()) { - resolvedProperties.put(propertiesEntry.getKey(), getEnvValue(propertiesEntry.getValue())); - } - analyticsDTO.setProperties(resolvedProperties); - for (AnalyticsPublisher analyticsPublisher : analyticsConfig.getAnalyticsPublisherList()) { - Map resolvedConfigMap = new HashMap<>(); - Map configPropertiesMap = analyticsPublisher.getConfigPropertiesMap(); - for (Map.Entry config : configPropertiesMap.entrySet()) { - resolvedConfigMap.put(config.getKey(), getEnvValue(config.getValue()).toString()); - } - String authURL = envVarConfig.getChoreoAnalyticsAuthUrl(); - String authToken = envVarConfig.getChoreoAnalyticsAuthToken(); - String moesifToken = envVarConfig.getMoesifToken(); - - // if the analytics publisher is of default type, retrieve authURL and authToken - if (analyticsPublisher.getType().equalsIgnoreCase(Constants.DEFAULT_ANALYTICS_PUBLISHER)){ - resolvedConfigMap.put(Constants.AUTH_URL_CONFIG_KEY, authURL); - resolvedConfigMap.put(Constants.AUTH_URL_CONFIG_TOKEN, authToken); - } else if (analyticsPublisher.getType().equalsIgnoreCase(Constants.MOESIF_ANALYTICS_PUBLISHER)){ - resolvedConfigMap.put(Constants.MOESIF_TOKEN, moesifToken); - } - analyticsDTO.addAnalyticsPublisherConfig(new AnalyticsPublisherConfigDTO(analyticsPublisher.getEnabled(), - analyticsPublisher.getType(), resolvedConfigMap)); - } - config.setAnalyticsConfig(analyticsDTO); - - } - - /** - * This method recursively looks for the string type config values in the {@link EnforcerConfig} object , - * which have the prefix `$env{` and reads the respective value from the environment variable and set it to - * the config object. - * - * @param config - Enforcer config object. - */ - private void resolveConfigsWithEnvs(Object config) { - //extended config class env variables should also be resolved - if (config.getClass().getSuperclass() != null && ( - config.getClass().getSuperclass().getPackageName().contains(dtoPackageName))) { - processRecursiveObject(config, config.getClass().getSuperclass().getDeclaredFields()); - } - processRecursiveObject(config, config.getClass().getDeclaredFields()); - } - - private void processRecursiveObject(Object config, Field[] classFields) { - - for (Field field : classFields) { - try { - field.setAccessible(true); - // handles the string and char array objects - if (field.getType().isAssignableFrom(String.class) || field.getType().isAssignableFrom(char[].class)) { - field.set(config, getEnvValue(field.get(config))); - } else if (field.getName().contains(Constants.OBJECT_THIS_NOTATION)) { - // skip the java internal objects created, inside the recursion to avoid stack overflow. - continue; - } else if (Map.class.isAssignableFrom(field.getType())) { - // handles the config objects saved as Maps - Map objectMap = (Map) field.get(config); - for (Map.Entry entry : objectMap.entrySet()) { - if (entry.getValue().getClass().isAssignableFrom(String.class) || entry.getValue().getClass() - .isAssignableFrom(char[].class)) { - field.set(config, getEnvValue(field.get(config))); - continue; - } else if (entry.getValue().getClass().getPackageName().contains(dtoPackageName)) { - resolveConfigsWithEnvs(entry.getValue()); - } - } - } else if (field.getType().isArray() && field.getType().getPackageName().contains(dtoPackageName)) { - // handles the config objects saved as arrays - Object[] objectArray = (Object[]) field.get(config); - for (Object arrayObject : objectArray) { - if (arrayObject.getClass().getPackageName().contains(dtoPackageName)) { - resolveConfigsWithEnvs(arrayObject); - } else if (arrayObject.getClass().isAssignableFrom(String.class) || arrayObject.getClass() - .isAssignableFrom(char[].class)) { - field.set(config, getEnvValue(arrayObject)); - } - } - } else if (field.getType().getPackageName().contains(dtoPackageName)) { //recursively call the dto - // objects in the same package - resolveConfigsWithEnvs(field.get(config)); - } - } catch (IllegalAccessException e) { - //log and continue - logger.error("Error while reading the config value : " + field.getName(), e); - } - } - } - - private Object getEnvValue(Object configValue) { - - if (configValue instanceof String) { - String value = (String) configValue; - return replaceEnvRegex(value); - } else if (configValue instanceof char[]) { - String value = String.valueOf((char[]) configValue); - return replaceEnvRegex(value).toCharArray(); - } - return configValue; - } - - private String replaceEnvRegex(String value) { - - Matcher m = Pattern.compile("\\$env\\{(.*?)\\}").matcher(value); - if (value.contains(Constants.ENV_PREFIX)) { - while (m.find()) { - String envName = value.substring(m.start() + 5, m.end() - 1); - if (System.getenv(envName) != null) { - value = value.replace(value.substring(m.start(), m.end()), System.getenv(envName)); - } - } - } - return value; - } - - private void populateCustomFilters(List filterList) { - - FilterDTO[] filterArray = new FilterDTO[filterList.size()]; - int index = 0; - for (Filter filter : filterList) { - FilterDTO filterDTO = new FilterDTO(); - filterDTO.setClassName(filter.getClassName()); - filterDTO.setPosition(filter.getPosition()); - filterDTO.setConfigProperties(filter.getConfigPropertiesMap()); - filterArray[index] = filterDTO; - index++; - } - config.setCustomFilters(filterArray); - } - - public EnforcerConfig getConfig() { - - return config; - } - - public void setConfig(EnforcerConfig config) { - - this.config = config; - } - - public KeyStore getTrustStore() { - - return trustStore; - } - - public KeyStore getTrustStoreForJWT() { - - return trustStoreForJWT; - } - - public KeyStore getOpaKeyStore() { - - return opaKeyStore; - } - - public TrustManagerFactory getTrustManagerFactory() { - - return trustManagerFactory; - } - - public EnvVarConfig getEnvVarConfig() { - - return envVarConfig; - } - -} 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 deleted file mode 100644 index 789634146f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnforcerConfig.java +++ /dev/null @@ -1,247 +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; - -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -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.AnalyticsDTO; -import org.wso2.apk.enforcer.config.dto.AuthServiceConfigurationDto; -import org.wso2.apk.enforcer.config.dto.CacheDto; -import org.wso2.apk.enforcer.config.dto.ClientConfigDto; -import org.wso2.apk.enforcer.config.dto.FilterDTO; -import org.wso2.apk.enforcer.config.dto.ManagementCredentialsDto; -import org.wso2.apk.enforcer.config.dto.MetricsDTO; -import org.wso2.apk.enforcer.config.dto.MutualSSLDto; -import org.wso2.apk.enforcer.config.dto.SoapErrorResponseConfigDto; -import org.wso2.apk.enforcer.config.dto.TracingDTO; -import org.wso2.apk.enforcer.jwks.BackendJWKSDto; - -import java.util.HashMap; -import java.util.Map; - -/** - * Configuration holder class for Microgateway. - */ -public class EnforcerConfig { - - private AuthServiceConfigurationDto authService; - private TracingDTO tracingConfig; - private MetricsDTO metricsConfig; - private JWTConfigurationDto jwtConfigurationDto; - private BackendJWKSDto backendJWKSDto; - - private APIKeyIssuerDto apiKeyIssuerDto; - private APIKeyIssuerDto runtimeTokenIssuerDto; - private CacheDto cacheDto; - private String publicCertificatePath = ""; - private String privateKeyPath = ""; - private AnalyticsDTO analyticsConfig; - private final Map jwtTransformerMap = new HashMap<>(); - private MutualSSLDto mtlsInfo; - private ManagementCredentialsDto management; - private FilterDTO[] customFilters; - - private SoapErrorResponseConfigDto soapErrorResponseConfigDto; - private boolean mandateSubscriptionValidation; - private boolean mandateInternalKeyValidation; - private ClientConfigDto httpClientConfigDto; - private boolean enableGatewayClassController; - - public void setEnableGatewayClassController(Boolean enableGatewayClassController) { - - this.enableGatewayClassController = enableGatewayClassController; - } - - public Boolean getEnableGatewayClassController() { - - return enableGatewayClassController; - } - public ClientConfigDto getHttpClientConfigDto() { - - return httpClientConfigDto; - } - - public void setHttpClientConfigDto(ClientConfigDto httpClientConfigDto) { - - this.httpClientConfigDto = httpClientConfigDto; - } - - public AuthServiceConfigurationDto getAuthService() { - return authService; - } - - public void setAuthService(AuthServiceConfigurationDto authService) { - this.authService = authService; - } - - - - public void setTracingConfig(TracingDTO tracingConfig) { - this.tracingConfig = tracingConfig; - } - - public TracingDTO getTracingConfig() { - return tracingConfig; - } - - public MetricsDTO getMetricsConfig() { - return metricsConfig; - } - - public void setMetricsConfig(MetricsDTO metricsConfig) { - this.metricsConfig = metricsConfig; - } - - public void setJwtConfigurationDto(JWTConfigurationDto jwtConfigurationDto) { - this.jwtConfigurationDto = jwtConfigurationDto; - } - - public JWTConfigurationDto getJwtConfigurationDto() { - return jwtConfigurationDto; - } - - public CacheDto getCacheDto() { - return cacheDto; - } - - public void setCacheDto(CacheDto cacheDto) { - this.cacheDto = cacheDto; - } - - public void setPublicCertificatePath(String certPath) { - this.publicCertificatePath = certPath; - } - - public String getPublicCertificatePath() { - return publicCertificatePath; - } - - public void setPrivateKeyPath(String keyPath) { - this.privateKeyPath = keyPath; - } - - public String getPrivateKeyPath() { - return privateKeyPath; - } - - public AnalyticsDTO getAnalyticsConfig() { - return analyticsConfig; - } - - public void setAnalyticsConfig(AnalyticsDTO analyticsConfig) { - this.analyticsConfig = analyticsConfig; - } - - public JWTTransformer getJwtTransformer(String issuer) { - if (jwtTransformerMap.containsKey(issuer)) { - return jwtTransformerMap.get(issuer); - } - synchronized (jwtTransformerMap) { - // check the map again, if two threads blocks and one add the default one - // so the next thread also check if the default added by previous one - if (jwtTransformerMap.containsKey(issuer)) { - return jwtTransformerMap.get(issuer); - } - JWTTransformer defaultJWTTransformer = new DefaultJWTTransformer(); - jwtTransformerMap.put(issuer, defaultJWTTransformer); - return defaultJWTTransformer; - } - } - - public void setJwtTransformers(Map jwtTransformerMap) { - this.jwtTransformerMap.putAll(jwtTransformerMap); - } - public MutualSSLDto getMtlsInfo() { - return mtlsInfo; - } - - public void setMtlsInfo(MutualSSLDto mtlsInfo) { - this.mtlsInfo = mtlsInfo; - } - - public ManagementCredentialsDto getManagement() { - return management; - } - - public void setManagement(ManagementCredentialsDto management) { - this.management = management; - } - - public SoapErrorResponseConfigDto getSoapErrorResponseConfigDto() { - return soapErrorResponseConfigDto; - } - - public void setSoapErrorResponseConfigDto(SoapErrorResponseConfigDto soapErrorResponseConfigDto) { - this.soapErrorResponseConfigDto = soapErrorResponseConfigDto; - } - - public FilterDTO[] getCustomFilters() { - return customFilters; - } - - public void setCustomFilters(FilterDTO[] customFilters) { - this.customFilters = customFilters; - } - - public APIKeyIssuerDto getApiKeyIssuerDto() { - - return apiKeyIssuerDto; - } - - public void setApiKeyIssuerDto(APIKeyIssuerDto apiKeyIssuerDto) { - - this.apiKeyIssuerDto = apiKeyIssuerDto; - } - - public APIKeyIssuerDto getRuntimeTokenIssuerDto() { - - return runtimeTokenIssuerDto; - } - - public void setRuntimeTokenIssuerDto(APIKeyIssuerDto runtimeTokenIssuerDto) { - - this.runtimeTokenIssuerDto = runtimeTokenIssuerDto; - } - public BackendJWKSDto getBackendJWKSDto() { - return backendJWKSDto; - } - - public void setBackendJWKSDto(BackendJWKSDto backendJWKSDto) { - this.backendJWKSDto = backendJWKSDto; - } - - public boolean getMandateSubscriptionValidation() { - return mandateSubscriptionValidation; - } - - public void setMandateSubscriptionValidation(boolean mandateSubscriptionValidation) { - this.mandateSubscriptionValidation = mandateSubscriptionValidation; - } - - public boolean getMandateInternalKeyValidation() { - return mandateInternalKeyValidation; - } - - public void setMandateInternalKeyValidation(boolean mandateInternalKeyValidation) { - this.mandateInternalKeyValidation = mandateInternalKeyValidation; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnvVarConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnvVarConfig.java deleted file mode 100644 index 1a0d3c40dc..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnvVarConfig.java +++ /dev/null @@ -1,370 +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; - -import org.apache.commons.lang3.StringUtils; -import org.wso2.apk.enforcer.constants.Constants; - -/** - * Holds and returns the configuration values retrieved from the environment variables. - */ -public class EnvVarConfig { - private static final String TRUSTED_CA_CERTS_PATH = "TRUSTED_CA_CERTS_PATH"; - private static final String TRUST_DEFAULT_CERTS = "TRUST_DEFAULT_CERTS"; - private static final String ADAPTER_HOST_NAME = "ADAPTER_HOST_NAME"; - private static final String COMMON_CONTROLLER_HOST_NAME = "COMMON_CONTROLLER_HOST_NAME"; - private static final String ENFORCER_PRIVATE_KEY_PATH = "ENFORCER_PRIVATE_KEY_PATH"; - private static final String ENFORCER_PUBLIC_CERT_PATH = "ENFORCER_PUBLIC_CERT_PATH"; - private static final String OPA_CLIENT_PRIVATE_KEY_PATH = "OPA_CLIENT_PRIVATE_KEY_PATH"; - private static final String OPA_CLIENT_PUBLIC_CERT_PATH = "OPA_CLIENT_PUBLIC_CERT_PATH"; - private static final String ADAPTER_HOST = "ADAPTER_HOST"; - private static final String RATELIMITER_HOST = "RATELIMITER_HOST"; - private static final String RATELIMITER_PORT = "RATELIMITER_PORT"; - private static final String ADAPTER_XDS_PORT = "ADAPTER_XDS_PORT"; - private static final String COMMON_CONTROLLER_HOST = "COMMON_CONTROLLER_HOST"; - private static final String COMMON_CONTROLLER_XDS_PORT = "COMMON_CONTROLLER_XDS_PORT"; - private static final String COMMON_CONTROLLER_REST_PORT = "COMMON_CONTROLLER_REST_PORT"; - - private static final String ENFORCER_LABEL = "ENFORCER_LABEL"; - private static final String ENFORCER_REGION_ID = "ENFORCER_REGION"; - public static final String XDS_MAX_MSG_SIZE = "XDS_MAX_MSG_SIZE"; - public static final String XDS_MAX_RETRIES = "XDS_MAX_RETRIES"; - public static final String XDS_RETRY_PERIOD = "XDS_RETRY_PERIOD"; - public static final String HOSTNAME = "HOSTNAME"; - public static final String REDIS_USERNAME = "REDIS_USERNAME"; - public static final String REDIS_PASSWORD = "REDIS_PASSWORD"; - public static final String REDIS_HOST = "REDIS_HOST"; - public static final String REDIS_PORT = "REDIS_PORT"; - public static final String IS_REDIS_TLS_ENABLED = "IS_REDIS_TLS_ENABLED"; - public static final String REDIS_REVOKED_TOKENS_CHANNEL = "REDIS_REVOKED_TOKENS_CHANNEL"; - public static final String REDIS_KEY_FILE = "REDIS_KEY_FILE"; - public static final String REDIS_CERT_FILE = "REDIS_CERT_FILE"; - public static final String REDIS_CA_CERT_FILE = "REDIS_CA_CERT_FILE"; - public static final String REVOKED_TOKEN_CLEANUP_INTERVAL = "REVOKED_TOKEN_CLEANUP_INTERVAL"; - public static final String CHOREO_ANALYTICS_AUTH_TOKEN = "CHOREO_ANALYTICS_AUTH_TOKEN"; - public static final String CHOREO_ANALYTICS_AUTH_URL = "CHOREO_ANALYTICS_AUTH_URL"; - public static final String MOESIF_TOKEN = "MOESIF_TOKEN"; - - // Since the container is running in linux container, path separator is not needed. - private static final String DEFAULT_TRUSTED_CA_CERTS_PATH = "/home/wso2/security/truststore"; - private static final String DEFAULT_TRUST_DEFAULT_CERTS = "true"; - private static final String DEFAULT_ADAPTER_HOST_NAME = "adapter"; - private static final String DEFAULT_COMMON_CONTROLLER_HOST_NAME = "common-controller"; - private static final String DEFAULT_ENFORCER_PRIVATE_KEY_PATH = "/home/wso2/security/keystore/mg.key"; - private static final String DEFAULT_ENFORCER_PUBLIC_CERT_PATH = "/home/wso2/security/keystore/mg.pem"; - private static final String DEFAULT_ENFORCER_REGION_ID = "UNKNOWN"; - private static final String DEFAULT_ADAPTER_HOST = "adapter"; - private static final String DEFAULT_RATELIMITER_HOST = "apk-test-wso2-apk-ratelimiter-service.apk.svc"; - private static final String DEFAULT_RATELIMITER_PORT = "8091"; - private static final String DEFAULT_ADAPTER_XDS_PORT = "18000"; - private static final String DEFAULT_COMMON_CONTROLLER_HOST = "common-controller"; - private static final String DEFAULT_COMMON_CONTROLLER_XDS_PORT = "18002"; - private static final String DEFAULT_COMMON_CONTROLLER_REST_PORT = "18003"; - private static final String DEFAULT_ENFORCER_LABEL = "enforcer"; - public static final String DEFAULT_XDS_MAX_MSG_SIZE = "4194304"; - public static final String DEFAULT_XDS_MAX_RETRIES = Integer.toString(Constants.MAX_XDS_RETRIES); - public static final String DEFAULT_XDS_RETRY_PERIOD = Integer.toString(Constants.XDS_DEFAULT_RETRY); - public static final String DEFAULT_HOSTNAME = "Unassigned"; - public static final String DEFAULT_REDIS_USERNAME = ""; - public static final String DEFAULT_REDIS_PASSWORD = ""; - public static final String DEFAULT_REDIS_HOST = "redis-master"; - public static final int DEFAULT_REDIS_PORT = 6379; - public static final String DEFAULT_IS_REDIS_TLS_ENABLED = "false"; - public static final String DEFAULT_REDIS_REVOKED_TOKENS_CHANNEL = "wso2-apk-revoked-tokens-channel"; - public static final String DEFAULT_REDIS_KEY_FILE = "/home/wso2/security/redis/redis.key"; - public static final String DEFAULT_REDIS_CERT_FILE = "/home/wso2/security/redis/redis.crt"; - public static final String DEFAULT_REDIS_CA_CERT_FILE = "/home/wso2/security/redis/ca.crt"; - public static final int DEFAULT_REVOKED_TOKEN_CLEANUP_INTERVAL = 60*60; // In seconds - - public static final String DEFAULT_CHOREO_ANALYTICS_AUTH_TOKEN = ""; - public static final String DEFAULT_CHOREO_ANALYTICS_AUTH_URL = ""; - public static final String DEFAULT_MOESIF_TOKEN = ""; - - private static EnvVarConfig instance; - private final String trustedAdapterCertsPath; - private final String trustDefaultCerts; - private final String enforcerPrivateKeyPath; - private final String enforcerPublicKeyPath; - private final String opaClientPrivateKeyPath; - private final String opaClientPublicKeyPath; - private final String adapterHost; - private final String ratelimiterHost; - private final String ratelimiterPort; - private final String commonControllerHost; - private final String enforcerLabel; - private final String adapterXdsPort; - private final String commonControllerXdsPort; - private final String commonControllerRestPort; - private final String adapterHostname; - private final String commonControllerHostname; - // TODO: (VirajSalaka) Enforcer ID should be picked from router once envoy 1.18.0 is released and microgateway - // is updated. - private final String enforcerRegionId; - private final String xdsMaxMsgSize; - private final String xdsMaxRetries; - private final String xdsRetryPeriod; - private final String instanceIdentifier; - private final String redisUsername; - private final String redisPassword; - private final String redisHost; - private final int redisPort; - private final boolean isRedisTlsEnabled; - private final String revokedTokensRedisChannel; - private final String redisKeyFile; - private final String redisCertFile; - private final String redisCaCertFile; - - private final String choreoAnalyticsAuthToken; - private final String choreoAnalyticsAuthUrl; - private final String moesifToken; - private final int revokedTokenCleanupInterval; - - private EnvVarConfig() { - trustedAdapterCertsPath = retrieveEnvVarOrDefault(TRUSTED_CA_CERTS_PATH, - DEFAULT_TRUSTED_CA_CERTS_PATH); - trustDefaultCerts = retrieveEnvVarOrDefault(TRUST_DEFAULT_CERTS, - DEFAULT_TRUST_DEFAULT_CERTS); - enforcerPrivateKeyPath = retrieveEnvVarOrDefault(ENFORCER_PRIVATE_KEY_PATH, - DEFAULT_ENFORCER_PRIVATE_KEY_PATH); - enforcerPublicKeyPath = retrieveEnvVarOrDefault(ENFORCER_PUBLIC_CERT_PATH, - DEFAULT_ENFORCER_PUBLIC_CERT_PATH); - opaClientPrivateKeyPath = retrieveEnvVarOrDefault(OPA_CLIENT_PRIVATE_KEY_PATH, - DEFAULT_ENFORCER_PRIVATE_KEY_PATH); - opaClientPublicKeyPath = retrieveEnvVarOrDefault(OPA_CLIENT_PUBLIC_CERT_PATH, - DEFAULT_ENFORCER_PUBLIC_CERT_PATH); - enforcerLabel = retrieveEnvVarOrDefault(ENFORCER_LABEL, DEFAULT_ENFORCER_LABEL); - adapterHost = retrieveEnvVarOrDefault(ADAPTER_HOST, DEFAULT_ADAPTER_HOST); - ratelimiterHost = retrieveEnvVarOrDefault(RATELIMITER_HOST, DEFAULT_RATELIMITER_HOST); - ratelimiterPort = retrieveEnvVarOrDefault(RATELIMITER_PORT, DEFAULT_RATELIMITER_PORT); - adapterHostname = retrieveEnvVarOrDefault(ADAPTER_HOST_NAME, DEFAULT_ADAPTER_HOST_NAME); - adapterXdsPort = retrieveEnvVarOrDefault(ADAPTER_XDS_PORT, DEFAULT_ADAPTER_XDS_PORT); - commonControllerHost = retrieveEnvVarOrDefault(COMMON_CONTROLLER_HOST, DEFAULT_COMMON_CONTROLLER_HOST); - commonControllerHostname = retrieveEnvVarOrDefault(COMMON_CONTROLLER_HOST_NAME, - DEFAULT_COMMON_CONTROLLER_HOST_NAME); - commonControllerXdsPort = retrieveEnvVarOrDefault(COMMON_CONTROLLER_XDS_PORT, - DEFAULT_COMMON_CONTROLLER_XDS_PORT); - commonControllerRestPort = retrieveEnvVarOrDefault(COMMON_CONTROLLER_REST_PORT, - DEFAULT_COMMON_CONTROLLER_REST_PORT); - xdsMaxMsgSize = retrieveEnvVarOrDefault(XDS_MAX_MSG_SIZE, DEFAULT_XDS_MAX_MSG_SIZE); - enforcerRegionId = retrieveEnvVarOrDefault(ENFORCER_REGION_ID, DEFAULT_ENFORCER_REGION_ID); - xdsMaxRetries = retrieveEnvVarOrDefault(XDS_MAX_RETRIES, DEFAULT_XDS_MAX_RETRIES); - xdsRetryPeriod = retrieveEnvVarOrDefault(XDS_RETRY_PERIOD, DEFAULT_XDS_RETRY_PERIOD); - // HOSTNAME environment property is readily available in docker and kubernetes, and it represents the Pod - // name in Kubernetes context, containerID in docker context. - instanceIdentifier = retrieveEnvVarOrDefault(HOSTNAME, DEFAULT_HOSTNAME); - redisUsername = retrieveEnvVarOrDefault(REDIS_USERNAME, DEFAULT_REDIS_USERNAME); - redisPassword = retrieveEnvVarOrDefault(REDIS_PASSWORD, DEFAULT_REDIS_PASSWORD); - redisHost = retrieveEnvVarOrDefault(REDIS_HOST, DEFAULT_REDIS_HOST); - redisPort = getRedisPortFromEnv(); - isRedisTlsEnabled = retrieveEnvVarOrDefault(IS_REDIS_TLS_ENABLED, DEFAULT_IS_REDIS_TLS_ENABLED).toLowerCase() - .equals(DEFAULT_IS_REDIS_TLS_ENABLED)? false:true; - revokedTokensRedisChannel = retrieveEnvVarOrDefault(REDIS_REVOKED_TOKENS_CHANNEL, DEFAULT_REDIS_REVOKED_TOKENS_CHANNEL); - redisKeyFile = retrieveEnvVarOrDefault(REDIS_KEY_FILE, DEFAULT_REDIS_KEY_FILE); - redisCertFile = retrieveEnvVarOrDefault(REDIS_CERT_FILE, DEFAULT_REDIS_CERT_FILE); - redisCaCertFile = retrieveEnvVarOrDefault(REDIS_CA_CERT_FILE, DEFAULT_REDIS_CA_CERT_FILE); - revokedTokenCleanupInterval = getRevokedTokenCleanupIntervalFromEnv(); - choreoAnalyticsAuthToken = retrieveEnvVarOrDefault(CHOREO_ANALYTICS_AUTH_TOKEN, DEFAULT_CHOREO_ANALYTICS_AUTH_TOKEN); - choreoAnalyticsAuthUrl = retrieveEnvVarOrDefault(CHOREO_ANALYTICS_AUTH_URL, DEFAULT_CHOREO_ANALYTICS_AUTH_URL); - moesifToken = retrieveEnvVarOrDefault(MOESIF_TOKEN, DEFAULT_MOESIF_TOKEN); - } - - public static EnvVarConfig getInstance() { - if (instance == null) { - synchronized (EnvVarConfig.class) { - if (instance == null) { - instance = new EnvVarConfig(); - } - } - } - return instance; - } - - private int getRedisPortFromEnv() { - String portStr = retrieveEnvVarOrDefault(REDIS_PORT, String.valueOf(DEFAULT_REDIS_PORT)); - try { - return Integer.parseInt(portStr); - } catch (Exception e) { - return DEFAULT_REDIS_PORT; - } - } - - private int getRevokedTokenCleanupIntervalFromEnv() { - String intervalStr = retrieveEnvVarOrDefault(REVOKED_TOKEN_CLEANUP_INTERVAL, String.valueOf(DEFAULT_REVOKED_TOKEN_CLEANUP_INTERVAL)); - try { - return Integer.parseInt(intervalStr); - } catch (Exception e) { - return DEFAULT_REVOKED_TOKEN_CLEANUP_INTERVAL; - } - } - - private String retrieveEnvVarOrDefault(String variable, String defaultValue) { - if (StringUtils.isEmpty(System.getenv(variable))) { - return defaultValue; - } - return System.getenv(variable); - } - - public String getTrustedAdapterCertsPath() { - return trustedAdapterCertsPath; - } - - public boolean isTrustDefaultCerts() { - return Boolean.valueOf(trustDefaultCerts); - } - - public String getEnforcerPrivateKeyPath() { - return enforcerPrivateKeyPath; - } - - public String getEnforcerPublicKeyPath() { - return enforcerPublicKeyPath; - } - - public String getOpaClientPrivateKeyPath() { - return opaClientPrivateKeyPath; - } - - public String getOpaClientPublicKeyPath() { - return opaClientPublicKeyPath; - } - - public String getAdapterHost() { - return adapterHost; - } - - public String getRatelimiterHost() { - return ratelimiterHost; - } - - public int getRatelimiterPort() { - try { - int port = Integer.parseInt(ratelimiterPort); - return port; - } catch (NumberFormatException e) { - return Integer.parseInt(DEFAULT_RATELIMITER_PORT); - } - } - - public String getCommonControllerHost() { - return commonControllerHost; - } - - public String getEnforcerLabel() { - return enforcerLabel; - } - - public String getAdapterXdsPort() { - return adapterXdsPort; - } - - public String getCommonControllerXdsPort() { - return commonControllerXdsPort; - } - - public String getAdapterHostname() { - return adapterHostname; - } - - public String getCommonControllerHostname() { - return commonControllerHostname; - } - - public String getXdsMaxMsgSize() { - return xdsMaxMsgSize; - } - - - public String getEnforcerRegionId() { - return enforcerRegionId; - } - - public String getXdsMaxRetries() { - return xdsMaxRetries; - } - - public String getXdsRetryPeriod() { - return xdsRetryPeriod; - } - - public String getInstanceIdentifier() { - return instanceIdentifier; - } - - public String getRedisUsername() { - - return redisUsername; - } - - public String getRedisPassword() { - - return redisPassword; - } - - public String getRedisHost() { - - return redisHost; - } - - public boolean isRedisTlsEnabled() { - - return isRedisTlsEnabled; - } - - public int getRedisPort() { - return redisPort; - } - - public String getRedisKeyFile() { - return redisKeyFile; - } - - public String getRedisCertFile() { - return redisCertFile; - } - - public String getRedisCaCertFile() { - return redisCaCertFile; - } - - public String getRevokedTokensRedisChannel() { - return revokedTokensRedisChannel; - } - - public int getRevokedTokenCleanupInterval() { - return revokedTokenCleanupInterval; - } - - public String getCommonControllerRestPort() { - - return commonControllerRestPort; - } - - public String getChoreoAnalyticsAuthToken() { - return choreoAnalyticsAuthToken; - } - - public String getChoreoAnalyticsAuthUrl() { - return choreoAnalyticsAuthUrl; - } - - public String getMoesifToken() { - return moesifToken; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/APIKeyIssuerDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/APIKeyIssuerDto.java deleted file mode 100644 index 281d4b9c98..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/APIKeyIssuerDto.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package org.wso2.apk.enforcer.config.dto; - -import java.security.cert.Certificate; -/** - * DTO class for API Key Issuer - */ -public class APIKeyIssuerDto { - private boolean enabled; - private Certificate publicCertificate; - - public boolean isEnabled() { - - return enabled; - } - - public void setEnabled(boolean enabled) { - - this.enabled = enabled; - } - - public Certificate getPublicCertificate() { - - return publicCertificate; - } - - public void setPublicCertificate(Certificate publicCertificate) { - - this.publicCertificate = publicCertificate; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsDTO.java deleted file mode 100644 index 6e9e7e11b8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsDTO.java +++ /dev/null @@ -1,76 +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; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Holds the analytics data publishing related Configuration. - */ -public class AnalyticsDTO { - - private boolean enabled = false; - - private Map properties = new HashMap<>(); - private List analyticsPublisherConfigDTOList = new ArrayList<>(); - private AnalyticsReceiverConfigDTO serverConfig; - - public AnalyticsReceiverConfigDTO getServerConfig() { - - return serverConfig; - } - - public void setServerConfig(AnalyticsReceiverConfigDTO serverConfig) { - - this.serverConfig = serverConfig; - } - - public List getAnalyticsPublisherConfigDTOList() { - - return analyticsPublisherConfigDTOList; - } - - public void addAnalyticsPublisherConfig(AnalyticsPublisherConfigDTO analyticsPublisherConfigDTO) { - - this.analyticsPublisherConfigDTOList.add(analyticsPublisherConfigDTO); - } - - public boolean isEnabled() { - - return enabled; - } - - public void setEnabled(boolean enabled) { - - this.enabled = enabled; - } - - public Map getProperties() { - - return properties; - } - - public void setProperties(Map properties) { - - this.properties = properties; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsPublisherConfigDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsPublisherConfigDTO.java deleted file mode 100644 index 50cecae13d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsPublisherConfigDTO.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.wso2.apk.enforcer.config.dto; - -import java.util.Map; - -public class AnalyticsPublisherConfigDTO { - - private boolean isEnabled; - private String type; - private Map configProperties; - - public boolean isEnabled() { - - return isEnabled; - } - - public void setEnabled(boolean enabled) { - - isEnabled = enabled; - } - - public String getType() { - - return type; - } - - public void setType(String type) { - - this.type = type; - } - - public Map getConfigProperties() { - - return configProperties; - } - - public void setConfigProperties(Map configProperties) { - - this.configProperties = configProperties; - } - - public AnalyticsPublisherConfigDTO(boolean isEnabled, String type, Map configProperties) { - - this.isEnabled = isEnabled; - this.type = type; - this.configProperties = configProperties; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsReceiverConfigDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsReceiverConfigDTO.java deleted file mode 100644 index 69bedbeaa3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AnalyticsReceiverConfigDTO.java +++ /dev/null @@ -1,70 +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; - -/** - * Holds the grpc analytics server related configurations. - */ -public class AnalyticsReceiverConfigDTO { - private int port; - private int maxMessageSize; - private int maxHeaderLimit; - private int keepAliveTime; - private ThreadPoolConfig threadPoolConfig; - - public int getMaxMessageSize() { - return maxMessageSize; - } - - public void setMaxMessageSize(int maxMessageSize) { - this.maxMessageSize = maxMessageSize; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public int getMaxHeaderLimit() { - return maxHeaderLimit; - } - - public void setMaxHeaderLimit(int maxHeaderLimit) { - this.maxHeaderLimit = maxHeaderLimit; - } - - public int getKeepAliveTime() { - return keepAliveTime; - } - - public void setKeepAliveTime(int keepAliveTime) { - this.keepAliveTime = keepAliveTime; - } - - public ThreadPoolConfig getThreadPoolConfig() { - return threadPoolConfig; - } - - public void setThreadPoolConfig(ThreadPoolConfig threadPoolConfig) { - this.threadPoolConfig = threadPoolConfig; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AuthServiceConfigurationDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AuthServiceConfigurationDto.java deleted file mode 100644 index 7d9ab51f6e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AuthServiceConfigurationDto.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2020, 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; - -/** - * Holds the configurations related to gRPC netty server that implements the enforcer functionality. - */ -public class AuthServiceConfigurationDto { - - private int port; - private int maxMessageSize; - private int maxHeaderLimit; - private int keepAliveTime; - private ThreadPoolConfig threadPool; - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public int getMaxMessageSize() { - return maxMessageSize; - } - - public void setMaxMessageSize(int maxMessageSize) { - this.maxMessageSize = maxMessageSize; - } - - public int getMaxHeaderLimit() { - return maxHeaderLimit; - } - - public void setMaxHeaderLimit(int maxHeaderLimit) { - this.maxHeaderLimit = maxHeaderLimit; - } - - public int getKeepAliveTime() { - return keepAliveTime; - } - - public void setKeepAliveTime(int keepAliveTime) { - this.keepAliveTime = keepAliveTime; - } - - public ThreadPoolConfig getThreadPool() { - return threadPool; - } - - public void setThreadPool(ThreadPoolConfig threadPool) { - this.threadPool = threadPool; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/CacheDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/CacheDto.java deleted file mode 100644 index c3ac0c2022..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/CacheDto.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.config.dto; - -/** - * Holds the configurations related to caching used for token validation. - */ -public class CacheDto { - private boolean enabled; - private int maximumSize; - private int expiryTime; - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public int getMaximumSize() { - return maximumSize; - } - - public void setMaximumSize(int maximumSize) { - this.maximumSize = maximumSize; - } - - public int getExpiryTime() { - return expiryTime; - } - - public void setExpiryTime(int expiryTime) { - this.expiryTime = expiryTime; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ClientConfigDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ClientConfigDto.java deleted file mode 100644 index b8cca630ac..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ClientConfigDto.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2024, 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; - -/** - * This contains HttpClient properties. - */ -public class ClientConfigDto { - - private boolean enableSslVerification; - private String hostnameVerifier; - private int connectionTimeout; - private int socketTimeout; - private int maxConnections; - private int maxConnectionsPerRoute; - - public boolean isEnableSslVerification() { - - return enableSslVerification; - } - - public void setEnableSslVerification(boolean enableSslVerification) { - - this.enableSslVerification = enableSslVerification; - } - - public String getHostnameVerifier() { - - return hostnameVerifier; - } - - public void setHostnameVerifier(String hostnameVerifier) { - - this.hostnameVerifier = hostnameVerifier; - } - - public int getConnectionTimeout() { - - return connectionTimeout; - } - - public void setConnectionTimeout(int connectionTimeout) { - - this.connectionTimeout = connectionTimeout; - } - - public int getSocketTimeout() { - - return socketTimeout; - } - - public void setSocketTimeout(int socketTimeout) { - - this.socketTimeout = socketTimeout; - } - - public int getMaxConnections() { - - return maxConnections; - } - - public void setMaxConnections(int maxConnections) { - - this.maxConnections = maxConnections; - } - - public int getMaxConnectionsPerRoute() { - - return maxConnectionsPerRoute; - } - - public void setMaxConnectionsPerRoute(int maxConnectionsPerRoute) { - - this.maxConnectionsPerRoute = maxConnectionsPerRoute; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/CredentialDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/CredentialDto.java deleted file mode 100644 index b30c97392f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/CredentialDto.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2020, 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; - -/** - * Holds the configurations related to basic authentication when connecting with secured services. - */ -public class CredentialDto { - - String username; - char[] pwd; - - public CredentialDto(String username, char[] pwd) { - this.username = username; - this.pwd = pwd; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public char[] getPwd() { - return pwd; - } - - public void setPwd(char[] pwd) { - this.pwd = pwd; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ExtendedTokenIssuerDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ExtendedTokenIssuerDto.java deleted file mode 100644 index 04dc55d442..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ExtendedTokenIssuerDto.java +++ /dev/null @@ -1,63 +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; - -import org.wso2.apk.enforcer.commons.dto.ClaimMappingDto; -import org.wso2.apk.enforcer.commons.dto.TokenIssuerDto; - -import java.util.List; - -/** - * Holds meta data related to a JWT token issuer. - */ -public class ExtendedTokenIssuerDto extends TokenIssuerDto { - private String name; - private boolean validateSubscriptions; - private String alias; - - - public ExtendedTokenIssuerDto(String issuer) { - super(issuer); - } - - public boolean isValidateSubscriptions() { - return validateSubscriptions; - } - - public void setValidateSubscriptions(boolean validateSubscriptions) { - this.validateSubscriptions = validateSubscriptions; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCertificateAlias() { - return alias; - } - - public void setCertificateAlias(String alias) { - this.alias = alias; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/FilterDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/FilterDTO.java deleted file mode 100644 index b0d6d86006..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/FilterDTO.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org). - * - * 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; - -import java.util.Map; - -/** - * Holds the configurations related to custom filters. - */ -public class FilterDTO { - private String className; - private int position; - private Map configProperties; - - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public int getPosition() { - return position; - } - - public void setPosition(int position) { - this.position = position; - } - - public Map getConfigProperties() { - return configProperties; - } - - public void setConfigProperties(Map configProperties) { - this.configProperties = configProperties; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ManagementCredentialsDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ManagementCredentialsDto.java deleted file mode 100644 index 65de27403d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ManagementCredentialsDto.java +++ /dev/null @@ -1,42 +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; - -/** - * Holder for Admin User credentials - * */ -public class ManagementCredentialsDto { - private String userName; - private char[] password; - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public char[] getPassword() { - return password; - } - - public void setPassword(char[] password) { - this.password = password; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/MetricsDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/MetricsDTO.java deleted file mode 100644 index 98deb80247..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/MetricsDTO.java +++ /dev/null @@ -1,45 +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; - -/** - * Holder meta data related to publishing metrics. - */ -public class MetricsDTO { - - private boolean isMetricsEnabled; - private String metricsType; - - public boolean isMetricsEnabled() { - return isMetricsEnabled; - } - - public void setMetricsEnabled(boolean enabled) { - this.isMetricsEnabled = enabled; - } - - public String getMetricsType() { - return metricsType; - } - - public void setMetricsType(String metricsType) { - this.metricsType = metricsType; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/MutualSSLDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/MutualSSLDto.java deleted file mode 100644 index d5866c00f7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/MutualSSLDto.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.config.dto; - -/** - * This contains mutualssl header properties. - */ -public class MutualSSLDto { - private String certificateHeader = ""; - private boolean enableClientValidation; - private boolean clientCertificateEncode; - private boolean enableOutboundCertificateHeader; - - public String getCertificateHeader() { - return certificateHeader; - } - - public void setCertificateHeader(String certificateHeader) { - this.certificateHeader = certificateHeader; - } - - public boolean isEnableClientValidation() { - return enableClientValidation; - } - - public void setEnableClientValidation(boolean enableClientValidation) { - this.enableClientValidation = enableClientValidation; - } - - public boolean isClientCertificateEncode() { - return clientCertificateEncode; - } - - public void setClientCertificateEncode(boolean clientCertificateEncode) { - this.clientCertificateEncode = clientCertificateEncode; - } - - public boolean isEnableOutboundCertificateHeader() { - return enableOutboundCertificateHeader; - } - - public void setEnableOutboundCertificateHeader(boolean enableOutboundCertificateHeader) { - this.enableOutboundCertificateHeader = enableOutboundCertificateHeader; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/SoapErrorResponseConfigDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/SoapErrorResponseConfigDto.java deleted file mode 100644 index afabc3ea7a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/SoapErrorResponseConfigDto.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.config.dto; - -/** - * Configuration for enabling SOAP error responses for SOAP APIs. - */ -public class SoapErrorResponseConfigDto { - private boolean soapErrorInXMLEnabled; - - public boolean isEnable() { - return soapErrorInXMLEnabled; - } - - public void setEnable(boolean enable) { - this.soapErrorInXMLEnabled = enable; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ThreadPoolConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ThreadPoolConfig.java deleted file mode 100644 index 399c8197fa..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ThreadPoolConfig.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.config.dto; - -/** - * Holds the configurations related to threading of gRPC netty server. - */ -public class ThreadPoolConfig implements ThreadPoolConfigMBean { - private int coreSize; - private int maxSize; - private int keepAliveTime; - private int queueSize; - - public int getCoreSize() { - return coreSize; - } - - public void setCoreSize(int coreSize) { - this.coreSize = coreSize; - } - - public int getMaxSize() { - return maxSize; - } - - public void setMaxSize(int maxSize) { - this.maxSize = maxSize; - } - - public int getKeepAliveTime() { - return keepAliveTime; - } - - public void setKeepAliveTime(int keepAliveTime) { - this.keepAliveTime = keepAliveTime; - } - - public int getQueueSize() { - return queueSize; - } - - public void setQueueSize(int queueSize) { - this.queueSize = queueSize; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ThreadPoolConfigMBean.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ThreadPoolConfigMBean.java deleted file mode 100644 index 6509d2e76c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/ThreadPoolConfigMBean.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.config.dto; - -/** - * MBean API for Thread Pool Configuration. - */ -public interface ThreadPoolConfigMBean { - /** - * Getter for core size. - * - * @return int - */ - public int getCoreSize(); - - /** - * Getter for max size. - * - * @return int - */ - public int getMaxSize(); - - /** - * Getter for keep alive size. - * - * @return int - */ - public int getKeepAliveTime(); - - /** - * Getter for queue size. - * - * @return int - */ - public int getQueueSize(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/TracingDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/TracingDTO.java deleted file mode 100644 index 7880df1e89..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/TracingDTO.java +++ /dev/null @@ -1,56 +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; - -import java.util.Map; - -/** - * Holder meta data related to tracing. - */ -public class TracingDTO { - - private boolean isTracingEnabled; - private String exporterType; - private Map configProperties; - - public boolean isTracingEnabled() { - return isTracingEnabled; - } - - public void setTracingEnabled(boolean enabled) { - this.isTracingEnabled = enabled; - } - - public String getExporterType() { - return exporterType; - } - - public void setExporterType(String type) { - this.exporterType = type; - } - - public Map getConfigProperties() { - return configProperties; - } - - public void setConfigProperties(Map configProperties) { - this.configProperties = configProperties; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIConstants.java deleted file mode 100644 index 4e6da22594..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIConstants.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) 2020, 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.constants; - -import java.util.List; - -/** - * Holds the common set of constants for the enforcer package. - */ -public class APIConstants { - - public static final String DEFAULT = "default"; - public static final String GW_VHOST_PARAM = "vHost"; - public static final String ROUTE_NAME_PARAM = "route-name"; - public static final String GW_BASE_PATH_PARAM = "basePath"; - public static final String GW_RES_PATH_PARAM = "path"; - public static final String GW_VERSION_PARAM = "version"; - public static final String GW_API_NAME_PARAM = "name"; - public static final String PROTOTYPED_LIFE_CYCLE_STATUS = "PROTOTYPED"; - public static final String UNLIMITED_TIER = "Unlimited"; - public static final String UNAUTHENTICATED_TIER = "Unauthenticated"; - public static final String END_USER_ANONYMOUS = "anonymous"; - public static final String END_USER_UNKNOWN = "unknown"; - public static final String ANONYMOUS_PREFIX = "anon:"; - public static final String PUBLISHER_CERTIFICATE_ALIAS = "publisher_certificate_alias"; - public static final String APIKEY_CERTIFICATE_ALIAS = "apikey_certificate_alias"; - public static final String WSO2_PUBLIC_CERTIFICATE_ALIAS = "wso2carbon"; - public static final String HTTPS_PROTOCOL = "https"; - public static final String SUPER_TENANT_DOMAIN_NAME = "carbon.super"; - public static final String BANDWIDTH_TYPE = "bandwidthVolume"; - public static final String AUTHORIZATION_HEADER_DEFAULT = "Authorization"; - public static final String AUTHORIZATION_BEARER = "Bearer "; - public static final String API_KEY_TYPE_PRODUCTION = "PRODUCTION"; - public static final String API_KEY_TYPE_SANDBOX = "SANDBOX"; - public static final String DEFAULT_ENVIRONMENT_NAME = "Default"; - - public static final String AUTHORIZATION_HEADER_BASIC = "Basic"; - public static final String API_SECURITY_OAUTH2 = "OAuth2"; - public static final String API_SECURITY_BASIC_AUTH = "basic_auth"; - public static final String API_SECURITY_API_KEY = "\"API Key\""; - public static final String SWAGGER_API_KEY_IN_HEADER = "Header"; - public static final String SWAGGER_API_KEY_IN_QUERY = "Query"; - public static final String API_SECURITY_MUTUAL_SSL_NAME = "mtls"; - public static final String CLIENT_CERTIFICATE_HEADER_DEFAULT = "X-WSO2-CLIENT-CERTIFICATE"; - public static final String WWW_AUTHENTICATE = "WWW-Authenticate"; - public static final String TEST_CONSOLE_KEY_HEADER = "internal-key"; - - public static final String BEGIN_CERTIFICATE_STRING = "-----BEGIN CERTIFICATE-----"; - public static final String END_CERTIFICATE_STRING = "-----END CERTIFICATE-----"; - public static final String EVENT_PAYLOAD = "event"; - public static final String EVENT_PAYLOAD_DATA = "payloadData"; - - public static final String NOT_FOUND_MESSAGE = "Not Found"; - public static final String NOT_FOUND_DESCRIPTION = "The requested resource is not available."; - public static final String NOT_IMPLEMENTED_MESSAGE = "Not Implemented"; - public static final String BAD_REQUEST_MESSAGE = "Bad Request"; - public static final String INTERNAL_SERVER_ERROR_MESSAGE = "Internal Server Error"; - - //headers and values - public static final String CONTENT_TYPE_HEADER = "content-type"; - public static final String SOAP_ACTION_HEADER_NAME = "soapaction"; - public static final String ACCEPT_HEADER = "accept"; - public static final String PREFER_HEADER = "prefer"; - public static final String PREFER_CODE = "code"; - public static final String PREFER_EXAMPLE = "example"; - public static final List PREFER_KEYS = List.of(PREFER_CODE, PREFER_EXAMPLE); - public static final String APPLICATION_JSON = "application/json"; - public static final String CONTENT_TYPE_TEXT_XML = "text/xml"; - public static final String CONTENT_TYPE_SOAP_XML = "application/soap+xml"; - public static final String APPLICATION_GRAPHQL = "application/graphql"; - public static final String X_FORWARDED_FOR = "x-forwarded-for"; - public static final String PATH_HEADER = ":path"; - public static final String UPGRADE_HEADER = "upgrade"; - public static final String WEBSOCKET = "websocket"; - - public static final String LOG_TRACE_ID = "traceId"; - - // SOAP protocol versions - public static final String SOAP11_PROTOCOL = "SOAP 1.1 Protocol"; - public static final String SOAP12_PROTOCOL = "SOAP 1.2 Protocol"; - public static final String API_UUID = "API_UUID"; - public static final String HTTP_PROTOCOL = "http"; - - /** - * Holds the constants related to denied response types. - */ - public static class ErrorResponseTypes { - - public static final String SOAP11 = "SOAP11"; - public static final String SOAP12 = "SOAP12"; - public static final String JSON = "JSON"; - } - - /** - * Holds the common set of constants related to the output status codes of the security validations. - */ - public static class KeyValidationStatus { - - public static final int API_AUTH_INVALID_CREDENTIALS = 900901; - public static final int API_BLOCKED = 900907; - public static final int API_AUTH_RESOURCE_FORBIDDEN = 900908; - public static final int SUBSCRIPTION_INACTIVE = 900909; - public static final int INVALID_SCOPE = 900910; - public static final int SUBSCRIPTION_ON_HOLD = 900911; - public static final int SUBSCRIPTION_REJECTED = 900912; - public static final int SUBSCRIPTION_BLOCKED = 900913; - public static final int SUBSCRIPTION_PROD_BLOCKED = 900914; - - - private KeyValidationStatus() { - - } - } - - /** - * Holds the common set of constants for output of the subscription validation. - */ - public static class SubscriptionStatus { - - public static final String BLOCKED = "BLOCKED"; - public static final String PROD_ONLY_BLOCKED = "PROD_ONLY_BLOCKED"; - public static final String ON_HOLD = "ON_HOLD"; - public static final String REJECTED = "REJECTED"; - public static final String INACTIVE = "INACTIVE"; - - private SubscriptionStatus() { - - } - } - - /** - * Holds the common set of constants related to life cycle states. - */ - public static class LifecycleStatus { - - public static final String BLOCKED = "BLOCKED"; - } - - /** - * Holds the common set of constants for validating the JWT tokens. - */ - public static class JwtTokenConstants { - - public static final String APPLICATION = "application"; - public static final String APPLICATION_ID = "id"; - public static final String APPLICATION_UUID = "uuid"; - public static final String APPLICATION_NAME = "name"; - public static final String APPLICATION_TIER = "tier"; - public static final String APPLICATION_OWNER = "owner"; - public static final String SUBSCRIPTION_TIER = "subscriptionTier"; - public static final String SUBSCRIBER_TENANT_DOMAIN = "subscriberTenantDomain"; - public static final String TIER_INFO = "tierInfo"; - public static final String STOP_ON_QUOTA_REACH = "stopOnQuotaReach"; - public static final String SCOPE = "scope"; - public static final String SCOPE_DELIMITER = " "; - public static final String TOKEN_TYPE = "token_type"; - public static final String SUBSCRIBED_APIS = "subscribedAPIs"; - public static final String API_CONTEXT = "context"; - public static final String API_VERSION = "version"; - public static final String API_PUBLISHER = "publisher"; - public static final String API_NAME = "name"; - public static final String QUOTA_TYPE = "tierQuotaType"; - public static final String QUOTA_TYPE_BANDWIDTH = "bandwidthVolume"; - public static final String PERMITTED_IP = "permittedIP"; - public static final String PERMITTED_REFERER = "permittedReferer"; - public static final String INTERNAL_KEY_TOKEN_TYPE = "InternalKey"; - public static final String PARAM_SEPARATOR = "&"; - public static final String PARAM_VALUE_SEPARATOR = "="; - public static final String INTERNAL_KEY_APP_NAME = "internal-key-app"; - - } - - /** - * Holds the common set of constants for validating the JWT tokens - */ - public static class KeyManager { - - public static final String DEFAULT_KEY_MANAGER = "Resident Key Manager"; - public static final String APIM_PUBLISHER_ISSUER = "APIM Publisher"; - public static final String APIM_APIKEY_ISSUER = "APIM APIkey"; - - // APIM_APIKEY_ISSUER_URL is intentionally different from the Resident Key Manager - // to avoid conflicts with the access token issuer configs. - public static final String APIM_APIKEY_ISSUER_URL = "https://host:9443/apikey"; - - public static final String ISSUER = "issuer"; - public static final String JWKS_ENDPOINT = "jwks_endpoint"; - public static final String SELF_VALIDATE_JWT = "self_validate_jwt"; - public static final String CLAIM_MAPPING = "claim_mappings"; - public static final String CONSUMER_KEY_CLAIM = "consumer_key_claim"; - public static final String SCOPES_CLAIM = "scopes_claim"; - public static final String CERTIFICATE_TYPE = "certificate_type"; - public static final String CERTIFICATE_VALUE = "certificate_value"; - public static final String CERTIFICATE_TYPE_JWKS_ENDPOINT = "JWKS"; - } - - /** - * Supported policy types. - */ - public enum PolicyType { - API, - APPLICATION, - SUBSCRIPTION - } - - /** - * Holds the constants related to attributes to be sent in the response in case of an error - * scenario raised within the enforcer. - */ - public static class MessageFormat { - - public static final String STATUS_CODE = "status_code"; - public static final String ERROR_CODE = "code"; - public static final String ERROR_MESSAGE = "error_message"; - public static final String ERROR_DESCRIPTION = "error_description"; - } - - /** - * Holds the values related http status codes. - */ - public enum StatusCodes { - OK("200", 200), - UNAUTHENTICATED("401", 401), - UNAUTHORIZED("403", 403), - NOTFOUND("404", 404), - THROTTLED("429", 429), - SERVICE_UNAVAILABLE("503", 503), - INTERNAL_SERVER_ERROR("500", 500), - BAD_REQUEST_ERROR("400", 400), - NOT_IMPLEMENTED_ERROR("501", 501); - - private final String value; - private final int code; - - StatusCodes(String value, int code) { - - this.value = value; - this.code = code; - } - - public String getValue() { - - return this.value; - } - - public int getCode() { - - return this.code; - } - } - - /** - * Holds the values for API types - */ - public static class ApiType { - - public static final String WEB_SOCKET = "WS"; - public static final String GRAPHQL = "GraphQL"; - public static final String GRPC = "GRPC"; - } - - /** - * Holds values for optionality. - */ - public static class Optionality { - - public static final String MANDATORY = "mandatory"; - public static final String OPTIONAL = "optional"; - } - - /** - * Holds values related to readiness check. - */ - public static class ReadinessCheck { - public static final String ENDPOINT = "/ready"; - public static final String RESPONSE_KEY = "status"; - public static final String RESPONSE_VALUE = "ready"; - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIDefinitionConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIDefinitionConstants.java deleted file mode 100644 index 26cc46e5b0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIDefinitionConstants.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.wso2.apk.enforcer.constants; - -public class APIDefinitionConstants { - public static final String SWAGGER_DEFINITION = "OAS"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APISecurityConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APISecurityConstants.java deleted file mode 100644 index 21c83570d0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APISecurityConstants.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2020, 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.constants; - -/** - * Common set of constants related to the security validations of MGW filter core component. - */ -public class APISecurityConstants { - public static final String API_AUTH_FAILURE_HANDLER = "_auth_failure_handler_"; - public static final int API_AUTH_GENERAL_ERROR = 900900; - public static final String API_AUTH_GENERAL_ERROR_MESSAGE = "Unclassified Authentication Failure"; - - public static final int API_AUTH_INVALID_CREDENTIALS = 900901; - public static final String API_AUTH_INVALID_CREDENTIALS_MESSAGE = "Invalid Credentials"; - public static final String API_AUTH_INVALID_CREDENTIALS_DESCRIPTION = "Make sure you have provided the correct " - + "security credentials"; - - public static final int API_AUTH_MISSING_CREDENTIALS = 900902; - public static final String API_AUTH_MISSING_CREDENTIALS_MESSAGE = "Missing Credentials"; - public static final String API_AUTH_MISSING_CREDENTIALS_DESCRIPTION = "Make sure your API invocation call " - + "has a header: Authorization: Bearer ACCESS_TOKEN"; - - public static final int API_AUTH_ACCESS_TOKEN_EXPIRED = 900903; - public static final String API_AUTH_ACCESS_TOKEN_EXPIRED_MESSAGE = "Access Token Expired"; - public static final String API_AUTH_ACCESS_TOKEN_EXPIRED_DESCRIPTION = "Renew the access token and try again"; - - public static final int API_AUTH_ACCESS_TOKEN_INACTIVE = 900904; - public static final String API_AUTH_ACCESS_TOKEN_INACTIVE_MESSAGE = "Access Token Inactive"; - public static final String API_AUTH_ACCESS_TOKEN_INACTIVE_DESCRIPTION = "Generate a new access token and try again"; - - public static final int API_AUTH_INCORRECT_ACCESS_TOKEN_TYPE = 900905; - public static final String API_AUTH_INCORRECT_ACCESS_TOKEN_TYPE_MESSAGE = "Incorrect Access Token Type is provided"; - - public static final int API_AUTH_INCORRECT_API_RESOURCE = 900906; - public static final String API_AUTH_INCORRECT_API_RESOURCE_MESSAGE = "No matching resource found in the API for " - + "the given request"; - public static final String API_AUTH_INCORRECT_API_RESOURCE_DESCRIPTION = "Check the API documentation and add a " - + "proper REST resource path to the invocation URL"; - - public static final int API_SUBSCRIPTION_BLOCKED = 900907; - public static final String API_SUBSCRIPTION_BLOCKED_MESSAGE = "The requested API is temporarily blocked"; - public static final String API_SUBSCRIPTION_BLOCKED_DESCRIPTION = "API Subscription is blocked"; - - public static final int API_AUTH_FORBIDDEN = 900908; - public static final String API_AUTH_FORBIDDEN_MESSAGE = "Resource forbidden"; - - public static final int SUBSCRIPTION_INACTIVE = 900909; - public static final String SUBSCRIPTION_INACTIVE_MESSAGE = "The subscription to the API is inactive"; - - public static final int INVALID_SCOPE = 900910; - public static final String INVALID_SCOPE_MESSAGE = "The access token does not allow you to access the " - + "requested resource"; - - public static final int API_AUTH_MISSING_OPEN_API_DEF = 900911; - public static final String API_AUTH_MISSING_OPEN_API_DEF_ERROR_MESSAGE = "Internal Server Error"; - - // TODO: (renuka) check error codes with APIM: https://github.com/wso2/wso2-synapse/pull/1899/files#r809710868 - public static final int OPA_AUTH_FORBIDDEN = 901101; - public static final String OPA_AUTH_FORBIDDEN_MESSAGE = "Forbidden"; - - public static final int OPA_REQUEST_FAILURE = 901102; - public static final String OPA_REQUEST_FAILURE_MESSAGE = "Internal Server Error"; - - public static final int OPA_RESPONSE_FAILURE = 901103; - public static final String OPA_RESPONSE_FAILURE_MESSAGE = "Internal Server Error"; - - // We have added this because we need to add an additional description to the original one and we need to - // separate the 2 messages - public static final String DESCRIPTION_SEPARATOR = ". "; - - /** - * returns an String that corresponds to errorCode passed in. - * - * @param errorCode - * @return String - */ - public static final String getAuthenticationFailureMessage(int errorCode) { - String errorMessage; - switch (errorCode) { - case API_AUTH_ACCESS_TOKEN_EXPIRED: - errorMessage = API_AUTH_ACCESS_TOKEN_EXPIRED_MESSAGE; - break; - case API_AUTH_ACCESS_TOKEN_INACTIVE: - errorMessage = API_AUTH_ACCESS_TOKEN_INACTIVE_MESSAGE; - break; - case API_AUTH_GENERAL_ERROR: - errorMessage = API_AUTH_GENERAL_ERROR_MESSAGE; - break; - case API_AUTH_MISSING_OPEN_API_DEF: - errorMessage = API_AUTH_MISSING_OPEN_API_DEF_ERROR_MESSAGE; - break; - case API_AUTH_INVALID_CREDENTIALS: - errorMessage = API_AUTH_INVALID_CREDENTIALS_MESSAGE; - break; - case API_AUTH_MISSING_CREDENTIALS: - errorMessage = API_AUTH_MISSING_CREDENTIALS_MESSAGE; - break; - case API_AUTH_INCORRECT_API_RESOURCE: - errorMessage = API_AUTH_INCORRECT_API_RESOURCE_MESSAGE; - break; - case API_AUTH_INCORRECT_ACCESS_TOKEN_TYPE: - errorMessage = API_AUTH_INCORRECT_ACCESS_TOKEN_TYPE_MESSAGE; - break; - case API_SUBSCRIPTION_BLOCKED: - errorMessage = API_SUBSCRIPTION_BLOCKED_MESSAGE; - break; - case API_AUTH_FORBIDDEN: - errorMessage = API_AUTH_FORBIDDEN_MESSAGE; - break; - case SUBSCRIPTION_INACTIVE: - errorMessage = SUBSCRIPTION_INACTIVE_MESSAGE; - break; - case INVALID_SCOPE: - errorMessage = INVALID_SCOPE_MESSAGE; - break; - case OPA_AUTH_FORBIDDEN: - errorMessage = OPA_AUTH_FORBIDDEN_MESSAGE; - break; - case OPA_REQUEST_FAILURE: - errorMessage = OPA_REQUEST_FAILURE_MESSAGE; - break; - case OPA_RESPONSE_FAILURE: - errorMessage = OPA_RESPONSE_FAILURE_MESSAGE; - break; - default: - errorMessage = API_AUTH_GENERAL_ERROR_MESSAGE; - break; - } - return errorMessage; - } - - /** - * This method is used to get an additional description for error message details. - * - * @param errorCode The error code that is embedded in the exception - * @param errorMessage The default error message of the exception - * @return The error description including the original error message and some additional information - */ - public static String getFailureMessageDetailDescription(int errorCode, String errorMessage) { - String errorDescription = errorMessage; - switch (errorCode) { - case API_AUTH_INCORRECT_API_RESOURCE: - errorDescription += DESCRIPTION_SEPARATOR + API_AUTH_INCORRECT_API_RESOURCE_DESCRIPTION; - break; - case API_AUTH_ACCESS_TOKEN_INACTIVE: - errorDescription += DESCRIPTION_SEPARATOR + API_AUTH_ACCESS_TOKEN_INACTIVE_DESCRIPTION; - break; - case API_AUTH_MISSING_CREDENTIALS: - errorDescription += DESCRIPTION_SEPARATOR + API_AUTH_MISSING_CREDENTIALS_DESCRIPTION; - break; - case API_AUTH_ACCESS_TOKEN_EXPIRED: - errorDescription += DESCRIPTION_SEPARATOR + API_AUTH_ACCESS_TOKEN_EXPIRED_DESCRIPTION; - break; - case API_AUTH_INVALID_CREDENTIALS: - errorDescription += DESCRIPTION_SEPARATOR + API_AUTH_INVALID_CREDENTIALS_DESCRIPTION; - break; - default: - // Do nothing since we are anyhow returning the original error description. - } - return errorDescription; - } - - public static final String API_SECURITY_NS = "http://wso2.org/apimanager/security"; - public static final String API_SECURITY_NS_PREFIX = "ams"; - - public static final int DEFAULT_MAX_VALID_KEYS = 250; - public static final int DEFAULT_MAX_INVALID_KEYS = 100; -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIStatus.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIStatus.java deleted file mode 100644 index 16c419bd3c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2020, 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.constants; - -/** - * Status of an API can be anyone from following list. - */ -public enum APIStatus { - - CREATED("CREATED"), PUBLISHED("PUBLISHED"), - DEPRECATED("DEPRECATED"), RETIRED("RETIRED"), BLOCKED("BLOCKED"), PROTOTYPED("PROTOTYPED"); - - private String status; - - APIStatus(String status) { - this.status = status; - } - - public String getStatus() { - return status; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AdapterConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AdapterConstants.java deleted file mode 100644 index f3f1100bfd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AdapterConstants.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2020, 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.constants; - -/** - * Adapter Constants class holds constants shared between adapter and enforcer. - * If a certain value is changed, the change should be added to the adapter implementation - * as well. - */ -public class AdapterConstants { - // The header which should be populated to set the upstream cluster - public static final String CLUSTER_HEADER = "x-wso2-cluster-header"; - // The key which specifies the production cluster name inside the request context - public static final String CLUSTER_HEADER_KEY = "clusterName"; - // The common enforcer Label - public static final String COMMON_ENFORCER_LABEL = "commonEnforcerLabel"; - // The node identifier Key - public static final String NODE_IDENTIFIER_KEY = "instanceIdentifier"; - - /** - * Key in a Key-Value pair of a router http header to configure retry, etc. - * These are Envoy specific constants are not used in Adapter, but correlates with route configs added at adapter. - */ - public static class HttpRouterHeaders { - public static final String RETRY_ON = "x-envoy-retry-on"; - public static final String MAX_RETRIES = "x-envoy-max-retries"; - public static final String RETRIABLE_STATUS_CODES = "x-envoy-retriable-status-codes"; - public static final String UPSTREAM_REQ_TIMEOUT_MS = "x-envoy-upstream-rq-timeout-ms"; - - private HttpRouterHeaders() {} - } - - /** - * Values in a Key-Value pair of a router http header to configure retry, etc. - * These are Envoy specific constants that correlates with the route config added at the adapter. - */ - public static class HttpRouterHeaderValues { - public static final String RETRIABLE_STATUS_CODES = "retriable-status-codes"; - - private HttpRouterHeaderValues() {} - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AdminConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AdminConstants.java deleted file mode 100644 index 04f9d13503..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AdminConstants.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2020, 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.constants; - -/** - * Constants for Admin Rest API - */ -public class AdminConstants { - - public static final String API_TYPE = "API"; - public static final String API_INFO_TYPE = "API_INFO"; - public static final String SUBSCRIPTION_TYPE = "SUBSCRIPTION"; - public static final String APPLICATION_TYPE = "APPLICATION"; - public static final String APPLICATION_THROTTLING_POLICY_TYPE = "APPLICATION_THROTTLING_POLICY"; - public static final String SUBSCRIPTION_THROTTLING_POLICY_TYPE = "SUBSCRIPTION_THROTTLING_POLICY"; - public static final String REVOKED_TOKEN_TYPE = "REVOKED_TOKENS"; - - /** - * Admin Resource definitions - */ - public static class AdminResources { - public static final String API_INFO = "/api/info"; - public static final String APIS = "/apis"; - public static final String APPLICATIONS = "/applications"; - public static final String SUBSCRIPTIONS = "/subscriptions"; - public static final String REVOKED_TOKENS = "/revoked_tokens"; - } - - /** - * Query parameter definitions - */ - public static class Parameters { - public static final String NAME = "name"; - public static final String CONTEXT = "context"; - public static final String VERSION = "version"; - public static final String API_UUID = "apiUUID"; - public static final String APP_UUID = "appUUID"; - public static final String CONSUMER_KEY = "consumerKey"; - public static final String ORGANIZATION_ID = "orgId"; - public static final String TOKEN = "token"; - public static final String STATE = "state"; - } - - /** - * Error messages - */ - public static class ErrorMessages { - public static final String METHOD_NOT_IMPLEMENTED = - "{\"error\": true, \"message\": \"Request Method not implemented.\"}"; - public static final String INTERNAL_SERVER_ERROR = - "{\"error\": true, \"message\": \"Internal server error while processing the request\"}"; - public static final String RESOURCE_NOT_FOUND_ERROR = - "{\"error\": true, \"message\": \"Requested Resource Not Found\"}"; - public static final String UNAUTHORIZED_ERROR = "{\"error\": true, " + - "\"message\": \"Username/ password invalid. User is not authorized to invoke the resource.\"}"; - public static final String NO_AUTH_HEADER_ERROR = - "{\"error\": true, \"message\": \"No Authorization header provided\"}"; - public static final String BAD_REQUEST = - "{\"error\": true, \"message\": \"Invalid request for API Definition.\"}"; - public static final String NOT_FOUND = - "{\"error\": true, \"message\": \"API Definition not found.\"}"; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AnalyticsConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AnalyticsConstants.java deleted file mode 100644 index a27a33b941..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/AnalyticsConstants.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2020, 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.constants; - -/** - * Holds the constants specific to the analytics data publishing. - */ -public class AnalyticsConstants { - - public static final String UPSTREAM_SUCCESS_RESPONSE_DETAIL = "via_upstream"; - public static final String EXT_AUTH_DENIED_RESPONSE_DETAIL = "ext_authz_denied"; - public static final String EXT_AUTH_ERROR_RESPONSE_DETAIL = "ext_authz_error"; - public static final String ROUTE_NOT_FOUND_RESPONSE_DETAIL = "route_not_found"; - public static final String GATEWAY_LABEL = "ENVOY"; - - public static final String TOKEN_ENDPOINT_PATH = "/testkey"; - public static final String HEALTH_ENDPOINT_PATH = "/health"; - public static final String JWKS_ENDPOINT_PATH = "/.wellknown/jwks"; - public static final String DEFAULT_FOR_UNASSIGNED = "UNKNOWN"; - public static final String DATA_PROVIDER_CLASS_PROPERTY = "publisher.custom.data.provider.class"; - - public static final int API_THROTTLE_OUT_ERROR_CODE = 900800; - public static final int HARD_LIMIT_EXCEEDED_ERROR_CODE = 900801; - public static final int RESOURCE_THROTTLE_OUT_ERROR_CODE = 900802; - public static final int APPLICATION_THROTTLE_OUT_ERROR_CODE = 900803; - public static final int SUBSCRIPTION_THROTTLE_OUT_ERROR_CODE = 900804; - public static final int BLOCKED_ERROR_CODE = 900805; - public static final int CUSTOM_POLICY_THROTTLE_OUT_ERROR_CODE = 900806; - - public static final int NHTTP_RECEIVER_INPUT_OUTPUT_ERROR_SENDING = 101000; - public static final int NHTTP_RECEIVER_INPUT_OUTPUT_ERROR_RECEIVING = 101001; - public static final int NHTTP_SENDER_INPUT_OUTPUT_ERROR_SENDING = 101500; - public static final int NHTTP_CONNECTION_FAILED = 101503; - public static final int NHTTP_CONNECTION_TIMEOUT = 101504; - public static final int NHTTP_CONNECTION_CLOSED = 101505; - public static final int NHTTP_PROTOCOL_VIOLATION = 101506; - public static final int NHTTP_CONNECT_TIMEOUT = 101508; - - public static final String WEBSOCKET_HANDSHAKE_RESOURCE_PREFIX = "init-request:"; - public static final String GATEWAY_URL = "x-original-gw-url"; - public static final String X_FORWARD_PROTO_HEADER = "x-forwarded-proto"; - public static final String X_FORWARD_PORT_HEADER = "x-forwarded-port"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/Constants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/Constants.java deleted file mode 100644 index ed2cdb5427..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/Constants.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2020, 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.constants; - -/** - * This class holds the constant keys related to the Microgateway. - */ -public class Constants { - public static final String CONFIG_TYPE_URL = "type.googleapis.com/wso2.discovery.config.enforcer.Config"; - public static final String API_TYPE_URL = "type.googleapis.com/wso2.discovery.api.Api"; - public static final String SUBSCRIPTION_LIST_TYPE_URL = - "type.googleapis.com/wso2.discovery.subscription.SubscriptionList"; - public static final String API_LIST_TYPE_URL = "type.googleapis.com/wso2.discovery.subscription.APIList"; - public static final String APPLICATION_LIST_TYPE_URL = - "type.googleapis.com/wso2.discovery.subscription.ApplicationList"; - public static final String JWT_ISSUER_LIST_TYPE_URL = - "type.googleapis.com/wso2.discovery.subscription.JWTIssuerList"; - - public static final String APPLICATION_POLICY_LIST_TYPE_URL = - "type.googleapis.com/wso2.discovery.subscription.ApplicationPolicyList"; - public static final String SUBSCRIPTION_POLICY_LIST_TYPE_URL = - "type.googleapis.com/wso2.discovery.subscription.SubscriptionPolicyList"; - public static final String APPLICATION_KEY_MAPPING_LIST_TYPE_URL = - "type.googleapis.com/wso2.discovery.subscription.ApplicationKeyMappingList"; - public static final String APPLICATION_MAPPING_LIST_TYPE_URL = - "type.googleapis.com/wso2.discovery.subscription.ApplicationMappingList"; - public static final String KEY_MANAGER_TYPE_URL = - "type.googleapis.com/wso2.discovery.keymgt.KeyManagerConfig"; - public static final String REVOKED_TOKEN_TYPE_URL = - "type.googleapis.com/wso2.discovery.keymgt.RevokedToken"; - public static final String THROTTLE_DATA_TYPE_URL = - "type.googleapis.com/wso2.discovery.throttle.ThrottleData"; - - // xDS constants - public static final int MAX_XDS_RETRIES = 3; - public static final int XDS_DEFAULT_RETRY = 15; - - // Config constants - public static final String EVENT_HUB_EVENT_LISTENING_ENDPOINT = "eventListeningEndpoints"; - - /* "-----BEGIN PRIVATE KEY-----\n" changed to "-----BEGIN PRIVATE KEY-----" - since new lines in different OSs differ (Linux: \n, Windows: \r\n) */ - public static final String BEGINING_OF_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----"; - public static final String END_OF_PRIVATE_KEY = "-----END PRIVATE KEY-----"; - public static final String RSA = "RSA"; - - public static final String LOADBALANCE = "loadbalance"; - public static final String FAILOVER = "failover"; - public static final String TM_BINARY_LOADBALANCE_SEPARATOR = ","; - public static final String TM_BINARY_FAILOVER_SEPARATOR = "|"; - public static final String UNKNOWN_VALUE = "__unknown__"; - - public static final String OBJECT_THIS_NOTATION = "this$"; - public static final String ENV_PREFIX = "$env{"; - public static final String START_BRACKET = "{"; - public static final String END_BRACKET = "}"; - - // jms listener properties - public static final String PROP_INIT_CONTEXT_FACTORY = "java.naming.factory.initial"; - public static final String PROP_CON_FACTORY_JNDI_NAME = "transport.jms.ConnectionFactoryJNDIName"; - public static final String PROP_DESTINATION_TYPE = "transport.jms.DestinationType"; - public static final String PROP_CON_FACTORY = "connectionfactory.TopicConnectionFactory"; - public static final String DEFAULT_DESTINATION_TYPE = "Topic"; - public static final String DEFAULT_CON_FACTORY_JNDI_NAME = "TopicConnectionFactory"; - - // multi-env constants - public static final String DEFAULT_ALL_ENVIRONMENTS_TOKEN_ISSUER = "*"; - public static final String AUTH_URL_CONFIG_KEY = "authURL"; - public static final String AUTH_URL_CONFIG_TOKEN = "authToken"; - public static final String MOESIF_TOKEN = "moesifToken"; - public static final String DEFAULT_ANALYTICS_PUBLISHER = "default"; - public static final String MOESIF_ANALYTICS_PUBLISHER = "moesif"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/GeneralErrorCodeConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/GeneralErrorCodeConstants.java deleted file mode 100644 index ba0a6465d4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/GeneralErrorCodeConstants.java +++ /dev/null @@ -1,40 +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.constants; - -/** - * Common set of constants that holds error code, messages and descriptions. - */ -public class GeneralErrorCodeConstants { - public static final int API_BLOCKED_CODE = 700700; - public static final String API_BLOCKED_MESSAGE = "API blocked"; - public static final String API_BLOCKED_DESCRIPTION = "This API has been blocked temporarily. " - + "Please try again later or contact the system administrators."; - - // TODO: (renuka) check error codes with APIM - public static final int MEDIATION_POLICY_ERROR_CODE = 901100; - - /** - * Contains mock impl endpoint apis related errors - */ - public static class MockImpl { - public static final String BAD_REQUEST_CODE = "900870"; - public static final String NOT_IMPLEMENTED_CODE = "900871"; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/HttpConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/HttpConstants.java deleted file mode 100644 index 890b5a4a08..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/HttpConstants.java +++ /dev/null @@ -1,31 +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.constants; - -/** - * HttpConstants class holds the constants related HTTP protocol related constants - */ -public class HttpConstants { - public static final int NO_CONTENT_STATUS_CODE = 204; - public static final String OPTIONS = "OPTIONS"; - public static final String ALLOW_HEADER = "allow"; - public static final String X_REQUEST_ID_HEADER = "x-request-id"; - public static final String APPLICATION_JSON = "application/json"; - public static final String BASIC_LOWER = "basic"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/InterceptorConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/InterceptorConstants.java deleted file mode 100644 index 706efc52a7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/InterceptorConstants.java +++ /dev/null @@ -1,48 +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.constants; - -/** - * Interceptor Constants class holds constants shared between router's interceptor lua script and enforcer. - * If a certain value is changed, the change should be added to the lua script implementation - * as well. - */ -public class InterceptorConstants { - /** - * Key in a Key-Value pair of authentication context in request body to interceptor service. - */ - public static class AuthContextFields { - public static final String TOKEN_TYPE = "tokenType"; - public static final String TOKEN = "token"; - public static final String KEY_TYPE = "keyType"; // PRODUCTION or SANDBOX - } - - /** - * Data names for api metadata fileds - */ - public static class APIMetadataFields { - public static final String API_BASE_PATH = "basePath"; - public static final String API_NAME = "apiName"; - public static final String API_VERSION = "apiVersion"; - public static final String API_VHOST = "vhost"; - public static final String API_ORGANIZATION_ID = "organizationId"; - public static final String ENVIRONMENT = "environment"; - - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/JwtConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/JwtConstants.java deleted file mode 100644 index 53703b6f3e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/JwtConstants.java +++ /dev/null @@ -1,40 +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.constants; - -/** - * JwtConstants class holds the constants related to JWT generation. - */ -public class JwtConstants { - public static final String API_NAME = "name"; - public static final String SUBSCRIPTION_TIER = "subscriptionTier"; - public static final String SUBSCRIBER_TENANT_DOMAIN = "subscriberTenantDomain"; - public static final String APPLICATION = "application"; - public static final String APPLICATION_ID = "id"; - public static final String APPLICATION_NAME = "name"; - public static final String APPLICATION_TIER = "tier"; - public static final String APPLICATION_OWNER = "owner"; - public static final String EXP = "exp"; - public static final String DROPINS_FOLDER = "/home/wso2/lib/dropins/"; - public static final String JAR = ".jar"; - public static final String CLASS = ".class"; - public static final String RS256 = "SHA256withRSA"; - public static final String RS384 = "SHA384withRSA"; - public static final String RS512 = "SHA512withRSA"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/MetadataConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/MetadataConstants.java deleted file mode 100644 index e7daf1316b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/MetadataConstants.java +++ /dev/null @@ -1,74 +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.constants; - -/** - * MetadataConstants class contains all the Metadata Key Values added from enforcer. - */ -public class MetadataConstants { - public static final String EXT_AUTH_METADATA_CONTEXT_KEY = "envoy.filters.http.ext_authz"; - public static final String EXT_PROC_METADATA_CONTEXT_KEY = "envoy.filters.http.ext_proc"; - public static final String WSO2_METADATA_PREFIX = "x-wso2-"; - public static final String API_ID_KEY = WSO2_METADATA_PREFIX + "api-id"; - public static final String API_CREATOR_KEY = WSO2_METADATA_PREFIX + "api-creator"; - public static final String API_NAME_KEY = WSO2_METADATA_PREFIX + "api-name"; - public static final String API_VERSION_KEY = WSO2_METADATA_PREFIX + "api-version"; - public static final String API_TYPE_KEY = WSO2_METADATA_PREFIX + "api-type"; - public static final String API_USER_NAME_KEY = WSO2_METADATA_PREFIX + "username"; - public static final String API_CONTEXT_KEY = WSO2_METADATA_PREFIX + "api-context"; - public static final String IS_MOCK_API = WSO2_METADATA_PREFIX + "is-mock-api"; - public static final String API_CREATOR_TENANT_DOMAIN_KEY = WSO2_METADATA_PREFIX + "api-creator-tenant-domain"; - public static final String API_ORGANIZATION_ID = WSO2_METADATA_PREFIX + "api-organization-id"; - - public static final String APP_ID_KEY = WSO2_METADATA_PREFIX + "application-id"; - public static final String APP_UUID_KEY = WSO2_METADATA_PREFIX + "application-uuid"; - public static final String APP_KEY_TYPE_KEY = WSO2_METADATA_PREFIX + "application-key-type"; - public static final String APP_NAME_KEY = WSO2_METADATA_PREFIX + "application-name"; - public static final String APP_OWNER_KEY = WSO2_METADATA_PREFIX + "application-owner"; - - public static final String CORRELATION_ID_KEY = WSO2_METADATA_PREFIX + "correlation-id"; - public static final String REGION_KEY = WSO2_METADATA_PREFIX + "region"; - - public static final String API_RESOURCE_TEMPLATE_KEY = WSO2_METADATA_PREFIX + "api-resource-template"; - - public static final String DESTINATION = WSO2_METADATA_PREFIX + "destination"; - - public static final String USER_AGENT_KEY = WSO2_METADATA_PREFIX + "user-agent"; - public static final String CLIENT_IP_KEY = WSO2_METADATA_PREFIX + "client-ip"; - - public static final String ERROR_CODE_KEY = "ErrorCode"; - public static final String APK_ENFORCER_REPLY = "apk-enforcer-reply"; - public static final String RATELIMIT_WSO2_ORG_PREFIX = "customorg"; - public static final String GATEWAY_URL = WSO2_METADATA_PREFIX + "x-original-gw-url"; - public static final String API_ENVIRONMENT = WSO2_METADATA_PREFIX + "api-environment"; - public static final String ORGANIZATION_AND_AIRL_POLICY = "ratelimit:organization-and-rlpolicy"; - public static final String SUBSCRIPTION = "ratelimit:subscription"; - public static final String EXTRACT_TOKEN_FROM = "aitoken:extracttokenfrom"; - public static final String PROMPT_TOKEN_ID = "aitoken:prompttokenid"; - public static final String COMPLETION_TOKEN_ID = "aitoken:completiontokenid"; - public static final String TOTAL_TOKEN_ID = "aitoken:totaltokenid"; - public static final String PROMPT_TOKEN_COUNT = "aitoken:prompttokencount"; - public static final String COMPLETION_TOKEN_COUNT = "aitoken:completiontokencount"; - public static final String TOTAL_TOKEN_COUNT = "aitoken:totaltokencount"; - public static final String MODEL_ID = "aitoken:modelid"; - public static final String MODEL = "aitoken:model"; - public static final String AI_PROVIDER_NAME = "ai:providername"; - public static final String AI_PROVIDER_API_VERSION = "ai:providerversion"; - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/RouterAccessLogConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/RouterAccessLogConstants.java deleted file mode 100644 index d195de4f9c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/RouterAccessLogConstants.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.constants; - -/** - * RouterAccessLogConstants class holds the constants used in Router access logs - */ -public class RouterAccessLogConstants { - public static final String ORIGINAL_PATH_DATA_NAME = "originalPath"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/SoapConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/SoapConstants.java deleted file mode 100644 index 3c76fbe127..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/SoapConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.constants; - -/** - * Constants related to SOAP apis. - */ -public class SoapConstants { - public static final String CONTENT_TYPE_HEADER_NAME = "content-type"; - public static final String SOAP_ACTION_HEADER_NAME = "soapaction"; - public static final String CONTENT_TYPE_TEXT_XML = "text/xml"; - public static final String CONTENT_TYPE_SOAP_XML = "application/soap+xml"; - public static final String SOAP11_PROTOCOL = "SOAP 1.1 Protocol"; - public static final String SOAP12_PROTOCOL = "SOAP 1.2 Protocol"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/cors/CorsFilter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/cors/CorsFilter.java deleted file mode 100644 index 7a37d3717c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/cors/CorsFilter.java +++ /dev/null @@ -1,95 +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.cors; - -import io.opentelemetry.context.Scope; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.commons.Filter; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.HttpConstants; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingSpan; -import org.wso2.apk.enforcer.tracing.TracingTracer; -import org.wso2.apk.enforcer.tracing.Utils; - -/** - * Cors Filter for failed preflight requests. - */ -public class CorsFilter implements Filter { - - private static final Logger logger = LogManager.getLogger(CorsFilter.class); - - @Override - public boolean handleRequest(RequestContext requestContext) { - TracingSpan corsSpan = null; - Scope corsSpanScope = null; - try { - if (Utils.tracingEnabled()) { - TracingTracer tracer = Utils.getGlobalTracer(); - corsSpan = Utils.startSpan(TracingConstants.CORS_SPAN, tracer); - corsSpanScope = corsSpan.getSpan().makeCurrent(); - Utils.setTag(corsSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - - } - logger.debug("Cors Filter (enforcer) is applied."); - // Options request is served here. - // Preflight success request does not reach here. - if (requestContext.getRequestMethod().contains(HttpConstants.OPTIONS)) { - // If the OPTIONS method is provided under the resource, microgateway do not respond - if (requestContext.getMatchedResourcePaths() != null) { - logger.debug("OPTIONS method is listed under the resource. Hence OPTIONS request will" + - "be responded from the upstream"); - return true; - } - StringBuilder allowedMethodsBuilder = new StringBuilder(HttpConstants.OPTIONS); - // Handling GraphQL post requests - // Only post method is allowed for GQL apis, hence it will be added to the allowed method list. - if (APIConstants.ApiType.GRAPHQL.equalsIgnoreCase(requestContext.getMatchedAPI().getApiType())) { - allowedMethodsBuilder.append(", ").append(ResourceConfig.HttpMethods.POST); - } else { - for (ResourceConfig resourceConfig : requestContext.getMatchedAPI().getResources()) { - if (!resourceConfig.getPath().equals(requestContext.getRequestPathTemplate())) { - continue; - } - allowedMethodsBuilder.append(", ").append(resourceConfig.getMethod().name()); - } - } - requestContext.getProperties() - .put(APIConstants.MessageFormat.STATUS_CODE, HttpConstants.NO_CONTENT_STATUS_CODE); - requestContext.addOrModifyHeaders(HttpConstants.ALLOW_HEADER, allowedMethodsBuilder.toString()); - logger.debug("OPTIONS request received for " + - requestContext.getMatchedAPI().getResources().get(0).getPath() + - ". Responded with allow header : " + allowedMethodsBuilder.toString()); - return false; - } - return true; - } finally { - if (Utils.tracingEnabled()) { - corsSpanScope.close(); - Utils.finishSpan(corsSpan); - - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/DeniedResponse.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/DeniedResponse.java deleted file mode 100644 index ef4778f136..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/DeniedResponse.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.deniedresponse; - -import io.envoyproxy.envoy.service.auth.v3.DeniedHttpResponse; -import org.wso2.apk.enforcer.api.ResponseObject; - -/** - * Abstract class for generating a denied responses. - */ -public abstract class DeniedResponse { - protected DeniedHttpResponse.Builder denyResponseBuilder; - - public DeniedResponse(DeniedHttpResponse.Builder denyResponseBuilder) { - this.denyResponseBuilder = denyResponseBuilder; - } - - /** - * Sets the denied response to the deniedResponseBuilder. - * - * @param responseObject - */ - public abstract void setResponse(ResponseObject responseObject); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/DeniedResponsePreparer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/DeniedResponsePreparer.java deleted file mode 100644 index d3df432c13..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/DeniedResponsePreparer.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.deniedresponse; - -import io.envoyproxy.envoy.config.core.v3.HeaderValueOption; -import io.envoyproxy.envoy.service.auth.v3.CheckRequest; -import io.envoyproxy.envoy.service.auth.v3.DeniedHttpResponse; -import io.envoyproxy.envoy.type.v3.HttpStatus; -import org.wso2.apk.enforcer.api.ResponseObject; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.deniedresponse.types.JsonDeniedResponse; -import org.wso2.apk.enforcer.deniedresponse.types.Soap11DeniedResponse; -import org.wso2.apk.enforcer.deniedresponse.types.Soap12DeniedResponse; - -/** - * DeniedResponsePreparer will prepare the DeniedHttpResponse.Builder accordingly to the appropriate response format. - */ -public class DeniedResponsePreparer { - private DeniedResponse deniedResponse; - - private final DeniedHttpResponse.Builder denyResponseBuilder; - - private String responseType = "JSON"; - - public DeniedResponsePreparer(DeniedHttpResponse.Builder denyResponseBuilder) { - this.denyResponseBuilder = denyResponseBuilder; - } - private static final boolean soapErrorInXMLEnabled = - ConfigHolder.getInstance().getConfig().getSoapErrorResponseConfigDto().isEnable(); - - public DeniedResponse getDeniedResponse() { - return deniedResponse; - } - - /** - * This function will set the error message according to the format that needs to be sent. - * Currently, supported formats are JSON, SOAP1.1, SOAP1.2. - * - * @param request CheckRequest object containing request details - * @param responseObject ResponseObject containing the response details - */ - public void setErrorMessage(CheckRequest request, ResponseObject responseObject) { - findResponseType(request); - switch (responseType) { - case APIConstants.ErrorResponseTypes.SOAP11: - deniedResponse = new Soap11DeniedResponse(denyResponseBuilder); - deniedResponse.setResponse(responseObject); - break; - case APIConstants.ErrorResponseTypes.SOAP12: - deniedResponse = new Soap12DeniedResponse(denyResponseBuilder); - deniedResponse.setResponse(responseObject); - break; - default: - deniedResponse = new JsonDeniedResponse(denyResponseBuilder); - deniedResponse.setResponse(responseObject); - } - } - - public void addHeaders(HeaderValueOption headerValueOption) { - denyResponseBuilder.addHeaders(headerValueOption); - } - - public void addHeaders(HeaderValueOption.Builder headerValueOption) { - denyResponseBuilder.addHeaders(headerValueOption); - } - - public void setStatus(HttpStatus status) { - denyResponseBuilder.setStatus(status); - } - - public void setBody(String body) { - denyResponseBuilder.setBody(body); - } - - /** - * Decides the response type. - * - * @param request CheckRequest object containing request details - */ - private void findResponseType(CheckRequest request) { - if (soapErrorInXMLEnabled) { - String contentType = request.getAttributes().getRequest().getHttp().getHeadersMap() - .get(APIConstants.CONTENT_TYPE_HEADER.toLowerCase()); - if (APIConstants.CONTENT_TYPE_TEXT_XML.equals(contentType) && request.getAttributes().getRequest() - .getHttp().getHeadersMap().containsKey(APIConstants.SOAP_ACTION_HEADER_NAME)) { - this.responseType = APIConstants.ErrorResponseTypes.SOAP11; - } else if (APIConstants.CONTENT_TYPE_SOAP_XML.equals(contentType)) { - this.responseType = APIConstants.ErrorResponseTypes.SOAP12; - } else { - this.responseType = APIConstants.ErrorResponseTypes.JSON; - } - } else { - this.responseType = APIConstants.ErrorResponseTypes.JSON; - } - } - - public DeniedHttpResponse build() { - return denyResponseBuilder.build(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/JsonDeniedResponse.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/JsonDeniedResponse.java deleted file mode 100644 index 13a5863d64..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/JsonDeniedResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.deniedresponse.types; - -import io.envoyproxy.envoy.config.core.v3.HeaderValue; -import io.envoyproxy.envoy.config.core.v3.HeaderValueOption; -import io.envoyproxy.envoy.service.auth.v3.DeniedHttpResponse; -import org.json.JSONObject; -import org.wso2.apk.enforcer.api.ResponseObject; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.deniedresponse.DeniedResponse; - -/** - * generates JSON formatted denied responses. - */ -public class JsonDeniedResponse extends DeniedResponse { - - public JsonDeniedResponse(DeniedHttpResponse.Builder denyResponseBuilder) { - super(denyResponseBuilder); - } - - @Override - public void setResponse(ResponseObject responseObject) { - JSONObject responseJson = new JSONObject(); - responseJson.put(APIConstants.MessageFormat.ERROR_CODE, responseObject.getErrorCode()); - responseJson.put(APIConstants.MessageFormat.ERROR_MESSAGE, responseObject.getErrorMessage()); - responseJson.put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - responseObject.getErrorDescription()); - denyResponseBuilder.setBody(responseJson.toString()); - HeaderValueOption headerValueOption = HeaderValueOption.newBuilder().setHeader(HeaderValue.newBuilder() - .setKey(APIConstants.CONTENT_TYPE_HEADER) - .setValue(APIConstants.APPLICATION_JSON).build()).build(); - denyResponseBuilder.addHeaders(headerValueOption); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/Soap11DeniedResponse.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/Soap11DeniedResponse.java deleted file mode 100644 index ab0b198834..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/Soap11DeniedResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.deniedresponse.types; - -import io.envoyproxy.envoy.config.core.v3.HeaderValue; -import io.envoyproxy.envoy.config.core.v3.HeaderValueOption; -import io.envoyproxy.envoy.service.auth.v3.DeniedHttpResponse; -import org.wso2.apk.enforcer.api.ResponseObject; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.deniedresponse.DeniedResponse; -import org.wso2.apk.enforcer.util.SOAPUtils; - -/** - * generates SOAP 1.1 formatted denied responses. - */ -public class Soap11DeniedResponse extends DeniedResponse { - public Soap11DeniedResponse(DeniedHttpResponse.Builder denyResponseBuilder) { - super(denyResponseBuilder); - } - - @Override - public void setResponse(ResponseObject responseObject) { - denyResponseBuilder.setBody(SOAPUtils.getSoapFaultMessage(APIConstants.SOAP11_PROTOCOL, - responseObject.getErrorMessage(), responseObject.getErrorDescription(), responseObject.getErrorCode())); - HeaderValueOption headerValueOption = HeaderValueOption.newBuilder().setHeader(HeaderValue.newBuilder() - .setKey(APIConstants.CONTENT_TYPE_HEADER) - .setValue(APIConstants.CONTENT_TYPE_TEXT_XML).build()).build(); - denyResponseBuilder.addHeaders(headerValueOption); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/Soap12DeniedResponse.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/Soap12DeniedResponse.java deleted file mode 100644 index 618a93004b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/deniedresponse/types/Soap12DeniedResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.deniedresponse.types; - -import io.envoyproxy.envoy.config.core.v3.HeaderValue; -import io.envoyproxy.envoy.config.core.v3.HeaderValueOption; -import io.envoyproxy.envoy.service.auth.v3.DeniedHttpResponse; -import org.wso2.apk.enforcer.api.ResponseObject; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.deniedresponse.DeniedResponse; -import org.wso2.apk.enforcer.util.SOAPUtils; - -/** - * generates SOAP 1.2 formatted denied responses. - */ -public class Soap12DeniedResponse extends DeniedResponse { - public Soap12DeniedResponse(DeniedHttpResponse.Builder denyResponseBuilder) { - super(denyResponseBuilder); - } - - @Override - public void setResponse(ResponseObject responseObject) { - denyResponseBuilder.setBody(SOAPUtils.getSoapFaultMessage(APIConstants.SOAP12_PROTOCOL, - responseObject.getErrorMessage(), responseObject.getErrorDescription(), responseObject.getErrorCode())); - HeaderValueOption headerValueOption = HeaderValueOption.newBuilder().setHeader(HeaderValue.newBuilder() - .setKey(APIConstants.CONTENT_TYPE_HEADER) - .setValue(APIConstants.CONTENT_TYPE_SOAP_XML).build()).build(); - denyResponseBuilder.addHeaders(headerValueOption); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApiDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApiDiscoveryClient.java deleted file mode 100644 index 27c7a6907a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApiDiscoveryClient.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2020, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.api.Api; -import org.wso2.apk.enforcer.discovery.service.api.ApiDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.api.APIFactory; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with API discovery service at the adapter. - */ -public class ApiDiscoveryClient implements Runnable { - private static final Logger logger = LogManager.getLogger(ApiDiscoveryClient.class); - private static ApiDiscoveryClient instance; - private final APIFactory apiFactory; - private final String host; - private final String hostname; - private final int port; - private ManagedChannel channel; - private ApiDiscoveryServiceGrpc.ApiDiscoveryServiceStub stub; - private StreamObserver reqObserver; - /** - * This is a reference to the latest received response from the ADS. - *

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

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

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

- */ - private DiscoveryResponse latestACKed; - /** - * Node struct for the discovery client - */ - private final Node node; - - private ApiDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.apiFactory = APIFactory.getInstance(); - this.node = XDSCommonUtils.generateXDSNode(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerLabel()); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - initConnection(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("API discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - this.stub = ApiDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopAPIDiscoveryScheduling(); - } - } - - public static ApiDiscoveryClient getInstance() { - if (instance == null) { - String adsHost = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHost(); - String adsHostname = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHostname(); - int adsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getAdapterXdsPort()); - instance = new ApiDiscoveryClient(adsHost, adsHostname, adsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchApis(); - } - - public void watchApis() { - int maxSize = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getXdsMaxMsgSize()); - reqObserver = stub.withMaxInboundMessageSize(maxSize).streamApis(new StreamObserver<>() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("API event received with version : " + response.getVersionInfo()); - logger.debug("Received API discovery response " + response); - XdsSchedulerManager.getInstance().stopAPIDiscoveryScheduling(); - latestReceived = response; - try { - List apis = handleResponse(response); - apiFactory.addApis(apis); - logger.info("Number of API artifacts received : " + apis.size()); - // TODO: (Praminda) fix recursive ack on ack failure - ack(); - } catch (Exception e) { - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during API discovery", throwable); - XdsSchedulerManager.getInstance().startAPIDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving APIs"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.API_TYPE_URL).build(); - reqObserver.onNext(req); - } catch (Exception e) { - logger.error("Unexpected error occurred in API discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. - * This is part of the xDS communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.API_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.API_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } - - private List handleResponse(DiscoveryResponse response) throws InvalidProtocolBufferException { - List apis = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - apis.add(res.unpack(Api.class)); - } - return apis; - } - - public void shutdown() throws InterruptedException { - channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ConfigDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ConfigDiscoveryClient.java deleted file mode 100644 index 638567e6ab..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ConfigDiscoveryClient.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2020, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.discovery; - -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.config.enforcer.Config; -import org.wso2.apk.enforcer.discovery.service.config.ConfigDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import javax.validation.constraints.NotNull; - -/** - * Client to communicate with configuration discovery service at the adapter. - */ -public class ConfigDiscoveryClient implements Runnable { - private static final Logger log = LogManager.getLogger(ConfigDiscoveryClient.class); - private static ConfigDiscoveryClient instance; - private final String host; - private final String hostname; - private final int port; - private final CountDownLatch latch; - private ConfigDiscoveryServiceGrpc.ConfigDiscoveryServiceBlockingStub blockingStub; - private ManagedChannel channel; - /** - * Node struct for the discovery client - */ - private final Node node; - - private ConfigDiscoveryClient(String host, String hostname, int port, CountDownLatch latch) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.latch = latch; - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - initConnection(); - } - - /** - * Initialize an instance of {@link ConfigDiscoveryClient}. - * - * @param latch a latch counter to make calling thread wait for proper - * completion of config discovery. - * @return initialized instance of {@link ConfigDiscoveryClient} - */ - public static ConfigDiscoveryClient init(@NotNull CountDownLatch latch) { - if (instance == null) { - String adsHost = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHost(); - String adsHostname = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHostname(); - int adsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getAdapterXdsPort()); - instance = new ConfigDiscoveryClient(adsHost, adsHostname, adsPort, latch); - } - return instance; - } - - /** - * Retrieves the already initialized instance of this class. Instance must be - * initialized first by calling {@link ConfigDiscoveryClient#init(CountDownLatch)} - * before calling this methods. This methods doesn't handled initialization - * of the instance. - * - * @return initialized {@link ConfigDiscoveryClient} instance or {@code null} - * if the instance is not initialized previously by calling - * {@link ConfigDiscoveryClient#init(CountDownLatch)} - */ - public static ConfigDiscoveryClient getInstance() { - return instance; - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - log.error("Config discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(log, host, port, hostname); - this.blockingStub = ConfigDiscoveryServiceGrpc.newBlockingStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopConfigDiscoveryScheduling(); - } - } - - public void requestInitConfig() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setTypeUrl(Constants.CONFIG_TYPE_URL).build(); - try { - DiscoveryResponse res = blockingStub.withDeadlineAfter(60, TimeUnit.SECONDS).fetchConfigs(req); - shutdown(); - XdsSchedulerManager.getInstance().stopConfigDiscoveryScheduling(); - - // There's only one config root resource here. Therefore, taking 0 and no need to iterate - Config config = res.getResources(0).unpack(Config.class); - ConfigHolder.load(config); - this.latch.countDown(); - } catch (Exception e) { - // Catching generic error here to wrap any gRPC communication errors in the runtime - log.error("Error occurred during Config discovery", e); - XdsSchedulerManager.getInstance().startConfigDiscoveryScheduling(); - } - } - - public void shutdown() throws InterruptedException { - channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); - } - - @Override - public void run() { - initConnection(); - requestInitConfig(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/JWTIssuerDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/JWTIssuerDiscoveryClient.java deleted file mode 100644 index e4311e4c93..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/JWTIssuerDiscoveryClient.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.discovery.service.subscription.JWTIssuerDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.discovery.subscription.JWTIssuer; -import org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList; -import org.wso2.apk.enforcer.jmx.JMXUtils; -import org.wso2.apk.enforcer.metrics.jmx.impl.ExtAuthMetrics; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStore; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with JWTIssuer discovery service at the adapter. - */ -public class JWTIssuerDiscoveryClient implements Runnable { - - private static final Logger logger = LogManager.getLogger(JWTIssuerDiscoveryClient.class); - private static JWTIssuerDiscoveryClient instance; - private ManagedChannel channel; - private JWTIssuerDiscoveryServiceGrpc.JWTIssuerDiscoveryServiceStub stub; - private StreamObserver reqObserver; - private final String host; - private final String hostname; - private final int port; - - /** - * This is a reference to the latest received response from the ADS. - *

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

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

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

- */ - private DiscoveryResponse latestACKed; - - /** - * Node struct for the discovery client - */ - private final Node node; - - private JWTIssuerDiscoveryClient(String host, String hostname, int port) { - - this.host = host; - this.hostname = hostname; - this.port = port; - initConnection(); - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("JWTISsuer discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - this.stub = JWTIssuerDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopJWTIssuerDiscoveryScheduling(); - } - } - - public static JWTIssuerDiscoveryClient getInstance() { - - if (instance == null) { - String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHost(); - String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHostname(); - int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getAdapterXdsPort()); - instance = new JWTIssuerDiscoveryClient(sdsHost, sdsHostname, sdsPort); - } - return instance; - } - - public void run() { - - initConnection(); - watchJWTIssuers(); - } - - public void watchJWTIssuers() { - - reqObserver = stub.streamJWTIssuers(new StreamObserver<>() { - @Override - public void onNext(DiscoveryResponse response) { - - logger.info("JWTIssuer creation event received with version : " + response.getVersionInfo()); - logger.debug("Received JWTIssuer discovery response " + response); - XdsSchedulerManager.getInstance().stopJWTIssuerDiscoveryScheduling(); - latestReceived = response; - try { - List jwtIssuers = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - jwtIssuers.addAll(res.unpack(JWTIssuerList.class).getListList()); - } - Map> orgWizeIssuerMap = new HashMap<>(); - for (JWTIssuer jwtIssuer : jwtIssuers) { - List jwtIssuerList = orgWizeIssuerMap.computeIfAbsent(jwtIssuer.getOrganization(), - k -> new ArrayList<>()); - jwtIssuerList.add(jwtIssuer); - } - orgWizeIssuerMap.forEach((k, v) -> { - SubscriptionDataStore subscriptionDataStore = - SubscriptionDataHolder.getInstance().getSubscriptionDataStore(k); - if (subscriptionDataStore == null) { - subscriptionDataStore = - SubscriptionDataHolder.getInstance().initializeSubscriptionDataStore(k); - } - subscriptionDataStore.addJWTIssuers(v); - }); - if (JMXUtils.isJMXMetricsEnabled()) { - ExtAuthMetrics.getInstance().recordJWTIssuerMetrics(SubscriptionDataHolder.getInstance().getTotalJWTIssuerCount()); - } - logger.info("Number of jwt issuers received : " + jwtIssuers.size()); - ack(); - } catch (Exception e) { - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - - logger.error("Error occurred during JWTIssuer discovery", throwable); - XdsSchedulerManager.getInstance().startJWTIssuerDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - - logger.info("Completed receiving JWT Issuer data"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.JWT_ISSUER_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.JWT_ISSUER_LIST_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in JWTIssuer discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. This is part of the xDS - * communication protocol. - */ - private void ack() { - - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.JWT_ISSUER_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.JWT_ISSUER_LIST_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProvider.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProvider.java deleted file mode 100644 index 0848c58b6e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProvider.java +++ /dev/null @@ -1,1658 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/ai_provider.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Holds AIProvider configs
- * 
- * - * Protobuf type {@code wso2.discovery.api.AIProvider} - */ -public final class AIProvider extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.AIProvider) - AIProviderOrBuilder { -private static final long serialVersionUID = 0L; - // Use AIProvider.newBuilder() to construct. - private AIProvider(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AIProvider() { - providerName_ = ""; - providerAPIVersion_ = ""; - organization_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AIProvider(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AIProvider( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - providerName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - providerAPIVersion_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - organization_ = s; - break; - } - case 34: { - org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder subBuilder = null; - if (model_ != null) { - subBuilder = model_.toBuilder(); - } - model_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.ValueDetails.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(model_); - model_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder subBuilder = null; - if (promptTokens_ != null) { - subBuilder = promptTokens_.toBuilder(); - } - promptTokens_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.ValueDetails.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(promptTokens_); - promptTokens_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder subBuilder = null; - if (completionToken_ != null) { - subBuilder = completionToken_.toBuilder(); - } - completionToken_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.ValueDetails.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(completionToken_); - completionToken_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder subBuilder = null; - if (totalToken_ != null) { - subBuilder = totalToken_.toBuilder(); - } - totalToken_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.ValueDetails.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(totalToken_); - totalToken_ = subBuilder.buildPartial(); - } - - break; - } - case 64: { - - enabled_ = 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.api.AIProviderProto.internal_static_wso2_discovery_api_AIProvider_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_AIProvider_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.AIProvider.class, org.wso2.apk.enforcer.discovery.api.AIProvider.Builder.class); - } - - public static final int PROVIDERNAME_FIELD_NUMBER = 1; - private volatile java.lang.Object providerName_; - /** - * string providerName = 1; - * @return The providerName. - */ - @java.lang.Override - public java.lang.String getProviderName() { - java.lang.Object ref = providerName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - providerName_ = s; - return s; - } - } - /** - * string providerName = 1; - * @return The bytes for providerName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getProviderNameBytes() { - java.lang.Object ref = providerName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - providerName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROVIDERAPIVERSION_FIELD_NUMBER = 2; - private volatile java.lang.Object providerAPIVersion_; - /** - * string providerAPIVersion = 2; - * @return The providerAPIVersion. - */ - @java.lang.Override - public java.lang.String getProviderAPIVersion() { - java.lang.Object ref = providerAPIVersion_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - providerAPIVersion_ = s; - return s; - } - } - /** - * string providerAPIVersion = 2; - * @return The bytes for providerAPIVersion. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getProviderAPIVersionBytes() { - java.lang.Object ref = providerAPIVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - providerAPIVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATION_FIELD_NUMBER = 3; - private volatile java.lang.Object organization_; - /** - * string organization = 3; - * @return The organization. - */ - @java.lang.Override - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } - } - /** - * string organization = 3; - * @return The bytes for organization. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MODEL_FIELD_NUMBER = 4; - private org.wso2.apk.enforcer.discovery.api.ValueDetails model_; - /** - * .wso2.discovery.api.ValueDetails model = 4; - * @return Whether the model field is set. - */ - @java.lang.Override - public boolean hasModel() { - return model_ != null; - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - * @return The model. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetails getModel() { - return model_ == null ? org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : model_; - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getModelOrBuilder() { - return getModel(); - } - - public static final int PROMPTTOKENS_FIELD_NUMBER = 5; - private org.wso2.apk.enforcer.discovery.api.ValueDetails promptTokens_; - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - * @return Whether the promptTokens field is set. - */ - @java.lang.Override - public boolean hasPromptTokens() { - return promptTokens_ != null; - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - * @return The promptTokens. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetails getPromptTokens() { - return promptTokens_ == null ? org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : promptTokens_; - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getPromptTokensOrBuilder() { - return getPromptTokens(); - } - - public static final int COMPLETIONTOKEN_FIELD_NUMBER = 6; - private org.wso2.apk.enforcer.discovery.api.ValueDetails completionToken_; - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - * @return Whether the completionToken field is set. - */ - @java.lang.Override - public boolean hasCompletionToken() { - return completionToken_ != null; - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - * @return The completionToken. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetails getCompletionToken() { - return completionToken_ == null ? org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : completionToken_; - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getCompletionTokenOrBuilder() { - return getCompletionToken(); - } - - public static final int TOTALTOKEN_FIELD_NUMBER = 7; - private org.wso2.apk.enforcer.discovery.api.ValueDetails totalToken_; - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - * @return Whether the totalToken field is set. - */ - @java.lang.Override - public boolean hasTotalToken() { - return totalToken_ != null; - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - * @return The totalToken. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetails getTotalToken() { - return totalToken_ == null ? org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : totalToken_; - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getTotalTokenOrBuilder() { - return getTotalToken(); - } - - public static final int ENABLED_FIELD_NUMBER = 8; - private boolean enabled_; - /** - * bool enabled = 8; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - 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 (!getProviderNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, providerName_); - } - if (!getProviderAPIVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, providerAPIVersion_); - } - if (!getOrganizationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, organization_); - } - if (model_ != null) { - output.writeMessage(4, getModel()); - } - if (promptTokens_ != null) { - output.writeMessage(5, getPromptTokens()); - } - if (completionToken_ != null) { - output.writeMessage(6, getCompletionToken()); - } - if (totalToken_ != null) { - output.writeMessage(7, getTotalToken()); - } - if (enabled_ != false) { - output.writeBool(8, enabled_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getProviderNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, providerName_); - } - if (!getProviderAPIVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, providerAPIVersion_); - } - if (!getOrganizationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, organization_); - } - if (model_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getModel()); - } - if (promptTokens_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getPromptTokens()); - } - if (completionToken_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getCompletionToken()); - } - if (totalToken_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getTotalToken()); - } - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, enabled_); - } - 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.api.AIProvider)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.AIProvider other = (org.wso2.apk.enforcer.discovery.api.AIProvider) obj; - - if (!getProviderName() - .equals(other.getProviderName())) return false; - if (!getProviderAPIVersion() - .equals(other.getProviderAPIVersion())) return false; - if (!getOrganization() - .equals(other.getOrganization())) return false; - if (hasModel() != other.hasModel()) return false; - if (hasModel()) { - if (!getModel() - .equals(other.getModel())) return false; - } - if (hasPromptTokens() != other.hasPromptTokens()) return false; - if (hasPromptTokens()) { - if (!getPromptTokens() - .equals(other.getPromptTokens())) return false; - } - if (hasCompletionToken() != other.hasCompletionToken()) return false; - if (hasCompletionToken()) { - if (!getCompletionToken() - .equals(other.getCompletionToken())) return false; - } - if (hasTotalToken() != other.hasTotalToken()) return false; - if (hasTotalToken()) { - if (!getTotalToken() - .equals(other.getTotalToken())) return false; - } - if (getEnabled() - != other.getEnabled()) 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) + PROVIDERNAME_FIELD_NUMBER; - hash = (53 * hash) + getProviderName().hashCode(); - hash = (37 * hash) + PROVIDERAPIVERSION_FIELD_NUMBER; - hash = (53 * hash) + getProviderAPIVersion().hashCode(); - hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; - hash = (53 * hash) + getOrganization().hashCode(); - if (hasModel()) { - hash = (37 * hash) + MODEL_FIELD_NUMBER; - hash = (53 * hash) + getModel().hashCode(); - } - if (hasPromptTokens()) { - hash = (37 * hash) + PROMPTTOKENS_FIELD_NUMBER; - hash = (53 * hash) + getPromptTokens().hashCode(); - } - if (hasCompletionToken()) { - hash = (37 * hash) + COMPLETIONTOKEN_FIELD_NUMBER; - hash = (53 * hash) + getCompletionToken().hashCode(); - } - if (hasTotalToken()) { - hash = (37 * hash) + TOTALTOKEN_FIELD_NUMBER; - hash = (53 * hash) + getTotalToken().hashCode(); - } - hash = (37 * hash) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.AIProvider parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.AIProvider 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.api.AIProvider parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.AIProvider 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.api.AIProvider parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.AIProvider 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.api.AIProvider parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.AIProvider 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.api.AIProvider parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.AIProvider 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.api.AIProvider 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.api.AIProvider 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.api.AIProvider 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; - } - /** - *
-   * Holds AIProvider configs
-   * 
- * - * Protobuf type {@code wso2.discovery.api.AIProvider} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.AIProvider) - org.wso2.apk.enforcer.discovery.api.AIProviderOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_AIProvider_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_AIProvider_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.AIProvider.class, org.wso2.apk.enforcer.discovery.api.AIProvider.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.AIProvider.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(); - providerName_ = ""; - - providerAPIVersion_ = ""; - - organization_ = ""; - - if (modelBuilder_ == null) { - model_ = null; - } else { - model_ = null; - modelBuilder_ = null; - } - if (promptTokensBuilder_ == null) { - promptTokens_ = null; - } else { - promptTokens_ = null; - promptTokensBuilder_ = null; - } - if (completionTokenBuilder_ == null) { - completionToken_ = null; - } else { - completionToken_ = null; - completionTokenBuilder_ = null; - } - if (totalTokenBuilder_ == null) { - totalToken_ = null; - } else { - totalToken_ = null; - totalTokenBuilder_ = null; - } - enabled_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_AIProvider_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.AIProvider getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.AIProvider.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.AIProvider build() { - org.wso2.apk.enforcer.discovery.api.AIProvider result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.AIProvider buildPartial() { - org.wso2.apk.enforcer.discovery.api.AIProvider result = new org.wso2.apk.enforcer.discovery.api.AIProvider(this); - result.providerName_ = providerName_; - result.providerAPIVersion_ = providerAPIVersion_; - result.organization_ = organization_; - if (modelBuilder_ == null) { - result.model_ = model_; - } else { - result.model_ = modelBuilder_.build(); - } - if (promptTokensBuilder_ == null) { - result.promptTokens_ = promptTokens_; - } else { - result.promptTokens_ = promptTokensBuilder_.build(); - } - if (completionTokenBuilder_ == null) { - result.completionToken_ = completionToken_; - } else { - result.completionToken_ = completionTokenBuilder_.build(); - } - if (totalTokenBuilder_ == null) { - result.totalToken_ = totalToken_; - } else { - result.totalToken_ = totalTokenBuilder_.build(); - } - result.enabled_ = enabled_; - 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.api.AIProvider) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.AIProvider)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.AIProvider other) { - if (other == org.wso2.apk.enforcer.discovery.api.AIProvider.getDefaultInstance()) return this; - if (!other.getProviderName().isEmpty()) { - providerName_ = other.providerName_; - onChanged(); - } - if (!other.getProviderAPIVersion().isEmpty()) { - providerAPIVersion_ = other.providerAPIVersion_; - onChanged(); - } - if (!other.getOrganization().isEmpty()) { - organization_ = other.organization_; - onChanged(); - } - if (other.hasModel()) { - mergeModel(other.getModel()); - } - if (other.hasPromptTokens()) { - mergePromptTokens(other.getPromptTokens()); - } - if (other.hasCompletionToken()) { - mergeCompletionToken(other.getCompletionToken()); - } - if (other.hasTotalToken()) { - mergeTotalToken(other.getTotalToken()); - } - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - 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.api.AIProvider parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.AIProvider) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object providerName_ = ""; - /** - * string providerName = 1; - * @return The providerName. - */ - public java.lang.String getProviderName() { - java.lang.Object ref = providerName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - providerName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string providerName = 1; - * @return The bytes for providerName. - */ - public com.google.protobuf.ByteString - getProviderNameBytes() { - java.lang.Object ref = providerName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - providerName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string providerName = 1; - * @param value The providerName to set. - * @return This builder for chaining. - */ - public Builder setProviderName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - providerName_ = value; - onChanged(); - return this; - } - /** - * string providerName = 1; - * @return This builder for chaining. - */ - public Builder clearProviderName() { - - providerName_ = getDefaultInstance().getProviderName(); - onChanged(); - return this; - } - /** - * string providerName = 1; - * @param value The bytes for providerName to set. - * @return This builder for chaining. - */ - public Builder setProviderNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - providerName_ = value; - onChanged(); - return this; - } - - private java.lang.Object providerAPIVersion_ = ""; - /** - * string providerAPIVersion = 2; - * @return The providerAPIVersion. - */ - public java.lang.String getProviderAPIVersion() { - java.lang.Object ref = providerAPIVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - providerAPIVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string providerAPIVersion = 2; - * @return The bytes for providerAPIVersion. - */ - public com.google.protobuf.ByteString - getProviderAPIVersionBytes() { - java.lang.Object ref = providerAPIVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - providerAPIVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string providerAPIVersion = 2; - * @param value The providerAPIVersion to set. - * @return This builder for chaining. - */ - public Builder setProviderAPIVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - providerAPIVersion_ = value; - onChanged(); - return this; - } - /** - * string providerAPIVersion = 2; - * @return This builder for chaining. - */ - public Builder clearProviderAPIVersion() { - - providerAPIVersion_ = getDefaultInstance().getProviderAPIVersion(); - onChanged(); - return this; - } - /** - * string providerAPIVersion = 2; - * @param value The bytes for providerAPIVersion to set. - * @return This builder for chaining. - */ - public Builder setProviderAPIVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - providerAPIVersion_ = value; - onChanged(); - return this; - } - - private java.lang.Object organization_ = ""; - /** - * string organization = 3; - * @return The organization. - */ - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organization = 3; - * @return The bytes for organization. - */ - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organization = 3; - * @param value The organization to set. - * @return This builder for chaining. - */ - public Builder setOrganization( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organization_ = value; - onChanged(); - return this; - } - /** - * string organization = 3; - * @return This builder for chaining. - */ - public Builder clearOrganization() { - - organization_ = getDefaultInstance().getOrganization(); - onChanged(); - return this; - } - /** - * string organization = 3; - * @param value The bytes for organization to set. - * @return This builder for chaining. - */ - public Builder setOrganizationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organization_ = value; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.api.ValueDetails model_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder> modelBuilder_; - /** - * .wso2.discovery.api.ValueDetails model = 4; - * @return Whether the model field is set. - */ - public boolean hasModel() { - return modelBuilder_ != null || model_ != null; - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - * @return The model. - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetails getModel() { - if (modelBuilder_ == null) { - return model_ == null ? org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : model_; - } else { - return modelBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - public Builder setModel(org.wso2.apk.enforcer.discovery.api.ValueDetails value) { - if (modelBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - model_ = value; - onChanged(); - } else { - modelBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - public Builder setModel( - org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder builderForValue) { - if (modelBuilder_ == null) { - model_ = builderForValue.build(); - onChanged(); - } else { - modelBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - public Builder mergeModel(org.wso2.apk.enforcer.discovery.api.ValueDetails value) { - if (modelBuilder_ == null) { - if (model_ != null) { - model_ = - org.wso2.apk.enforcer.discovery.api.ValueDetails.newBuilder(model_).mergeFrom(value).buildPartial(); - } else { - model_ = value; - } - onChanged(); - } else { - modelBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - public Builder clearModel() { - if (modelBuilder_ == null) { - model_ = null; - onChanged(); - } else { - model_ = null; - modelBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder getModelBuilder() { - - onChanged(); - return getModelFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getModelOrBuilder() { - if (modelBuilder_ != null) { - return modelBuilder_.getMessageOrBuilder(); - } else { - return model_ == null ? - org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : model_; - } - } - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder> - getModelFieldBuilder() { - if (modelBuilder_ == null) { - modelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder>( - getModel(), - getParentForChildren(), - isClean()); - model_ = null; - } - return modelBuilder_; - } - - private org.wso2.apk.enforcer.discovery.api.ValueDetails promptTokens_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder> promptTokensBuilder_; - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - * @return Whether the promptTokens field is set. - */ - public boolean hasPromptTokens() { - return promptTokensBuilder_ != null || promptTokens_ != null; - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - * @return The promptTokens. - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetails getPromptTokens() { - if (promptTokensBuilder_ == null) { - return promptTokens_ == null ? org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : promptTokens_; - } else { - return promptTokensBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - public Builder setPromptTokens(org.wso2.apk.enforcer.discovery.api.ValueDetails value) { - if (promptTokensBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - promptTokens_ = value; - onChanged(); - } else { - promptTokensBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - public Builder setPromptTokens( - org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder builderForValue) { - if (promptTokensBuilder_ == null) { - promptTokens_ = builderForValue.build(); - onChanged(); - } else { - promptTokensBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - public Builder mergePromptTokens(org.wso2.apk.enforcer.discovery.api.ValueDetails value) { - if (promptTokensBuilder_ == null) { - if (promptTokens_ != null) { - promptTokens_ = - org.wso2.apk.enforcer.discovery.api.ValueDetails.newBuilder(promptTokens_).mergeFrom(value).buildPartial(); - } else { - promptTokens_ = value; - } - onChanged(); - } else { - promptTokensBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - public Builder clearPromptTokens() { - if (promptTokensBuilder_ == null) { - promptTokens_ = null; - onChanged(); - } else { - promptTokens_ = null; - promptTokensBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder getPromptTokensBuilder() { - - onChanged(); - return getPromptTokensFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getPromptTokensOrBuilder() { - if (promptTokensBuilder_ != null) { - return promptTokensBuilder_.getMessageOrBuilder(); - } else { - return promptTokens_ == null ? - org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : promptTokens_; - } - } - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder> - getPromptTokensFieldBuilder() { - if (promptTokensBuilder_ == null) { - promptTokensBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder>( - getPromptTokens(), - getParentForChildren(), - isClean()); - promptTokens_ = null; - } - return promptTokensBuilder_; - } - - private org.wso2.apk.enforcer.discovery.api.ValueDetails completionToken_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder> completionTokenBuilder_; - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - * @return Whether the completionToken field is set. - */ - public boolean hasCompletionToken() { - return completionTokenBuilder_ != null || completionToken_ != null; - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - * @return The completionToken. - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetails getCompletionToken() { - if (completionTokenBuilder_ == null) { - return completionToken_ == null ? org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : completionToken_; - } else { - return completionTokenBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - public Builder setCompletionToken(org.wso2.apk.enforcer.discovery.api.ValueDetails value) { - if (completionTokenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - completionToken_ = value; - onChanged(); - } else { - completionTokenBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - public Builder setCompletionToken( - org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder builderForValue) { - if (completionTokenBuilder_ == null) { - completionToken_ = builderForValue.build(); - onChanged(); - } else { - completionTokenBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - public Builder mergeCompletionToken(org.wso2.apk.enforcer.discovery.api.ValueDetails value) { - if (completionTokenBuilder_ == null) { - if (completionToken_ != null) { - completionToken_ = - org.wso2.apk.enforcer.discovery.api.ValueDetails.newBuilder(completionToken_).mergeFrom(value).buildPartial(); - } else { - completionToken_ = value; - } - onChanged(); - } else { - completionTokenBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - public Builder clearCompletionToken() { - if (completionTokenBuilder_ == null) { - completionToken_ = null; - onChanged(); - } else { - completionToken_ = null; - completionTokenBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder getCompletionTokenBuilder() { - - onChanged(); - return getCompletionTokenFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getCompletionTokenOrBuilder() { - if (completionTokenBuilder_ != null) { - return completionTokenBuilder_.getMessageOrBuilder(); - } else { - return completionToken_ == null ? - org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : completionToken_; - } - } - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder> - getCompletionTokenFieldBuilder() { - if (completionTokenBuilder_ == null) { - completionTokenBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder>( - getCompletionToken(), - getParentForChildren(), - isClean()); - completionToken_ = null; - } - return completionTokenBuilder_; - } - - private org.wso2.apk.enforcer.discovery.api.ValueDetails totalToken_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder> totalTokenBuilder_; - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - * @return Whether the totalToken field is set. - */ - public boolean hasTotalToken() { - return totalTokenBuilder_ != null || totalToken_ != null; - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - * @return The totalToken. - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetails getTotalToken() { - if (totalTokenBuilder_ == null) { - return totalToken_ == null ? org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : totalToken_; - } else { - return totalTokenBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - public Builder setTotalToken(org.wso2.apk.enforcer.discovery.api.ValueDetails value) { - if (totalTokenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - totalToken_ = value; - onChanged(); - } else { - totalTokenBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - public Builder setTotalToken( - org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder builderForValue) { - if (totalTokenBuilder_ == null) { - totalToken_ = builderForValue.build(); - onChanged(); - } else { - totalTokenBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - public Builder mergeTotalToken(org.wso2.apk.enforcer.discovery.api.ValueDetails value) { - if (totalTokenBuilder_ == null) { - if (totalToken_ != null) { - totalToken_ = - org.wso2.apk.enforcer.discovery.api.ValueDetails.newBuilder(totalToken_).mergeFrom(value).buildPartial(); - } else { - totalToken_ = value; - } - onChanged(); - } else { - totalTokenBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - public Builder clearTotalToken() { - if (totalTokenBuilder_ == null) { - totalToken_ = null; - onChanged(); - } else { - totalToken_ = null; - totalTokenBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder getTotalTokenBuilder() { - - onChanged(); - return getTotalTokenFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - public org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getTotalTokenOrBuilder() { - if (totalTokenBuilder_ != null) { - return totalTokenBuilder_.getMessageOrBuilder(); - } else { - return totalToken_ == null ? - org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance() : totalToken_; - } - } - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder> - getTotalTokenFieldBuilder() { - if (totalTokenBuilder_ == null) { - totalTokenBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.ValueDetails, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder, org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder>( - getTotalToken(), - getParentForChildren(), - isClean()); - totalToken_ = null; - } - return totalTokenBuilder_; - } - - private boolean enabled_ ; - /** - * bool enabled = 8; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 8; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * bool enabled = 8; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = 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.api.AIProvider) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.AIProvider) - private static final org.wso2.apk.enforcer.discovery.api.AIProvider DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.AIProvider(); - } - - public static org.wso2.apk.enforcer.discovery.api.AIProvider getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AIProvider parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AIProvider(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.api.AIProvider getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProviderOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProviderOrBuilder.java deleted file mode 100644 index 1c06e1de95..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProviderOrBuilder.java +++ /dev/null @@ -1,111 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/ai_provider.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface AIProviderOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.AIProvider) - com.google.protobuf.MessageOrBuilder { - - /** - * string providerName = 1; - * @return The providerName. - */ - java.lang.String getProviderName(); - /** - * string providerName = 1; - * @return The bytes for providerName. - */ - com.google.protobuf.ByteString - getProviderNameBytes(); - - /** - * string providerAPIVersion = 2; - * @return The providerAPIVersion. - */ - java.lang.String getProviderAPIVersion(); - /** - * string providerAPIVersion = 2; - * @return The bytes for providerAPIVersion. - */ - com.google.protobuf.ByteString - getProviderAPIVersionBytes(); - - /** - * string organization = 3; - * @return The organization. - */ - java.lang.String getOrganization(); - /** - * string organization = 3; - * @return The bytes for organization. - */ - com.google.protobuf.ByteString - getOrganizationBytes(); - - /** - * .wso2.discovery.api.ValueDetails model = 4; - * @return Whether the model field is set. - */ - boolean hasModel(); - /** - * .wso2.discovery.api.ValueDetails model = 4; - * @return The model. - */ - org.wso2.apk.enforcer.discovery.api.ValueDetails getModel(); - /** - * .wso2.discovery.api.ValueDetails model = 4; - */ - org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getModelOrBuilder(); - - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - * @return Whether the promptTokens field is set. - */ - boolean hasPromptTokens(); - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - * @return The promptTokens. - */ - org.wso2.apk.enforcer.discovery.api.ValueDetails getPromptTokens(); - /** - * .wso2.discovery.api.ValueDetails promptTokens = 5; - */ - org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getPromptTokensOrBuilder(); - - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - * @return Whether the completionToken field is set. - */ - boolean hasCompletionToken(); - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - * @return The completionToken. - */ - org.wso2.apk.enforcer.discovery.api.ValueDetails getCompletionToken(); - /** - * .wso2.discovery.api.ValueDetails completionToken = 6; - */ - org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getCompletionTokenOrBuilder(); - - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - * @return Whether the totalToken field is set. - */ - boolean hasTotalToken(); - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - * @return The totalToken. - */ - org.wso2.apk.enforcer.discovery.api.ValueDetails getTotalToken(); - /** - * .wso2.discovery.api.ValueDetails totalToken = 7; - */ - org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder getTotalTokenOrBuilder(); - - /** - * bool enabled = 8; - * @return The enabled. - */ - boolean getEnabled(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProviderProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProviderProto.java deleted file mode 100644 index 8b97e469aa..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/AIProviderProto.java +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/ai_provider.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class AIProviderProto { - private AIProviderProto() {} - 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_api_AIProvider_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_AIProvider_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_ValueDetails_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_ValueDetails_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n$wso2/discovery/api/ai_provider.proto\022\022" + - "wso2.discovery.api\"\277\002\n\nAIProvider\022\024\n\014pro" + - "viderName\030\001 \001(\t\022\032\n\022providerAPIVersion\030\002 " + - "\001(\t\022\024\n\014organization\030\003 \001(\t\022/\n\005model\030\004 \001(\013" + - "2 .wso2.discovery.api.ValueDetails\0226\n\014pr" + - "omptTokens\030\005 \001(\0132 .wso2.discovery.api.Va" + - "lueDetails\0229\n\017completionToken\030\006 \001(\0132 .ws" + - "o2.discovery.api.ValueDetails\0224\n\ntotalTo" + - "ken\030\007 \001(\0132 .wso2.discovery.api.ValueDeta" + - "ils\022\017\n\007enabled\030\010 \001(\010\")\n\014ValueDetails\022\n\n\002" + - "in\030\001 \001(\t\022\r\n\005value\030\002 \001(\tBw\n#org.wso2.apk." + - "enforcer.discovery.apiB\017AIProviderProtoP" + - "\001Z=github.com/envoyproxy/go-control-plan" + - "e/wso2/discovery/api;apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_api_AIProvider_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_AIProvider_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_AIProvider_descriptor, - new java.lang.String[] { "ProviderName", "ProviderAPIVersion", "Organization", "Model", "PromptTokens", "CompletionToken", "TotalToken", "Enabled", }); - internal_static_wso2_discovery_api_ValueDetails_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_api_ValueDetails_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_ValueDetails_descriptor, - new java.lang.String[] { "In", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthentication.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthentication.java deleted file mode 100644 index 439f65eb75..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthentication.java +++ /dev/null @@ -1,1227 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - * Protobuf type {@code wso2.discovery.api.APIAuthentication} - */ -public final class APIAuthentication extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.APIAuthentication) - APIAuthenticationOrBuilder { -private static final long serialVersionUID = 0L; - // Use APIAuthentication.newBuilder() to construct. - private APIAuthentication(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private APIAuthentication() { - apikey_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new APIAuthentication(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private APIAuthentication( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - disabled_ = input.readBool(); - break; - } - case 18: { - org.wso2.apk.enforcer.discovery.api.JWT.Builder subBuilder = null; - if (jwt_ != null) { - subBuilder = jwt_.toBuilder(); - } - jwt_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.JWT.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(jwt_); - jwt_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - apikey_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - apikey_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.APIKey.parser(), extensionRegistry)); - break; - } - case 34: { - org.wso2.apk.enforcer.discovery.api.Oauth2.Builder subBuilder = null; - if (oauth2_ != null) { - subBuilder = oauth2_.toBuilder(); - } - oauth2_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.Oauth2.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(oauth2_); - oauth2_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - apikey_ = java.util.Collections.unmodifiableList(apikey_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIAuthentication_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIAuthentication_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.APIAuthentication.class, org.wso2.apk.enforcer.discovery.api.APIAuthentication.Builder.class); - } - - public static final int DISABLED_FIELD_NUMBER = 1; - private boolean disabled_; - /** - *
-   * disable authentication
-   * 
- * - * bool disabled = 1; - * @return The disabled. - */ - @java.lang.Override - public boolean getDisabled() { - return disabled_; - } - - public static final int JWT_FIELD_NUMBER = 2; - private org.wso2.apk.enforcer.discovery.api.JWT jwt_; - /** - * .wso2.discovery.api.JWT jwt = 2; - * @return Whether the jwt field is set. - */ - @java.lang.Override - public boolean hasJwt() { - return jwt_ != null; - } - /** - * .wso2.discovery.api.JWT jwt = 2; - * @return The jwt. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.JWT getJwt() { - return jwt_ == null ? org.wso2.apk.enforcer.discovery.api.JWT.getDefaultInstance() : jwt_; - } - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.JWTOrBuilder getJwtOrBuilder() { - return getJwt(); - } - - public static final int APIKEY_FIELD_NUMBER = 3; - private java.util.List apikey_; - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - @java.lang.Override - public java.util.List getApikeyList() { - return apikey_; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - @java.lang.Override - public java.util.List - getApikeyOrBuilderList() { - return apikey_; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - @java.lang.Override - public int getApikeyCount() { - return apikey_.size(); - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIKey getApikey(int index) { - return apikey_.get(index); - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIKeyOrBuilder getApikeyOrBuilder( - int index) { - return apikey_.get(index); - } - - public static final int OAUTH2_FIELD_NUMBER = 4; - private org.wso2.apk.enforcer.discovery.api.Oauth2 oauth2_; - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - * @return Whether the oauth2 field is set. - */ - @java.lang.Override - public boolean hasOauth2() { - return oauth2_ != null; - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - * @return The oauth2. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Oauth2 getOauth2() { - return oauth2_ == null ? org.wso2.apk.enforcer.discovery.api.Oauth2.getDefaultInstance() : oauth2_; - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Oauth2OrBuilder getOauth2OrBuilder() { - return getOauth2(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (disabled_ != false) { - output.writeBool(1, disabled_); - } - if (jwt_ != null) { - output.writeMessage(2, getJwt()); - } - for (int i = 0; i < apikey_.size(); i++) { - output.writeMessage(3, apikey_.get(i)); - } - if (oauth2_ != null) { - output.writeMessage(4, getOauth2()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (disabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, disabled_); - } - if (jwt_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getJwt()); - } - for (int i = 0; i < apikey_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, apikey_.get(i)); - } - if (oauth2_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getOauth2()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.api.APIAuthentication)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.APIAuthentication other = (org.wso2.apk.enforcer.discovery.api.APIAuthentication) obj; - - if (getDisabled() - != other.getDisabled()) return false; - if (hasJwt() != other.hasJwt()) return false; - if (hasJwt()) { - if (!getJwt() - .equals(other.getJwt())) return false; - } - if (!getApikeyList() - .equals(other.getApikeyList())) return false; - if (hasOauth2() != other.hasOauth2()) return false; - if (hasOauth2()) { - if (!getOauth2() - .equals(other.getOauth2())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DISABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDisabled()); - if (hasJwt()) { - hash = (37 * hash) + JWT_FIELD_NUMBER; - hash = (53 * hash) + getJwt().hashCode(); - } - if (getApikeyCount() > 0) { - hash = (37 * hash) + APIKEY_FIELD_NUMBER; - hash = (53 * hash) + getApikeyList().hashCode(); - } - if (hasOauth2()) { - hash = (37 * hash) + OAUTH2_FIELD_NUMBER; - hash = (53 * hash) + getOauth2().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.APIAuthentication parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.APIAuthentication 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.api.APIAuthentication parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.APIAuthentication 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.api.APIAuthentication parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.APIAuthentication 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.api.APIAuthentication parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.APIAuthentication 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.api.APIAuthentication parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.APIAuthentication 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.api.APIAuthentication 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.api.APIAuthentication 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.api.APIAuthentication prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.api.APIAuthentication} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.APIAuthentication) - org.wso2.apk.enforcer.discovery.api.APIAuthenticationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIAuthentication_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIAuthentication_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.APIAuthentication.class, org.wso2.apk.enforcer.discovery.api.APIAuthentication.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.APIAuthentication.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getApikeyFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - disabled_ = false; - - if (jwtBuilder_ == null) { - jwt_ = null; - } else { - jwt_ = null; - jwtBuilder_ = null; - } - if (apikeyBuilder_ == null) { - apikey_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - apikeyBuilder_.clear(); - } - if (oauth2Builder_ == null) { - oauth2_ = null; - } else { - oauth2_ = null; - oauth2Builder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIAuthentication_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIAuthentication getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.APIAuthentication.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIAuthentication build() { - org.wso2.apk.enforcer.discovery.api.APIAuthentication result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIAuthentication buildPartial() { - org.wso2.apk.enforcer.discovery.api.APIAuthentication result = new org.wso2.apk.enforcer.discovery.api.APIAuthentication(this); - int from_bitField0_ = bitField0_; - result.disabled_ = disabled_; - if (jwtBuilder_ == null) { - result.jwt_ = jwt_; - } else { - result.jwt_ = jwtBuilder_.build(); - } - if (apikeyBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - apikey_ = java.util.Collections.unmodifiableList(apikey_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.apikey_ = apikey_; - } else { - result.apikey_ = apikeyBuilder_.build(); - } - if (oauth2Builder_ == null) { - result.oauth2_ = oauth2_; - } else { - result.oauth2_ = oauth2Builder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.APIAuthentication) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.APIAuthentication)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.APIAuthentication other) { - if (other == org.wso2.apk.enforcer.discovery.api.APIAuthentication.getDefaultInstance()) return this; - if (other.getDisabled() != false) { - setDisabled(other.getDisabled()); - } - if (other.hasJwt()) { - mergeJwt(other.getJwt()); - } - if (apikeyBuilder_ == null) { - if (!other.apikey_.isEmpty()) { - if (apikey_.isEmpty()) { - apikey_ = other.apikey_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureApikeyIsMutable(); - apikey_.addAll(other.apikey_); - } - onChanged(); - } - } else { - if (!other.apikey_.isEmpty()) { - if (apikeyBuilder_.isEmpty()) { - apikeyBuilder_.dispose(); - apikeyBuilder_ = null; - apikey_ = other.apikey_; - bitField0_ = (bitField0_ & ~0x00000001); - apikeyBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getApikeyFieldBuilder() : null; - } else { - apikeyBuilder_.addAllMessages(other.apikey_); - } - } - } - if (other.hasOauth2()) { - mergeOauth2(other.getOauth2()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.APIAuthentication parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.APIAuthentication) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private boolean disabled_ ; - /** - *
-     * disable authentication
-     * 
- * - * bool disabled = 1; - * @return The disabled. - */ - @java.lang.Override - public boolean getDisabled() { - return disabled_; - } - /** - *
-     * disable authentication
-     * 
- * - * bool disabled = 1; - * @param value The disabled to set. - * @return This builder for chaining. - */ - public Builder setDisabled(boolean value) { - - disabled_ = value; - onChanged(); - return this; - } - /** - *
-     * disable authentication
-     * 
- * - * bool disabled = 1; - * @return This builder for chaining. - */ - public Builder clearDisabled() { - - disabled_ = false; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.api.JWT jwt_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.JWT, org.wso2.apk.enforcer.discovery.api.JWT.Builder, org.wso2.apk.enforcer.discovery.api.JWTOrBuilder> jwtBuilder_; - /** - * .wso2.discovery.api.JWT jwt = 2; - * @return Whether the jwt field is set. - */ - public boolean hasJwt() { - return jwtBuilder_ != null || jwt_ != null; - } - /** - * .wso2.discovery.api.JWT jwt = 2; - * @return The jwt. - */ - public org.wso2.apk.enforcer.discovery.api.JWT getJwt() { - if (jwtBuilder_ == null) { - return jwt_ == null ? org.wso2.apk.enforcer.discovery.api.JWT.getDefaultInstance() : jwt_; - } else { - return jwtBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - public Builder setJwt(org.wso2.apk.enforcer.discovery.api.JWT value) { - if (jwtBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - jwt_ = value; - onChanged(); - } else { - jwtBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - public Builder setJwt( - org.wso2.apk.enforcer.discovery.api.JWT.Builder builderForValue) { - if (jwtBuilder_ == null) { - jwt_ = builderForValue.build(); - onChanged(); - } else { - jwtBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - public Builder mergeJwt(org.wso2.apk.enforcer.discovery.api.JWT value) { - if (jwtBuilder_ == null) { - if (jwt_ != null) { - jwt_ = - org.wso2.apk.enforcer.discovery.api.JWT.newBuilder(jwt_).mergeFrom(value).buildPartial(); - } else { - jwt_ = value; - } - onChanged(); - } else { - jwtBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - public Builder clearJwt() { - if (jwtBuilder_ == null) { - jwt_ = null; - onChanged(); - } else { - jwt_ = null; - jwtBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - public org.wso2.apk.enforcer.discovery.api.JWT.Builder getJwtBuilder() { - - onChanged(); - return getJwtFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - public org.wso2.apk.enforcer.discovery.api.JWTOrBuilder getJwtOrBuilder() { - if (jwtBuilder_ != null) { - return jwtBuilder_.getMessageOrBuilder(); - } else { - return jwt_ == null ? - org.wso2.apk.enforcer.discovery.api.JWT.getDefaultInstance() : jwt_; - } - } - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.JWT, org.wso2.apk.enforcer.discovery.api.JWT.Builder, org.wso2.apk.enforcer.discovery.api.JWTOrBuilder> - getJwtFieldBuilder() { - if (jwtBuilder_ == null) { - jwtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.JWT, org.wso2.apk.enforcer.discovery.api.JWT.Builder, org.wso2.apk.enforcer.discovery.api.JWTOrBuilder>( - getJwt(), - getParentForChildren(), - isClean()); - jwt_ = null; - } - return jwtBuilder_; - } - - private java.util.List apikey_ = - java.util.Collections.emptyList(); - private void ensureApikeyIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - apikey_ = new java.util.ArrayList(apikey_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.APIKey, org.wso2.apk.enforcer.discovery.api.APIKey.Builder, org.wso2.apk.enforcer.discovery.api.APIKeyOrBuilder> apikeyBuilder_; - - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public java.util.List getApikeyList() { - if (apikeyBuilder_ == null) { - return java.util.Collections.unmodifiableList(apikey_); - } else { - return apikeyBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public int getApikeyCount() { - if (apikeyBuilder_ == null) { - return apikey_.size(); - } else { - return apikeyBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public org.wso2.apk.enforcer.discovery.api.APIKey getApikey(int index) { - if (apikeyBuilder_ == null) { - return apikey_.get(index); - } else { - return apikeyBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder setApikey( - int index, org.wso2.apk.enforcer.discovery.api.APIKey value) { - if (apikeyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureApikeyIsMutable(); - apikey_.set(index, value); - onChanged(); - } else { - apikeyBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder setApikey( - int index, org.wso2.apk.enforcer.discovery.api.APIKey.Builder builderForValue) { - if (apikeyBuilder_ == null) { - ensureApikeyIsMutable(); - apikey_.set(index, builderForValue.build()); - onChanged(); - } else { - apikeyBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder addApikey(org.wso2.apk.enforcer.discovery.api.APIKey value) { - if (apikeyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureApikeyIsMutable(); - apikey_.add(value); - onChanged(); - } else { - apikeyBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder addApikey( - int index, org.wso2.apk.enforcer.discovery.api.APIKey value) { - if (apikeyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureApikeyIsMutable(); - apikey_.add(index, value); - onChanged(); - } else { - apikeyBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder addApikey( - org.wso2.apk.enforcer.discovery.api.APIKey.Builder builderForValue) { - if (apikeyBuilder_ == null) { - ensureApikeyIsMutable(); - apikey_.add(builderForValue.build()); - onChanged(); - } else { - apikeyBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder addApikey( - int index, org.wso2.apk.enforcer.discovery.api.APIKey.Builder builderForValue) { - if (apikeyBuilder_ == null) { - ensureApikeyIsMutable(); - apikey_.add(index, builderForValue.build()); - onChanged(); - } else { - apikeyBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder addAllApikey( - java.lang.Iterable values) { - if (apikeyBuilder_ == null) { - ensureApikeyIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, apikey_); - onChanged(); - } else { - apikeyBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder clearApikey() { - if (apikeyBuilder_ == null) { - apikey_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - apikeyBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public Builder removeApikey(int index) { - if (apikeyBuilder_ == null) { - ensureApikeyIsMutable(); - apikey_.remove(index); - onChanged(); - } else { - apikeyBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public org.wso2.apk.enforcer.discovery.api.APIKey.Builder getApikeyBuilder( - int index) { - return getApikeyFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public org.wso2.apk.enforcer.discovery.api.APIKeyOrBuilder getApikeyOrBuilder( - int index) { - if (apikeyBuilder_ == null) { - return apikey_.get(index); } else { - return apikeyBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public java.util.List - getApikeyOrBuilderList() { - if (apikeyBuilder_ != null) { - return apikeyBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(apikey_); - } - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public org.wso2.apk.enforcer.discovery.api.APIKey.Builder addApikeyBuilder() { - return getApikeyFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.APIKey.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public org.wso2.apk.enforcer.discovery.api.APIKey.Builder addApikeyBuilder( - int index) { - return getApikeyFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.APIKey.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - public java.util.List - getApikeyBuilderList() { - return getApikeyFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.APIKey, org.wso2.apk.enforcer.discovery.api.APIKey.Builder, org.wso2.apk.enforcer.discovery.api.APIKeyOrBuilder> - getApikeyFieldBuilder() { - if (apikeyBuilder_ == null) { - apikeyBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.APIKey, org.wso2.apk.enforcer.discovery.api.APIKey.Builder, org.wso2.apk.enforcer.discovery.api.APIKeyOrBuilder>( - apikey_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - apikey_ = null; - } - return apikeyBuilder_; - } - - private org.wso2.apk.enforcer.discovery.api.Oauth2 oauth2_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Oauth2, org.wso2.apk.enforcer.discovery.api.Oauth2.Builder, org.wso2.apk.enforcer.discovery.api.Oauth2OrBuilder> oauth2Builder_; - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - * @return Whether the oauth2 field is set. - */ - public boolean hasOauth2() { - return oauth2Builder_ != null || oauth2_ != null; - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - * @return The oauth2. - */ - public org.wso2.apk.enforcer.discovery.api.Oauth2 getOauth2() { - if (oauth2Builder_ == null) { - return oauth2_ == null ? org.wso2.apk.enforcer.discovery.api.Oauth2.getDefaultInstance() : oauth2_; - } else { - return oauth2Builder_.getMessage(); - } - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - public Builder setOauth2(org.wso2.apk.enforcer.discovery.api.Oauth2 value) { - if (oauth2Builder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - oauth2_ = value; - onChanged(); - } else { - oauth2Builder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - public Builder setOauth2( - org.wso2.apk.enforcer.discovery.api.Oauth2.Builder builderForValue) { - if (oauth2Builder_ == null) { - oauth2_ = builderForValue.build(); - onChanged(); - } else { - oauth2Builder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - public Builder mergeOauth2(org.wso2.apk.enforcer.discovery.api.Oauth2 value) { - if (oauth2Builder_ == null) { - if (oauth2_ != null) { - oauth2_ = - org.wso2.apk.enforcer.discovery.api.Oauth2.newBuilder(oauth2_).mergeFrom(value).buildPartial(); - } else { - oauth2_ = value; - } - onChanged(); - } else { - oauth2Builder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - public Builder clearOauth2() { - if (oauth2Builder_ == null) { - oauth2_ = null; - onChanged(); - } else { - oauth2_ = null; - oauth2Builder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - public org.wso2.apk.enforcer.discovery.api.Oauth2.Builder getOauth2Builder() { - - onChanged(); - return getOauth2FieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - public org.wso2.apk.enforcer.discovery.api.Oauth2OrBuilder getOauth2OrBuilder() { - if (oauth2Builder_ != null) { - return oauth2Builder_.getMessageOrBuilder(); - } else { - return oauth2_ == null ? - org.wso2.apk.enforcer.discovery.api.Oauth2.getDefaultInstance() : oauth2_; - } - } - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Oauth2, org.wso2.apk.enforcer.discovery.api.Oauth2.Builder, org.wso2.apk.enforcer.discovery.api.Oauth2OrBuilder> - getOauth2FieldBuilder() { - if (oauth2Builder_ == null) { - oauth2Builder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Oauth2, org.wso2.apk.enforcer.discovery.api.Oauth2.Builder, org.wso2.apk.enforcer.discovery.api.Oauth2OrBuilder>( - getOauth2(), - getParentForChildren(), - isClean()); - oauth2_ = null; - } - return oauth2Builder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.api.APIAuthentication) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.APIAuthentication) - private static final org.wso2.apk.enforcer.discovery.api.APIAuthentication DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.APIAuthentication(); - } - - public static org.wso2.apk.enforcer.discovery.api.APIAuthentication getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public APIAuthentication parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new APIAuthentication(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.api.APIAuthentication getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthenticationOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthenticationOrBuilder.java deleted file mode 100644 index 110ea4c817..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthenticationOrBuilder.java +++ /dev/null @@ -1,73 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface APIAuthenticationOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.APIAuthentication) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * disable authentication
-   * 
- * - * bool disabled = 1; - * @return The disabled. - */ - boolean getDisabled(); - - /** - * .wso2.discovery.api.JWT jwt = 2; - * @return Whether the jwt field is set. - */ - boolean hasJwt(); - /** - * .wso2.discovery.api.JWT jwt = 2; - * @return The jwt. - */ - org.wso2.apk.enforcer.discovery.api.JWT getJwt(); - /** - * .wso2.discovery.api.JWT jwt = 2; - */ - org.wso2.apk.enforcer.discovery.api.JWTOrBuilder getJwtOrBuilder(); - - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - java.util.List - getApikeyList(); - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - org.wso2.apk.enforcer.discovery.api.APIKey getApikey(int index); - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - int getApikeyCount(); - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - java.util.List - getApikeyOrBuilderList(); - /** - * repeated .wso2.discovery.api.APIKey apikey = 3; - */ - org.wso2.apk.enforcer.discovery.api.APIKeyOrBuilder getApikeyOrBuilder( - int index); - - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - * @return Whether the oauth2 field is set. - */ - boolean hasOauth2(); - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - * @return The oauth2. - */ - org.wso2.apk.enforcer.discovery.api.Oauth2 getOauth2(); - /** - * .wso2.discovery.api.Oauth2 Oauth2 = 4; - */ - org.wso2.apk.enforcer.discovery.api.Oauth2OrBuilder getOauth2OrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthenticationProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthenticationProto.java deleted file mode 100644 index 9c112c460f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIAuthenticationProto.java +++ /dev/null @@ -1,92 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class APIAuthenticationProto { - private APIAuthenticationProto() {} - 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_api_APIKey_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_APIKey_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_JWT_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_JWT_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_Oauth2_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Oauth2_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_APIAuthentication_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_APIAuthentication_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n+wso2/discovery/api/api_authentication." + - "proto\022\022wso2.discovery.api\"?\n\006APIKey\022\014\n\004n" + - "ame\030\001 \001(\t\022\n\n\002in\030\002 \001(\t\022\033\n\023sendTokenToUpst" + - "ream\030\003 \001(\010\"D\n\003JWT\022\016\n\006header\030\001 \001(\t\022\033\n\023sen" + - "dTokenToUpstream\030\002 \001(\010\022\020\n\010audience\030\003 \003(\t" + - "\"5\n\006Oauth2\022\016\n\006header\030\001 \001(\t\022\033\n\023sendTokenT" + - "oUpstream\030\002 \001(\010\"\243\001\n\021APIAuthentication\022\020\n" + - "\010disabled\030\001 \001(\010\022$\n\003jwt\030\002 \001(\0132\027.wso2.disc" + - "overy.api.JWT\022*\n\006apikey\030\003 \003(\0132\032.wso2.dis" + - "covery.api.APIKey\022*\n\006Oauth2\030\004 \001(\0132\032.wso2" + - ".discovery.api.Oauth2B~\n#org.wso2.apk.en" + - "forcer.discovery.apiB\026APIAuthenticationP" + - "rotoP\001Z=github.com/envoyproxy/go-control" + - "-plane/wso2/discovery/api;apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_api_APIKey_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_APIKey_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_APIKey_descriptor, - new java.lang.String[] { "Name", "In", "SendTokenToUpstream", }); - internal_static_wso2_discovery_api_JWT_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_api_JWT_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_JWT_descriptor, - new java.lang.String[] { "Header", "SendTokenToUpstream", "Audience", }); - internal_static_wso2_discovery_api_Oauth2_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_wso2_discovery_api_Oauth2_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Oauth2_descriptor, - new java.lang.String[] { "Header", "SendTokenToUpstream", }); - internal_static_wso2_discovery_api_APIAuthentication_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_wso2_discovery_api_APIAuthentication_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_APIAuthentication_descriptor, - new java.lang.String[] { "Disabled", "Jwt", "Apikey", "Oauth2", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIKey.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIKey.java deleted file mode 100644 index 0f99198b25..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIKey.java +++ /dev/null @@ -1,840 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * APIKey apikey related configurations
- * 
- * - * Protobuf type {@code wso2.discovery.api.APIKey} - */ -public final class APIKey extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.APIKey) - APIKeyOrBuilder { -private static final long serialVersionUID = 0L; - // Use APIKey.newBuilder() to construct. - private APIKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private APIKey() { - name_ = ""; - in_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new APIKey(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private APIKey( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - in_ = s; - break; - } - case 24: { - - sendTokenToUpstream_ = 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.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIKey_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIKey_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.APIKey.class, org.wso2.apk.enforcer.discovery.api.APIKey.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * name of the security scheme
-   * 
- * - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * name of the security scheme
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int IN_FIELD_NUMBER = 2; - private volatile java.lang.Object in_; - /** - *
-   * location of the API key in request
-   * 
- * - * string in = 2; - * @return The in. - */ - @java.lang.Override - public java.lang.String getIn() { - java.lang.Object ref = in_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - in_ = s; - return s; - } - } - /** - *
-   * location of the API key in request
-   * 
- * - * string in = 2; - * @return The bytes for in. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getInBytes() { - java.lang.Object ref = in_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - in_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SENDTOKENTOUPSTREAM_FIELD_NUMBER = 3; - private boolean sendTokenToUpstream_; - /** - *
-   * send the token to upstream
-   * 
- * - * bool sendTokenToUpstream = 3; - * @return The sendTokenToUpstream. - */ - @java.lang.Override - public boolean getSendTokenToUpstream() { - return sendTokenToUpstream_; - } - - 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 (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getInBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, in_); - } - if (sendTokenToUpstream_ != false) { - output.writeBool(3, sendTokenToUpstream_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getInBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, in_); - } - if (sendTokenToUpstream_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, sendTokenToUpstream_); - } - 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.api.APIKey)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.APIKey other = (org.wso2.apk.enforcer.discovery.api.APIKey) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getIn() - .equals(other.getIn())) return false; - if (getSendTokenToUpstream() - != other.getSendTokenToUpstream()) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + IN_FIELD_NUMBER; - hash = (53 * hash) + getIn().hashCode(); - hash = (37 * hash) + SENDTOKENTOUPSTREAM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSendTokenToUpstream()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.APIKey parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.APIKey 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.api.APIKey parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.APIKey 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.api.APIKey parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.APIKey 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.api.APIKey parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.APIKey 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.api.APIKey parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.APIKey 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.api.APIKey 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.api.APIKey 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.api.APIKey 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; - } - /** - *
-   * APIKey apikey related configurations
-   * 
- * - * Protobuf type {@code wso2.discovery.api.APIKey} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.APIKey) - org.wso2.apk.enforcer.discovery.api.APIKeyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIKey_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIKey_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.APIKey.class, org.wso2.apk.enforcer.discovery.api.APIKey.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.APIKey.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(); - name_ = ""; - - in_ = ""; - - sendTokenToUpstream_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_APIKey_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIKey getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.APIKey.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIKey build() { - org.wso2.apk.enforcer.discovery.api.APIKey result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIKey buildPartial() { - org.wso2.apk.enforcer.discovery.api.APIKey result = new org.wso2.apk.enforcer.discovery.api.APIKey(this); - result.name_ = name_; - result.in_ = in_; - result.sendTokenToUpstream_ = sendTokenToUpstream_; - 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.api.APIKey) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.APIKey)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.APIKey other) { - if (other == org.wso2.apk.enforcer.discovery.api.APIKey.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getIn().isEmpty()) { - in_ = other.in_; - onChanged(); - } - if (other.getSendTokenToUpstream() != false) { - setSendTokenToUpstream(other.getSendTokenToUpstream()); - } - 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.api.APIKey parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.APIKey) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * name of the security scheme
-     * 
- * - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * name of the security scheme
-     * 
- * - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * name of the security scheme
-     * 
- * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * name of the security scheme
-     * 
- * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * name of the security scheme
-     * 
- * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object in_ = ""; - /** - *
-     * location of the API key in request
-     * 
- * - * string in = 2; - * @return The in. - */ - public java.lang.String getIn() { - java.lang.Object ref = in_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - in_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * location of the API key in request
-     * 
- * - * string in = 2; - * @return The bytes for in. - */ - public com.google.protobuf.ByteString - getInBytes() { - java.lang.Object ref = in_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - in_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * location of the API key in request
-     * 
- * - * string in = 2; - * @param value The in to set. - * @return This builder for chaining. - */ - public Builder setIn( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - in_ = value; - onChanged(); - return this; - } - /** - *
-     * location of the API key in request
-     * 
- * - * string in = 2; - * @return This builder for chaining. - */ - public Builder clearIn() { - - in_ = getDefaultInstance().getIn(); - onChanged(); - return this; - } - /** - *
-     * location of the API key in request
-     * 
- * - * string in = 2; - * @param value The bytes for in to set. - * @return This builder for chaining. - */ - public Builder setInBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - in_ = value; - onChanged(); - return this; - } - - private boolean sendTokenToUpstream_ ; - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 3; - * @return The sendTokenToUpstream. - */ - @java.lang.Override - public boolean getSendTokenToUpstream() { - return sendTokenToUpstream_; - } - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 3; - * @param value The sendTokenToUpstream to set. - * @return This builder for chaining. - */ - public Builder setSendTokenToUpstream(boolean value) { - - sendTokenToUpstream_ = value; - onChanged(); - return this; - } - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 3; - * @return This builder for chaining. - */ - public Builder clearSendTokenToUpstream() { - - sendTokenToUpstream_ = 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.api.APIKey) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.APIKey) - private static final org.wso2.apk.enforcer.discovery.api.APIKey DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.APIKey(); - } - - public static org.wso2.apk.enforcer.discovery.api.APIKey getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public APIKey parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new APIKey(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.api.APIKey getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIKeyOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIKeyOrBuilder.java deleted file mode 100644 index aa2dc7ece6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/APIKeyOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface APIKeyOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.APIKey) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * name of the security scheme
-   * 
- * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * name of the security scheme
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * location of the API key in request
-   * 
- * - * string in = 2; - * @return The in. - */ - java.lang.String getIn(); - /** - *
-   * location of the API key in request
-   * 
- * - * string in = 2; - * @return The bytes for in. - */ - com.google.protobuf.ByteString - getInBytes(); - - /** - *
-   * send the token to upstream
-   * 
- * - * bool sendTokenToUpstream = 3; - * @return The sendTokenToUpstream. - */ - boolean getSendTokenToUpstream(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Api.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Api.java deleted file mode 100644 index d728267421..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Api.java +++ /dev/null @@ -1,5094 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * API config model
- * 
- * - * Protobuf type {@code wso2.discovery.api.Api} - */ -public final class Api extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.Api) - ApiOrBuilder { -private static final long serialVersionUID = 0L; - // Use Api.newBuilder() to construct. - private Api(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Api() { - id_ = ""; - title_ = ""; - version_ = ""; - apiType_ = ""; - envType_ = ""; - resources_ = java.util.Collections.emptyList(); - basePath_ = ""; - tier_ = ""; - apiLifeCycleState_ = ""; - vhost_ = ""; - organizationId_ = ""; - clientCertificates_ = java.util.Collections.emptyList(); - mutualSSL_ = ""; - httpRouteIDs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - graphqlComplexityInfo_ = java.util.Collections.emptyList(); - apiDefinitionFile_ = com.google.protobuf.ByteString.EMPTY; - environment_ = ""; - endpointSecurity_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Api(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Api( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - id_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - title_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - version_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - apiType_ = s; - break; - } - case 40: { - - disableAuthentications_ = input.readBool(); - break; - } - case 48: { - - disableScopes_ = input.readBool(); - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - envType_ = s; - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - resources_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - resources_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.Resource.parser(), extensionRegistry)); - break; - } - case 74: { - java.lang.String s = input.readStringRequireUtf8(); - - basePath_ = s; - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - - tier_ = s; - break; - } - case 90: { - java.lang.String s = input.readStringRequireUtf8(); - - apiLifeCycleState_ = s; - break; - } - case 98: { - java.lang.String s = input.readStringRequireUtf8(); - - vhost_ = s; - break; - } - case 106: { - java.lang.String s = input.readStringRequireUtf8(); - - organizationId_ = s; - break; - } - case 114: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - clientCertificates_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - clientCertificates_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.Certificate.parser(), extensionRegistry)); - break; - } - case 122: { - java.lang.String s = input.readStringRequireUtf8(); - - mutualSSL_ = s; - break; - } - case 130: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - applicationSecurity_ = com.google.protobuf.MapField.newMapField( - ApplicationSecurityDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000004; - } - com.google.protobuf.MapEntry - applicationSecurity__ = input.readMessage( - ApplicationSecurityDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - applicationSecurity_.getMutableMap().put( - applicationSecurity__.getKey(), applicationSecurity__.getValue()); - break; - } - case 136: { - - transportSecurity_ = input.readBool(); - break; - } - case 154: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - httpRouteIDs_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000008; - } - httpRouteIDs_.add(s); - break; - } - case 186: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - graphqlComplexityInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - graphqlComplexityInfo_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.parser(), extensionRegistry)); - break; - } - case 192: { - - systemAPI_ = input.readBool(); - break; - } - case 202: { - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.Builder subBuilder = null; - if (backendJWTTokenInfo_ != null) { - subBuilder = backendJWTTokenInfo_.toBuilder(); - } - backendJWTTokenInfo_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(backendJWTTokenInfo_); - backendJWTTokenInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 210: { - - apiDefinitionFile_ = input.readBytes(); - break; - } - case 218: { - java.lang.String s = input.readStringRequireUtf8(); - - environment_ = s; - break; - } - case 224: { - - subscriptionValidation_ = input.readBool(); - break; - } - case 234: { - org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder subBuilder = null; - if (endpoints_ != null) { - subBuilder = endpoints_.toBuilder(); - } - endpoints_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.EndpointCluster.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endpoints_); - endpoints_ = subBuilder.buildPartial(); - } - - break; - } - case 242: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { - endpointSecurity_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - endpointSecurity_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.SecurityInfo.parser(), extensionRegistry)); - break; - } - case 250: { - org.wso2.apk.enforcer.discovery.api.AIProvider.Builder subBuilder = null; - if (aiprovider_ != null) { - subBuilder = aiprovider_.toBuilder(); - } - aiprovider_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.AIProvider.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(aiprovider_); - aiprovider_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - resources_ = java.util.Collections.unmodifiableList(resources_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - clientCertificates_ = java.util.Collections.unmodifiableList(clientCertificates_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - httpRouteIDs_ = httpRouteIDs_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000010) != 0)) { - graphqlComplexityInfo_ = java.util.Collections.unmodifiableList(graphqlComplexityInfo_); - } - if (((mutable_bitField0_ & 0x00000020) != 0)) { - endpointSecurity_ = java.util.Collections.unmodifiableList(endpointSecurity_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ApiProto.internal_static_wso2_discovery_api_Api_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 16: - return internalGetApplicationSecurity(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ApiProto.internal_static_wso2_discovery_api_Api_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Api.class, org.wso2.apk.enforcer.discovery.api.Api.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; - /** - * string id = 1; - * @return The id. - */ - @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } - } - /** - * string id = 1; - * @return The bytes for id. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TITLE_FIELD_NUMBER = 2; - private volatile java.lang.Object title_; - /** - * string title = 2; - * @return The title. - */ - @java.lang.Override - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } - } - /** - * string title = 2; - * @return The bytes for title. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VERSION_FIELD_NUMBER = 3; - private volatile java.lang.Object version_; - /** - * string version = 3; - * @return The version. - */ - @java.lang.Override - public java.lang.String getVersion() { - java.lang.Object ref = version_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - version_ = s; - return s; - } - } - /** - * string version = 3; - * @return The bytes for version. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getVersionBytes() { - java.lang.Object ref = version_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - version_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APITYPE_FIELD_NUMBER = 4; - private volatile java.lang.Object apiType_; - /** - * string apiType = 4; - * @return The apiType. - */ - @java.lang.Override - public java.lang.String getApiType() { - java.lang.Object ref = apiType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - apiType_ = s; - return s; - } - } - /** - * string apiType = 4; - * @return The bytes for apiType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApiTypeBytes() { - java.lang.Object ref = apiType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - apiType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DISABLEAUTHENTICATIONS_FIELD_NUMBER = 5; - private boolean disableAuthentications_; - /** - * bool disableAuthentications = 5; - * @return The disableAuthentications. - */ - @java.lang.Override - public boolean getDisableAuthentications() { - return disableAuthentications_; - } - - public static final int DISABLESCOPES_FIELD_NUMBER = 6; - private boolean disableScopes_; - /** - * bool disableScopes = 6; - * @return The disableScopes. - */ - @java.lang.Override - public boolean getDisableScopes() { - return disableScopes_; - } - - public static final int ENVTYPE_FIELD_NUMBER = 7; - private volatile java.lang.Object envType_; - /** - * string envType = 7; - * @return The envType. - */ - @java.lang.Override - public java.lang.String getEnvType() { - java.lang.Object ref = envType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - envType_ = s; - return s; - } - } - /** - * string envType = 7; - * @return The bytes for envType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEnvTypeBytes() { - java.lang.Object ref = envType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - envType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESOURCES_FIELD_NUMBER = 8; - private java.util.List resources_; - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - @java.lang.Override - public java.util.List getResourcesList() { - return resources_; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - @java.lang.Override - public java.util.List - getResourcesOrBuilderList() { - return resources_; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - @java.lang.Override - public int getResourcesCount() { - return resources_.size(); - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Resource getResources(int index) { - return resources_.get(index); - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ResourceOrBuilder getResourcesOrBuilder( - int index) { - return resources_.get(index); - } - - public static final int BASEPATH_FIELD_NUMBER = 9; - private volatile java.lang.Object basePath_; - /** - * string basePath = 9; - * @return The basePath. - */ - @java.lang.Override - public java.lang.String getBasePath() { - java.lang.Object ref = basePath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - basePath_ = s; - return s; - } - } - /** - * string basePath = 9; - * @return The bytes for basePath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getBasePathBytes() { - java.lang.Object ref = basePath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - basePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIER_FIELD_NUMBER = 10; - private volatile java.lang.Object tier_; - /** - * string tier = 10; - * @return The tier. - */ - @java.lang.Override - public java.lang.String getTier() { - java.lang.Object ref = tier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tier_ = s; - return s; - } - } - /** - * string tier = 10; - * @return The bytes for tier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTierBytes() { - java.lang.Object ref = tier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APILIFECYCLESTATE_FIELD_NUMBER = 11; - private volatile java.lang.Object apiLifeCycleState_; - /** - * string apiLifeCycleState = 11; - * @return The apiLifeCycleState. - */ - @java.lang.Override - public java.lang.String getApiLifeCycleState() { - java.lang.Object ref = apiLifeCycleState_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - apiLifeCycleState_ = s; - return s; - } - } - /** - * string apiLifeCycleState = 11; - * @return The bytes for apiLifeCycleState. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApiLifeCycleStateBytes() { - java.lang.Object ref = apiLifeCycleState_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - apiLifeCycleState_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VHOST_FIELD_NUMBER = 12; - private volatile java.lang.Object vhost_; - /** - * string vhost = 12; - * @return The vhost. - */ - @java.lang.Override - public java.lang.String getVhost() { - java.lang.Object ref = vhost_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - vhost_ = s; - return s; - } - } - /** - * string vhost = 12; - * @return The bytes for vhost. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getVhostBytes() { - java.lang.Object ref = vhost_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - vhost_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATIONID_FIELD_NUMBER = 13; - private volatile java.lang.Object organizationId_; - /** - * string organizationId = 13; - * @return The organizationId. - */ - @java.lang.Override - public java.lang.String getOrganizationId() { - java.lang.Object ref = organizationId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organizationId_ = s; - return s; - } - } - /** - * string organizationId = 13; - * @return The bytes for organizationId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationIdBytes() { - java.lang.Object ref = organizationId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organizationId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLIENTCERTIFICATES_FIELD_NUMBER = 14; - private java.util.List clientCertificates_; - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - @java.lang.Override - public java.util.List getClientCertificatesList() { - return clientCertificates_; - } - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - @java.lang.Override - public java.util.List - getClientCertificatesOrBuilderList() { - return clientCertificates_; - } - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - @java.lang.Override - public int getClientCertificatesCount() { - return clientCertificates_.size(); - } - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Certificate getClientCertificates(int index) { - return clientCertificates_.get(index); - } - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.CertificateOrBuilder getClientCertificatesOrBuilder( - int index) { - return clientCertificates_.get(index); - } - - public static final int MUTUALSSL_FIELD_NUMBER = 15; - private volatile java.lang.Object mutualSSL_; - /** - * string mutualSSL = 15; - * @return The mutualSSL. - */ - @java.lang.Override - public java.lang.String getMutualSSL() { - java.lang.Object ref = mutualSSL_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mutualSSL_ = s; - return s; - } - } - /** - * string mutualSSL = 15; - * @return The bytes for mutualSSL. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getMutualSSLBytes() { - java.lang.Object ref = mutualSSL_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mutualSSL_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APPLICATIONSECURITY_FIELD_NUMBER = 16; - private static final class ApplicationSecurityDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.Boolean> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.api.ApiProto.internal_static_wso2_discovery_api_Api_ApplicationSecurityEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.BOOL, - false); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.Boolean> applicationSecurity_; - private com.google.protobuf.MapField - internalGetApplicationSecurity() { - if (applicationSecurity_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ApplicationSecurityDefaultEntryHolder.defaultEntry); - } - return applicationSecurity_; - } - - public int getApplicationSecurityCount() { - return internalGetApplicationSecurity().getMap().size(); - } - /** - * map<string, bool> applicationSecurity = 16; - */ - - @java.lang.Override - public boolean containsApplicationSecurity( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetApplicationSecurity().getMap().containsKey(key); - } - /** - * Use {@link #getApplicationSecurityMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getApplicationSecurity() { - return getApplicationSecurityMap(); - } - /** - * map<string, bool> applicationSecurity = 16; - */ - @java.lang.Override - - public java.util.Map getApplicationSecurityMap() { - return internalGetApplicationSecurity().getMap(); - } - /** - * map<string, bool> applicationSecurity = 16; - */ - @java.lang.Override - - public boolean getApplicationSecurityOrDefault( - java.lang.String key, - boolean defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetApplicationSecurity().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, bool> applicationSecurity = 16; - */ - @java.lang.Override - - public boolean getApplicationSecurityOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetApplicationSecurity().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int TRANSPORTSECURITY_FIELD_NUMBER = 17; - private boolean transportSecurity_; - /** - * bool transportSecurity = 17; - * @return The transportSecurity. - */ - @java.lang.Override - public boolean getTransportSecurity() { - return transportSecurity_; - } - - public static final int HTTPROUTEIDS_FIELD_NUMBER = 19; - private com.google.protobuf.LazyStringList httpRouteIDs_; - /** - * repeated string httpRouteIDs = 19; - * @return A list containing the httpRouteIDs. - */ - public com.google.protobuf.ProtocolStringList - getHttpRouteIDsList() { - return httpRouteIDs_; - } - /** - * repeated string httpRouteIDs = 19; - * @return The count of httpRouteIDs. - */ - public int getHttpRouteIDsCount() { - return httpRouteIDs_.size(); - } - /** - * repeated string httpRouteIDs = 19; - * @param index The index of the element to return. - * @return The httpRouteIDs at the given index. - */ - public java.lang.String getHttpRouteIDs(int index) { - return httpRouteIDs_.get(index); - } - /** - * repeated string httpRouteIDs = 19; - * @param index The index of the value to return. - * @return The bytes of the httpRouteIDs at the given index. - */ - public com.google.protobuf.ByteString - getHttpRouteIDsBytes(int index) { - return httpRouteIDs_.getByteString(index); - } - - public static final int GRAPHQLCOMPLEXITYINFO_FIELD_NUMBER = 23; - private java.util.List graphqlComplexityInfo_; - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - @java.lang.Override - public java.util.List getGraphqlComplexityInfoList() { - return graphqlComplexityInfo_; - } - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - @java.lang.Override - public java.util.List - getGraphqlComplexityInfoOrBuilderList() { - return graphqlComplexityInfo_; - } - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - @java.lang.Override - public int getGraphqlComplexityInfoCount() { - return graphqlComplexityInfo_.size(); - } - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexity getGraphqlComplexityInfo(int index) { - return graphqlComplexityInfo_.get(index); - } - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexityOrBuilder getGraphqlComplexityInfoOrBuilder( - int index) { - return graphqlComplexityInfo_.get(index); - } - - public static final int SYSTEMAPI_FIELD_NUMBER = 24; - private boolean systemAPI_; - /** - * bool systemAPI = 24; - * @return The systemAPI. - */ - @java.lang.Override - public boolean getSystemAPI() { - return systemAPI_; - } - - public static final int BACKENDJWTTOKENINFO_FIELD_NUMBER = 25; - private org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo_; - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - * @return Whether the backendJWTTokenInfo field is set. - */ - @java.lang.Override - public boolean hasBackendJWTTokenInfo() { - return backendJWTTokenInfo_ != null; - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - * @return The backendJWTTokenInfo. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo getBackendJWTTokenInfo() { - return backendJWTTokenInfo_ == null ? org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.getDefaultInstance() : backendJWTTokenInfo_; - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoOrBuilder getBackendJWTTokenInfoOrBuilder() { - return getBackendJWTTokenInfo(); - } - - public static final int APIDEFINITIONFILE_FIELD_NUMBER = 26; - private com.google.protobuf.ByteString apiDefinitionFile_; - /** - * bytes apiDefinitionFile = 26; - * @return The apiDefinitionFile. - */ - @java.lang.Override - public com.google.protobuf.ByteString getApiDefinitionFile() { - return apiDefinitionFile_; - } - - public static final int ENVIRONMENT_FIELD_NUMBER = 27; - private volatile java.lang.Object environment_; - /** - * string environment = 27; - * @return The environment. - */ - @java.lang.Override - public java.lang.String getEnvironment() { - java.lang.Object ref = environment_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - environment_ = s; - return s; - } - } - /** - * string environment = 27; - * @return The bytes for environment. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEnvironmentBytes() { - java.lang.Object ref = environment_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - environment_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SUBSCRIPTIONVALIDATION_FIELD_NUMBER = 28; - private boolean subscriptionValidation_; - /** - * bool subscriptionValidation = 28; - * @return The subscriptionValidation. - */ - @java.lang.Override - public boolean getSubscriptionValidation() { - return subscriptionValidation_; - } - - public static final int ENDPOINTS_FIELD_NUMBER = 29; - private org.wso2.apk.enforcer.discovery.api.EndpointCluster endpoints_; - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - * @return Whether the endpoints field is set. - */ - @java.lang.Override - public boolean hasEndpoints() { - return endpoints_ != null; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - * @return The endpoints. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointCluster getEndpoints() { - return endpoints_ == null ? org.wso2.apk.enforcer.discovery.api.EndpointCluster.getDefaultInstance() : endpoints_; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder getEndpointsOrBuilder() { - return getEndpoints(); - } - - public static final int ENDPOINTSECURITY_FIELD_NUMBER = 30; - private java.util.List endpointSecurity_; - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - @java.lang.Override - public java.util.List getEndpointSecurityList() { - return endpointSecurity_; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - @java.lang.Override - public java.util.List - getEndpointSecurityOrBuilderList() { - return endpointSecurity_; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - @java.lang.Override - public int getEndpointSecurityCount() { - return endpointSecurity_.size(); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.SecurityInfo getEndpointSecurity(int index) { - return endpointSecurity_.get(index); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder getEndpointSecurityOrBuilder( - int index) { - return endpointSecurity_.get(index); - } - - public static final int AIPROVIDER_FIELD_NUMBER = 31; - private org.wso2.apk.enforcer.discovery.api.AIProvider aiprovider_; - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - * @return Whether the aiprovider field is set. - */ - @java.lang.Override - public boolean hasAiprovider() { - return aiprovider_ != null; - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - * @return The aiprovider. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.AIProvider getAiprovider() { - return aiprovider_ == null ? org.wso2.apk.enforcer.discovery.api.AIProvider.getDefaultInstance() : aiprovider_; - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.AIProviderOrBuilder getAiproviderOrBuilder() { - return getAiprovider(); - } - - 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 (!getIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); - } - if (!getTitleBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); - } - if (!getVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, version_); - } - if (!getApiTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, apiType_); - } - if (disableAuthentications_ != false) { - output.writeBool(5, disableAuthentications_); - } - if (disableScopes_ != false) { - output.writeBool(6, disableScopes_); - } - if (!getEnvTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, envType_); - } - for (int i = 0; i < resources_.size(); i++) { - output.writeMessage(8, resources_.get(i)); - } - if (!getBasePathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, basePath_); - } - if (!getTierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, tier_); - } - if (!getApiLifeCycleStateBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, apiLifeCycleState_); - } - if (!getVhostBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, vhost_); - } - if (!getOrganizationIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, organizationId_); - } - for (int i = 0; i < clientCertificates_.size(); i++) { - output.writeMessage(14, clientCertificates_.get(i)); - } - if (!getMutualSSLBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 15, mutualSSL_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetApplicationSecurity(), - ApplicationSecurityDefaultEntryHolder.defaultEntry, - 16); - if (transportSecurity_ != false) { - output.writeBool(17, transportSecurity_); - } - for (int i = 0; i < httpRouteIDs_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 19, httpRouteIDs_.getRaw(i)); - } - for (int i = 0; i < graphqlComplexityInfo_.size(); i++) { - output.writeMessage(23, graphqlComplexityInfo_.get(i)); - } - if (systemAPI_ != false) { - output.writeBool(24, systemAPI_); - } - if (backendJWTTokenInfo_ != null) { - output.writeMessage(25, getBackendJWTTokenInfo()); - } - if (!apiDefinitionFile_.isEmpty()) { - output.writeBytes(26, apiDefinitionFile_); - } - if (!getEnvironmentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 27, environment_); - } - if (subscriptionValidation_ != false) { - output.writeBool(28, subscriptionValidation_); - } - if (endpoints_ != null) { - output.writeMessage(29, getEndpoints()); - } - for (int i = 0; i < endpointSecurity_.size(); i++) { - output.writeMessage(30, endpointSecurity_.get(i)); - } - if (aiprovider_ != null) { - output.writeMessage(31, getAiprovider()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); - } - if (!getTitleBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); - } - if (!getVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, version_); - } - if (!getApiTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, apiType_); - } - if (disableAuthentications_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, disableAuthentications_); - } - if (disableScopes_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, disableScopes_); - } - if (!getEnvTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, envType_); - } - for (int i = 0; i < resources_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, resources_.get(i)); - } - if (!getBasePathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, basePath_); - } - if (!getTierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, tier_); - } - if (!getApiLifeCycleStateBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, apiLifeCycleState_); - } - if (!getVhostBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, vhost_); - } - if (!getOrganizationIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, organizationId_); - } - for (int i = 0; i < clientCertificates_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, clientCertificates_.get(i)); - } - if (!getMutualSSLBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, mutualSSL_); - } - for (java.util.Map.Entry entry - : internalGetApplicationSecurity().getMap().entrySet()) { - com.google.protobuf.MapEntry - applicationSecurity__ = ApplicationSecurityDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(16, applicationSecurity__); - } - if (transportSecurity_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(17, transportSecurity_); - } - { - int dataSize = 0; - for (int i = 0; i < httpRouteIDs_.size(); i++) { - dataSize += computeStringSizeNoTag(httpRouteIDs_.getRaw(i)); - } - size += dataSize; - size += 2 * getHttpRouteIDsList().size(); - } - for (int i = 0; i < graphqlComplexityInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(23, graphqlComplexityInfo_.get(i)); - } - if (systemAPI_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(24, systemAPI_); - } - if (backendJWTTokenInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(25, getBackendJWTTokenInfo()); - } - if (!apiDefinitionFile_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(26, apiDefinitionFile_); - } - if (!getEnvironmentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, environment_); - } - if (subscriptionValidation_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(28, subscriptionValidation_); - } - if (endpoints_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(29, getEndpoints()); - } - for (int i = 0; i < endpointSecurity_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(30, endpointSecurity_.get(i)); - } - if (aiprovider_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(31, getAiprovider()); - } - 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.api.Api)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.Api other = (org.wso2.apk.enforcer.discovery.api.Api) obj; - - if (!getId() - .equals(other.getId())) return false; - if (!getTitle() - .equals(other.getTitle())) return false; - if (!getVersion() - .equals(other.getVersion())) return false; - if (!getApiType() - .equals(other.getApiType())) return false; - if (getDisableAuthentications() - != other.getDisableAuthentications()) return false; - if (getDisableScopes() - != other.getDisableScopes()) return false; - if (!getEnvType() - .equals(other.getEnvType())) return false; - if (!getResourcesList() - .equals(other.getResourcesList())) return false; - if (!getBasePath() - .equals(other.getBasePath())) return false; - if (!getTier() - .equals(other.getTier())) return false; - if (!getApiLifeCycleState() - .equals(other.getApiLifeCycleState())) return false; - if (!getVhost() - .equals(other.getVhost())) return false; - if (!getOrganizationId() - .equals(other.getOrganizationId())) return false; - if (!getClientCertificatesList() - .equals(other.getClientCertificatesList())) return false; - if (!getMutualSSL() - .equals(other.getMutualSSL())) return false; - if (!internalGetApplicationSecurity().equals( - other.internalGetApplicationSecurity())) return false; - if (getTransportSecurity() - != other.getTransportSecurity()) return false; - if (!getHttpRouteIDsList() - .equals(other.getHttpRouteIDsList())) return false; - if (!getGraphqlComplexityInfoList() - .equals(other.getGraphqlComplexityInfoList())) return false; - if (getSystemAPI() - != other.getSystemAPI()) return false; - if (hasBackendJWTTokenInfo() != other.hasBackendJWTTokenInfo()) return false; - if (hasBackendJWTTokenInfo()) { - if (!getBackendJWTTokenInfo() - .equals(other.getBackendJWTTokenInfo())) return false; - } - if (!getApiDefinitionFile() - .equals(other.getApiDefinitionFile())) return false; - if (!getEnvironment() - .equals(other.getEnvironment())) return false; - if (getSubscriptionValidation() - != other.getSubscriptionValidation()) return false; - if (hasEndpoints() != other.hasEndpoints()) return false; - if (hasEndpoints()) { - if (!getEndpoints() - .equals(other.getEndpoints())) return false; - } - if (!getEndpointSecurityList() - .equals(other.getEndpointSecurityList())) return false; - if (hasAiprovider() != other.hasAiprovider()) return false; - if (hasAiprovider()) { - if (!getAiprovider() - .equals(other.getAiprovider())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + TITLE_FIELD_NUMBER; - hash = (53 * hash) + getTitle().hashCode(); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion().hashCode(); - hash = (37 * hash) + APITYPE_FIELD_NUMBER; - hash = (53 * hash) + getApiType().hashCode(); - hash = (37 * hash) + DISABLEAUTHENTICATIONS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDisableAuthentications()); - hash = (37 * hash) + DISABLESCOPES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDisableScopes()); - hash = (37 * hash) + ENVTYPE_FIELD_NUMBER; - hash = (53 * hash) + getEnvType().hashCode(); - if (getResourcesCount() > 0) { - hash = (37 * hash) + RESOURCES_FIELD_NUMBER; - hash = (53 * hash) + getResourcesList().hashCode(); - } - hash = (37 * hash) + BASEPATH_FIELD_NUMBER; - hash = (53 * hash) + getBasePath().hashCode(); - hash = (37 * hash) + TIER_FIELD_NUMBER; - hash = (53 * hash) + getTier().hashCode(); - hash = (37 * hash) + APILIFECYCLESTATE_FIELD_NUMBER; - hash = (53 * hash) + getApiLifeCycleState().hashCode(); - hash = (37 * hash) + VHOST_FIELD_NUMBER; - hash = (53 * hash) + getVhost().hashCode(); - hash = (37 * hash) + ORGANIZATIONID_FIELD_NUMBER; - hash = (53 * hash) + getOrganizationId().hashCode(); - if (getClientCertificatesCount() > 0) { - hash = (37 * hash) + CLIENTCERTIFICATES_FIELD_NUMBER; - hash = (53 * hash) + getClientCertificatesList().hashCode(); - } - hash = (37 * hash) + MUTUALSSL_FIELD_NUMBER; - hash = (53 * hash) + getMutualSSL().hashCode(); - if (!internalGetApplicationSecurity().getMap().isEmpty()) { - hash = (37 * hash) + APPLICATIONSECURITY_FIELD_NUMBER; - hash = (53 * hash) + internalGetApplicationSecurity().hashCode(); - } - hash = (37 * hash) + TRANSPORTSECURITY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getTransportSecurity()); - if (getHttpRouteIDsCount() > 0) { - hash = (37 * hash) + HTTPROUTEIDS_FIELD_NUMBER; - hash = (53 * hash) + getHttpRouteIDsList().hashCode(); - } - if (getGraphqlComplexityInfoCount() > 0) { - hash = (37 * hash) + GRAPHQLCOMPLEXITYINFO_FIELD_NUMBER; - hash = (53 * hash) + getGraphqlComplexityInfoList().hashCode(); - } - hash = (37 * hash) + SYSTEMAPI_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSystemAPI()); - if (hasBackendJWTTokenInfo()) { - hash = (37 * hash) + BACKENDJWTTOKENINFO_FIELD_NUMBER; - hash = (53 * hash) + getBackendJWTTokenInfo().hashCode(); - } - hash = (37 * hash) + APIDEFINITIONFILE_FIELD_NUMBER; - hash = (53 * hash) + getApiDefinitionFile().hashCode(); - hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; - hash = (53 * hash) + getEnvironment().hashCode(); - hash = (37 * hash) + SUBSCRIPTIONVALIDATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSubscriptionValidation()); - if (hasEndpoints()) { - hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; - hash = (53 * hash) + getEndpoints().hashCode(); - } - if (getEndpointSecurityCount() > 0) { - hash = (37 * hash) + ENDPOINTSECURITY_FIELD_NUMBER; - hash = (53 * hash) + getEndpointSecurityList().hashCode(); - } - if (hasAiprovider()) { - hash = (37 * hash) + AIPROVIDER_FIELD_NUMBER; - hash = (53 * hash) + getAiprovider().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.Api parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Api 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.api.Api parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Api 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.api.Api parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Api 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.api.Api parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Api 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.api.Api parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Api 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.api.Api 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.api.Api 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.api.Api 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; - } - /** - *
-   * API config model
-   * 
- * - * Protobuf type {@code wso2.discovery.api.Api} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.Api) - org.wso2.apk.enforcer.discovery.api.ApiOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ApiProto.internal_static_wso2_discovery_api_Api_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 16: - return internalGetApplicationSecurity(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 16: - return internalGetMutableApplicationSecurity(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ApiProto.internal_static_wso2_discovery_api_Api_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Api.class, org.wso2.apk.enforcer.discovery.api.Api.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.Api.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResourcesFieldBuilder(); - getClientCertificatesFieldBuilder(); - getGraphqlComplexityInfoFieldBuilder(); - getEndpointSecurityFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = ""; - - title_ = ""; - - version_ = ""; - - apiType_ = ""; - - disableAuthentications_ = false; - - disableScopes_ = false; - - envType_ = ""; - - if (resourcesBuilder_ == null) { - resources_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resourcesBuilder_.clear(); - } - basePath_ = ""; - - tier_ = ""; - - apiLifeCycleState_ = ""; - - vhost_ = ""; - - organizationId_ = ""; - - if (clientCertificatesBuilder_ == null) { - clientCertificates_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - clientCertificatesBuilder_.clear(); - } - mutualSSL_ = ""; - - internalGetMutableApplicationSecurity().clear(); - transportSecurity_ = false; - - httpRouteIDs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - if (graphqlComplexityInfoBuilder_ == null) { - graphqlComplexityInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - } else { - graphqlComplexityInfoBuilder_.clear(); - } - systemAPI_ = false; - - if (backendJWTTokenInfoBuilder_ == null) { - backendJWTTokenInfo_ = null; - } else { - backendJWTTokenInfo_ = null; - backendJWTTokenInfoBuilder_ = null; - } - apiDefinitionFile_ = com.google.protobuf.ByteString.EMPTY; - - environment_ = ""; - - subscriptionValidation_ = false; - - if (endpointsBuilder_ == null) { - endpoints_ = null; - } else { - endpoints_ = null; - endpointsBuilder_ = null; - } - if (endpointSecurityBuilder_ == null) { - endpointSecurity_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - } else { - endpointSecurityBuilder_.clear(); - } - if (aiproviderBuilder_ == null) { - aiprovider_ = null; - } else { - aiprovider_ = null; - aiproviderBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.ApiProto.internal_static_wso2_discovery_api_Api_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Api getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.Api.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Api build() { - org.wso2.apk.enforcer.discovery.api.Api result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Api buildPartial() { - org.wso2.apk.enforcer.discovery.api.Api result = new org.wso2.apk.enforcer.discovery.api.Api(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - result.title_ = title_; - result.version_ = version_; - result.apiType_ = apiType_; - result.disableAuthentications_ = disableAuthentications_; - result.disableScopes_ = disableScopes_; - result.envType_ = envType_; - if (resourcesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - resources_ = java.util.Collections.unmodifiableList(resources_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.resources_ = resources_; - } else { - result.resources_ = resourcesBuilder_.build(); - } - result.basePath_ = basePath_; - result.tier_ = tier_; - result.apiLifeCycleState_ = apiLifeCycleState_; - result.vhost_ = vhost_; - result.organizationId_ = organizationId_; - if (clientCertificatesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - clientCertificates_ = java.util.Collections.unmodifiableList(clientCertificates_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.clientCertificates_ = clientCertificates_; - } else { - result.clientCertificates_ = clientCertificatesBuilder_.build(); - } - result.mutualSSL_ = mutualSSL_; - result.applicationSecurity_ = internalGetApplicationSecurity(); - result.applicationSecurity_.makeImmutable(); - result.transportSecurity_ = transportSecurity_; - if (((bitField0_ & 0x00000008) != 0)) { - httpRouteIDs_ = httpRouteIDs_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.httpRouteIDs_ = httpRouteIDs_; - if (graphqlComplexityInfoBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0)) { - graphqlComplexityInfo_ = java.util.Collections.unmodifiableList(graphqlComplexityInfo_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.graphqlComplexityInfo_ = graphqlComplexityInfo_; - } else { - result.graphqlComplexityInfo_ = graphqlComplexityInfoBuilder_.build(); - } - result.systemAPI_ = systemAPI_; - if (backendJWTTokenInfoBuilder_ == null) { - result.backendJWTTokenInfo_ = backendJWTTokenInfo_; - } else { - result.backendJWTTokenInfo_ = backendJWTTokenInfoBuilder_.build(); - } - result.apiDefinitionFile_ = apiDefinitionFile_; - result.environment_ = environment_; - result.subscriptionValidation_ = subscriptionValidation_; - if (endpointsBuilder_ == null) { - result.endpoints_ = endpoints_; - } else { - result.endpoints_ = endpointsBuilder_.build(); - } - if (endpointSecurityBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0)) { - endpointSecurity_ = java.util.Collections.unmodifiableList(endpointSecurity_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.endpointSecurity_ = endpointSecurity_; - } else { - result.endpointSecurity_ = endpointSecurityBuilder_.build(); - } - if (aiproviderBuilder_ == null) { - result.aiprovider_ = aiprovider_; - } else { - result.aiprovider_ = aiproviderBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.Api) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.Api)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.Api other) { - if (other == org.wso2.apk.enforcer.discovery.api.Api.getDefaultInstance()) return this; - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (!other.getTitle().isEmpty()) { - title_ = other.title_; - onChanged(); - } - if (!other.getVersion().isEmpty()) { - version_ = other.version_; - onChanged(); - } - if (!other.getApiType().isEmpty()) { - apiType_ = other.apiType_; - onChanged(); - } - if (other.getDisableAuthentications() != false) { - setDisableAuthentications(other.getDisableAuthentications()); - } - if (other.getDisableScopes() != false) { - setDisableScopes(other.getDisableScopes()); - } - if (!other.getEnvType().isEmpty()) { - envType_ = other.envType_; - onChanged(); - } - if (resourcesBuilder_ == null) { - if (!other.resources_.isEmpty()) { - if (resources_.isEmpty()) { - resources_ = other.resources_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResourcesIsMutable(); - resources_.addAll(other.resources_); - } - onChanged(); - } - } else { - if (!other.resources_.isEmpty()) { - if (resourcesBuilder_.isEmpty()) { - resourcesBuilder_.dispose(); - resourcesBuilder_ = null; - resources_ = other.resources_; - bitField0_ = (bitField0_ & ~0x00000001); - resourcesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResourcesFieldBuilder() : null; - } else { - resourcesBuilder_.addAllMessages(other.resources_); - } - } - } - if (!other.getBasePath().isEmpty()) { - basePath_ = other.basePath_; - onChanged(); - } - if (!other.getTier().isEmpty()) { - tier_ = other.tier_; - onChanged(); - } - if (!other.getApiLifeCycleState().isEmpty()) { - apiLifeCycleState_ = other.apiLifeCycleState_; - onChanged(); - } - if (!other.getVhost().isEmpty()) { - vhost_ = other.vhost_; - onChanged(); - } - if (!other.getOrganizationId().isEmpty()) { - organizationId_ = other.organizationId_; - onChanged(); - } - if (clientCertificatesBuilder_ == null) { - if (!other.clientCertificates_.isEmpty()) { - if (clientCertificates_.isEmpty()) { - clientCertificates_ = other.clientCertificates_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureClientCertificatesIsMutable(); - clientCertificates_.addAll(other.clientCertificates_); - } - onChanged(); - } - } else { - if (!other.clientCertificates_.isEmpty()) { - if (clientCertificatesBuilder_.isEmpty()) { - clientCertificatesBuilder_.dispose(); - clientCertificatesBuilder_ = null; - clientCertificates_ = other.clientCertificates_; - bitField0_ = (bitField0_ & ~0x00000002); - clientCertificatesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getClientCertificatesFieldBuilder() : null; - } else { - clientCertificatesBuilder_.addAllMessages(other.clientCertificates_); - } - } - } - if (!other.getMutualSSL().isEmpty()) { - mutualSSL_ = other.mutualSSL_; - onChanged(); - } - internalGetMutableApplicationSecurity().mergeFrom( - other.internalGetApplicationSecurity()); - if (other.getTransportSecurity() != false) { - setTransportSecurity(other.getTransportSecurity()); - } - if (!other.httpRouteIDs_.isEmpty()) { - if (httpRouteIDs_.isEmpty()) { - httpRouteIDs_ = other.httpRouteIDs_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureHttpRouteIDsIsMutable(); - httpRouteIDs_.addAll(other.httpRouteIDs_); - } - onChanged(); - } - if (graphqlComplexityInfoBuilder_ == null) { - if (!other.graphqlComplexityInfo_.isEmpty()) { - if (graphqlComplexityInfo_.isEmpty()) { - graphqlComplexityInfo_ = other.graphqlComplexityInfo_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureGraphqlComplexityInfoIsMutable(); - graphqlComplexityInfo_.addAll(other.graphqlComplexityInfo_); - } - onChanged(); - } - } else { - if (!other.graphqlComplexityInfo_.isEmpty()) { - if (graphqlComplexityInfoBuilder_.isEmpty()) { - graphqlComplexityInfoBuilder_.dispose(); - graphqlComplexityInfoBuilder_ = null; - graphqlComplexityInfo_ = other.graphqlComplexityInfo_; - bitField0_ = (bitField0_ & ~0x00000010); - graphqlComplexityInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getGraphqlComplexityInfoFieldBuilder() : null; - } else { - graphqlComplexityInfoBuilder_.addAllMessages(other.graphqlComplexityInfo_); - } - } - } - if (other.getSystemAPI() != false) { - setSystemAPI(other.getSystemAPI()); - } - if (other.hasBackendJWTTokenInfo()) { - mergeBackendJWTTokenInfo(other.getBackendJWTTokenInfo()); - } - if (other.getApiDefinitionFile() != com.google.protobuf.ByteString.EMPTY) { - setApiDefinitionFile(other.getApiDefinitionFile()); - } - if (!other.getEnvironment().isEmpty()) { - environment_ = other.environment_; - onChanged(); - } - if (other.getSubscriptionValidation() != false) { - setSubscriptionValidation(other.getSubscriptionValidation()); - } - if (other.hasEndpoints()) { - mergeEndpoints(other.getEndpoints()); - } - if (endpointSecurityBuilder_ == null) { - if (!other.endpointSecurity_.isEmpty()) { - if (endpointSecurity_.isEmpty()) { - endpointSecurity_ = other.endpointSecurity_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.addAll(other.endpointSecurity_); - } - onChanged(); - } - } else { - if (!other.endpointSecurity_.isEmpty()) { - if (endpointSecurityBuilder_.isEmpty()) { - endpointSecurityBuilder_.dispose(); - endpointSecurityBuilder_ = null; - endpointSecurity_ = other.endpointSecurity_; - bitField0_ = (bitField0_ & ~0x00000020); - endpointSecurityBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEndpointSecurityFieldBuilder() : null; - } else { - endpointSecurityBuilder_.addAllMessages(other.endpointSecurity_); - } - } - } - if (other.hasAiprovider()) { - mergeAiprovider(other.getAiprovider()); - } - 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.api.Api parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.Api) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object id_ = ""; - /** - * string id = 1; - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string id = 1; - * @return The bytes for id. - */ - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string id = 1; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - id_ = value; - onChanged(); - return this; - } - /** - * string id = 1; - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - * string id = 1; - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; - } - - private java.lang.Object title_ = ""; - /** - * string title = 2; - * @return The title. - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string title = 2; - * @return The bytes for title. - */ - public com.google.protobuf.ByteString - getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string title = 2; - * @param value The title to set. - * @return This builder for chaining. - */ - public Builder setTitle( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - title_ = value; - onChanged(); - return this; - } - /** - * string title = 2; - * @return This builder for chaining. - */ - public Builder clearTitle() { - - title_ = getDefaultInstance().getTitle(); - onChanged(); - return this; - } - /** - * string title = 2; - * @param value The bytes for title to set. - * @return This builder for chaining. - */ - public Builder setTitleBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - title_ = value; - onChanged(); - return this; - } - - private java.lang.Object version_ = ""; - /** - * string version = 3; - * @return The version. - */ - public java.lang.String getVersion() { - java.lang.Object ref = version_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - version_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string version = 3; - * @return The bytes for version. - */ - public com.google.protobuf.ByteString - getVersionBytes() { - java.lang.Object ref = version_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - version_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string version = 3; - * @param value The version to set. - * @return This builder for chaining. - */ - public Builder setVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - version_ = value; - onChanged(); - return this; - } - /** - * string version = 3; - * @return This builder for chaining. - */ - public Builder clearVersion() { - - version_ = getDefaultInstance().getVersion(); - onChanged(); - return this; - } - /** - * string version = 3; - * @param value The bytes for version to set. - * @return This builder for chaining. - */ - public Builder setVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - version_ = value; - onChanged(); - return this; - } - - private java.lang.Object apiType_ = ""; - /** - * string apiType = 4; - * @return The apiType. - */ - public java.lang.String getApiType() { - java.lang.Object ref = apiType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - apiType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string apiType = 4; - * @return The bytes for apiType. - */ - public com.google.protobuf.ByteString - getApiTypeBytes() { - java.lang.Object ref = apiType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - apiType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string apiType = 4; - * @param value The apiType to set. - * @return This builder for chaining. - */ - public Builder setApiType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - apiType_ = value; - onChanged(); - return this; - } - /** - * string apiType = 4; - * @return This builder for chaining. - */ - public Builder clearApiType() { - - apiType_ = getDefaultInstance().getApiType(); - onChanged(); - return this; - } - /** - * string apiType = 4; - * @param value The bytes for apiType to set. - * @return This builder for chaining. - */ - public Builder setApiTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - apiType_ = value; - onChanged(); - return this; - } - - private boolean disableAuthentications_ ; - /** - * bool disableAuthentications = 5; - * @return The disableAuthentications. - */ - @java.lang.Override - public boolean getDisableAuthentications() { - return disableAuthentications_; - } - /** - * bool disableAuthentications = 5; - * @param value The disableAuthentications to set. - * @return This builder for chaining. - */ - public Builder setDisableAuthentications(boolean value) { - - disableAuthentications_ = value; - onChanged(); - return this; - } - /** - * bool disableAuthentications = 5; - * @return This builder for chaining. - */ - public Builder clearDisableAuthentications() { - - disableAuthentications_ = false; - onChanged(); - return this; - } - - private boolean disableScopes_ ; - /** - * bool disableScopes = 6; - * @return The disableScopes. - */ - @java.lang.Override - public boolean getDisableScopes() { - return disableScopes_; - } - /** - * bool disableScopes = 6; - * @param value The disableScopes to set. - * @return This builder for chaining. - */ - public Builder setDisableScopes(boolean value) { - - disableScopes_ = value; - onChanged(); - return this; - } - /** - * bool disableScopes = 6; - * @return This builder for chaining. - */ - public Builder clearDisableScopes() { - - disableScopes_ = false; - onChanged(); - return this; - } - - private java.lang.Object envType_ = ""; - /** - * string envType = 7; - * @return The envType. - */ - public java.lang.String getEnvType() { - java.lang.Object ref = envType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - envType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string envType = 7; - * @return The bytes for envType. - */ - public com.google.protobuf.ByteString - getEnvTypeBytes() { - java.lang.Object ref = envType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - envType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string envType = 7; - * @param value The envType to set. - * @return This builder for chaining. - */ - public Builder setEnvType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - envType_ = value; - onChanged(); - return this; - } - /** - * string envType = 7; - * @return This builder for chaining. - */ - public Builder clearEnvType() { - - envType_ = getDefaultInstance().getEnvType(); - onChanged(); - return this; - } - /** - * string envType = 7; - * @param value The bytes for envType to set. - * @return This builder for chaining. - */ - public Builder setEnvTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - envType_ = value; - onChanged(); - return this; - } - - private java.util.List resources_ = - java.util.Collections.emptyList(); - private void ensureResourcesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - resources_ = new java.util.ArrayList(resources_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Resource, org.wso2.apk.enforcer.discovery.api.Resource.Builder, org.wso2.apk.enforcer.discovery.api.ResourceOrBuilder> resourcesBuilder_; - - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public java.util.List getResourcesList() { - if (resourcesBuilder_ == null) { - return java.util.Collections.unmodifiableList(resources_); - } else { - return resourcesBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public int getResourcesCount() { - if (resourcesBuilder_ == null) { - return resources_.size(); - } else { - return resourcesBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public org.wso2.apk.enforcer.discovery.api.Resource getResources(int index) { - if (resourcesBuilder_ == null) { - return resources_.get(index); - } else { - return resourcesBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder setResources( - int index, org.wso2.apk.enforcer.discovery.api.Resource value) { - if (resourcesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.set(index, value); - onChanged(); - } else { - resourcesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder setResources( - int index, org.wso2.apk.enforcer.discovery.api.Resource.Builder builderForValue) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - resources_.set(index, builderForValue.build()); - onChanged(); - } else { - resourcesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder addResources(org.wso2.apk.enforcer.discovery.api.Resource value) { - if (resourcesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.add(value); - onChanged(); - } else { - resourcesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder addResources( - int index, org.wso2.apk.enforcer.discovery.api.Resource value) { - if (resourcesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.add(index, value); - onChanged(); - } else { - resourcesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder addResources( - org.wso2.apk.enforcer.discovery.api.Resource.Builder builderForValue) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - resources_.add(builderForValue.build()); - onChanged(); - } else { - resourcesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder addResources( - int index, org.wso2.apk.enforcer.discovery.api.Resource.Builder builderForValue) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - resources_.add(index, builderForValue.build()); - onChanged(); - } else { - resourcesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder addAllResources( - java.lang.Iterable values) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, resources_); - onChanged(); - } else { - resourcesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder clearResources() { - if (resourcesBuilder_ == null) { - resources_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resourcesBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public Builder removeResources(int index) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - resources_.remove(index); - onChanged(); - } else { - resourcesBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public org.wso2.apk.enforcer.discovery.api.Resource.Builder getResourcesBuilder( - int index) { - return getResourcesFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public org.wso2.apk.enforcer.discovery.api.ResourceOrBuilder getResourcesOrBuilder( - int index) { - if (resourcesBuilder_ == null) { - return resources_.get(index); } else { - return resourcesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public java.util.List - getResourcesOrBuilderList() { - if (resourcesBuilder_ != null) { - return resourcesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(resources_); - } - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public org.wso2.apk.enforcer.discovery.api.Resource.Builder addResourcesBuilder() { - return getResourcesFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.Resource.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public org.wso2.apk.enforcer.discovery.api.Resource.Builder addResourcesBuilder( - int index) { - return getResourcesFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.Resource.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - public java.util.List - getResourcesBuilderList() { - return getResourcesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Resource, org.wso2.apk.enforcer.discovery.api.Resource.Builder, org.wso2.apk.enforcer.discovery.api.ResourceOrBuilder> - getResourcesFieldBuilder() { - if (resourcesBuilder_ == null) { - resourcesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Resource, org.wso2.apk.enforcer.discovery.api.Resource.Builder, org.wso2.apk.enforcer.discovery.api.ResourceOrBuilder>( - resources_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - resources_ = null; - } - return resourcesBuilder_; - } - - private java.lang.Object basePath_ = ""; - /** - * string basePath = 9; - * @return The basePath. - */ - public java.lang.String getBasePath() { - java.lang.Object ref = basePath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - basePath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string basePath = 9; - * @return The bytes for basePath. - */ - public com.google.protobuf.ByteString - getBasePathBytes() { - java.lang.Object ref = basePath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - basePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string basePath = 9; - * @param value The basePath to set. - * @return This builder for chaining. - */ - public Builder setBasePath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - basePath_ = value; - onChanged(); - return this; - } - /** - * string basePath = 9; - * @return This builder for chaining. - */ - public Builder clearBasePath() { - - basePath_ = getDefaultInstance().getBasePath(); - onChanged(); - return this; - } - /** - * string basePath = 9; - * @param value The bytes for basePath to set. - * @return This builder for chaining. - */ - public Builder setBasePathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - basePath_ = value; - onChanged(); - return this; - } - - private java.lang.Object tier_ = ""; - /** - * string tier = 10; - * @return The tier. - */ - public java.lang.String getTier() { - java.lang.Object ref = tier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string tier = 10; - * @return The bytes for tier. - */ - public com.google.protobuf.ByteString - getTierBytes() { - java.lang.Object ref = tier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string tier = 10; - * @param value The tier to set. - * @return This builder for chaining. - */ - public Builder setTier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tier_ = value; - onChanged(); - return this; - } - /** - * string tier = 10; - * @return This builder for chaining. - */ - public Builder clearTier() { - - tier_ = getDefaultInstance().getTier(); - onChanged(); - return this; - } - /** - * string tier = 10; - * @param value The bytes for tier to set. - * @return This builder for chaining. - */ - public Builder setTierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tier_ = value; - onChanged(); - return this; - } - - private java.lang.Object apiLifeCycleState_ = ""; - /** - * string apiLifeCycleState = 11; - * @return The apiLifeCycleState. - */ - public java.lang.String getApiLifeCycleState() { - java.lang.Object ref = apiLifeCycleState_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - apiLifeCycleState_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string apiLifeCycleState = 11; - * @return The bytes for apiLifeCycleState. - */ - public com.google.protobuf.ByteString - getApiLifeCycleStateBytes() { - java.lang.Object ref = apiLifeCycleState_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - apiLifeCycleState_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string apiLifeCycleState = 11; - * @param value The apiLifeCycleState to set. - * @return This builder for chaining. - */ - public Builder setApiLifeCycleState( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - apiLifeCycleState_ = value; - onChanged(); - return this; - } - /** - * string apiLifeCycleState = 11; - * @return This builder for chaining. - */ - public Builder clearApiLifeCycleState() { - - apiLifeCycleState_ = getDefaultInstance().getApiLifeCycleState(); - onChanged(); - return this; - } - /** - * string apiLifeCycleState = 11; - * @param value The bytes for apiLifeCycleState to set. - * @return This builder for chaining. - */ - public Builder setApiLifeCycleStateBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - apiLifeCycleState_ = value; - onChanged(); - return this; - } - - private java.lang.Object vhost_ = ""; - /** - * string vhost = 12; - * @return The vhost. - */ - public java.lang.String getVhost() { - java.lang.Object ref = vhost_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - vhost_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string vhost = 12; - * @return The bytes for vhost. - */ - public com.google.protobuf.ByteString - getVhostBytes() { - java.lang.Object ref = vhost_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - vhost_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string vhost = 12; - * @param value The vhost to set. - * @return This builder for chaining. - */ - public Builder setVhost( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - vhost_ = value; - onChanged(); - return this; - } - /** - * string vhost = 12; - * @return This builder for chaining. - */ - public Builder clearVhost() { - - vhost_ = getDefaultInstance().getVhost(); - onChanged(); - return this; - } - /** - * string vhost = 12; - * @param value The bytes for vhost to set. - * @return This builder for chaining. - */ - public Builder setVhostBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - vhost_ = value; - onChanged(); - return this; - } - - private java.lang.Object organizationId_ = ""; - /** - * string organizationId = 13; - * @return The organizationId. - */ - public java.lang.String getOrganizationId() { - java.lang.Object ref = organizationId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organizationId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organizationId = 13; - * @return The bytes for organizationId. - */ - public com.google.protobuf.ByteString - getOrganizationIdBytes() { - java.lang.Object ref = organizationId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organizationId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organizationId = 13; - * @param value The organizationId to set. - * @return This builder for chaining. - */ - public Builder setOrganizationId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organizationId_ = value; - onChanged(); - return this; - } - /** - * string organizationId = 13; - * @return This builder for chaining. - */ - public Builder clearOrganizationId() { - - organizationId_ = getDefaultInstance().getOrganizationId(); - onChanged(); - return this; - } - /** - * string organizationId = 13; - * @param value The bytes for organizationId to set. - * @return This builder for chaining. - */ - public Builder setOrganizationIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organizationId_ = value; - onChanged(); - return this; - } - - private java.util.List clientCertificates_ = - java.util.Collections.emptyList(); - private void ensureClientCertificatesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - clientCertificates_ = new java.util.ArrayList(clientCertificates_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Certificate, org.wso2.apk.enforcer.discovery.api.Certificate.Builder, org.wso2.apk.enforcer.discovery.api.CertificateOrBuilder> clientCertificatesBuilder_; - - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public java.util.List getClientCertificatesList() { - if (clientCertificatesBuilder_ == null) { - return java.util.Collections.unmodifiableList(clientCertificates_); - } else { - return clientCertificatesBuilder_.getMessageList(); - } - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public int getClientCertificatesCount() { - if (clientCertificatesBuilder_ == null) { - return clientCertificates_.size(); - } else { - return clientCertificatesBuilder_.getCount(); - } - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public org.wso2.apk.enforcer.discovery.api.Certificate getClientCertificates(int index) { - if (clientCertificatesBuilder_ == null) { - return clientCertificates_.get(index); - } else { - return clientCertificatesBuilder_.getMessage(index); - } - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder setClientCertificates( - int index, org.wso2.apk.enforcer.discovery.api.Certificate value) { - if (clientCertificatesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureClientCertificatesIsMutable(); - clientCertificates_.set(index, value); - onChanged(); - } else { - clientCertificatesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder setClientCertificates( - int index, org.wso2.apk.enforcer.discovery.api.Certificate.Builder builderForValue) { - if (clientCertificatesBuilder_ == null) { - ensureClientCertificatesIsMutable(); - clientCertificates_.set(index, builderForValue.build()); - onChanged(); - } else { - clientCertificatesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder addClientCertificates(org.wso2.apk.enforcer.discovery.api.Certificate value) { - if (clientCertificatesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureClientCertificatesIsMutable(); - clientCertificates_.add(value); - onChanged(); - } else { - clientCertificatesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder addClientCertificates( - int index, org.wso2.apk.enforcer.discovery.api.Certificate value) { - if (clientCertificatesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureClientCertificatesIsMutable(); - clientCertificates_.add(index, value); - onChanged(); - } else { - clientCertificatesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder addClientCertificates( - org.wso2.apk.enforcer.discovery.api.Certificate.Builder builderForValue) { - if (clientCertificatesBuilder_ == null) { - ensureClientCertificatesIsMutable(); - clientCertificates_.add(builderForValue.build()); - onChanged(); - } else { - clientCertificatesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder addClientCertificates( - int index, org.wso2.apk.enforcer.discovery.api.Certificate.Builder builderForValue) { - if (clientCertificatesBuilder_ == null) { - ensureClientCertificatesIsMutable(); - clientCertificates_.add(index, builderForValue.build()); - onChanged(); - } else { - clientCertificatesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder addAllClientCertificates( - java.lang.Iterable values) { - if (clientCertificatesBuilder_ == null) { - ensureClientCertificatesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, clientCertificates_); - onChanged(); - } else { - clientCertificatesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder clearClientCertificates() { - if (clientCertificatesBuilder_ == null) { - clientCertificates_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - clientCertificatesBuilder_.clear(); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public Builder removeClientCertificates(int index) { - if (clientCertificatesBuilder_ == null) { - ensureClientCertificatesIsMutable(); - clientCertificates_.remove(index); - onChanged(); - } else { - clientCertificatesBuilder_.remove(index); - } - return this; - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public org.wso2.apk.enforcer.discovery.api.Certificate.Builder getClientCertificatesBuilder( - int index) { - return getClientCertificatesFieldBuilder().getBuilder(index); - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public org.wso2.apk.enforcer.discovery.api.CertificateOrBuilder getClientCertificatesOrBuilder( - int index) { - if (clientCertificatesBuilder_ == null) { - return clientCertificates_.get(index); } else { - return clientCertificatesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public java.util.List - getClientCertificatesOrBuilderList() { - if (clientCertificatesBuilder_ != null) { - return clientCertificatesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(clientCertificates_); - } - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public org.wso2.apk.enforcer.discovery.api.Certificate.Builder addClientCertificatesBuilder() { - return getClientCertificatesFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.Certificate.getDefaultInstance()); - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public org.wso2.apk.enforcer.discovery.api.Certificate.Builder addClientCertificatesBuilder( - int index) { - return getClientCertificatesFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.Certificate.getDefaultInstance()); - } - /** - *
-     * bool isMockedApi = 18;
-     * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - public java.util.List - getClientCertificatesBuilderList() { - return getClientCertificatesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Certificate, org.wso2.apk.enforcer.discovery.api.Certificate.Builder, org.wso2.apk.enforcer.discovery.api.CertificateOrBuilder> - getClientCertificatesFieldBuilder() { - if (clientCertificatesBuilder_ == null) { - clientCertificatesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Certificate, org.wso2.apk.enforcer.discovery.api.Certificate.Builder, org.wso2.apk.enforcer.discovery.api.CertificateOrBuilder>( - clientCertificates_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - clientCertificates_ = null; - } - return clientCertificatesBuilder_; - } - - private java.lang.Object mutualSSL_ = ""; - /** - * string mutualSSL = 15; - * @return The mutualSSL. - */ - public java.lang.String getMutualSSL() { - java.lang.Object ref = mutualSSL_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mutualSSL_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string mutualSSL = 15; - * @return The bytes for mutualSSL. - */ - public com.google.protobuf.ByteString - getMutualSSLBytes() { - java.lang.Object ref = mutualSSL_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mutualSSL_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string mutualSSL = 15; - * @param value The mutualSSL to set. - * @return This builder for chaining. - */ - public Builder setMutualSSL( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mutualSSL_ = value; - onChanged(); - return this; - } - /** - * string mutualSSL = 15; - * @return This builder for chaining. - */ - public Builder clearMutualSSL() { - - mutualSSL_ = getDefaultInstance().getMutualSSL(); - onChanged(); - return this; - } - /** - * string mutualSSL = 15; - * @param value The bytes for mutualSSL to set. - * @return This builder for chaining. - */ - public Builder setMutualSSLBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mutualSSL_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.Boolean> applicationSecurity_; - private com.google.protobuf.MapField - internalGetApplicationSecurity() { - if (applicationSecurity_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ApplicationSecurityDefaultEntryHolder.defaultEntry); - } - return applicationSecurity_; - } - private com.google.protobuf.MapField - internalGetMutableApplicationSecurity() { - onChanged();; - if (applicationSecurity_ == null) { - applicationSecurity_ = com.google.protobuf.MapField.newMapField( - ApplicationSecurityDefaultEntryHolder.defaultEntry); - } - if (!applicationSecurity_.isMutable()) { - applicationSecurity_ = applicationSecurity_.copy(); - } - return applicationSecurity_; - } - - public int getApplicationSecurityCount() { - return internalGetApplicationSecurity().getMap().size(); - } - /** - * map<string, bool> applicationSecurity = 16; - */ - - @java.lang.Override - public boolean containsApplicationSecurity( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetApplicationSecurity().getMap().containsKey(key); - } - /** - * Use {@link #getApplicationSecurityMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getApplicationSecurity() { - return getApplicationSecurityMap(); - } - /** - * map<string, bool> applicationSecurity = 16; - */ - @java.lang.Override - - public java.util.Map getApplicationSecurityMap() { - return internalGetApplicationSecurity().getMap(); - } - /** - * map<string, bool> applicationSecurity = 16; - */ - @java.lang.Override - - public boolean getApplicationSecurityOrDefault( - java.lang.String key, - boolean defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetApplicationSecurity().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, bool> applicationSecurity = 16; - */ - @java.lang.Override - - public boolean getApplicationSecurityOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetApplicationSecurity().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearApplicationSecurity() { - internalGetMutableApplicationSecurity().getMutableMap() - .clear(); - return this; - } - /** - * map<string, bool> applicationSecurity = 16; - */ - - public Builder removeApplicationSecurity( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableApplicationSecurity().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableApplicationSecurity() { - return internalGetMutableApplicationSecurity().getMutableMap(); - } - /** - * map<string, bool> applicationSecurity = 16; - */ - public Builder putApplicationSecurity( - java.lang.String key, - boolean value) { - if (key == null) { throw new java.lang.NullPointerException(); } - - internalGetMutableApplicationSecurity().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, bool> applicationSecurity = 16; - */ - - public Builder putAllApplicationSecurity( - java.util.Map values) { - internalGetMutableApplicationSecurity().getMutableMap() - .putAll(values); - return this; - } - - private boolean transportSecurity_ ; - /** - * bool transportSecurity = 17; - * @return The transportSecurity. - */ - @java.lang.Override - public boolean getTransportSecurity() { - return transportSecurity_; - } - /** - * bool transportSecurity = 17; - * @param value The transportSecurity to set. - * @return This builder for chaining. - */ - public Builder setTransportSecurity(boolean value) { - - transportSecurity_ = value; - onChanged(); - return this; - } - /** - * bool transportSecurity = 17; - * @return This builder for chaining. - */ - public Builder clearTransportSecurity() { - - transportSecurity_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList httpRouteIDs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureHttpRouteIDsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - httpRouteIDs_ = new com.google.protobuf.LazyStringArrayList(httpRouteIDs_); - bitField0_ |= 0x00000008; - } - } - /** - * repeated string httpRouteIDs = 19; - * @return A list containing the httpRouteIDs. - */ - public com.google.protobuf.ProtocolStringList - getHttpRouteIDsList() { - return httpRouteIDs_.getUnmodifiableView(); - } - /** - * repeated string httpRouteIDs = 19; - * @return The count of httpRouteIDs. - */ - public int getHttpRouteIDsCount() { - return httpRouteIDs_.size(); - } - /** - * repeated string httpRouteIDs = 19; - * @param index The index of the element to return. - * @return The httpRouteIDs at the given index. - */ - public java.lang.String getHttpRouteIDs(int index) { - return httpRouteIDs_.get(index); - } - /** - * repeated string httpRouteIDs = 19; - * @param index The index of the value to return. - * @return The bytes of the httpRouteIDs at the given index. - */ - public com.google.protobuf.ByteString - getHttpRouteIDsBytes(int index) { - return httpRouteIDs_.getByteString(index); - } - /** - * repeated string httpRouteIDs = 19; - * @param index The index to set the value at. - * @param value The httpRouteIDs to set. - * @return This builder for chaining. - */ - public Builder setHttpRouteIDs( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureHttpRouteIDsIsMutable(); - httpRouteIDs_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string httpRouteIDs = 19; - * @param value The httpRouteIDs to add. - * @return This builder for chaining. - */ - public Builder addHttpRouteIDs( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureHttpRouteIDsIsMutable(); - httpRouteIDs_.add(value); - onChanged(); - return this; - } - /** - * repeated string httpRouteIDs = 19; - * @param values The httpRouteIDs to add. - * @return This builder for chaining. - */ - public Builder addAllHttpRouteIDs( - java.lang.Iterable values) { - ensureHttpRouteIDsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, httpRouteIDs_); - onChanged(); - return this; - } - /** - * repeated string httpRouteIDs = 19; - * @return This builder for chaining. - */ - public Builder clearHttpRouteIDs() { - httpRouteIDs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * repeated string httpRouteIDs = 19; - * @param value The bytes of the httpRouteIDs to add. - * @return This builder for chaining. - */ - public Builder addHttpRouteIDsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureHttpRouteIDsIsMutable(); - httpRouteIDs_.add(value); - onChanged(); - return this; - } - - private java.util.List graphqlComplexityInfo_ = - java.util.Collections.emptyList(); - private void ensureGraphqlComplexityInfoIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - graphqlComplexityInfo_ = new java.util.ArrayList(graphqlComplexityInfo_); - bitField0_ |= 0x00000010; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder, org.wso2.apk.enforcer.discovery.api.GraphqlComplexityOrBuilder> graphqlComplexityInfoBuilder_; - - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public java.util.List getGraphqlComplexityInfoList() { - if (graphqlComplexityInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(graphqlComplexityInfo_); - } else { - return graphqlComplexityInfoBuilder_.getMessageList(); - } - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public int getGraphqlComplexityInfoCount() { - if (graphqlComplexityInfoBuilder_ == null) { - return graphqlComplexityInfo_.size(); - } else { - return graphqlComplexityInfoBuilder_.getCount(); - } - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexity getGraphqlComplexityInfo(int index) { - if (graphqlComplexityInfoBuilder_ == null) { - return graphqlComplexityInfo_.get(index); - } else { - return graphqlComplexityInfoBuilder_.getMessage(index); - } - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder setGraphqlComplexityInfo( - int index, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity value) { - if (graphqlComplexityInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphqlComplexityInfoIsMutable(); - graphqlComplexityInfo_.set(index, value); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder setGraphqlComplexityInfo( - int index, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder builderForValue) { - if (graphqlComplexityInfoBuilder_ == null) { - ensureGraphqlComplexityInfoIsMutable(); - graphqlComplexityInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder addGraphqlComplexityInfo(org.wso2.apk.enforcer.discovery.api.GraphqlComplexity value) { - if (graphqlComplexityInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphqlComplexityInfoIsMutable(); - graphqlComplexityInfo_.add(value); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.addMessage(value); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder addGraphqlComplexityInfo( - int index, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity value) { - if (graphqlComplexityInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphqlComplexityInfoIsMutable(); - graphqlComplexityInfo_.add(index, value); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder addGraphqlComplexityInfo( - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder builderForValue) { - if (graphqlComplexityInfoBuilder_ == null) { - ensureGraphqlComplexityInfoIsMutable(); - graphqlComplexityInfo_.add(builderForValue.build()); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder addGraphqlComplexityInfo( - int index, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder builderForValue) { - if (graphqlComplexityInfoBuilder_ == null) { - ensureGraphqlComplexityInfoIsMutable(); - graphqlComplexityInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder addAllGraphqlComplexityInfo( - java.lang.Iterable values) { - if (graphqlComplexityInfoBuilder_ == null) { - ensureGraphqlComplexityInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, graphqlComplexityInfo_); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder clearGraphqlComplexityInfo() { - if (graphqlComplexityInfoBuilder_ == null) { - graphqlComplexityInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.clear(); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public Builder removeGraphqlComplexityInfo(int index) { - if (graphqlComplexityInfoBuilder_ == null) { - ensureGraphqlComplexityInfoIsMutable(); - graphqlComplexityInfo_.remove(index); - onChanged(); - } else { - graphqlComplexityInfoBuilder_.remove(index); - } - return this; - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder getGraphqlComplexityInfoBuilder( - int index) { - return getGraphqlComplexityInfoFieldBuilder().getBuilder(index); - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexityOrBuilder getGraphqlComplexityInfoOrBuilder( - int index) { - if (graphqlComplexityInfoBuilder_ == null) { - return graphqlComplexityInfo_.get(index); } else { - return graphqlComplexityInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public java.util.List - getGraphqlComplexityInfoOrBuilderList() { - if (graphqlComplexityInfoBuilder_ != null) { - return graphqlComplexityInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(graphqlComplexityInfo_); - } - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder addGraphqlComplexityInfoBuilder() { - return getGraphqlComplexityInfoFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.getDefaultInstance()); - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder addGraphqlComplexityInfoBuilder( - int index) { - return getGraphqlComplexityInfoFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.getDefaultInstance()); - } - /** - *
-     */ string graphQLSchema = 22;
-     * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - public java.util.List - getGraphqlComplexityInfoBuilderList() { - return getGraphqlComplexityInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder, org.wso2.apk.enforcer.discovery.api.GraphqlComplexityOrBuilder> - getGraphqlComplexityInfoFieldBuilder() { - if (graphqlComplexityInfoBuilder_ == null) { - graphqlComplexityInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder, org.wso2.apk.enforcer.discovery.api.GraphqlComplexityOrBuilder>( - graphqlComplexityInfo_, - ((bitField0_ & 0x00000010) != 0), - getParentForChildren(), - isClean()); - graphqlComplexityInfo_ = null; - } - return graphqlComplexityInfoBuilder_; - } - - private boolean systemAPI_ ; - /** - * bool systemAPI = 24; - * @return The systemAPI. - */ - @java.lang.Override - public boolean getSystemAPI() { - return systemAPI_; - } - /** - * bool systemAPI = 24; - * @param value The systemAPI to set. - * @return This builder for chaining. - */ - public Builder setSystemAPI(boolean value) { - - systemAPI_ = value; - onChanged(); - return this; - } - /** - * bool systemAPI = 24; - * @return This builder for chaining. - */ - public Builder clearSystemAPI() { - - systemAPI_ = false; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo, org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.Builder, org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoOrBuilder> backendJWTTokenInfoBuilder_; - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - * @return Whether the backendJWTTokenInfo field is set. - */ - public boolean hasBackendJWTTokenInfo() { - return backendJWTTokenInfoBuilder_ != null || backendJWTTokenInfo_ != null; - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - * @return The backendJWTTokenInfo. - */ - public org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo getBackendJWTTokenInfo() { - if (backendJWTTokenInfoBuilder_ == null) { - return backendJWTTokenInfo_ == null ? org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.getDefaultInstance() : backendJWTTokenInfo_; - } else { - return backendJWTTokenInfoBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - public Builder setBackendJWTTokenInfo(org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo value) { - if (backendJWTTokenInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - backendJWTTokenInfo_ = value; - onChanged(); - } else { - backendJWTTokenInfoBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - public Builder setBackendJWTTokenInfo( - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.Builder builderForValue) { - if (backendJWTTokenInfoBuilder_ == null) { - backendJWTTokenInfo_ = builderForValue.build(); - onChanged(); - } else { - backendJWTTokenInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - public Builder mergeBackendJWTTokenInfo(org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo value) { - if (backendJWTTokenInfoBuilder_ == null) { - if (backendJWTTokenInfo_ != null) { - backendJWTTokenInfo_ = - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.newBuilder(backendJWTTokenInfo_).mergeFrom(value).buildPartial(); - } else { - backendJWTTokenInfo_ = value; - } - onChanged(); - } else { - backendJWTTokenInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - public Builder clearBackendJWTTokenInfo() { - if (backendJWTTokenInfoBuilder_ == null) { - backendJWTTokenInfo_ = null; - onChanged(); - } else { - backendJWTTokenInfo_ = null; - backendJWTTokenInfoBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - public org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.Builder getBackendJWTTokenInfoBuilder() { - - onChanged(); - return getBackendJWTTokenInfoFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - public org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoOrBuilder getBackendJWTTokenInfoOrBuilder() { - if (backendJWTTokenInfoBuilder_ != null) { - return backendJWTTokenInfoBuilder_.getMessageOrBuilder(); - } else { - return backendJWTTokenInfo_ == null ? - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.getDefaultInstance() : backendJWTTokenInfo_; - } - } - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo, org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.Builder, org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoOrBuilder> - getBackendJWTTokenInfoFieldBuilder() { - if (backendJWTTokenInfoBuilder_ == null) { - backendJWTTokenInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo, org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.Builder, org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoOrBuilder>( - getBackendJWTTokenInfo(), - getParentForChildren(), - isClean()); - backendJWTTokenInfo_ = null; - } - return backendJWTTokenInfoBuilder_; - } - - private com.google.protobuf.ByteString apiDefinitionFile_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes apiDefinitionFile = 26; - * @return The apiDefinitionFile. - */ - @java.lang.Override - public com.google.protobuf.ByteString getApiDefinitionFile() { - return apiDefinitionFile_; - } - /** - * bytes apiDefinitionFile = 26; - * @param value The apiDefinitionFile to set. - * @return This builder for chaining. - */ - public Builder setApiDefinitionFile(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - apiDefinitionFile_ = value; - onChanged(); - return this; - } - /** - * bytes apiDefinitionFile = 26; - * @return This builder for chaining. - */ - public Builder clearApiDefinitionFile() { - - apiDefinitionFile_ = getDefaultInstance().getApiDefinitionFile(); - onChanged(); - return this; - } - - private java.lang.Object environment_ = ""; - /** - * string environment = 27; - * @return The environment. - */ - public java.lang.String getEnvironment() { - java.lang.Object ref = environment_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - environment_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string environment = 27; - * @return The bytes for environment. - */ - public com.google.protobuf.ByteString - getEnvironmentBytes() { - java.lang.Object ref = environment_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - environment_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string environment = 27; - * @param value The environment to set. - * @return This builder for chaining. - */ - public Builder setEnvironment( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - environment_ = value; - onChanged(); - return this; - } - /** - * string environment = 27; - * @return This builder for chaining. - */ - public Builder clearEnvironment() { - - environment_ = getDefaultInstance().getEnvironment(); - onChanged(); - return this; - } - /** - * string environment = 27; - * @param value The bytes for environment to set. - * @return This builder for chaining. - */ - public Builder setEnvironmentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - environment_ = value; - onChanged(); - return this; - } - - private boolean subscriptionValidation_ ; - /** - * bool subscriptionValidation = 28; - * @return The subscriptionValidation. - */ - @java.lang.Override - public boolean getSubscriptionValidation() { - return subscriptionValidation_; - } - /** - * bool subscriptionValidation = 28; - * @param value The subscriptionValidation to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionValidation(boolean value) { - - subscriptionValidation_ = value; - onChanged(); - return this; - } - /** - * bool subscriptionValidation = 28; - * @return This builder for chaining. - */ - public Builder clearSubscriptionValidation() { - - subscriptionValidation_ = false; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.api.EndpointCluster endpoints_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointCluster, org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder> endpointsBuilder_; - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - * @return Whether the endpoints field is set. - */ - public boolean hasEndpoints() { - return endpointsBuilder_ != null || endpoints_ != null; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - * @return The endpoints. - */ - public org.wso2.apk.enforcer.discovery.api.EndpointCluster getEndpoints() { - if (endpointsBuilder_ == null) { - return endpoints_ == null ? org.wso2.apk.enforcer.discovery.api.EndpointCluster.getDefaultInstance() : endpoints_; - } else { - return endpointsBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - public Builder setEndpoints(org.wso2.apk.enforcer.discovery.api.EndpointCluster value) { - if (endpointsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endpoints_ = value; - onChanged(); - } else { - endpointsBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - public Builder setEndpoints( - org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder builderForValue) { - if (endpointsBuilder_ == null) { - endpoints_ = builderForValue.build(); - onChanged(); - } else { - endpointsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - public Builder mergeEndpoints(org.wso2.apk.enforcer.discovery.api.EndpointCluster value) { - if (endpointsBuilder_ == null) { - if (endpoints_ != null) { - endpoints_ = - org.wso2.apk.enforcer.discovery.api.EndpointCluster.newBuilder(endpoints_).mergeFrom(value).buildPartial(); - } else { - endpoints_ = value; - } - onChanged(); - } else { - endpointsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - public Builder clearEndpoints() { - if (endpointsBuilder_ == null) { - endpoints_ = null; - onChanged(); - } else { - endpoints_ = null; - endpointsBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - public org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder getEndpointsBuilder() { - - onChanged(); - return getEndpointsFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - public org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder getEndpointsOrBuilder() { - if (endpointsBuilder_ != null) { - return endpointsBuilder_.getMessageOrBuilder(); - } else { - return endpoints_ == null ? - org.wso2.apk.enforcer.discovery.api.EndpointCluster.getDefaultInstance() : endpoints_; - } - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointCluster, org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder> - getEndpointsFieldBuilder() { - if (endpointsBuilder_ == null) { - endpointsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointCluster, org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder>( - getEndpoints(), - getParentForChildren(), - isClean()); - endpoints_ = null; - } - return endpointsBuilder_; - } - - private java.util.List endpointSecurity_ = - java.util.Collections.emptyList(); - private void ensureEndpointSecurityIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { - endpointSecurity_ = new java.util.ArrayList(endpointSecurity_); - bitField0_ |= 0x00000020; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.SecurityInfo, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder, org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder> endpointSecurityBuilder_; - - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public java.util.List getEndpointSecurityList() { - if (endpointSecurityBuilder_ == null) { - return java.util.Collections.unmodifiableList(endpointSecurity_); - } else { - return endpointSecurityBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public int getEndpointSecurityCount() { - if (endpointSecurityBuilder_ == null) { - return endpointSecurity_.size(); - } else { - return endpointSecurityBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfo getEndpointSecurity(int index) { - if (endpointSecurityBuilder_ == null) { - return endpointSecurity_.get(index); - } else { - return endpointSecurityBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder setEndpointSecurity( - int index, org.wso2.apk.enforcer.discovery.api.SecurityInfo value) { - if (endpointSecurityBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointSecurityIsMutable(); - endpointSecurity_.set(index, value); - onChanged(); - } else { - endpointSecurityBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder setEndpointSecurity( - int index, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder builderForValue) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.set(index, builderForValue.build()); - onChanged(); - } else { - endpointSecurityBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder addEndpointSecurity(org.wso2.apk.enforcer.discovery.api.SecurityInfo value) { - if (endpointSecurityBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointSecurityIsMutable(); - endpointSecurity_.add(value); - onChanged(); - } else { - endpointSecurityBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder addEndpointSecurity( - int index, org.wso2.apk.enforcer.discovery.api.SecurityInfo value) { - if (endpointSecurityBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointSecurityIsMutable(); - endpointSecurity_.add(index, value); - onChanged(); - } else { - endpointSecurityBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder addEndpointSecurity( - org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder builderForValue) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.add(builderForValue.build()); - onChanged(); - } else { - endpointSecurityBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder addEndpointSecurity( - int index, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder builderForValue) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.add(index, builderForValue.build()); - onChanged(); - } else { - endpointSecurityBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder addAllEndpointSecurity( - java.lang.Iterable values) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, endpointSecurity_); - onChanged(); - } else { - endpointSecurityBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder clearEndpointSecurity() { - if (endpointSecurityBuilder_ == null) { - endpointSecurity_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - } else { - endpointSecurityBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public Builder removeEndpointSecurity(int index) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.remove(index); - onChanged(); - } else { - endpointSecurityBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder getEndpointSecurityBuilder( - int index) { - return getEndpointSecurityFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder getEndpointSecurityOrBuilder( - int index) { - if (endpointSecurityBuilder_ == null) { - return endpointSecurity_.get(index); } else { - return endpointSecurityBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public java.util.List - getEndpointSecurityOrBuilderList() { - if (endpointSecurityBuilder_ != null) { - return endpointSecurityBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(endpointSecurity_); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder addEndpointSecurityBuilder() { - return getEndpointSecurityFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.SecurityInfo.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder addEndpointSecurityBuilder( - int index) { - return getEndpointSecurityFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.SecurityInfo.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - public java.util.List - getEndpointSecurityBuilderList() { - return getEndpointSecurityFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.SecurityInfo, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder, org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder> - getEndpointSecurityFieldBuilder() { - if (endpointSecurityBuilder_ == null) { - endpointSecurityBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.SecurityInfo, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder, org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder>( - endpointSecurity_, - ((bitField0_ & 0x00000020) != 0), - getParentForChildren(), - isClean()); - endpointSecurity_ = null; - } - return endpointSecurityBuilder_; - } - - private org.wso2.apk.enforcer.discovery.api.AIProvider aiprovider_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.AIProvider, org.wso2.apk.enforcer.discovery.api.AIProvider.Builder, org.wso2.apk.enforcer.discovery.api.AIProviderOrBuilder> aiproviderBuilder_; - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - * @return Whether the aiprovider field is set. - */ - public boolean hasAiprovider() { - return aiproviderBuilder_ != null || aiprovider_ != null; - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - * @return The aiprovider. - */ - public org.wso2.apk.enforcer.discovery.api.AIProvider getAiprovider() { - if (aiproviderBuilder_ == null) { - return aiprovider_ == null ? org.wso2.apk.enforcer.discovery.api.AIProvider.getDefaultInstance() : aiprovider_; - } else { - return aiproviderBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - public Builder setAiprovider(org.wso2.apk.enforcer.discovery.api.AIProvider value) { - if (aiproviderBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - aiprovider_ = value; - onChanged(); - } else { - aiproviderBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - public Builder setAiprovider( - org.wso2.apk.enforcer.discovery.api.AIProvider.Builder builderForValue) { - if (aiproviderBuilder_ == null) { - aiprovider_ = builderForValue.build(); - onChanged(); - } else { - aiproviderBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - public Builder mergeAiprovider(org.wso2.apk.enforcer.discovery.api.AIProvider value) { - if (aiproviderBuilder_ == null) { - if (aiprovider_ != null) { - aiprovider_ = - org.wso2.apk.enforcer.discovery.api.AIProvider.newBuilder(aiprovider_).mergeFrom(value).buildPartial(); - } else { - aiprovider_ = value; - } - onChanged(); - } else { - aiproviderBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - public Builder clearAiprovider() { - if (aiproviderBuilder_ == null) { - aiprovider_ = null; - onChanged(); - } else { - aiprovider_ = null; - aiproviderBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - public org.wso2.apk.enforcer.discovery.api.AIProvider.Builder getAiproviderBuilder() { - - onChanged(); - return getAiproviderFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - public org.wso2.apk.enforcer.discovery.api.AIProviderOrBuilder getAiproviderOrBuilder() { - if (aiproviderBuilder_ != null) { - return aiproviderBuilder_.getMessageOrBuilder(); - } else { - return aiprovider_ == null ? - org.wso2.apk.enforcer.discovery.api.AIProvider.getDefaultInstance() : aiprovider_; - } - } - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.AIProvider, org.wso2.apk.enforcer.discovery.api.AIProvider.Builder, org.wso2.apk.enforcer.discovery.api.AIProviderOrBuilder> - getAiproviderFieldBuilder() { - if (aiproviderBuilder_ == null) { - aiproviderBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.AIProvider, org.wso2.apk.enforcer.discovery.api.AIProvider.Builder, org.wso2.apk.enforcer.discovery.api.AIProviderOrBuilder>( - getAiprovider(), - getParentForChildren(), - isClean()); - aiprovider_ = null; - } - return aiproviderBuilder_; - } - @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.api.Api) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.Api) - private static final org.wso2.apk.enforcer.discovery.api.Api DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.Api(); - } - - public static org.wso2.apk.enforcer.discovery.api.Api getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Api parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Api(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.api.Api getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ApiOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ApiOrBuilder.java deleted file mode 100644 index 6b1e2770df..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ApiOrBuilder.java +++ /dev/null @@ -1,429 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface ApiOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.Api) - com.google.protobuf.MessageOrBuilder { - - /** - * string id = 1; - * @return The id. - */ - java.lang.String getId(); - /** - * string id = 1; - * @return The bytes for id. - */ - com.google.protobuf.ByteString - getIdBytes(); - - /** - * string title = 2; - * @return The title. - */ - java.lang.String getTitle(); - /** - * string title = 2; - * @return The bytes for title. - */ - com.google.protobuf.ByteString - getTitleBytes(); - - /** - * string version = 3; - * @return The version. - */ - java.lang.String getVersion(); - /** - * string version = 3; - * @return The bytes for version. - */ - com.google.protobuf.ByteString - getVersionBytes(); - - /** - * string apiType = 4; - * @return The apiType. - */ - java.lang.String getApiType(); - /** - * string apiType = 4; - * @return The bytes for apiType. - */ - com.google.protobuf.ByteString - getApiTypeBytes(); - - /** - * bool disableAuthentications = 5; - * @return The disableAuthentications. - */ - boolean getDisableAuthentications(); - - /** - * bool disableScopes = 6; - * @return The disableScopes. - */ - boolean getDisableScopes(); - - /** - * string envType = 7; - * @return The envType. - */ - java.lang.String getEnvType(); - /** - * string envType = 7; - * @return The bytes for envType. - */ - com.google.protobuf.ByteString - getEnvTypeBytes(); - - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - java.util.List - getResourcesList(); - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - org.wso2.apk.enforcer.discovery.api.Resource getResources(int index); - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - int getResourcesCount(); - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - java.util.List - getResourcesOrBuilderList(); - /** - * repeated .wso2.discovery.api.Resource resources = 8; - */ - org.wso2.apk.enforcer.discovery.api.ResourceOrBuilder getResourcesOrBuilder( - int index); - - /** - * string basePath = 9; - * @return The basePath. - */ - java.lang.String getBasePath(); - /** - * string basePath = 9; - * @return The bytes for basePath. - */ - com.google.protobuf.ByteString - getBasePathBytes(); - - /** - * string tier = 10; - * @return The tier. - */ - java.lang.String getTier(); - /** - * string tier = 10; - * @return The bytes for tier. - */ - com.google.protobuf.ByteString - getTierBytes(); - - /** - * string apiLifeCycleState = 11; - * @return The apiLifeCycleState. - */ - java.lang.String getApiLifeCycleState(); - /** - * string apiLifeCycleState = 11; - * @return The bytes for apiLifeCycleState. - */ - com.google.protobuf.ByteString - getApiLifeCycleStateBytes(); - - /** - * string vhost = 12; - * @return The vhost. - */ - java.lang.String getVhost(); - /** - * string vhost = 12; - * @return The bytes for vhost. - */ - com.google.protobuf.ByteString - getVhostBytes(); - - /** - * string organizationId = 13; - * @return The organizationId. - */ - java.lang.String getOrganizationId(); - /** - * string organizationId = 13; - * @return The bytes for organizationId. - */ - com.google.protobuf.ByteString - getOrganizationIdBytes(); - - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - java.util.List - getClientCertificatesList(); - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - org.wso2.apk.enforcer.discovery.api.Certificate getClientCertificates(int index); - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - int getClientCertificatesCount(); - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - java.util.List - getClientCertificatesOrBuilderList(); - /** - *
-   * bool isMockedApi = 18;
-   * 
- * - * repeated .wso2.discovery.api.Certificate clientCertificates = 14; - */ - org.wso2.apk.enforcer.discovery.api.CertificateOrBuilder getClientCertificatesOrBuilder( - int index); - - /** - * string mutualSSL = 15; - * @return The mutualSSL. - */ - java.lang.String getMutualSSL(); - /** - * string mutualSSL = 15; - * @return The bytes for mutualSSL. - */ - com.google.protobuf.ByteString - getMutualSSLBytes(); - - /** - * map<string, bool> applicationSecurity = 16; - */ - int getApplicationSecurityCount(); - /** - * map<string, bool> applicationSecurity = 16; - */ - boolean containsApplicationSecurity( - java.lang.String key); - /** - * Use {@link #getApplicationSecurityMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getApplicationSecurity(); - /** - * map<string, bool> applicationSecurity = 16; - */ - java.util.Map - getApplicationSecurityMap(); - /** - * map<string, bool> applicationSecurity = 16; - */ - - boolean getApplicationSecurityOrDefault( - java.lang.String key, - boolean defaultValue); - /** - * map<string, bool> applicationSecurity = 16; - */ - - boolean getApplicationSecurityOrThrow( - java.lang.String key); - - /** - * bool transportSecurity = 17; - * @return The transportSecurity. - */ - boolean getTransportSecurity(); - - /** - * repeated string httpRouteIDs = 19; - * @return A list containing the httpRouteIDs. - */ - java.util.List - getHttpRouteIDsList(); - /** - * repeated string httpRouteIDs = 19; - * @return The count of httpRouteIDs. - */ - int getHttpRouteIDsCount(); - /** - * repeated string httpRouteIDs = 19; - * @param index The index of the element to return. - * @return The httpRouteIDs at the given index. - */ - java.lang.String getHttpRouteIDs(int index); - /** - * repeated string httpRouteIDs = 19; - * @param index The index of the value to return. - * @return The bytes of the httpRouteIDs at the given index. - */ - com.google.protobuf.ByteString - getHttpRouteIDsBytes(int index); - - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - java.util.List - getGraphqlComplexityInfoList(); - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity getGraphqlComplexityInfo(int index); - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - int getGraphqlComplexityInfoCount(); - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - java.util.List - getGraphqlComplexityInfoOrBuilderList(); - /** - *
-   */ string graphQLSchema = 22;
-   * 
- * - * repeated .wso2.discovery.api.GraphqlComplexity graphqlComplexityInfo = 23; - */ - org.wso2.apk.enforcer.discovery.api.GraphqlComplexityOrBuilder getGraphqlComplexityInfoOrBuilder( - int index); - - /** - * bool systemAPI = 24; - * @return The systemAPI. - */ - boolean getSystemAPI(); - - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - * @return Whether the backendJWTTokenInfo field is set. - */ - boolean hasBackendJWTTokenInfo(); - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - * @return The backendJWTTokenInfo. - */ - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo getBackendJWTTokenInfo(); - /** - * .wso2.discovery.api.BackendJWTTokenInfo backendJWTTokenInfo = 25; - */ - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoOrBuilder getBackendJWTTokenInfoOrBuilder(); - - /** - * bytes apiDefinitionFile = 26; - * @return The apiDefinitionFile. - */ - com.google.protobuf.ByteString getApiDefinitionFile(); - - /** - * string environment = 27; - * @return The environment. - */ - java.lang.String getEnvironment(); - /** - * string environment = 27; - * @return The bytes for environment. - */ - com.google.protobuf.ByteString - getEnvironmentBytes(); - - /** - * bool subscriptionValidation = 28; - * @return The subscriptionValidation. - */ - boolean getSubscriptionValidation(); - - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - * @return Whether the endpoints field is set. - */ - boolean hasEndpoints(); - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - * @return The endpoints. - */ - org.wso2.apk.enforcer.discovery.api.EndpointCluster getEndpoints(); - /** - * .wso2.discovery.api.EndpointCluster endpoints = 29; - */ - org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder getEndpointsOrBuilder(); - - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - java.util.List - getEndpointSecurityList(); - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - org.wso2.apk.enforcer.discovery.api.SecurityInfo getEndpointSecurity(int index); - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - int getEndpointSecurityCount(); - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - java.util.List - getEndpointSecurityOrBuilderList(); - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 30; - */ - org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder getEndpointSecurityOrBuilder( - int index); - - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - * @return Whether the aiprovider field is set. - */ - boolean hasAiprovider(); - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - * @return The aiprovider. - */ - org.wso2.apk.enforcer.discovery.api.AIProvider getAiprovider(); - /** - * .wso2.discovery.api.AIProvider aiprovider = 31; - */ - org.wso2.apk.enforcer.discovery.api.AIProviderOrBuilder getAiproviderOrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ApiProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ApiProto.java deleted file mode 100644 index 0a4e79198e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ApiProto.java +++ /dev/null @@ -1,106 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class ApiProto { - private ApiProto() {} - 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_api_Api_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Api_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_Api_ApplicationSecurityEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Api_ApplicationSecurityEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\034wso2/discovery/api/api.proto\022\022wso2.dis" + - "covery.api\032!wso2/discovery/api/Resource." + - "proto\032$wso2/discovery/api/Certificate.pr" + - "oto\032,wso2/discovery/api/BackendJWTTokenI" + - "nfo.proto\032)wso2/discovery/api/endpoint_c" + - "luster.proto\032&wso2/discovery/api/securit" + - "y_info.proto\032 wso2/discovery/api/graphql" + - ".proto\032$wso2/discovery/api/ai_provider.p" + - "roto\"\300\007\n\003Api\022\n\n\002id\030\001 \001(\t\022\r\n\005title\030\002 \001(\t\022" + - "\017\n\007version\030\003 \001(\t\022\017\n\007apiType\030\004 \001(\t\022\036\n\026dis" + - "ableAuthentications\030\005 \001(\010\022\025\n\rdisableScop" + - "es\030\006 \001(\010\022\017\n\007envType\030\007 \001(\t\022/\n\tresources\030\010" + - " \003(\0132\034.wso2.discovery.api.Resource\022\020\n\010ba" + - "sePath\030\t \001(\t\022\014\n\004tier\030\n \001(\t\022\031\n\021apiLifeCyc" + - "leState\030\013 \001(\t\022\r\n\005vhost\030\014 \001(\t\022\026\n\016organiza" + - "tionId\030\r \001(\t\022;\n\022clientCertificates\030\016 \003(\013" + - "2\037.wso2.discovery.api.Certificate\022\021\n\tmut" + - "ualSSL\030\017 \001(\t\022M\n\023applicationSecurity\030\020 \003(" + - "\01320.wso2.discovery.api.Api.ApplicationSe" + - "curityEntry\022\031\n\021transportSecurity\030\021 \001(\010\022\024" + - "\n\014httpRouteIDs\030\023 \003(\t\022D\n\025graphqlComplexit" + - "yInfo\030\027 \003(\0132%.wso2.discovery.api.Graphql" + - "Complexity\022\021\n\tsystemAPI\030\030 \001(\010\022D\n\023backend" + - "JWTTokenInfo\030\031 \001(\0132\'.wso2.discovery.api." + - "BackendJWTTokenInfo\022\031\n\021apiDefinitionFile" + - "\030\032 \001(\014\022\023\n\013environment\030\033 \001(\t\022\036\n\026subscript" + - "ionValidation\030\034 \001(\010\0226\n\tendpoints\030\035 \001(\0132#" + - ".wso2.discovery.api.EndpointCluster\022:\n\020e" + - "ndpointSecurity\030\036 \003(\0132 .wso2.discovery.a" + - "pi.SecurityInfo\0222\n\naiprovider\030\037 \001(\0132\036.ws" + - "o2.discovery.api.AIProvider\032:\n\030Applicati" + - "onSecurityEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + - "\001(\010:\0028\001Bp\n#org.wso2.apk.enforcer.discove" + - "ry.apiB\010ApiProtoP\001Z=github.com/envoyprox" + - "y/go-control-plane/wso2/discovery/api;ap" + - "ib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.api.ResourceProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.api.CertificateProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.api.GraphQLProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.api.AIProviderProto.getDescriptor(), - }); - internal_static_wso2_discovery_api_Api_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_Api_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Api_descriptor, - new java.lang.String[] { "Id", "Title", "Version", "ApiType", "DisableAuthentications", "DisableScopes", "EnvType", "Resources", "BasePath", "Tier", "ApiLifeCycleState", "Vhost", "OrganizationId", "ClientCertificates", "MutualSSL", "ApplicationSecurity", "TransportSecurity", "HttpRouteIDs", "GraphqlComplexityInfo", "SystemAPI", "BackendJWTTokenInfo", "ApiDefinitionFile", "Environment", "SubscriptionValidation", "Endpoints", "EndpointSecurity", "Aiprovider", }); - internal_static_wso2_discovery_api_Api_ApplicationSecurityEntry_descriptor = - internal_static_wso2_discovery_api_Api_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_api_Api_ApplicationSecurityEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Api_ApplicationSecurityEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - org.wso2.apk.enforcer.discovery.api.ResourceProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.api.CertificateProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.api.GraphQLProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.api.AIProviderProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfo.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfo.java deleted file mode 100644 index 2b92bd2d3c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfo.java +++ /dev/null @@ -1,1256 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/BackendJWTTokenInfo.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Endpoint config model
- * 
- * - * Protobuf type {@code wso2.discovery.api.BackendJWTTokenInfo} - */ -public final class BackendJWTTokenInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.BackendJWTTokenInfo) - BackendJWTTokenInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use BackendJWTTokenInfo.newBuilder() to construct. - private BackendJWTTokenInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BackendJWTTokenInfo() { - encoding_ = ""; - header_ = ""; - signingAlgorithm_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BackendJWTTokenInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BackendJWTTokenInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - enabled_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - encoding_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - header_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - signingAlgorithm_ = s; - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - customClaims_ = com.google.protobuf.MapField.newMapField( - CustomClaimsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - customClaims__ = input.readMessage( - CustomClaimsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - customClaims_.getMutableMap().put( - customClaims__.getKey(), customClaims__.getValue()); - break; - } - case 48: { - - tokenTTL_ = input.readInt32(); - 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.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_BackendJWTTokenInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 5: - return internalGetCustomClaims(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_BackendJWTTokenInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.class, org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int ENCODING_FIELD_NUMBER = 2; - private volatile java.lang.Object encoding_; - /** - * string encoding = 2; - * @return The encoding. - */ - @java.lang.Override - public java.lang.String getEncoding() { - java.lang.Object ref = encoding_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - encoding_ = s; - return s; - } - } - /** - * string encoding = 2; - * @return The bytes for encoding. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEncodingBytes() { - java.lang.Object ref = encoding_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - encoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HEADER_FIELD_NUMBER = 3; - private volatile java.lang.Object header_; - /** - * string header = 3; - * @return The header. - */ - @java.lang.Override - public java.lang.String getHeader() { - java.lang.Object ref = header_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - header_ = s; - return s; - } - } - /** - * string header = 3; - * @return The bytes for header. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getHeaderBytes() { - java.lang.Object ref = header_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - header_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SIGNINGALGORITHM_FIELD_NUMBER = 4; - private volatile java.lang.Object signingAlgorithm_; - /** - * string signingAlgorithm = 4; - * @return The signingAlgorithm. - */ - @java.lang.Override - public java.lang.String getSigningAlgorithm() { - java.lang.Object ref = signingAlgorithm_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - signingAlgorithm_ = s; - return s; - } - } - /** - * string signingAlgorithm = 4; - * @return The bytes for signingAlgorithm. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSigningAlgorithmBytes() { - java.lang.Object ref = signingAlgorithm_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - signingAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOMCLAIMS_FIELD_NUMBER = 5; - private static final class CustomClaimsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.wso2.apk.enforcer.discovery.api.Claim> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_BackendJWTTokenInfo_CustomClaimsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.wso2.apk.enforcer.discovery.api.Claim.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.wso2.apk.enforcer.discovery.api.Claim> customClaims_; - private com.google.protobuf.MapField - internalGetCustomClaims() { - if (customClaims_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CustomClaimsDefaultEntryHolder.defaultEntry); - } - return customClaims_; - } - - public int getCustomClaimsCount() { - return internalGetCustomClaims().getMap().size(); - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - - @java.lang.Override - public boolean containsCustomClaims( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetCustomClaims().getMap().containsKey(key); - } - /** - * Use {@link #getCustomClaimsMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getCustomClaims() { - return getCustomClaimsMap(); - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - @java.lang.Override - - public java.util.Map getCustomClaimsMap() { - return internalGetCustomClaims().getMap(); - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - @java.lang.Override - - public org.wso2.apk.enforcer.discovery.api.Claim getCustomClaimsOrDefault( - java.lang.String key, - org.wso2.apk.enforcer.discovery.api.Claim defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCustomClaims().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - @java.lang.Override - - public org.wso2.apk.enforcer.discovery.api.Claim getCustomClaimsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCustomClaims().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int TOKENTTL_FIELD_NUMBER = 6; - private int tokenTTL_; - /** - * int32 tokenTTL = 6; - * @return The tokenTTL. - */ - @java.lang.Override - public int getTokenTTL() { - return tokenTTL_; - } - - 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 (enabled_ != false) { - output.writeBool(1, enabled_); - } - if (!getEncodingBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, encoding_); - } - if (!getHeaderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, header_); - } - if (!getSigningAlgorithmBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, signingAlgorithm_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetCustomClaims(), - CustomClaimsDefaultEntryHolder.defaultEntry, - 5); - if (tokenTTL_ != 0) { - output.writeInt32(6, tokenTTL_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enabled_); - } - if (!getEncodingBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, encoding_); - } - if (!getHeaderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, header_); - } - if (!getSigningAlgorithmBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, signingAlgorithm_); - } - for (java.util.Map.Entry entry - : internalGetCustomClaims().getMap().entrySet()) { - com.google.protobuf.MapEntry - customClaims__ = CustomClaimsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, customClaims__); - } - if (tokenTTL_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, tokenTTL_); - } - 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.api.BackendJWTTokenInfo)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo other = (org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo) obj; - - if (getEnabled() - != other.getEnabled()) return false; - if (!getEncoding() - .equals(other.getEncoding())) return false; - if (!getHeader() - .equals(other.getHeader())) return false; - if (!getSigningAlgorithm() - .equals(other.getSigningAlgorithm())) return false; - if (!internalGetCustomClaims().equals( - other.internalGetCustomClaims())) return false; - if (getTokenTTL() - != other.getTokenTTL()) 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) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - hash = (37 * hash) + ENCODING_FIELD_NUMBER; - hash = (53 * hash) + getEncoding().hashCode(); - hash = (37 * hash) + HEADER_FIELD_NUMBER; - hash = (53 * hash) + getHeader().hashCode(); - hash = (37 * hash) + SIGNINGALGORITHM_FIELD_NUMBER; - hash = (53 * hash) + getSigningAlgorithm().hashCode(); - if (!internalGetCustomClaims().getMap().isEmpty()) { - hash = (37 * hash) + CUSTOMCLAIMS_FIELD_NUMBER; - hash = (53 * hash) + internalGetCustomClaims().hashCode(); - } - hash = (37 * hash) + TOKENTTL_FIELD_NUMBER; - hash = (53 * hash) + getTokenTTL(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo 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.api.BackendJWTTokenInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo 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.api.BackendJWTTokenInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo 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.api.BackendJWTTokenInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo 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.api.BackendJWTTokenInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo 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.api.BackendJWTTokenInfo 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.api.BackendJWTTokenInfo 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.api.BackendJWTTokenInfo 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; - } - /** - *
-   * Endpoint config model
-   * 
- * - * Protobuf type {@code wso2.discovery.api.BackendJWTTokenInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.BackendJWTTokenInfo) - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_BackendJWTTokenInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 5: - return internalGetCustomClaims(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 5: - return internalGetMutableCustomClaims(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_BackendJWTTokenInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.class, org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.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(); - enabled_ = false; - - encoding_ = ""; - - header_ = ""; - - signingAlgorithm_ = ""; - - internalGetMutableCustomClaims().clear(); - tokenTTL_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_BackendJWTTokenInfo_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo build() { - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo buildPartial() { - org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo result = new org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo(this); - int from_bitField0_ = bitField0_; - result.enabled_ = enabled_; - result.encoding_ = encoding_; - result.header_ = header_; - result.signingAlgorithm_ = signingAlgorithm_; - result.customClaims_ = internalGetCustomClaims(); - result.customClaims_.makeImmutable(); - result.tokenTTL_ = tokenTTL_; - 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.api.BackendJWTTokenInfo) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo other) { - if (other == org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo.getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (!other.getEncoding().isEmpty()) { - encoding_ = other.encoding_; - onChanged(); - } - if (!other.getHeader().isEmpty()) { - header_ = other.header_; - onChanged(); - } - if (!other.getSigningAlgorithm().isEmpty()) { - signingAlgorithm_ = other.signingAlgorithm_; - onChanged(); - } - internalGetMutableCustomClaims().mergeFrom( - other.internalGetCustomClaims()); - if (other.getTokenTTL() != 0) { - setTokenTTL(other.getTokenTTL()); - } - 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.api.BackendJWTTokenInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private boolean enabled_ ; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 1; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * bool enabled = 1; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private java.lang.Object encoding_ = ""; - /** - * string encoding = 2; - * @return The encoding. - */ - public java.lang.String getEncoding() { - java.lang.Object ref = encoding_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - encoding_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string encoding = 2; - * @return The bytes for encoding. - */ - public com.google.protobuf.ByteString - getEncodingBytes() { - java.lang.Object ref = encoding_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - encoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string encoding = 2; - * @param value The encoding to set. - * @return This builder for chaining. - */ - public Builder setEncoding( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - encoding_ = value; - onChanged(); - return this; - } - /** - * string encoding = 2; - * @return This builder for chaining. - */ - public Builder clearEncoding() { - - encoding_ = getDefaultInstance().getEncoding(); - onChanged(); - return this; - } - /** - * string encoding = 2; - * @param value The bytes for encoding to set. - * @return This builder for chaining. - */ - public Builder setEncodingBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - encoding_ = value; - onChanged(); - return this; - } - - private java.lang.Object header_ = ""; - /** - * string header = 3; - * @return The header. - */ - public java.lang.String getHeader() { - java.lang.Object ref = header_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - header_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string header = 3; - * @return The bytes for header. - */ - public com.google.protobuf.ByteString - getHeaderBytes() { - java.lang.Object ref = header_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - header_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string header = 3; - * @param value The header to set. - * @return This builder for chaining. - */ - public Builder setHeader( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - header_ = value; - onChanged(); - return this; - } - /** - * string header = 3; - * @return This builder for chaining. - */ - public Builder clearHeader() { - - header_ = getDefaultInstance().getHeader(); - onChanged(); - return this; - } - /** - * string header = 3; - * @param value The bytes for header to set. - * @return This builder for chaining. - */ - public Builder setHeaderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - header_ = value; - onChanged(); - return this; - } - - private java.lang.Object signingAlgorithm_ = ""; - /** - * string signingAlgorithm = 4; - * @return The signingAlgorithm. - */ - public java.lang.String getSigningAlgorithm() { - java.lang.Object ref = signingAlgorithm_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - signingAlgorithm_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string signingAlgorithm = 4; - * @return The bytes for signingAlgorithm. - */ - public com.google.protobuf.ByteString - getSigningAlgorithmBytes() { - java.lang.Object ref = signingAlgorithm_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - signingAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string signingAlgorithm = 4; - * @param value The signingAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setSigningAlgorithm( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - signingAlgorithm_ = value; - onChanged(); - return this; - } - /** - * string signingAlgorithm = 4; - * @return This builder for chaining. - */ - public Builder clearSigningAlgorithm() { - - signingAlgorithm_ = getDefaultInstance().getSigningAlgorithm(); - onChanged(); - return this; - } - /** - * string signingAlgorithm = 4; - * @param value The bytes for signingAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setSigningAlgorithmBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - signingAlgorithm_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, org.wso2.apk.enforcer.discovery.api.Claim> customClaims_; - private com.google.protobuf.MapField - internalGetCustomClaims() { - if (customClaims_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CustomClaimsDefaultEntryHolder.defaultEntry); - } - return customClaims_; - } - private com.google.protobuf.MapField - internalGetMutableCustomClaims() { - onChanged();; - if (customClaims_ == null) { - customClaims_ = com.google.protobuf.MapField.newMapField( - CustomClaimsDefaultEntryHolder.defaultEntry); - } - if (!customClaims_.isMutable()) { - customClaims_ = customClaims_.copy(); - } - return customClaims_; - } - - public int getCustomClaimsCount() { - return internalGetCustomClaims().getMap().size(); - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - - @java.lang.Override - public boolean containsCustomClaims( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetCustomClaims().getMap().containsKey(key); - } - /** - * Use {@link #getCustomClaimsMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getCustomClaims() { - return getCustomClaimsMap(); - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - @java.lang.Override - - public java.util.Map getCustomClaimsMap() { - return internalGetCustomClaims().getMap(); - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - @java.lang.Override - - public org.wso2.apk.enforcer.discovery.api.Claim getCustomClaimsOrDefault( - java.lang.String key, - org.wso2.apk.enforcer.discovery.api.Claim defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCustomClaims().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - @java.lang.Override - - public org.wso2.apk.enforcer.discovery.api.Claim getCustomClaimsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCustomClaims().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearCustomClaims() { - internalGetMutableCustomClaims().getMutableMap() - .clear(); - return this; - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - - public Builder removeCustomClaims( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableCustomClaims().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableCustomClaims() { - return internalGetMutableCustomClaims().getMutableMap(); - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - public Builder putCustomClaims( - java.lang.String key, - org.wso2.apk.enforcer.discovery.api.Claim value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableCustomClaims().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - - public Builder putAllCustomClaims( - java.util.Map values) { - internalGetMutableCustomClaims().getMutableMap() - .putAll(values); - return this; - } - - private int tokenTTL_ ; - /** - * int32 tokenTTL = 6; - * @return The tokenTTL. - */ - @java.lang.Override - public int getTokenTTL() { - return tokenTTL_; - } - /** - * int32 tokenTTL = 6; - * @param value The tokenTTL to set. - * @return This builder for chaining. - */ - public Builder setTokenTTL(int value) { - - tokenTTL_ = value; - onChanged(); - return this; - } - /** - * int32 tokenTTL = 6; - * @return This builder for chaining. - */ - public Builder clearTokenTTL() { - - tokenTTL_ = 0; - 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.api.BackendJWTTokenInfo) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.BackendJWTTokenInfo) - private static final org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo(); - } - - public static org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BackendJWTTokenInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BackendJWTTokenInfo(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.api.BackendJWTTokenInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfoOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfoOrBuilder.java deleted file mode 100644 index 1526cb5cf2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfoOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/BackendJWTTokenInfo.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface BackendJWTTokenInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.BackendJWTTokenInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * bool enabled = 1; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * string encoding = 2; - * @return The encoding. - */ - java.lang.String getEncoding(); - /** - * string encoding = 2; - * @return The bytes for encoding. - */ - com.google.protobuf.ByteString - getEncodingBytes(); - - /** - * string header = 3; - * @return The header. - */ - java.lang.String getHeader(); - /** - * string header = 3; - * @return The bytes for header. - */ - com.google.protobuf.ByteString - getHeaderBytes(); - - /** - * string signingAlgorithm = 4; - * @return The signingAlgorithm. - */ - java.lang.String getSigningAlgorithm(); - /** - * string signingAlgorithm = 4; - * @return The bytes for signingAlgorithm. - */ - com.google.protobuf.ByteString - getSigningAlgorithmBytes(); - - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - int getCustomClaimsCount(); - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - boolean containsCustomClaims( - java.lang.String key); - /** - * Use {@link #getCustomClaimsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getCustomClaims(); - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - java.util.Map - getCustomClaimsMap(); - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - - org.wso2.apk.enforcer.discovery.api.Claim getCustomClaimsOrDefault( - java.lang.String key, - org.wso2.apk.enforcer.discovery.api.Claim defaultValue); - /** - * map<string, .wso2.discovery.api.Claim> customClaims = 5; - */ - - org.wso2.apk.enforcer.discovery.api.Claim getCustomClaimsOrThrow( - java.lang.String key); - - /** - * int32 tokenTTL = 6; - * @return The tokenTTL. - */ - int getTokenTTL(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfoProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfoProto.java deleted file mode 100644 index b458dffebe..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/BackendJWTTokenInfoProto.java +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/BackendJWTTokenInfo.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class BackendJWTTokenInfoProto { - private BackendJWTTokenInfoProto() {} - 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_api_BackendJWTTokenInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_BackendJWTTokenInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_BackendJWTTokenInfo_CustomClaimsEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_BackendJWTTokenInfo_CustomClaimsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_Claim_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Claim_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n,wso2/discovery/api/BackendJWTTokenInfo" + - ".proto\022\022wso2.discovery.api\"\225\002\n\023BackendJW" + - "TTokenInfo\022\017\n\007enabled\030\001 \001(\010\022\020\n\010encoding\030" + - "\002 \001(\t\022\016\n\006header\030\003 \001(\t\022\030\n\020signingAlgorith" + - "m\030\004 \001(\t\022O\n\014customClaims\030\005 \003(\01329.wso2.dis" + - "covery.api.BackendJWTTokenInfo.CustomCla" + - "imsEntry\022\020\n\010tokenTTL\030\006 \001(\005\032N\n\021CustomClai" + - "msEntry\022\013\n\003key\030\001 \001(\t\022(\n\005value\030\002 \001(\0132\031.ws" + - "o2.discovery.api.Claim:\0028\001\"$\n\005Claim\022\r\n\005v" + - "alue\030\001 \001(\t\022\014\n\004type\030\002 \001(\tB\200\001\n#org.wso2.ap" + - "k.enforcer.discovery.apiB\030BackendJWTToke" + - "nInfoProtoP\001Z=github.com/envoyproxy/go-c" + - "ontrol-plane/wso2/discovery/api;apib\006pro" + - "to3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_api_BackendJWTTokenInfo_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_BackendJWTTokenInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_BackendJWTTokenInfo_descriptor, - new java.lang.String[] { "Enabled", "Encoding", "Header", "SigningAlgorithm", "CustomClaims", "TokenTTL", }); - internal_static_wso2_discovery_api_BackendJWTTokenInfo_CustomClaimsEntry_descriptor = - internal_static_wso2_discovery_api_BackendJWTTokenInfo_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_api_BackendJWTTokenInfo_CustomClaimsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_BackendJWTTokenInfo_CustomClaimsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_wso2_discovery_api_Claim_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_api_Claim_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Claim_descriptor, - new java.lang.String[] { "Value", "Type", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Certificate.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Certificate.java deleted file mode 100644 index f53500587b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Certificate.java +++ /dev/null @@ -1,633 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Certificate.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Certificates config model
- * 
- * - * Protobuf type {@code wso2.discovery.api.Certificate} - */ -public final class Certificate extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.Certificate) - CertificateOrBuilder { -private static final long serialVersionUID = 0L; - // Use Certificate.newBuilder() to construct. - private Certificate(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Certificate() { - alias_ = ""; - content_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Certificate(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Certificate( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - alias_ = s; - break; - } - case 18: { - - content_ = input.readBytes(); - 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.api.CertificateProto.internal_static_wso2_discovery_api_Certificate_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.CertificateProto.internal_static_wso2_discovery_api_Certificate_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Certificate.class, org.wso2.apk.enforcer.discovery.api.Certificate.Builder.class); - } - - public static final int ALIAS_FIELD_NUMBER = 1; - private volatile java.lang.Object alias_; - /** - * string alias = 1; - * @return The alias. - */ - @java.lang.Override - public java.lang.String getAlias() { - java.lang.Object ref = alias_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - alias_ = s; - return s; - } - } - /** - * string alias = 1; - * @return The bytes for alias. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAliasBytes() { - java.lang.Object ref = alias_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - alias_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONTENT_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString content_; - /** - * bytes content = 2; - * @return The content. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContent() { - return content_; - } - - 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 (!getAliasBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, alias_); - } - if (!content_.isEmpty()) { - output.writeBytes(2, content_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getAliasBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, alias_); - } - if (!content_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, content_); - } - 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.api.Certificate)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.Certificate other = (org.wso2.apk.enforcer.discovery.api.Certificate) obj; - - if (!getAlias() - .equals(other.getAlias())) return false; - if (!getContent() - .equals(other.getContent())) 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) + ALIAS_FIELD_NUMBER; - hash = (53 * hash) + getAlias().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.Certificate parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Certificate 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.api.Certificate parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Certificate 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.api.Certificate parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Certificate 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.api.Certificate parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Certificate 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.api.Certificate parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Certificate 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.api.Certificate 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.api.Certificate 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.api.Certificate 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; - } - /** - *
-   * Certificates config model
-   * 
- * - * Protobuf type {@code wso2.discovery.api.Certificate} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.Certificate) - org.wso2.apk.enforcer.discovery.api.CertificateOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.CertificateProto.internal_static_wso2_discovery_api_Certificate_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.CertificateProto.internal_static_wso2_discovery_api_Certificate_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Certificate.class, org.wso2.apk.enforcer.discovery.api.Certificate.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.Certificate.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(); - alias_ = ""; - - content_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.CertificateProto.internal_static_wso2_discovery_api_Certificate_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Certificate getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.Certificate.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Certificate build() { - org.wso2.apk.enforcer.discovery.api.Certificate result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Certificate buildPartial() { - org.wso2.apk.enforcer.discovery.api.Certificate result = new org.wso2.apk.enforcer.discovery.api.Certificate(this); - result.alias_ = alias_; - result.content_ = content_; - 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.api.Certificate) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.Certificate)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.Certificate other) { - if (other == org.wso2.apk.enforcer.discovery.api.Certificate.getDefaultInstance()) return this; - if (!other.getAlias().isEmpty()) { - alias_ = other.alias_; - onChanged(); - } - if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { - setContent(other.getContent()); - } - 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.api.Certificate parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.Certificate) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object alias_ = ""; - /** - * string alias = 1; - * @return The alias. - */ - public java.lang.String getAlias() { - java.lang.Object ref = alias_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - alias_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string alias = 1; - * @return The bytes for alias. - */ - public com.google.protobuf.ByteString - getAliasBytes() { - java.lang.Object ref = alias_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - alias_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string alias = 1; - * @param value The alias to set. - * @return This builder for chaining. - */ - public Builder setAlias( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - alias_ = value; - onChanged(); - return this; - } - /** - * string alias = 1; - * @return This builder for chaining. - */ - public Builder clearAlias() { - - alias_ = getDefaultInstance().getAlias(); - onChanged(); - return this; - } - /** - * string alias = 1; - * @param value The bytes for alias to set. - * @return This builder for chaining. - */ - public Builder setAliasBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - alias_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes content = 2; - * @return The content. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContent() { - return content_; - } - /** - * bytes content = 2; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - * bytes content = 2; - * @return This builder for chaining. - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - 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.api.Certificate) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.Certificate) - private static final org.wso2.apk.enforcer.discovery.api.Certificate DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.Certificate(); - } - - public static org.wso2.apk.enforcer.discovery.api.Certificate getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Certificate parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Certificate(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.api.Certificate getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/CertificateOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/CertificateOrBuilder.java deleted file mode 100644 index 51080ae9f6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/CertificateOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Certificate.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface CertificateOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.Certificate) - com.google.protobuf.MessageOrBuilder { - - /** - * string alias = 1; - * @return The alias. - */ - java.lang.String getAlias(); - /** - * string alias = 1; - * @return The bytes for alias. - */ - com.google.protobuf.ByteString - getAliasBytes(); - - /** - * bytes content = 2; - * @return The content. - */ - com.google.protobuf.ByteString getContent(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/CertificateProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/CertificateProto.java deleted file mode 100644 index 484d5794ad..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/CertificateProto.java +++ /dev/null @@ -1,51 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Certificate.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class CertificateProto { - private CertificateProto() {} - 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_api_Certificate_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Certificate_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n$wso2/discovery/api/Certificate.proto\022\022" + - "wso2.discovery.api\"-\n\013Certificate\022\r\n\005ali" + - "as\030\001 \001(\t\022\017\n\007content\030\002 \001(\014Bx\n#org.wso2.ap" + - "k.enforcer.discovery.apiB\020CertificatePro" + - "toP\001Z=github.com/envoyproxy/go-control-p" + - "lane/wso2/discovery/api;apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_api_Certificate_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_Certificate_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Certificate_descriptor, - new java.lang.String[] { "Alias", "Content", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Claim.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Claim.java deleted file mode 100644 index fbb116f66e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Claim.java +++ /dev/null @@ -1,695 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/BackendJWTTokenInfo.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - * Protobuf type {@code wso2.discovery.api.Claim} - */ -public final class Claim extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.Claim) - ClaimOrBuilder { -private static final long serialVersionUID = 0L; - // Use Claim.newBuilder() to construct. - private Claim(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Claim() { - value_ = ""; - type_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Claim(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Claim( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_Claim_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_Claim_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Claim.class, org.wso2.apk.enforcer.discovery.api.Claim.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object value_; - /** - * string value = 1; - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } - } - /** - * string value = 1; - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object type_; - /** - * string type = 2; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - * string type = 2; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); - } - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - 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.api.Claim)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.Claim other = (org.wso2.apk.enforcer.discovery.api.Claim) obj; - - if (!getValue() - .equals(other.getValue())) return false; - if (!getType() - .equals(other.getType())) 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) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.Claim parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Claim 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.api.Claim parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Claim 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.api.Claim parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Claim 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.api.Claim parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Claim 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.api.Claim parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Claim 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.api.Claim 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.api.Claim 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.api.Claim prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.api.Claim} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.Claim) - org.wso2.apk.enforcer.discovery.api.ClaimOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_Claim_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_Claim_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Claim.class, org.wso2.apk.enforcer.discovery.api.Claim.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.Claim.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(); - value_ = ""; - - type_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.BackendJWTTokenInfoProto.internal_static_wso2_discovery_api_Claim_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Claim getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.Claim.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Claim build() { - org.wso2.apk.enforcer.discovery.api.Claim result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Claim buildPartial() { - org.wso2.apk.enforcer.discovery.api.Claim result = new org.wso2.apk.enforcer.discovery.api.Claim(this); - result.value_ = value_; - result.type_ = type_; - 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.api.Claim) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.Claim)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.Claim other) { - if (other == org.wso2.apk.enforcer.discovery.api.Claim.getDefaultInstance()) return this; - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.Claim parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.Claim) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object value_ = ""; - /** - * string value = 1; - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string value = 1; - * @return The bytes for value. - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string value = 1; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * string value = 1; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - * string value = 1; - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - - private java.lang.Object type_ = ""; - /** - * string type = 2; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string type = 2; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string type = 2; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - * string type = 2; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - * string type = 2; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - @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.api.Claim) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.Claim) - private static final org.wso2.apk.enforcer.discovery.api.Claim DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.Claim(); - } - - public static org.wso2.apk.enforcer.discovery.api.Claim getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Claim parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Claim(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.api.Claim getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ClaimOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ClaimOrBuilder.java deleted file mode 100644 index c231bc1437..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ClaimOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/BackendJWTTokenInfo.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface ClaimOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.Claim) - com.google.protobuf.MessageOrBuilder { - - /** - * string value = 1; - * @return The value. - */ - java.lang.String getValue(); - /** - * string value = 1; - * @return The bytes for value. - */ - com.google.protobuf.ByteString - getValueBytes(); - - /** - * string type = 2; - * @return The type. - */ - java.lang.String getType(); - /** - * string type = 2; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Endpoint.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Endpoint.java deleted file mode 100644 index f3f40c00a5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Endpoint.java +++ /dev/null @@ -1,905 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Endpoint.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Endpoint config model
- * 
- * - * Protobuf type {@code wso2.discovery.api.Endpoint} - */ -public final class Endpoint extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.Endpoint) - EndpointOrBuilder { -private static final long serialVersionUID = 0L; - // Use Endpoint.newBuilder() to construct. - private Endpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Endpoint() { - host_ = ""; - basepath_ = ""; - uRLType_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Endpoint(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Endpoint( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - host_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - basepath_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - uRLType_ = s; - break; - } - case 32: { - - port_ = input.readUInt32(); - 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.api.EndpointProto.internal_static_wso2_discovery_api_Endpoint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointProto.internal_static_wso2_discovery_api_Endpoint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Endpoint.class, org.wso2.apk.enforcer.discovery.api.Endpoint.Builder.class); - } - - public static final int HOST_FIELD_NUMBER = 1; - private volatile java.lang.Object host_; - /** - * string host = 1; - * @return The host. - */ - @java.lang.Override - public java.lang.String getHost() { - java.lang.Object ref = host_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - host_ = s; - return s; - } - } - /** - * string host = 1; - * @return The bytes for host. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getHostBytes() { - java.lang.Object ref = host_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - host_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BASEPATH_FIELD_NUMBER = 2; - private volatile java.lang.Object basepath_; - /** - * string basepath = 2; - * @return The basepath. - */ - @java.lang.Override - public java.lang.String getBasepath() { - java.lang.Object ref = basepath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - basepath_ = s; - return s; - } - } - /** - * string basepath = 2; - * @return The bytes for basepath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getBasepathBytes() { - java.lang.Object ref = basepath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - basepath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int URLTYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object uRLType_; - /** - * string uRLType = 3; - * @return The uRLType. - */ - @java.lang.Override - public java.lang.String getURLType() { - java.lang.Object ref = uRLType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uRLType_ = s; - return s; - } - } - /** - * string uRLType = 3; - * @return The bytes for uRLType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getURLTypeBytes() { - java.lang.Object ref = uRLType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uRLType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PORT_FIELD_NUMBER = 4; - private int port_; - /** - * uint32 port = 4; - * @return The port. - */ - @java.lang.Override - public int getPort() { - return port_; - } - - 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 (!getHostBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, host_); - } - if (!getBasepathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, basepath_); - } - if (!getURLTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uRLType_); - } - if (port_ != 0) { - output.writeUInt32(4, port_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getHostBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, host_); - } - if (!getBasepathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, basepath_); - } - if (!getURLTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uRLType_); - } - if (port_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(4, port_); - } - 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.api.Endpoint)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.Endpoint other = (org.wso2.apk.enforcer.discovery.api.Endpoint) obj; - - if (!getHost() - .equals(other.getHost())) return false; - if (!getBasepath() - .equals(other.getBasepath())) return false; - if (!getURLType() - .equals(other.getURLType())) return false; - if (getPort() - != other.getPort()) 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) + HOST_FIELD_NUMBER; - hash = (53 * hash) + getHost().hashCode(); - hash = (37 * hash) + BASEPATH_FIELD_NUMBER; - hash = (53 * hash) + getBasepath().hashCode(); - hash = (37 * hash) + URLTYPE_FIELD_NUMBER; - hash = (53 * hash) + getURLType().hashCode(); - hash = (37 * hash) + PORT_FIELD_NUMBER; - hash = (53 * hash) + getPort(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.Endpoint parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Endpoint 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.api.Endpoint parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Endpoint 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.api.Endpoint parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Endpoint 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.api.Endpoint parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Endpoint 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.api.Endpoint parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Endpoint 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.api.Endpoint 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.api.Endpoint 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.api.Endpoint 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; - } - /** - *
-   * Endpoint config model
-   * 
- * - * Protobuf type {@code wso2.discovery.api.Endpoint} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.Endpoint) - org.wso2.apk.enforcer.discovery.api.EndpointOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.EndpointProto.internal_static_wso2_discovery_api_Endpoint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointProto.internal_static_wso2_discovery_api_Endpoint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Endpoint.class, org.wso2.apk.enforcer.discovery.api.Endpoint.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.Endpoint.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(); - host_ = ""; - - basepath_ = ""; - - uRLType_ = ""; - - port_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.EndpointProto.internal_static_wso2_discovery_api_Endpoint_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Endpoint getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.Endpoint.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Endpoint build() { - org.wso2.apk.enforcer.discovery.api.Endpoint result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Endpoint buildPartial() { - org.wso2.apk.enforcer.discovery.api.Endpoint result = new org.wso2.apk.enforcer.discovery.api.Endpoint(this); - result.host_ = host_; - result.basepath_ = basepath_; - result.uRLType_ = uRLType_; - result.port_ = port_; - 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.api.Endpoint) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.Endpoint)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.Endpoint other) { - if (other == org.wso2.apk.enforcer.discovery.api.Endpoint.getDefaultInstance()) return this; - if (!other.getHost().isEmpty()) { - host_ = other.host_; - onChanged(); - } - if (!other.getBasepath().isEmpty()) { - basepath_ = other.basepath_; - onChanged(); - } - if (!other.getURLType().isEmpty()) { - uRLType_ = other.uRLType_; - onChanged(); - } - if (other.getPort() != 0) { - setPort(other.getPort()); - } - 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.api.Endpoint parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.Endpoint) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object host_ = ""; - /** - * string host = 1; - * @return The host. - */ - public java.lang.String getHost() { - java.lang.Object ref = host_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - host_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string host = 1; - * @return The bytes for host. - */ - public com.google.protobuf.ByteString - getHostBytes() { - java.lang.Object ref = host_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - host_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string host = 1; - * @param value The host to set. - * @return This builder for chaining. - */ - public Builder setHost( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - host_ = value; - onChanged(); - return this; - } - /** - * string host = 1; - * @return This builder for chaining. - */ - public Builder clearHost() { - - host_ = getDefaultInstance().getHost(); - onChanged(); - return this; - } - /** - * string host = 1; - * @param value The bytes for host to set. - * @return This builder for chaining. - */ - public Builder setHostBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - host_ = value; - onChanged(); - return this; - } - - private java.lang.Object basepath_ = ""; - /** - * string basepath = 2; - * @return The basepath. - */ - public java.lang.String getBasepath() { - java.lang.Object ref = basepath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - basepath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string basepath = 2; - * @return The bytes for basepath. - */ - public com.google.protobuf.ByteString - getBasepathBytes() { - java.lang.Object ref = basepath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - basepath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string basepath = 2; - * @param value The basepath to set. - * @return This builder for chaining. - */ - public Builder setBasepath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - basepath_ = value; - onChanged(); - return this; - } - /** - * string basepath = 2; - * @return This builder for chaining. - */ - public Builder clearBasepath() { - - basepath_ = getDefaultInstance().getBasepath(); - onChanged(); - return this; - } - /** - * string basepath = 2; - * @param value The bytes for basepath to set. - * @return This builder for chaining. - */ - public Builder setBasepathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - basepath_ = value; - onChanged(); - return this; - } - - private java.lang.Object uRLType_ = ""; - /** - * string uRLType = 3; - * @return The uRLType. - */ - public java.lang.String getURLType() { - java.lang.Object ref = uRLType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uRLType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uRLType = 3; - * @return The bytes for uRLType. - */ - public com.google.protobuf.ByteString - getURLTypeBytes() { - java.lang.Object ref = uRLType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uRLType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uRLType = 3; - * @param value The uRLType to set. - * @return This builder for chaining. - */ - public Builder setURLType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uRLType_ = value; - onChanged(); - return this; - } - /** - * string uRLType = 3; - * @return This builder for chaining. - */ - public Builder clearURLType() { - - uRLType_ = getDefaultInstance().getURLType(); - onChanged(); - return this; - } - /** - * string uRLType = 3; - * @param value The bytes for uRLType to set. - * @return This builder for chaining. - */ - public Builder setURLTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uRLType_ = value; - onChanged(); - return this; - } - - private int port_ ; - /** - * uint32 port = 4; - * @return The port. - */ - @java.lang.Override - public int getPort() { - return port_; - } - /** - * uint32 port = 4; - * @param value The port to set. - * @return This builder for chaining. - */ - public Builder setPort(int value) { - - port_ = value; - onChanged(); - return this; - } - /** - * uint32 port = 4; - * @return This builder for chaining. - */ - public Builder clearPort() { - - port_ = 0; - 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.api.Endpoint) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.Endpoint) - private static final org.wso2.apk.enforcer.discovery.api.Endpoint DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.Endpoint(); - } - - public static org.wso2.apk.enforcer.discovery.api.Endpoint getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Endpoint parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Endpoint(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.api.Endpoint getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointCluster.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointCluster.java deleted file mode 100644 index 2d0afc4173..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointCluster.java +++ /dev/null @@ -1,966 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Holds endpoint URLs and the config
- * 
- * - * Protobuf type {@code wso2.discovery.api.EndpointCluster} - */ -public final class EndpointCluster extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.EndpointCluster) - EndpointClusterOrBuilder { -private static final long serialVersionUID = 0L; - // Use EndpointCluster.newBuilder() to construct. - private EndpointCluster(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EndpointCluster() { - urls_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EndpointCluster(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EndpointCluster( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - urls_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - urls_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.Endpoint.parser(), extensionRegistry)); - break; - } - case 18: { - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - urls_ = java.util.Collections.unmodifiableList(urls_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointCluster_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointCluster_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.EndpointCluster.class, org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder.class); - } - - public static final int URLS_FIELD_NUMBER = 1; - private java.util.List urls_; - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - @java.lang.Override - public java.util.List getUrlsList() { - return urls_; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - @java.lang.Override - public java.util.List - getUrlsOrBuilderList() { - return urls_; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - @java.lang.Override - public int getUrlsCount() { - return urls_.size(); - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Endpoint getUrls(int index) { - return urls_.get(index); - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointOrBuilder getUrlsOrBuilder( - int index) { - return urls_.get(index); - } - - public static final int CONFIG_FIELD_NUMBER = 2; - private org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig config_; - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - * @return The config. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig getConfig() { - return config_ == null ? org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.getDefaultInstance() : config_; - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointClusterConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < urls_.size(); i++) { - output.writeMessage(1, urls_.get(i)); - } - if (config_ != null) { - output.writeMessage(2, getConfig()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < urls_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, urls_.get(i)); - } - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getConfig()); - } - 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.api.EndpointCluster)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.EndpointCluster other = (org.wso2.apk.enforcer.discovery.api.EndpointCluster) obj; - - if (!getUrlsList() - .equals(other.getUrlsList())) return false; - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig() - .equals(other.getConfig())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getUrlsCount() > 0) { - hash = (37 * hash) + URLS_FIELD_NUMBER; - hash = (53 * hash) + getUrlsList().hashCode(); - } - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.EndpointCluster parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointCluster 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.api.EndpointCluster parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointCluster 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.api.EndpointCluster parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointCluster 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.api.EndpointCluster parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointCluster 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.api.EndpointCluster parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointCluster 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.api.EndpointCluster 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.api.EndpointCluster 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.api.EndpointCluster 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; - } - /** - *
-   * Holds endpoint URLs and the config
-   * 
- * - * Protobuf type {@code wso2.discovery.api.EndpointCluster} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.EndpointCluster) - org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointCluster_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointCluster_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.EndpointCluster.class, org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.EndpointCluster.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getUrlsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (urlsBuilder_ == null) { - urls_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - urlsBuilder_.clear(); - } - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointCluster_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointCluster getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.EndpointCluster.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointCluster build() { - org.wso2.apk.enforcer.discovery.api.EndpointCluster result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointCluster buildPartial() { - org.wso2.apk.enforcer.discovery.api.EndpointCluster result = new org.wso2.apk.enforcer.discovery.api.EndpointCluster(this); - int from_bitField0_ = bitField0_; - if (urlsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - urls_ = java.util.Collections.unmodifiableList(urls_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.urls_ = urls_; - } else { - result.urls_ = urlsBuilder_.build(); - } - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.EndpointCluster) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.EndpointCluster)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.EndpointCluster other) { - if (other == org.wso2.apk.enforcer.discovery.api.EndpointCluster.getDefaultInstance()) return this; - if (urlsBuilder_ == null) { - if (!other.urls_.isEmpty()) { - if (urls_.isEmpty()) { - urls_ = other.urls_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureUrlsIsMutable(); - urls_.addAll(other.urls_); - } - onChanged(); - } - } else { - if (!other.urls_.isEmpty()) { - if (urlsBuilder_.isEmpty()) { - urlsBuilder_.dispose(); - urlsBuilder_ = null; - urls_ = other.urls_; - bitField0_ = (bitField0_ & ~0x00000001); - urlsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getUrlsFieldBuilder() : null; - } else { - urlsBuilder_.addAllMessages(other.urls_); - } - } - } - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - 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.api.EndpointCluster parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.EndpointCluster) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List urls_ = - java.util.Collections.emptyList(); - private void ensureUrlsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - urls_ = new java.util.ArrayList(urls_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Endpoint, org.wso2.apk.enforcer.discovery.api.Endpoint.Builder, org.wso2.apk.enforcer.discovery.api.EndpointOrBuilder> urlsBuilder_; - - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public java.util.List getUrlsList() { - if (urlsBuilder_ == null) { - return java.util.Collections.unmodifiableList(urls_); - } else { - return urlsBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public int getUrlsCount() { - if (urlsBuilder_ == null) { - return urls_.size(); - } else { - return urlsBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public org.wso2.apk.enforcer.discovery.api.Endpoint getUrls(int index) { - if (urlsBuilder_ == null) { - return urls_.get(index); - } else { - return urlsBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder setUrls( - int index, org.wso2.apk.enforcer.discovery.api.Endpoint value) { - if (urlsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureUrlsIsMutable(); - urls_.set(index, value); - onChanged(); - } else { - urlsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder setUrls( - int index, org.wso2.apk.enforcer.discovery.api.Endpoint.Builder builderForValue) { - if (urlsBuilder_ == null) { - ensureUrlsIsMutable(); - urls_.set(index, builderForValue.build()); - onChanged(); - } else { - urlsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder addUrls(org.wso2.apk.enforcer.discovery.api.Endpoint value) { - if (urlsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureUrlsIsMutable(); - urls_.add(value); - onChanged(); - } else { - urlsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder addUrls( - int index, org.wso2.apk.enforcer.discovery.api.Endpoint value) { - if (urlsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureUrlsIsMutable(); - urls_.add(index, value); - onChanged(); - } else { - urlsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder addUrls( - org.wso2.apk.enforcer.discovery.api.Endpoint.Builder builderForValue) { - if (urlsBuilder_ == null) { - ensureUrlsIsMutable(); - urls_.add(builderForValue.build()); - onChanged(); - } else { - urlsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder addUrls( - int index, org.wso2.apk.enforcer.discovery.api.Endpoint.Builder builderForValue) { - if (urlsBuilder_ == null) { - ensureUrlsIsMutable(); - urls_.add(index, builderForValue.build()); - onChanged(); - } else { - urlsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder addAllUrls( - java.lang.Iterable values) { - if (urlsBuilder_ == null) { - ensureUrlsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, urls_); - onChanged(); - } else { - urlsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder clearUrls() { - if (urlsBuilder_ == null) { - urls_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - urlsBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public Builder removeUrls(int index) { - if (urlsBuilder_ == null) { - ensureUrlsIsMutable(); - urls_.remove(index); - onChanged(); - } else { - urlsBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public org.wso2.apk.enforcer.discovery.api.Endpoint.Builder getUrlsBuilder( - int index) { - return getUrlsFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public org.wso2.apk.enforcer.discovery.api.EndpointOrBuilder getUrlsOrBuilder( - int index) { - if (urlsBuilder_ == null) { - return urls_.get(index); } else { - return urlsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public java.util.List - getUrlsOrBuilderList() { - if (urlsBuilder_ != null) { - return urlsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(urls_); - } - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public org.wso2.apk.enforcer.discovery.api.Endpoint.Builder addUrlsBuilder() { - return getUrlsFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.Endpoint.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public org.wso2.apk.enforcer.discovery.api.Endpoint.Builder addUrlsBuilder( - int index) { - return getUrlsFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.Endpoint.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - public java.util.List - getUrlsBuilderList() { - return getUrlsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Endpoint, org.wso2.apk.enforcer.discovery.api.Endpoint.Builder, org.wso2.apk.enforcer.discovery.api.EndpointOrBuilder> - getUrlsFieldBuilder() { - if (urlsBuilder_ == null) { - urlsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Endpoint, org.wso2.apk.enforcer.discovery.api.Endpoint.Builder, org.wso2.apk.enforcer.discovery.api.EndpointOrBuilder>( - urls_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - urls_ = null; - } - return urlsBuilder_; - } - - private org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig, org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterConfigOrBuilder> configBuilder_; - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - * @return The config. - */ - public org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null ? org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.getDefaultInstance() : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - public Builder setConfig(org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - public Builder setConfig( - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - public Builder mergeConfig(org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.newBuilder(config_).mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - public org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - public org.wso2.apk.enforcer.discovery.api.EndpointClusterConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null ? - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.getDefaultInstance() : config_; - } - } - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig, org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig, org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterConfigOrBuilder>( - getConfig(), - getParentForChildren(), - isClean()); - config_ = null; - } - return configBuilder_; - } - @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.api.EndpointCluster) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.EndpointCluster) - private static final org.wso2.apk.enforcer.discovery.api.EndpointCluster DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.EndpointCluster(); - } - - public static org.wso2.apk.enforcer.discovery.api.EndpointCluster getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EndpointCluster parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EndpointCluster(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.api.EndpointCluster getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterConfig.java deleted file mode 100644 index f70578a888..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterConfig.java +++ /dev/null @@ -1,795 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - * Protobuf type {@code wso2.discovery.api.EndpointClusterConfig} - */ -public final class EndpointClusterConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.EndpointClusterConfig) - EndpointClusterConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use EndpointClusterConfig.newBuilder() to construct. - private EndpointClusterConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EndpointClusterConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EndpointClusterConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EndpointClusterConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - org.wso2.apk.enforcer.discovery.api.RetryConfig.Builder subBuilder = null; - if (retryConfig_ != null) { - subBuilder = retryConfig_.toBuilder(); - } - retryConfig_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.RetryConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(retryConfig_); - retryConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - org.wso2.apk.enforcer.discovery.api.TimeoutConfig.Builder subBuilder = null; - if (timeoutConfig_ != null) { - subBuilder = timeoutConfig_.toBuilder(); - } - timeoutConfig_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.TimeoutConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(timeoutConfig_); - timeoutConfig_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointClusterConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointClusterConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.class, org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.Builder.class); - } - - public static final int RETRYCONFIG_FIELD_NUMBER = 1; - private org.wso2.apk.enforcer.discovery.api.RetryConfig retryConfig_; - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - * @return Whether the retryConfig field is set. - */ - @java.lang.Override - public boolean hasRetryConfig() { - return retryConfig_ != null; - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - * @return The retryConfig. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.RetryConfig getRetryConfig() { - return retryConfig_ == null ? org.wso2.apk.enforcer.discovery.api.RetryConfig.getDefaultInstance() : retryConfig_; - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.RetryConfigOrBuilder getRetryConfigOrBuilder() { - return getRetryConfig(); - } - - public static final int TIMEOUTCONFIG_FIELD_NUMBER = 2; - private org.wso2.apk.enforcer.discovery.api.TimeoutConfig timeoutConfig_; - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - * @return Whether the timeoutConfig field is set. - */ - @java.lang.Override - public boolean hasTimeoutConfig() { - return timeoutConfig_ != null; - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - * @return The timeoutConfig. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.TimeoutConfig getTimeoutConfig() { - return timeoutConfig_ == null ? org.wso2.apk.enforcer.discovery.api.TimeoutConfig.getDefaultInstance() : timeoutConfig_; - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.TimeoutConfigOrBuilder getTimeoutConfigOrBuilder() { - return getTimeoutConfig(); - } - - 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 (retryConfig_ != null) { - output.writeMessage(1, getRetryConfig()); - } - if (timeoutConfig_ != null) { - output.writeMessage(2, getTimeoutConfig()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (retryConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getRetryConfig()); - } - if (timeoutConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTimeoutConfig()); - } - 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.api.EndpointClusterConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig other = (org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig) obj; - - if (hasRetryConfig() != other.hasRetryConfig()) return false; - if (hasRetryConfig()) { - if (!getRetryConfig() - .equals(other.getRetryConfig())) return false; - } - if (hasTimeoutConfig() != other.hasTimeoutConfig()) return false; - if (hasTimeoutConfig()) { - if (!getTimeoutConfig() - .equals(other.getTimeoutConfig())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasRetryConfig()) { - hash = (37 * hash) + RETRYCONFIG_FIELD_NUMBER; - hash = (53 * hash) + getRetryConfig().hashCode(); - } - if (hasTimeoutConfig()) { - hash = (37 * hash) + TIMEOUTCONFIG_FIELD_NUMBER; - hash = (53 * hash) + getTimeoutConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig 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.api.EndpointClusterConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig 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.api.EndpointClusterConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig 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.api.EndpointClusterConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig 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.api.EndpointClusterConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig 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.api.EndpointClusterConfig 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.api.EndpointClusterConfig 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.api.EndpointClusterConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.api.EndpointClusterConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.EndpointClusterConfig) - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointClusterConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointClusterConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.class, org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (retryConfigBuilder_ == null) { - retryConfig_ = null; - } else { - retryConfig_ = null; - retryConfigBuilder_ = null; - } - if (timeoutConfigBuilder_ == null) { - timeoutConfig_ = null; - } else { - timeoutConfig_ = null; - timeoutConfigBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_EndpointClusterConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig build() { - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig buildPartial() { - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig result = new org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig(this); - if (retryConfigBuilder_ == null) { - result.retryConfig_ = retryConfig_; - } else { - result.retryConfig_ = retryConfigBuilder_.build(); - } - if (timeoutConfigBuilder_ == null) { - result.timeoutConfig_ = timeoutConfig_; - } else { - result.timeoutConfig_ = timeoutConfigBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig other) { - if (other == org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig.getDefaultInstance()) return this; - if (other.hasRetryConfig()) { - mergeRetryConfig(other.getRetryConfig()); - } - if (other.hasTimeoutConfig()) { - mergeTimeoutConfig(other.getTimeoutConfig()); - } - 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.api.EndpointClusterConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.wso2.apk.enforcer.discovery.api.RetryConfig retryConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.RetryConfig, org.wso2.apk.enforcer.discovery.api.RetryConfig.Builder, org.wso2.apk.enforcer.discovery.api.RetryConfigOrBuilder> retryConfigBuilder_; - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - * @return Whether the retryConfig field is set. - */ - public boolean hasRetryConfig() { - return retryConfigBuilder_ != null || retryConfig_ != null; - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - * @return The retryConfig. - */ - public org.wso2.apk.enforcer.discovery.api.RetryConfig getRetryConfig() { - if (retryConfigBuilder_ == null) { - return retryConfig_ == null ? org.wso2.apk.enforcer.discovery.api.RetryConfig.getDefaultInstance() : retryConfig_; - } else { - return retryConfigBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - public Builder setRetryConfig(org.wso2.apk.enforcer.discovery.api.RetryConfig value) { - if (retryConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - retryConfig_ = value; - onChanged(); - } else { - retryConfigBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - public Builder setRetryConfig( - org.wso2.apk.enforcer.discovery.api.RetryConfig.Builder builderForValue) { - if (retryConfigBuilder_ == null) { - retryConfig_ = builderForValue.build(); - onChanged(); - } else { - retryConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - public Builder mergeRetryConfig(org.wso2.apk.enforcer.discovery.api.RetryConfig value) { - if (retryConfigBuilder_ == null) { - if (retryConfig_ != null) { - retryConfig_ = - org.wso2.apk.enforcer.discovery.api.RetryConfig.newBuilder(retryConfig_).mergeFrom(value).buildPartial(); - } else { - retryConfig_ = value; - } - onChanged(); - } else { - retryConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - public Builder clearRetryConfig() { - if (retryConfigBuilder_ == null) { - retryConfig_ = null; - onChanged(); - } else { - retryConfig_ = null; - retryConfigBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - public org.wso2.apk.enforcer.discovery.api.RetryConfig.Builder getRetryConfigBuilder() { - - onChanged(); - return getRetryConfigFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - public org.wso2.apk.enforcer.discovery.api.RetryConfigOrBuilder getRetryConfigOrBuilder() { - if (retryConfigBuilder_ != null) { - return retryConfigBuilder_.getMessageOrBuilder(); - } else { - return retryConfig_ == null ? - org.wso2.apk.enforcer.discovery.api.RetryConfig.getDefaultInstance() : retryConfig_; - } - } - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.RetryConfig, org.wso2.apk.enforcer.discovery.api.RetryConfig.Builder, org.wso2.apk.enforcer.discovery.api.RetryConfigOrBuilder> - getRetryConfigFieldBuilder() { - if (retryConfigBuilder_ == null) { - retryConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.RetryConfig, org.wso2.apk.enforcer.discovery.api.RetryConfig.Builder, org.wso2.apk.enforcer.discovery.api.RetryConfigOrBuilder>( - getRetryConfig(), - getParentForChildren(), - isClean()); - retryConfig_ = null; - } - return retryConfigBuilder_; - } - - private org.wso2.apk.enforcer.discovery.api.TimeoutConfig timeoutConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.TimeoutConfig, org.wso2.apk.enforcer.discovery.api.TimeoutConfig.Builder, org.wso2.apk.enforcer.discovery.api.TimeoutConfigOrBuilder> timeoutConfigBuilder_; - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - * @return Whether the timeoutConfig field is set. - */ - public boolean hasTimeoutConfig() { - return timeoutConfigBuilder_ != null || timeoutConfig_ != null; - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - * @return The timeoutConfig. - */ - public org.wso2.apk.enforcer.discovery.api.TimeoutConfig getTimeoutConfig() { - if (timeoutConfigBuilder_ == null) { - return timeoutConfig_ == null ? org.wso2.apk.enforcer.discovery.api.TimeoutConfig.getDefaultInstance() : timeoutConfig_; - } else { - return timeoutConfigBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - public Builder setTimeoutConfig(org.wso2.apk.enforcer.discovery.api.TimeoutConfig value) { - if (timeoutConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - timeoutConfig_ = value; - onChanged(); - } else { - timeoutConfigBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - public Builder setTimeoutConfig( - org.wso2.apk.enforcer.discovery.api.TimeoutConfig.Builder builderForValue) { - if (timeoutConfigBuilder_ == null) { - timeoutConfig_ = builderForValue.build(); - onChanged(); - } else { - timeoutConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - public Builder mergeTimeoutConfig(org.wso2.apk.enforcer.discovery.api.TimeoutConfig value) { - if (timeoutConfigBuilder_ == null) { - if (timeoutConfig_ != null) { - timeoutConfig_ = - org.wso2.apk.enforcer.discovery.api.TimeoutConfig.newBuilder(timeoutConfig_).mergeFrom(value).buildPartial(); - } else { - timeoutConfig_ = value; - } - onChanged(); - } else { - timeoutConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - public Builder clearTimeoutConfig() { - if (timeoutConfigBuilder_ == null) { - timeoutConfig_ = null; - onChanged(); - } else { - timeoutConfig_ = null; - timeoutConfigBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - public org.wso2.apk.enforcer.discovery.api.TimeoutConfig.Builder getTimeoutConfigBuilder() { - - onChanged(); - return getTimeoutConfigFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - public org.wso2.apk.enforcer.discovery.api.TimeoutConfigOrBuilder getTimeoutConfigOrBuilder() { - if (timeoutConfigBuilder_ != null) { - return timeoutConfigBuilder_.getMessageOrBuilder(); - } else { - return timeoutConfig_ == null ? - org.wso2.apk.enforcer.discovery.api.TimeoutConfig.getDefaultInstance() : timeoutConfig_; - } - } - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.TimeoutConfig, org.wso2.apk.enforcer.discovery.api.TimeoutConfig.Builder, org.wso2.apk.enforcer.discovery.api.TimeoutConfigOrBuilder> - getTimeoutConfigFieldBuilder() { - if (timeoutConfigBuilder_ == null) { - timeoutConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.TimeoutConfig, org.wso2.apk.enforcer.discovery.api.TimeoutConfig.Builder, org.wso2.apk.enforcer.discovery.api.TimeoutConfigOrBuilder>( - getTimeoutConfig(), - getParentForChildren(), - isClean()); - timeoutConfig_ = null; - } - return timeoutConfigBuilder_; - } - @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.api.EndpointClusterConfig) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.EndpointClusterConfig) - private static final org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig(); - } - - public static org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EndpointClusterConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EndpointClusterConfig(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.api.EndpointClusterConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterConfigOrBuilder.java deleted file mode 100644 index de53cb5f03..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterConfigOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface EndpointClusterConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.EndpointClusterConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - * @return Whether the retryConfig field is set. - */ - boolean hasRetryConfig(); - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - * @return The retryConfig. - */ - org.wso2.apk.enforcer.discovery.api.RetryConfig getRetryConfig(); - /** - * .wso2.discovery.api.RetryConfig retryConfig = 1; - */ - org.wso2.apk.enforcer.discovery.api.RetryConfigOrBuilder getRetryConfigOrBuilder(); - - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - * @return Whether the timeoutConfig field is set. - */ - boolean hasTimeoutConfig(); - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - * @return The timeoutConfig. - */ - org.wso2.apk.enforcer.discovery.api.TimeoutConfig getTimeoutConfig(); - /** - * .wso2.discovery.api.TimeoutConfig timeoutConfig = 2; - */ - org.wso2.apk.enforcer.discovery.api.TimeoutConfigOrBuilder getTimeoutConfigOrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterOrBuilder.java deleted file mode 100644 index d3031392b5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterOrBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface EndpointClusterOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.EndpointCluster) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - java.util.List - getUrlsList(); - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - org.wso2.apk.enforcer.discovery.api.Endpoint getUrls(int index); - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - int getUrlsCount(); - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - java.util.List - getUrlsOrBuilderList(); - /** - * repeated .wso2.discovery.api.Endpoint urls = 1; - */ - org.wso2.apk.enforcer.discovery.api.EndpointOrBuilder getUrlsOrBuilder( - int index); - - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - * @return The config. - */ - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfig getConfig(); - /** - * .wso2.discovery.api.EndpointClusterConfig config = 2; - */ - org.wso2.apk.enforcer.discovery.api.EndpointClusterConfigOrBuilder getConfigOrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterProto.java deleted file mode 100644 index 6070d6e5c9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointClusterProto.java +++ /dev/null @@ -1,95 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class EndpointClusterProto { - private EndpointClusterProto() {} - 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_api_EndpointCluster_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_EndpointCluster_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_EndpointClusterConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_EndpointClusterConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_TimeoutConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_TimeoutConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_RetryConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_RetryConfig_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n)wso2/discovery/api/endpoint_cluster.pr" + - "oto\022\022wso2.discovery.api\032!wso2/discovery/" + - "api/Endpoint.proto\"x\n\017EndpointCluster\022*\n" + - "\004urls\030\001 \003(\0132\034.wso2.discovery.api.Endpoin" + - "t\0229\n\006config\030\002 \001(\0132).wso2.discovery.api.E" + - "ndpointClusterConfig\"\207\001\n\025EndpointCluster" + - "Config\0224\n\013retryConfig\030\001 \001(\0132\037.wso2.disco" + - "very.api.RetryConfig\0228\n\rtimeoutConfig\030\002 " + - "\001(\0132!.wso2.discovery.api.TimeoutConfig\"-" + - "\n\rTimeoutConfig\022\034\n\024routeTimeoutInMillis\030" + - "\001 \001(\r\"1\n\013RetryConfig\022\r\n\005count\030\001 \001(\r\022\023\n\013s" + - "tatusCodes\030\002 \003(\rB|\n#org.wso2.apk.enforce" + - "r.discovery.apiB\024EndpointClusterProtoP\001Z" + - "=github.com/envoyproxy/go-control-plane/" + - "wso2/discovery/api;apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.api.EndpointProto.getDescriptor(), - }); - internal_static_wso2_discovery_api_EndpointCluster_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_EndpointCluster_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_EndpointCluster_descriptor, - new java.lang.String[] { "Urls", "Config", }); - internal_static_wso2_discovery_api_EndpointClusterConfig_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_api_EndpointClusterConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_EndpointClusterConfig_descriptor, - new java.lang.String[] { "RetryConfig", "TimeoutConfig", }); - internal_static_wso2_discovery_api_TimeoutConfig_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_wso2_discovery_api_TimeoutConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_TimeoutConfig_descriptor, - new java.lang.String[] { "RouteTimeoutInMillis", }); - internal_static_wso2_discovery_api_RetryConfig_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_wso2_discovery_api_RetryConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_RetryConfig_descriptor, - new java.lang.String[] { "Count", "StatusCodes", }); - org.wso2.apk.enforcer.discovery.api.EndpointProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointOrBuilder.java deleted file mode 100644 index 3c75b843a9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointOrBuilder.java +++ /dev/null @@ -1,51 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Endpoint.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface EndpointOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.Endpoint) - com.google.protobuf.MessageOrBuilder { - - /** - * string host = 1; - * @return The host. - */ - java.lang.String getHost(); - /** - * string host = 1; - * @return The bytes for host. - */ - com.google.protobuf.ByteString - getHostBytes(); - - /** - * string basepath = 2; - * @return The basepath. - */ - java.lang.String getBasepath(); - /** - * string basepath = 2; - * @return The bytes for basepath. - */ - com.google.protobuf.ByteString - getBasepathBytes(); - - /** - * string uRLType = 3; - * @return The uRLType. - */ - java.lang.String getURLType(); - /** - * string uRLType = 3; - * @return The bytes for uRLType. - */ - com.google.protobuf.ByteString - getURLTypeBytes(); - - /** - * uint32 port = 4; - * @return The port. - */ - int getPort(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointProto.java deleted file mode 100644 index f491dac5a4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/EndpointProto.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Endpoint.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class EndpointProto { - private EndpointProto() {} - 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_api_Endpoint_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Endpoint_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n!wso2/discovery/api/Endpoint.proto\022\022wso" + - "2.discovery.api\"I\n\010Endpoint\022\014\n\004host\030\001 \001(" + - "\t\022\020\n\010basepath\030\002 \001(\t\022\017\n\007uRLType\030\003 \001(\t\022\014\n\004" + - "port\030\004 \001(\rBu\n#org.wso2.apk.enforcer.disc" + - "overy.apiB\rEndpointProtoP\001Z=github.com/e" + - "nvoyproxy/go-control-plane/wso2/discover" + - "y/api;apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_api_Endpoint_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_Endpoint_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Endpoint_descriptor, - new java.lang.String[] { "Host", "Basepath", "URLType", "Port", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphQLProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphQLProto.java deleted file mode 100644 index 1ad0cfca11..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphQLProto.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/graphql.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class GraphQLProto { - private GraphQLProto() {} - 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_api_GraphqlComplexity_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_GraphqlComplexity_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n wso2/discovery/api/graphql.proto\022\022wso2" + - ".discovery.api\"I\n\021GraphqlComplexity\022\014\n\004t" + - "ype\030\001 \001(\t\022\r\n\005field\030\002 \001(\t\022\027\n\017complexityVa" + - "lue\030\003 \001(\rBt\n#org.wso2.apk.enforcer.disco" + - "very.apiB\014GraphQLProtoP\001Z=github.com/env" + - "oyproxy/go-control-plane/wso2/discovery/" + - "api;apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_api_GraphqlComplexity_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_GraphqlComplexity_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_GraphqlComplexity_descriptor, - new java.lang.String[] { "Type", "Field", "ComplexityValue", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphqlComplexity.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphqlComplexity.java deleted file mode 100644 index cba3c59e2f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphqlComplexity.java +++ /dev/null @@ -1,767 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/graphql.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Endpoint config model
- * 
- * - * Protobuf type {@code wso2.discovery.api.GraphqlComplexity} - */ -public final class GraphqlComplexity extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.GraphqlComplexity) - GraphqlComplexityOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphqlComplexity.newBuilder() to construct. - private GraphqlComplexity(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphqlComplexity() { - type_ = ""; - field_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphqlComplexity(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphqlComplexity( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - field_ = s; - break; - } - case 24: { - - complexityValue_ = input.readUInt32(); - 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.api.GraphQLProto.internal_static_wso2_discovery_api_GraphqlComplexity_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.GraphQLProto.internal_static_wso2_discovery_api_GraphqlComplexity_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.class, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder.class); - } - - public static final int TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object type_; - /** - * string type = 1; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - * string type = 1; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FIELD_FIELD_NUMBER = 2; - private volatile java.lang.Object field_; - /** - * string field = 2; - * @return The field. - */ - @java.lang.Override - public java.lang.String getField() { - java.lang.Object ref = field_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - field_ = s; - return s; - } - } - /** - * string field = 2; - * @return The bytes for field. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getFieldBytes() { - java.lang.Object ref = field_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - field_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMPLEXITYVALUE_FIELD_NUMBER = 3; - private int complexityValue_; - /** - * uint32 complexityValue = 3; - * @return The complexityValue. - */ - @java.lang.Override - public int getComplexityValue() { - return complexityValue_; - } - - 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 (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); - } - if (!getFieldBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, field_); - } - if (complexityValue_ != 0) { - output.writeUInt32(3, complexityValue_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); - } - if (!getFieldBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, field_); - } - if (complexityValue_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(3, complexityValue_); - } - 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.api.GraphqlComplexity)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity other = (org.wso2.apk.enforcer.discovery.api.GraphqlComplexity) obj; - - if (!getType() - .equals(other.getType())) return false; - if (!getField() - .equals(other.getField())) return false; - if (getComplexityValue() - != other.getComplexityValue()) 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) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + FIELD_FIELD_NUMBER; - hash = (53 * hash) + getField().hashCode(); - hash = (37 * hash) + COMPLEXITYVALUE_FIELD_NUMBER; - hash = (53 * hash) + getComplexityValue(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.GraphqlComplexity parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.GraphqlComplexity 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.api.GraphqlComplexity parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.GraphqlComplexity 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.api.GraphqlComplexity parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.GraphqlComplexity 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.api.GraphqlComplexity parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.GraphqlComplexity 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.api.GraphqlComplexity parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.GraphqlComplexity 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.api.GraphqlComplexity 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.api.GraphqlComplexity 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.api.GraphqlComplexity 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; - } - /** - *
-   * Endpoint config model
-   * 
- * - * Protobuf type {@code wso2.discovery.api.GraphqlComplexity} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.GraphqlComplexity) - org.wso2.apk.enforcer.discovery.api.GraphqlComplexityOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.GraphQLProto.internal_static_wso2_discovery_api_GraphqlComplexity_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.GraphQLProto.internal_static_wso2_discovery_api_GraphqlComplexity_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.class, org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.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(); - type_ = ""; - - field_ = ""; - - complexityValue_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.GraphQLProto.internal_static_wso2_discovery_api_GraphqlComplexity_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexity getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexity build() { - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.GraphqlComplexity buildPartial() { - org.wso2.apk.enforcer.discovery.api.GraphqlComplexity result = new org.wso2.apk.enforcer.discovery.api.GraphqlComplexity(this); - result.type_ = type_; - result.field_ = field_; - result.complexityValue_ = complexityValue_; - 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.api.GraphqlComplexity) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.GraphqlComplexity)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.GraphqlComplexity other) { - if (other == org.wso2.apk.enforcer.discovery.api.GraphqlComplexity.getDefaultInstance()) return this; - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (!other.getField().isEmpty()) { - field_ = other.field_; - onChanged(); - } - if (other.getComplexityValue() != 0) { - setComplexityValue(other.getComplexityValue()); - } - 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.api.GraphqlComplexity parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.GraphqlComplexity) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object type_ = ""; - /** - * string type = 1; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string type = 1; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string type = 1; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - * string type = 1; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - * string type = 1; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private java.lang.Object field_ = ""; - /** - * string field = 2; - * @return The field. - */ - public java.lang.String getField() { - java.lang.Object ref = field_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - field_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string field = 2; - * @return The bytes for field. - */ - public com.google.protobuf.ByteString - getFieldBytes() { - java.lang.Object ref = field_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - field_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string field = 2; - * @param value The field to set. - * @return This builder for chaining. - */ - public Builder setField( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - field_ = value; - onChanged(); - return this; - } - /** - * string field = 2; - * @return This builder for chaining. - */ - public Builder clearField() { - - field_ = getDefaultInstance().getField(); - onChanged(); - return this; - } - /** - * string field = 2; - * @param value The bytes for field to set. - * @return This builder for chaining. - */ - public Builder setFieldBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - field_ = value; - onChanged(); - return this; - } - - private int complexityValue_ ; - /** - * uint32 complexityValue = 3; - * @return The complexityValue. - */ - @java.lang.Override - public int getComplexityValue() { - return complexityValue_; - } - /** - * uint32 complexityValue = 3; - * @param value The complexityValue to set. - * @return This builder for chaining. - */ - public Builder setComplexityValue(int value) { - - complexityValue_ = value; - onChanged(); - return this; - } - /** - * uint32 complexityValue = 3; - * @return This builder for chaining. - */ - public Builder clearComplexityValue() { - - complexityValue_ = 0; - 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.api.GraphqlComplexity) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.GraphqlComplexity) - private static final org.wso2.apk.enforcer.discovery.api.GraphqlComplexity DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.GraphqlComplexity(); - } - - public static org.wso2.apk.enforcer.discovery.api.GraphqlComplexity getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphqlComplexity parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphqlComplexity(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.api.GraphqlComplexity getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphqlComplexityOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphqlComplexityOrBuilder.java deleted file mode 100644 index e74b864cb3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/GraphqlComplexityOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/graphql.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface GraphqlComplexityOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.GraphqlComplexity) - com.google.protobuf.MessageOrBuilder { - - /** - * string type = 1; - * @return The type. - */ - java.lang.String getType(); - /** - * string type = 1; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - * string field = 2; - * @return The field. - */ - java.lang.String getField(); - /** - * string field = 2; - * @return The bytes for field. - */ - com.google.protobuf.ByteString - getFieldBytes(); - - /** - * uint32 complexityValue = 3; - * @return The complexityValue. - */ - int getComplexityValue(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/JWT.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/JWT.java deleted file mode 100644 index fa94ed0631..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/JWT.java +++ /dev/null @@ -1,861 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - * Protobuf type {@code wso2.discovery.api.JWT} - */ -public final class JWT extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.JWT) - JWTOrBuilder { -private static final long serialVersionUID = 0L; - // Use JWT.newBuilder() to construct. - private JWT(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JWT() { - header_ = ""; - audience_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JWT(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JWT( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - header_ = s; - break; - } - case 16: { - - sendTokenToUpstream_ = input.readBool(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - audience_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - audience_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - audience_ = audience_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_JWT_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_JWT_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.JWT.class, org.wso2.apk.enforcer.discovery.api.JWT.Builder.class); - } - - public static final int HEADER_FIELD_NUMBER = 1; - private volatile java.lang.Object header_; - /** - *
-   * name of the header containing the JWT
-   * 
- * - * string header = 1; - * @return The header. - */ - @java.lang.Override - public java.lang.String getHeader() { - java.lang.Object ref = header_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - header_ = s; - return s; - } - } - /** - *
-   * name of the header containing the JWT
-   * 
- * - * string header = 1; - * @return The bytes for header. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getHeaderBytes() { - java.lang.Object ref = header_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - header_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SENDTOKENTOUPSTREAM_FIELD_NUMBER = 2; - private boolean sendTokenToUpstream_; - /** - *
-   * send the token to upstream
-   * 
- * - * bool sendTokenToUpstream = 2; - * @return The sendTokenToUpstream. - */ - @java.lang.Override - public boolean getSendTokenToUpstream() { - return sendTokenToUpstream_; - } - - public static final int AUDIENCE_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList audience_; - /** - * repeated string audience = 3; - * @return A list containing the audience. - */ - public com.google.protobuf.ProtocolStringList - getAudienceList() { - return audience_; - } - /** - * repeated string audience = 3; - * @return The count of audience. - */ - public int getAudienceCount() { - return audience_.size(); - } - /** - * repeated string audience = 3; - * @param index The index of the element to return. - * @return The audience at the given index. - */ - public java.lang.String getAudience(int index) { - return audience_.get(index); - } - /** - * repeated string audience = 3; - * @param index The index of the value to return. - * @return The bytes of the audience at the given index. - */ - public com.google.protobuf.ByteString - getAudienceBytes(int index) { - return audience_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getHeaderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, header_); - } - if (sendTokenToUpstream_ != false) { - output.writeBool(2, sendTokenToUpstream_); - } - for (int i = 0; i < audience_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, audience_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getHeaderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, header_); - } - if (sendTokenToUpstream_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, sendTokenToUpstream_); - } - { - int dataSize = 0; - for (int i = 0; i < audience_.size(); i++) { - dataSize += computeStringSizeNoTag(audience_.getRaw(i)); - } - size += dataSize; - size += 1 * getAudienceList().size(); - } - 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.api.JWT)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.JWT other = (org.wso2.apk.enforcer.discovery.api.JWT) obj; - - if (!getHeader() - .equals(other.getHeader())) return false; - if (getSendTokenToUpstream() - != other.getSendTokenToUpstream()) return false; - if (!getAudienceList() - .equals(other.getAudienceList())) 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) + HEADER_FIELD_NUMBER; - hash = (53 * hash) + getHeader().hashCode(); - hash = (37 * hash) + SENDTOKENTOUPSTREAM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSendTokenToUpstream()); - if (getAudienceCount() > 0) { - hash = (37 * hash) + AUDIENCE_FIELD_NUMBER; - hash = (53 * hash) + getAudienceList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.JWT parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.JWT 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.api.JWT parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.JWT 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.api.JWT parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.JWT 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.api.JWT parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.JWT 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.api.JWT parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.JWT 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.api.JWT 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.api.JWT 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.api.JWT prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.api.JWT} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.JWT) - org.wso2.apk.enforcer.discovery.api.JWTOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_JWT_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_JWT_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.JWT.class, org.wso2.apk.enforcer.discovery.api.JWT.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.JWT.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(); - header_ = ""; - - sendTokenToUpstream_ = false; - - audience_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_JWT_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.JWT getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.JWT.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.JWT build() { - org.wso2.apk.enforcer.discovery.api.JWT result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.JWT buildPartial() { - org.wso2.apk.enforcer.discovery.api.JWT result = new org.wso2.apk.enforcer.discovery.api.JWT(this); - int from_bitField0_ = bitField0_; - result.header_ = header_; - result.sendTokenToUpstream_ = sendTokenToUpstream_; - if (((bitField0_ & 0x00000001) != 0)) { - audience_ = audience_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.audience_ = audience_; - 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.api.JWT) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.JWT)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.JWT other) { - if (other == org.wso2.apk.enforcer.discovery.api.JWT.getDefaultInstance()) return this; - if (!other.getHeader().isEmpty()) { - header_ = other.header_; - onChanged(); - } - if (other.getSendTokenToUpstream() != false) { - setSendTokenToUpstream(other.getSendTokenToUpstream()); - } - if (!other.audience_.isEmpty()) { - if (audience_.isEmpty()) { - audience_ = other.audience_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAudienceIsMutable(); - audience_.addAll(other.audience_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.JWT parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.JWT) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object header_ = ""; - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @return The header. - */ - public java.lang.String getHeader() { - java.lang.Object ref = header_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - header_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @return The bytes for header. - */ - public com.google.protobuf.ByteString - getHeaderBytes() { - java.lang.Object ref = header_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - header_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @param value The header to set. - * @return This builder for chaining. - */ - public Builder setHeader( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - header_ = value; - onChanged(); - return this; - } - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @return This builder for chaining. - */ - public Builder clearHeader() { - - header_ = getDefaultInstance().getHeader(); - onChanged(); - return this; - } - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @param value The bytes for header to set. - * @return This builder for chaining. - */ - public Builder setHeaderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - header_ = value; - onChanged(); - return this; - } - - private boolean sendTokenToUpstream_ ; - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 2; - * @return The sendTokenToUpstream. - */ - @java.lang.Override - public boolean getSendTokenToUpstream() { - return sendTokenToUpstream_; - } - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 2; - * @param value The sendTokenToUpstream to set. - * @return This builder for chaining. - */ - public Builder setSendTokenToUpstream(boolean value) { - - sendTokenToUpstream_ = value; - onChanged(); - return this; - } - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 2; - * @return This builder for chaining. - */ - public Builder clearSendTokenToUpstream() { - - sendTokenToUpstream_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList audience_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureAudienceIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - audience_ = new com.google.protobuf.LazyStringArrayList(audience_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string audience = 3; - * @return A list containing the audience. - */ - public com.google.protobuf.ProtocolStringList - getAudienceList() { - return audience_.getUnmodifiableView(); - } - /** - * repeated string audience = 3; - * @return The count of audience. - */ - public int getAudienceCount() { - return audience_.size(); - } - /** - * repeated string audience = 3; - * @param index The index of the element to return. - * @return The audience at the given index. - */ - public java.lang.String getAudience(int index) { - return audience_.get(index); - } - /** - * repeated string audience = 3; - * @param index The index of the value to return. - * @return The bytes of the audience at the given index. - */ - public com.google.protobuf.ByteString - getAudienceBytes(int index) { - return audience_.getByteString(index); - } - /** - * repeated string audience = 3; - * @param index The index to set the value at. - * @param value The audience to set. - * @return This builder for chaining. - */ - public Builder setAudience( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAudienceIsMutable(); - audience_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string audience = 3; - * @param value The audience to add. - * @return This builder for chaining. - */ - public Builder addAudience( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAudienceIsMutable(); - audience_.add(value); - onChanged(); - return this; - } - /** - * repeated string audience = 3; - * @param values The audience to add. - * @return This builder for chaining. - */ - public Builder addAllAudience( - java.lang.Iterable values) { - ensureAudienceIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, audience_); - onChanged(); - return this; - } - /** - * repeated string audience = 3; - * @return This builder for chaining. - */ - public Builder clearAudience() { - audience_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string audience = 3; - * @param value The bytes of the audience to add. - * @return This builder for chaining. - */ - public Builder addAudienceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAudienceIsMutable(); - audience_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.api.JWT) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.JWT) - private static final org.wso2.apk.enforcer.discovery.api.JWT DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.JWT(); - } - - public static org.wso2.apk.enforcer.discovery.api.JWT getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JWT parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JWT(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.api.JWT getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/JWTOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/JWTOrBuilder.java deleted file mode 100644 index 0b1220acc4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/JWTOrBuilder.java +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface JWTOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.JWT) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * name of the header containing the JWT
-   * 
- * - * string header = 1; - * @return The header. - */ - java.lang.String getHeader(); - /** - *
-   * name of the header containing the JWT
-   * 
- * - * string header = 1; - * @return The bytes for header. - */ - com.google.protobuf.ByteString - getHeaderBytes(); - - /** - *
-   * send the token to upstream
-   * 
- * - * bool sendTokenToUpstream = 2; - * @return The sendTokenToUpstream. - */ - boolean getSendTokenToUpstream(); - - /** - * repeated string audience = 3; - * @return A list containing the audience. - */ - java.util.List - getAudienceList(); - /** - * repeated string audience = 3; - * @return The count of audience. - */ - int getAudienceCount(); - /** - * repeated string audience = 3; - * @param index The index of the element to return. - * @return The audience at the given index. - */ - java.lang.String getAudience(int index); - /** - * repeated string audience = 3; - * @param index The index of the value to return. - * @return The bytes of the audience at the given index. - */ - com.google.protobuf.ByteString - getAudienceBytes(int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfig.java deleted file mode 100644 index f348ef16e4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfig.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * MockedApiConfig holds configurations defined for a mocked API operation result
- * 
- * - * Protobuf type {@code wso2.discovery.api.MockedApiConfig} - */ -public final class MockedApiConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.MockedApiConfig) - MockedApiConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use MockedApiConfig.newBuilder() to construct. - private MockedApiConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MockedApiConfig() { - responses_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MockedApiConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MockedApiConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - responses_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - responses_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - responses_ = java.util.Collections.unmodifiableList(responses_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedApiConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedApiConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedApiConfig.class, org.wso2.apk.enforcer.discovery.api.MockedApiConfig.Builder.class); - } - - public static final int RESPONSES_FIELD_NUMBER = 3; - private java.util.List responses_; - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - @java.lang.Override - public java.util.List getResponsesList() { - return responses_; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - @java.lang.Override - public java.util.List - getResponsesOrBuilderList() { - return responses_; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - @java.lang.Override - public int getResponsesCount() { - return responses_.size(); - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfig getResponses(int index) { - return responses_.get(index); - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfigOrBuilder getResponsesOrBuilder( - int index) { - return responses_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < responses_.size(); i++) { - output.writeMessage(3, responses_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < responses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, responses_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.api.MockedApiConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.MockedApiConfig other = (org.wso2.apk.enforcer.discovery.api.MockedApiConfig) obj; - - if (!getResponsesList() - .equals(other.getResponsesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResponsesCount() > 0) { - hash = (37 * hash) + RESPONSES_FIELD_NUMBER; - hash = (53 * hash) + getResponsesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.MockedApiConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedApiConfig 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.api.MockedApiConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedApiConfig 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.api.MockedApiConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedApiConfig 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.api.MockedApiConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedApiConfig 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.api.MockedApiConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedApiConfig 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.api.MockedApiConfig 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.api.MockedApiConfig 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.api.MockedApiConfig 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; - } - /** - *
-   * MockedApiConfig holds configurations defined for a mocked API operation result
-   * 
- * - * Protobuf type {@code wso2.discovery.api.MockedApiConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.MockedApiConfig) - org.wso2.apk.enforcer.discovery.api.MockedApiConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedApiConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedApiConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedApiConfig.class, org.wso2.apk.enforcer.discovery.api.MockedApiConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.MockedApiConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResponsesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (responsesBuilder_ == null) { - responses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - responsesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedApiConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedApiConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedApiConfig build() { - org.wso2.apk.enforcer.discovery.api.MockedApiConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedApiConfig buildPartial() { - org.wso2.apk.enforcer.discovery.api.MockedApiConfig result = new org.wso2.apk.enforcer.discovery.api.MockedApiConfig(this); - int from_bitField0_ = bitField0_; - if (responsesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - responses_ = java.util.Collections.unmodifiableList(responses_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.responses_ = responses_; - } else { - result.responses_ = responsesBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.MockedApiConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.MockedApiConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.MockedApiConfig other) { - if (other == org.wso2.apk.enforcer.discovery.api.MockedApiConfig.getDefaultInstance()) return this; - if (responsesBuilder_ == null) { - if (!other.responses_.isEmpty()) { - if (responses_.isEmpty()) { - responses_ = other.responses_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResponsesIsMutable(); - responses_.addAll(other.responses_); - } - onChanged(); - } - } else { - if (!other.responses_.isEmpty()) { - if (responsesBuilder_.isEmpty()) { - responsesBuilder_.dispose(); - responsesBuilder_ = null; - responses_ = other.responses_; - bitField0_ = (bitField0_ & ~0x00000001); - responsesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResponsesFieldBuilder() : null; - } else { - responsesBuilder_.addAllMessages(other.responses_); - } - } - } - 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.api.MockedApiConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.MockedApiConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List responses_ = - java.util.Collections.emptyList(); - private void ensureResponsesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - responses_ = new java.util.ArrayList(responses_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedResponseConfigOrBuilder> responsesBuilder_; - - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public java.util.List getResponsesList() { - if (responsesBuilder_ == null) { - return java.util.Collections.unmodifiableList(responses_); - } else { - return responsesBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public int getResponsesCount() { - if (responsesBuilder_ == null) { - return responses_.size(); - } else { - return responsesBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfig getResponses(int index) { - if (responsesBuilder_ == null) { - return responses_.get(index); - } else { - return responsesBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder setResponses( - int index, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.set(index, value); - onChanged(); - } else { - responsesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder setResponses( - int index, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.set(index, builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder addResponses(org.wso2.apk.enforcer.discovery.api.MockedResponseConfig value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.add(value); - onChanged(); - } else { - responsesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder addResponses( - int index, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.add(index, value); - onChanged(); - } else { - responsesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder addResponses( - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.add(builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder addResponses( - int index, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.add(index, builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder addAllResponses( - java.lang.Iterable values) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, responses_); - onChanged(); - } else { - responsesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder clearResponses() { - if (responsesBuilder_ == null) { - responses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - responsesBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public Builder removeResponses(int index) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.remove(index); - onChanged(); - } else { - responsesBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder getResponsesBuilder( - int index) { - return getResponsesFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfigOrBuilder getResponsesOrBuilder( - int index) { - if (responsesBuilder_ == null) { - return responses_.get(index); } else { - return responsesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public java.util.List - getResponsesOrBuilderList() { - if (responsesBuilder_ != null) { - return responsesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(responses_); - } - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder addResponsesBuilder() { - return getResponsesFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder addResponsesBuilder( - int index) { - return getResponsesFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - public java.util.List - getResponsesBuilderList() { - return getResponsesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedResponseConfigOrBuilder> - getResponsesFieldBuilder() { - if (responsesBuilder_ == null) { - responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedResponseConfigOrBuilder>( - responses_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - responses_ = null; - } - return responsesBuilder_; - } - @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.api.MockedApiConfig) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.MockedApiConfig) - private static final org.wso2.apk.enforcer.discovery.api.MockedApiConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.MockedApiConfig(); - } - - public static org.wso2.apk.enforcer.discovery.api.MockedApiConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MockedApiConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MockedApiConfig(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.api.MockedApiConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfigOrBuilder.java deleted file mode 100644 index 8d8c8fa088..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfigOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface MockedApiConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.MockedApiConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - java.util.List - getResponsesList(); - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig getResponses(int index); - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - int getResponsesCount(); - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - java.util.List - getResponsesOrBuilderList(); - /** - * repeated .wso2.discovery.api.MockedResponseConfig responses = 3; - */ - org.wso2.apk.enforcer.discovery.api.MockedResponseConfigOrBuilder getResponsesOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfigProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfigProto.java deleted file mode 100644 index 326918e3f7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedApiConfigProto.java +++ /dev/null @@ -1,105 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class MockedApiConfigProto { - private MockedApiConfigProto() {} - 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_api_MockedApiConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_MockedApiConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_MockedResponseConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_MockedResponseConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_MockedHeaderConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_MockedHeaderConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_MockedContentConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_MockedContentConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_MockedContentExample_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_MockedContentExample_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n*wso2/discovery/api/mocked_api_config.p" + - "roto\022\022wso2.discovery.api\"N\n\017MockedApiCon" + - "fig\022;\n\tresponses\030\003 \003(\0132(.wso2.discovery." + - "api.MockedResponseConfig\"\227\001\n\024MockedRespo" + - "nseConfig\022\014\n\004code\030\001 \001(\t\0227\n\007headers\030\002 \003(\013" + - "2&.wso2.discovery.api.MockedHeaderConfig" + - "\0228\n\007content\030\003 \003(\0132\'.wso2.discovery.api.M" + - "ockedContentConfig\"1\n\022MockedHeaderConfig" + - "\022\014\n\004name\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"f\n\023MockedC" + - "ontentConfig\022\023\n\013contentType\030\001 \001(\t\022:\n\010exa" + - "mples\030\002 \003(\0132(.wso2.discovery.api.MockedC" + - "ontentExample\"1\n\024MockedContentExample\022\013\n" + - "\003Ref\030\001 \001(\t\022\014\n\004body\030\002 \001(\tB|\n#org.wso2.apk" + - ".enforcer.discovery.apiB\024MockedApiConfig" + - "ProtoP\001Z=github.com/envoyproxy/go-contro" + - "l-plane/wso2/discovery/api;apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_api_MockedApiConfig_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_MockedApiConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_MockedApiConfig_descriptor, - new java.lang.String[] { "Responses", }); - internal_static_wso2_discovery_api_MockedResponseConfig_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_api_MockedResponseConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_MockedResponseConfig_descriptor, - new java.lang.String[] { "Code", "Headers", "Content", }); - internal_static_wso2_discovery_api_MockedHeaderConfig_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_wso2_discovery_api_MockedHeaderConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_MockedHeaderConfig_descriptor, - new java.lang.String[] { "Name", "Value", }); - internal_static_wso2_discovery_api_MockedContentConfig_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_wso2_discovery_api_MockedContentConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_MockedContentConfig_descriptor, - new java.lang.String[] { "ContentType", "Examples", }); - internal_static_wso2_discovery_api_MockedContentExample_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_wso2_discovery_api_MockedContentExample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_MockedContentExample_descriptor, - new java.lang.String[] { "Ref", "Body", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentConfig.java deleted file mode 100644 index 732466f1e2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentConfig.java +++ /dev/null @@ -1,916 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * MockedContentConfig holds content configs in mocked API implementations
- * 
- * - * Protobuf type {@code wso2.discovery.api.MockedContentConfig} - */ -public final class MockedContentConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.MockedContentConfig) - MockedContentConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use MockedContentConfig.newBuilder() to construct. - private MockedContentConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MockedContentConfig() { - contentType_ = ""; - examples_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MockedContentConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MockedContentConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - contentType_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - examples_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - examples_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.MockedContentExample.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - examples_ = java.util.Collections.unmodifiableList(examples_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedContentConfig.class, org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder.class); - } - - public static final int CONTENTTYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object contentType_; - /** - * string contentType = 1; - * @return The contentType. - */ - @java.lang.Override - public java.lang.String getContentType() { - java.lang.Object ref = contentType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentType_ = s; - return s; - } - } - /** - * string contentType = 1; - * @return The bytes for contentType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentTypeBytes() { - java.lang.Object ref = contentType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - contentType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXAMPLES_FIELD_NUMBER = 2; - private java.util.List examples_; - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - @java.lang.Override - public java.util.List getExamplesList() { - return examples_; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - @java.lang.Override - public java.util.List - getExamplesOrBuilderList() { - return examples_; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - @java.lang.Override - public int getExamplesCount() { - return examples_.size(); - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentExample getExamples(int index) { - return examples_.get(index); - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentExampleOrBuilder getExamplesOrBuilder( - int index) { - return examples_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getContentTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contentType_); - } - for (int i = 0; i < examples_.size(); i++) { - output.writeMessage(2, examples_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getContentTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, contentType_); - } - for (int i = 0; i < examples_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, examples_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.api.MockedContentConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.MockedContentConfig other = (org.wso2.apk.enforcer.discovery.api.MockedContentConfig) obj; - - if (!getContentType() - .equals(other.getContentType())) return false; - if (!getExamplesList() - .equals(other.getExamplesList())) 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) + CONTENTTYPE_FIELD_NUMBER; - hash = (53 * hash) + getContentType().hashCode(); - if (getExamplesCount() > 0) { - hash = (37 * hash) + EXAMPLES_FIELD_NUMBER; - hash = (53 * hash) + getExamplesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.MockedContentConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentConfig 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.api.MockedContentConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentConfig 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.api.MockedContentConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentConfig 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.api.MockedContentConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentConfig 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.api.MockedContentConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentConfig 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.api.MockedContentConfig 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.api.MockedContentConfig 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.api.MockedContentConfig 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; - } - /** - *
-   * MockedContentConfig holds content configs in mocked API implementations
-   * 
- * - * Protobuf type {@code wso2.discovery.api.MockedContentConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.MockedContentConfig) - org.wso2.apk.enforcer.discovery.api.MockedContentConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedContentConfig.class, org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.MockedContentConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getExamplesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - contentType_ = ""; - - if (examplesBuilder_ == null) { - examples_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - examplesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.MockedContentConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentConfig build() { - org.wso2.apk.enforcer.discovery.api.MockedContentConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentConfig buildPartial() { - org.wso2.apk.enforcer.discovery.api.MockedContentConfig result = new org.wso2.apk.enforcer.discovery.api.MockedContentConfig(this); - int from_bitField0_ = bitField0_; - result.contentType_ = contentType_; - if (examplesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - examples_ = java.util.Collections.unmodifiableList(examples_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.examples_ = examples_; - } else { - result.examples_ = examplesBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.MockedContentConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.MockedContentConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.MockedContentConfig other) { - if (other == org.wso2.apk.enforcer.discovery.api.MockedContentConfig.getDefaultInstance()) return this; - if (!other.getContentType().isEmpty()) { - contentType_ = other.contentType_; - onChanged(); - } - if (examplesBuilder_ == null) { - if (!other.examples_.isEmpty()) { - if (examples_.isEmpty()) { - examples_ = other.examples_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureExamplesIsMutable(); - examples_.addAll(other.examples_); - } - onChanged(); - } - } else { - if (!other.examples_.isEmpty()) { - if (examplesBuilder_.isEmpty()) { - examplesBuilder_.dispose(); - examplesBuilder_ = null; - examples_ = other.examples_; - bitField0_ = (bitField0_ & ~0x00000001); - examplesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getExamplesFieldBuilder() : null; - } else { - examplesBuilder_.addAllMessages(other.examples_); - } - } - } - 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.api.MockedContentConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.MockedContentConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object contentType_ = ""; - /** - * string contentType = 1; - * @return The contentType. - */ - public java.lang.String getContentType() { - java.lang.Object ref = contentType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string contentType = 1; - * @return The bytes for contentType. - */ - public com.google.protobuf.ByteString - getContentTypeBytes() { - java.lang.Object ref = contentType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - contentType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string contentType = 1; - * @param value The contentType to set. - * @return This builder for chaining. - */ - public Builder setContentType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - contentType_ = value; - onChanged(); - return this; - } - /** - * string contentType = 1; - * @return This builder for chaining. - */ - public Builder clearContentType() { - - contentType_ = getDefaultInstance().getContentType(); - onChanged(); - return this; - } - /** - * string contentType = 1; - * @param value The bytes for contentType to set. - * @return This builder for chaining. - */ - public Builder setContentTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - contentType_ = value; - onChanged(); - return this; - } - - private java.util.List examples_ = - java.util.Collections.emptyList(); - private void ensureExamplesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - examples_ = new java.util.ArrayList(examples_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedContentExample, org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder, org.wso2.apk.enforcer.discovery.api.MockedContentExampleOrBuilder> examplesBuilder_; - - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public java.util.List getExamplesList() { - if (examplesBuilder_ == null) { - return java.util.Collections.unmodifiableList(examples_); - } else { - return examplesBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public int getExamplesCount() { - if (examplesBuilder_ == null) { - return examples_.size(); - } else { - return examplesBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentExample getExamples(int index) { - if (examplesBuilder_ == null) { - return examples_.get(index); - } else { - return examplesBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder setExamples( - int index, org.wso2.apk.enforcer.discovery.api.MockedContentExample value) { - if (examplesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExamplesIsMutable(); - examples_.set(index, value); - onChanged(); - } else { - examplesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder setExamples( - int index, org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder builderForValue) { - if (examplesBuilder_ == null) { - ensureExamplesIsMutable(); - examples_.set(index, builderForValue.build()); - onChanged(); - } else { - examplesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder addExamples(org.wso2.apk.enforcer.discovery.api.MockedContentExample value) { - if (examplesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExamplesIsMutable(); - examples_.add(value); - onChanged(); - } else { - examplesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder addExamples( - int index, org.wso2.apk.enforcer.discovery.api.MockedContentExample value) { - if (examplesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExamplesIsMutable(); - examples_.add(index, value); - onChanged(); - } else { - examplesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder addExamples( - org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder builderForValue) { - if (examplesBuilder_ == null) { - ensureExamplesIsMutable(); - examples_.add(builderForValue.build()); - onChanged(); - } else { - examplesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder addExamples( - int index, org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder builderForValue) { - if (examplesBuilder_ == null) { - ensureExamplesIsMutable(); - examples_.add(index, builderForValue.build()); - onChanged(); - } else { - examplesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder addAllExamples( - java.lang.Iterable values) { - if (examplesBuilder_ == null) { - ensureExamplesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, examples_); - onChanged(); - } else { - examplesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder clearExamples() { - if (examplesBuilder_ == null) { - examples_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - examplesBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public Builder removeExamples(int index) { - if (examplesBuilder_ == null) { - ensureExamplesIsMutable(); - examples_.remove(index); - onChanged(); - } else { - examplesBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder getExamplesBuilder( - int index) { - return getExamplesFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentExampleOrBuilder getExamplesOrBuilder( - int index) { - if (examplesBuilder_ == null) { - return examples_.get(index); } else { - return examplesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public java.util.List - getExamplesOrBuilderList() { - if (examplesBuilder_ != null) { - return examplesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(examples_); - } - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder addExamplesBuilder() { - return getExamplesFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.MockedContentExample.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder addExamplesBuilder( - int index) { - return getExamplesFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.MockedContentExample.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - public java.util.List - getExamplesBuilderList() { - return getExamplesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedContentExample, org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder, org.wso2.apk.enforcer.discovery.api.MockedContentExampleOrBuilder> - getExamplesFieldBuilder() { - if (examplesBuilder_ == null) { - examplesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedContentExample, org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder, org.wso2.apk.enforcer.discovery.api.MockedContentExampleOrBuilder>( - examples_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - examples_ = null; - } - return examplesBuilder_; - } - @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.api.MockedContentConfig) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.MockedContentConfig) - private static final org.wso2.apk.enforcer.discovery.api.MockedContentConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.MockedContentConfig(); - } - - public static org.wso2.apk.enforcer.discovery.api.MockedContentConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MockedContentConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MockedContentConfig(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.api.MockedContentConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentConfigOrBuilder.java deleted file mode 100644 index 109672549c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentConfigOrBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface MockedContentConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.MockedContentConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * string contentType = 1; - * @return The contentType. - */ - java.lang.String getContentType(); - /** - * string contentType = 1; - * @return The bytes for contentType. - */ - com.google.protobuf.ByteString - getContentTypeBytes(); - - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - java.util.List - getExamplesList(); - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - org.wso2.apk.enforcer.discovery.api.MockedContentExample getExamples(int index); - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - int getExamplesCount(); - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - java.util.List - getExamplesOrBuilderList(); - /** - * repeated .wso2.discovery.api.MockedContentExample examples = 2; - */ - org.wso2.apk.enforcer.discovery.api.MockedContentExampleOrBuilder getExamplesOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentExample.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentExample.java deleted file mode 100644 index db7878730a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentExample.java +++ /dev/null @@ -1,703 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * MockedContentConfig holds content configs in mocked API implementations
- * 
- * - * Protobuf type {@code wso2.discovery.api.MockedContentExample} - */ -public final class MockedContentExample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.MockedContentExample) - MockedContentExampleOrBuilder { -private static final long serialVersionUID = 0L; - // Use MockedContentExample.newBuilder() to construct. - private MockedContentExample(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MockedContentExample() { - ref_ = ""; - body_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MockedContentExample(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MockedContentExample( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - ref_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - body_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentExample_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentExample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedContentExample.class, org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder.class); - } - - public static final int REF_FIELD_NUMBER = 1; - private volatile java.lang.Object ref_; - /** - * string Ref = 1; - * @return The ref. - */ - @java.lang.Override - public java.lang.String getRef() { - java.lang.Object ref = ref_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ref_ = s; - return s; - } - } - /** - * string Ref = 1; - * @return The bytes for ref. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRefBytes() { - java.lang.Object ref = ref_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - ref_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BODY_FIELD_NUMBER = 2; - private volatile java.lang.Object body_; - /** - * string body = 2; - * @return The body. - */ - @java.lang.Override - public java.lang.String getBody() { - java.lang.Object ref = body_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - body_ = s; - return s; - } - } - /** - * string body = 2; - * @return The bytes for body. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getBodyBytes() { - java.lang.Object ref = body_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - body_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getRefBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ref_); - } - if (!getBodyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, body_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getRefBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ref_); - } - if (!getBodyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, body_); - } - 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.api.MockedContentExample)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.MockedContentExample other = (org.wso2.apk.enforcer.discovery.api.MockedContentExample) obj; - - if (!getRef() - .equals(other.getRef())) return false; - if (!getBody() - .equals(other.getBody())) 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) + REF_FIELD_NUMBER; - hash = (53 * hash) + getRef().hashCode(); - hash = (37 * hash) + BODY_FIELD_NUMBER; - hash = (53 * hash) + getBody().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.MockedContentExample parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentExample 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.api.MockedContentExample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentExample 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.api.MockedContentExample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentExample 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.api.MockedContentExample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentExample 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.api.MockedContentExample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedContentExample 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.api.MockedContentExample 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.api.MockedContentExample 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.api.MockedContentExample 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; - } - /** - *
-   * MockedContentConfig holds content configs in mocked API implementations
-   * 
- * - * Protobuf type {@code wso2.discovery.api.MockedContentExample} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.MockedContentExample) - org.wso2.apk.enforcer.discovery.api.MockedContentExampleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentExample_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentExample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedContentExample.class, org.wso2.apk.enforcer.discovery.api.MockedContentExample.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.MockedContentExample.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(); - ref_ = ""; - - body_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedContentExample_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentExample getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.MockedContentExample.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentExample build() { - org.wso2.apk.enforcer.discovery.api.MockedContentExample result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentExample buildPartial() { - org.wso2.apk.enforcer.discovery.api.MockedContentExample result = new org.wso2.apk.enforcer.discovery.api.MockedContentExample(this); - result.ref_ = ref_; - result.body_ = body_; - 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.api.MockedContentExample) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.MockedContentExample)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.MockedContentExample other) { - if (other == org.wso2.apk.enforcer.discovery.api.MockedContentExample.getDefaultInstance()) return this; - if (!other.getRef().isEmpty()) { - ref_ = other.ref_; - onChanged(); - } - if (!other.getBody().isEmpty()) { - body_ = other.body_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.MockedContentExample parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.MockedContentExample) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object ref_ = ""; - /** - * string Ref = 1; - * @return The ref. - */ - public java.lang.String getRef() { - java.lang.Object ref = ref_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ref_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string Ref = 1; - * @return The bytes for ref. - */ - public com.google.protobuf.ByteString - getRefBytes() { - java.lang.Object ref = ref_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - ref_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string Ref = 1; - * @param value The ref to set. - * @return This builder for chaining. - */ - public Builder setRef( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - ref_ = value; - onChanged(); - return this; - } - /** - * string Ref = 1; - * @return This builder for chaining. - */ - public Builder clearRef() { - - ref_ = getDefaultInstance().getRef(); - onChanged(); - return this; - } - /** - * string Ref = 1; - * @param value The bytes for ref to set. - * @return This builder for chaining. - */ - public Builder setRefBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - ref_ = value; - onChanged(); - return this; - } - - private java.lang.Object body_ = ""; - /** - * string body = 2; - * @return The body. - */ - public java.lang.String getBody() { - java.lang.Object ref = body_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - body_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string body = 2; - * @return The bytes for body. - */ - public com.google.protobuf.ByteString - getBodyBytes() { - java.lang.Object ref = body_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - body_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string body = 2; - * @param value The body to set. - * @return This builder for chaining. - */ - public Builder setBody( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - body_ = value; - onChanged(); - return this; - } - /** - * string body = 2; - * @return This builder for chaining. - */ - public Builder clearBody() { - - body_ = getDefaultInstance().getBody(); - onChanged(); - return this; - } - /** - * string body = 2; - * @param value The bytes for body to set. - * @return This builder for chaining. - */ - public Builder setBodyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - body_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.api.MockedContentExample) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.MockedContentExample) - private static final org.wso2.apk.enforcer.discovery.api.MockedContentExample DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.MockedContentExample(); - } - - public static org.wso2.apk.enforcer.discovery.api.MockedContentExample getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MockedContentExample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MockedContentExample(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.api.MockedContentExample getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentExampleOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentExampleOrBuilder.java deleted file mode 100644 index c3bc7ead5c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedContentExampleOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface MockedContentExampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.MockedContentExample) - com.google.protobuf.MessageOrBuilder { - - /** - * string Ref = 1; - * @return The ref. - */ - java.lang.String getRef(); - /** - * string Ref = 1; - * @return The bytes for ref. - */ - com.google.protobuf.ByteString - getRefBytes(); - - /** - * string body = 2; - * @return The body. - */ - java.lang.String getBody(); - /** - * string body = 2; - * @return The bytes for body. - */ - com.google.protobuf.ByteString - getBodyBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedHeaderConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedHeaderConfig.java deleted file mode 100644 index 405ef9e318..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedHeaderConfig.java +++ /dev/null @@ -1,703 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * MockedHeaderConfig holds header configs in mocked API implementations
- * 
- * - * Protobuf type {@code wso2.discovery.api.MockedHeaderConfig} - */ -public final class MockedHeaderConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.MockedHeaderConfig) - MockedHeaderConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use MockedHeaderConfig.newBuilder() to construct. - private MockedHeaderConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MockedHeaderConfig() { - name_ = ""; - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MockedHeaderConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MockedHeaderConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedHeaderConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedHeaderConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.class, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALUE_FIELD_NUMBER = 2; - private volatile java.lang.Object value_; - /** - * string value = 2; - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } - } - /** - * string value = 2; - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); - } - 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.api.MockedHeaderConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig other = (org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getValue() - .equals(other.getValue())) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig 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.api.MockedHeaderConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig 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.api.MockedHeaderConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig 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.api.MockedHeaderConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig 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.api.MockedHeaderConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig 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.api.MockedHeaderConfig 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.api.MockedHeaderConfig 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.api.MockedHeaderConfig 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; - } - /** - *
-   * MockedHeaderConfig holds header configs in mocked API implementations
-   * 
- * - * Protobuf type {@code wso2.discovery.api.MockedHeaderConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.MockedHeaderConfig) - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedHeaderConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedHeaderConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.class, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.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(); - name_ = ""; - - value_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedHeaderConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig build() { - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig buildPartial() { - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig result = new org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig(this); - result.name_ = name_; - result.value_ = value_; - 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.api.MockedHeaderConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig other) { - if (other == org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object value_ = ""; - /** - * string value = 2; - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string value = 2; - * @return The bytes for value. - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string value = 2; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * string value = 2; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - * string value = 2; - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.api.MockedHeaderConfig) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.MockedHeaderConfig) - private static final org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig(); - } - - public static org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MockedHeaderConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MockedHeaderConfig(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.api.MockedHeaderConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedHeaderConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedHeaderConfigOrBuilder.java deleted file mode 100644 index eaaa71f395..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedHeaderConfigOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface MockedHeaderConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.MockedHeaderConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string value = 2; - * @return The value. - */ - java.lang.String getValue(); - /** - * string value = 2; - * @return The bytes for value. - */ - com.google.protobuf.ByteString - getValueBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedResponseConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedResponseConfig.java deleted file mode 100644 index 4fe81fae3c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedResponseConfig.java +++ /dev/null @@ -1,1264 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * MockedResponseConfig hold response configurations for the mocked API implementations
- * 
- * - * Protobuf type {@code wso2.discovery.api.MockedResponseConfig} - */ -public final class MockedResponseConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.MockedResponseConfig) - MockedResponseConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use MockedResponseConfig.newBuilder() to construct. - private MockedResponseConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MockedResponseConfig() { - code_ = ""; - headers_ = java.util.Collections.emptyList(); - content_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MockedResponseConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MockedResponseConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - code_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - headers_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - headers_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - content_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - content_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.MockedContentConfig.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - headers_ = java.util.Collections.unmodifiableList(headers_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - content_ = java.util.Collections.unmodifiableList(content_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedResponseConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedResponseConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.class, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder.class); - } - - public static final int CODE_FIELD_NUMBER = 1; - private volatile java.lang.Object code_; - /** - * string code = 1; - * @return The code. - */ - @java.lang.Override - public java.lang.String getCode() { - java.lang.Object ref = code_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - code_ = s; - return s; - } - } - /** - * string code = 1; - * @return The bytes for code. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCodeBytes() { - java.lang.Object ref = code_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - code_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HEADERS_FIELD_NUMBER = 2; - private java.util.List headers_; - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - @java.lang.Override - public java.util.List getHeadersList() { - return headers_; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - @java.lang.Override - public java.util.List - getHeadersOrBuilderList() { - return headers_; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - @java.lang.Override - public int getHeadersCount() { - return headers_.size(); - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig getHeaders(int index) { - return headers_.get(index); - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfigOrBuilder getHeadersOrBuilder( - int index) { - return headers_.get(index); - } - - public static final int CONTENT_FIELD_NUMBER = 3; - private java.util.List content_; - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - @java.lang.Override - public java.util.List getContentList() { - return content_; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - @java.lang.Override - public java.util.List - getContentOrBuilderList() { - return content_; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - @java.lang.Override - public int getContentCount() { - return content_.size(); - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentConfig getContent(int index) { - return content_.get(index); - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedContentConfigOrBuilder getContentOrBuilder( - int index) { - return content_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, code_); - } - for (int i = 0; i < headers_.size(); i++) { - output.writeMessage(2, headers_.get(i)); - } - for (int i = 0; i < content_.size(); i++) { - output.writeMessage(3, content_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, code_); - } - for (int i = 0; i < headers_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, headers_.get(i)); - } - for (int i = 0; i < content_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, content_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.api.MockedResponseConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig other = (org.wso2.apk.enforcer.discovery.api.MockedResponseConfig) obj; - - if (!getCode() - .equals(other.getCode())) return false; - if (!getHeadersList() - .equals(other.getHeadersList())) return false; - if (!getContentList() - .equals(other.getContentList())) 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) + CODE_FIELD_NUMBER; - hash = (53 * hash) + getCode().hashCode(); - if (getHeadersCount() > 0) { - hash = (37 * hash) + HEADERS_FIELD_NUMBER; - hash = (53 * hash) + getHeadersList().hashCode(); - } - if (getContentCount() > 0) { - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContentList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.MockedResponseConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedResponseConfig 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.api.MockedResponseConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedResponseConfig 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.api.MockedResponseConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.MockedResponseConfig 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.api.MockedResponseConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedResponseConfig 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.api.MockedResponseConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.MockedResponseConfig 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.api.MockedResponseConfig 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.api.MockedResponseConfig 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.api.MockedResponseConfig 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; - } - /** - *
-   * MockedResponseConfig hold response configurations for the mocked API implementations
-   * 
- * - * Protobuf type {@code wso2.discovery.api.MockedResponseConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.MockedResponseConfig) - org.wso2.apk.enforcer.discovery.api.MockedResponseConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedResponseConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedResponseConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.class, org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getHeadersFieldBuilder(); - getContentFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - code_ = ""; - - if (headersBuilder_ == null) { - headers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - headersBuilder_.clear(); - } - if (contentBuilder_ == null) { - content_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - contentBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.MockedApiConfigProto.internal_static_wso2_discovery_api_MockedResponseConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfig build() { - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.MockedResponseConfig buildPartial() { - org.wso2.apk.enforcer.discovery.api.MockedResponseConfig result = new org.wso2.apk.enforcer.discovery.api.MockedResponseConfig(this); - int from_bitField0_ = bitField0_; - result.code_ = code_; - if (headersBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - headers_ = java.util.Collections.unmodifiableList(headers_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.headers_ = headers_; - } else { - result.headers_ = headersBuilder_.build(); - } - if (contentBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - content_ = java.util.Collections.unmodifiableList(content_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.content_ = content_; - } else { - result.content_ = contentBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.MockedResponseConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.MockedResponseConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.MockedResponseConfig other) { - if (other == org.wso2.apk.enforcer.discovery.api.MockedResponseConfig.getDefaultInstance()) return this; - if (!other.getCode().isEmpty()) { - code_ = other.code_; - onChanged(); - } - if (headersBuilder_ == null) { - if (!other.headers_.isEmpty()) { - if (headers_.isEmpty()) { - headers_ = other.headers_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureHeadersIsMutable(); - headers_.addAll(other.headers_); - } - onChanged(); - } - } else { - if (!other.headers_.isEmpty()) { - if (headersBuilder_.isEmpty()) { - headersBuilder_.dispose(); - headersBuilder_ = null; - headers_ = other.headers_; - bitField0_ = (bitField0_ & ~0x00000001); - headersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getHeadersFieldBuilder() : null; - } else { - headersBuilder_.addAllMessages(other.headers_); - } - } - } - if (contentBuilder_ == null) { - if (!other.content_.isEmpty()) { - if (content_.isEmpty()) { - content_ = other.content_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureContentIsMutable(); - content_.addAll(other.content_); - } - onChanged(); - } - } else { - if (!other.content_.isEmpty()) { - if (contentBuilder_.isEmpty()) { - contentBuilder_.dispose(); - contentBuilder_ = null; - content_ = other.content_; - bitField0_ = (bitField0_ & ~0x00000002); - contentBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getContentFieldBuilder() : null; - } else { - contentBuilder_.addAllMessages(other.content_); - } - } - } - 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.api.MockedResponseConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.MockedResponseConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object code_ = ""; - /** - * string code = 1; - * @return The code. - */ - public java.lang.String getCode() { - java.lang.Object ref = code_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - code_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string code = 1; - * @return The bytes for code. - */ - public com.google.protobuf.ByteString - getCodeBytes() { - java.lang.Object ref = code_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - code_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string code = 1; - * @param value The code to set. - * @return This builder for chaining. - */ - public Builder setCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - code_ = value; - onChanged(); - return this; - } - /** - * string code = 1; - * @return This builder for chaining. - */ - public Builder clearCode() { - - code_ = getDefaultInstance().getCode(); - onChanged(); - return this; - } - /** - * string code = 1; - * @param value The bytes for code to set. - * @return This builder for chaining. - */ - public Builder setCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - code_ = value; - onChanged(); - return this; - } - - private java.util.List headers_ = - java.util.Collections.emptyList(); - private void ensureHeadersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - headers_ = new java.util.ArrayList(headers_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfigOrBuilder> headersBuilder_; - - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public java.util.List getHeadersList() { - if (headersBuilder_ == null) { - return java.util.Collections.unmodifiableList(headers_); - } else { - return headersBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public int getHeadersCount() { - if (headersBuilder_ == null) { - return headers_.size(); - } else { - return headersBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig getHeaders(int index) { - if (headersBuilder_ == null) { - return headers_.get(index); - } else { - return headersBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder setHeaders( - int index, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig value) { - if (headersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHeadersIsMutable(); - headers_.set(index, value); - onChanged(); - } else { - headersBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder setHeaders( - int index, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder builderForValue) { - if (headersBuilder_ == null) { - ensureHeadersIsMutable(); - headers_.set(index, builderForValue.build()); - onChanged(); - } else { - headersBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder addHeaders(org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig value) { - if (headersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHeadersIsMutable(); - headers_.add(value); - onChanged(); - } else { - headersBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder addHeaders( - int index, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig value) { - if (headersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHeadersIsMutable(); - headers_.add(index, value); - onChanged(); - } else { - headersBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder addHeaders( - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder builderForValue) { - if (headersBuilder_ == null) { - ensureHeadersIsMutable(); - headers_.add(builderForValue.build()); - onChanged(); - } else { - headersBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder addHeaders( - int index, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder builderForValue) { - if (headersBuilder_ == null) { - ensureHeadersIsMutable(); - headers_.add(index, builderForValue.build()); - onChanged(); - } else { - headersBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder addAllHeaders( - java.lang.Iterable values) { - if (headersBuilder_ == null) { - ensureHeadersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, headers_); - onChanged(); - } else { - headersBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder clearHeaders() { - if (headersBuilder_ == null) { - headers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - headersBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public Builder removeHeaders(int index) { - if (headersBuilder_ == null) { - ensureHeadersIsMutable(); - headers_.remove(index); - onChanged(); - } else { - headersBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder getHeadersBuilder( - int index) { - return getHeadersFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfigOrBuilder getHeadersOrBuilder( - int index) { - if (headersBuilder_ == null) { - return headers_.get(index); } else { - return headersBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public java.util.List - getHeadersOrBuilderList() { - if (headersBuilder_ != null) { - return headersBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(headers_); - } - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder addHeadersBuilder() { - return getHeadersFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder addHeadersBuilder( - int index) { - return getHeadersFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - public java.util.List - getHeadersBuilderList() { - return getHeadersFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfigOrBuilder> - getHeadersFieldBuilder() { - if (headersBuilder_ == null) { - headersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedHeaderConfigOrBuilder>( - headers_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - headers_ = null; - } - return headersBuilder_; - } - - private java.util.List content_ = - java.util.Collections.emptyList(); - private void ensureContentIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - content_ = new java.util.ArrayList(content_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedContentConfig, org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedContentConfigOrBuilder> contentBuilder_; - - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public java.util.List getContentList() { - if (contentBuilder_ == null) { - return java.util.Collections.unmodifiableList(content_); - } else { - return contentBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public int getContentCount() { - if (contentBuilder_ == null) { - return content_.size(); - } else { - return contentBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentConfig getContent(int index) { - if (contentBuilder_ == null) { - return content_.get(index); - } else { - return contentBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder setContent( - int index, org.wso2.apk.enforcer.discovery.api.MockedContentConfig value) { - if (contentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureContentIsMutable(); - content_.set(index, value); - onChanged(); - } else { - contentBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder setContent( - int index, org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder builderForValue) { - if (contentBuilder_ == null) { - ensureContentIsMutable(); - content_.set(index, builderForValue.build()); - onChanged(); - } else { - contentBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder addContent(org.wso2.apk.enforcer.discovery.api.MockedContentConfig value) { - if (contentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureContentIsMutable(); - content_.add(value); - onChanged(); - } else { - contentBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder addContent( - int index, org.wso2.apk.enforcer.discovery.api.MockedContentConfig value) { - if (contentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureContentIsMutable(); - content_.add(index, value); - onChanged(); - } else { - contentBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder addContent( - org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder builderForValue) { - if (contentBuilder_ == null) { - ensureContentIsMutable(); - content_.add(builderForValue.build()); - onChanged(); - } else { - contentBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder addContent( - int index, org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder builderForValue) { - if (contentBuilder_ == null) { - ensureContentIsMutable(); - content_.add(index, builderForValue.build()); - onChanged(); - } else { - contentBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder addAllContent( - java.lang.Iterable values) { - if (contentBuilder_ == null) { - ensureContentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, content_); - onChanged(); - } else { - contentBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder clearContent() { - if (contentBuilder_ == null) { - content_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - contentBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public Builder removeContent(int index) { - if (contentBuilder_ == null) { - ensureContentIsMutable(); - content_.remove(index); - onChanged(); - } else { - contentBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder getContentBuilder( - int index) { - return getContentFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentConfigOrBuilder getContentOrBuilder( - int index) { - if (contentBuilder_ == null) { - return content_.get(index); } else { - return contentBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public java.util.List - getContentOrBuilderList() { - if (contentBuilder_ != null) { - return contentBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(content_); - } - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder addContentBuilder() { - return getContentFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.MockedContentConfig.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder addContentBuilder( - int index) { - return getContentFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.MockedContentConfig.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - public java.util.List - getContentBuilderList() { - return getContentFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedContentConfig, org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedContentConfigOrBuilder> - getContentFieldBuilder() { - if (contentBuilder_ == null) { - contentBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.MockedContentConfig, org.wso2.apk.enforcer.discovery.api.MockedContentConfig.Builder, org.wso2.apk.enforcer.discovery.api.MockedContentConfigOrBuilder>( - content_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - content_ = null; - } - return contentBuilder_; - } - @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.api.MockedResponseConfig) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.MockedResponseConfig) - private static final org.wso2.apk.enforcer.discovery.api.MockedResponseConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.MockedResponseConfig(); - } - - public static org.wso2.apk.enforcer.discovery.api.MockedResponseConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MockedResponseConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MockedResponseConfig(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.api.MockedResponseConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedResponseConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedResponseConfigOrBuilder.java deleted file mode 100644 index 8f0b327c74..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/MockedResponseConfigOrBuilder.java +++ /dev/null @@ -1,69 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/mocked_api_config.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface MockedResponseConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.MockedResponseConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * string code = 1; - * @return The code. - */ - java.lang.String getCode(); - /** - * string code = 1; - * @return The bytes for code. - */ - com.google.protobuf.ByteString - getCodeBytes(); - - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - java.util.List - getHeadersList(); - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfig getHeaders(int index); - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - int getHeadersCount(); - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - java.util.List - getHeadersOrBuilderList(); - /** - * repeated .wso2.discovery.api.MockedHeaderConfig headers = 2; - */ - org.wso2.apk.enforcer.discovery.api.MockedHeaderConfigOrBuilder getHeadersOrBuilder( - int index); - - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - java.util.List - getContentList(); - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - org.wso2.apk.enforcer.discovery.api.MockedContentConfig getContent(int index); - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - int getContentCount(); - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - java.util.List - getContentOrBuilderList(); - /** - * repeated .wso2.discovery.api.MockedContentConfig content = 3; - */ - org.wso2.apk.enforcer.discovery.api.MockedContentConfigOrBuilder getContentOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Oauth2.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Oauth2.java deleted file mode 100644 index e90bb74143..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Oauth2.java +++ /dev/null @@ -1,666 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - * Protobuf type {@code wso2.discovery.api.Oauth2} - */ -public final class Oauth2 extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.Oauth2) - Oauth2OrBuilder { -private static final long serialVersionUID = 0L; - // Use Oauth2.newBuilder() to construct. - private Oauth2(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Oauth2() { - header_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Oauth2(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Oauth2( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - header_ = s; - break; - } - case 16: { - - sendTokenToUpstream_ = 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.api.APIAuthenticationProto.internal_static_wso2_discovery_api_Oauth2_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_Oauth2_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Oauth2.class, org.wso2.apk.enforcer.discovery.api.Oauth2.Builder.class); - } - - public static final int HEADER_FIELD_NUMBER = 1; - private volatile java.lang.Object header_; - /** - *
-   * name of the header containing the JWT
-   * 
- * - * string header = 1; - * @return The header. - */ - @java.lang.Override - public java.lang.String getHeader() { - java.lang.Object ref = header_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - header_ = s; - return s; - } - } - /** - *
-   * name of the header containing the JWT
-   * 
- * - * string header = 1; - * @return The bytes for header. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getHeaderBytes() { - java.lang.Object ref = header_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - header_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SENDTOKENTOUPSTREAM_FIELD_NUMBER = 2; - private boolean sendTokenToUpstream_; - /** - *
-   * send the token to upstream
-   * 
- * - * bool sendTokenToUpstream = 2; - * @return The sendTokenToUpstream. - */ - @java.lang.Override - public boolean getSendTokenToUpstream() { - return sendTokenToUpstream_; - } - - 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 (!getHeaderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, header_); - } - if (sendTokenToUpstream_ != false) { - output.writeBool(2, sendTokenToUpstream_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getHeaderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, header_); - } - if (sendTokenToUpstream_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, sendTokenToUpstream_); - } - 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.api.Oauth2)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.Oauth2 other = (org.wso2.apk.enforcer.discovery.api.Oauth2) obj; - - if (!getHeader() - .equals(other.getHeader())) return false; - if (getSendTokenToUpstream() - != other.getSendTokenToUpstream()) 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) + HEADER_FIELD_NUMBER; - hash = (53 * hash) + getHeader().hashCode(); - hash = (37 * hash) + SENDTOKENTOUPSTREAM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSendTokenToUpstream()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Oauth2 parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.api.Oauth2 prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.api.Oauth2} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.Oauth2) - org.wso2.apk.enforcer.discovery.api.Oauth2OrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_Oauth2_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_Oauth2_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Oauth2.class, org.wso2.apk.enforcer.discovery.api.Oauth2.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.Oauth2.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - header_ = ""; - - sendTokenToUpstream_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.internal_static_wso2_discovery_api_Oauth2_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Oauth2 getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.Oauth2.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Oauth2 build() { - org.wso2.apk.enforcer.discovery.api.Oauth2 result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Oauth2 buildPartial() { - org.wso2.apk.enforcer.discovery.api.Oauth2 result = new org.wso2.apk.enforcer.discovery.api.Oauth2(this); - result.header_ = header_; - result.sendTokenToUpstream_ = sendTokenToUpstream_; - 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.api.Oauth2) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.Oauth2)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.Oauth2 other) { - if (other == org.wso2.apk.enforcer.discovery.api.Oauth2.getDefaultInstance()) return this; - if (!other.getHeader().isEmpty()) { - header_ = other.header_; - onChanged(); - } - if (other.getSendTokenToUpstream() != false) { - setSendTokenToUpstream(other.getSendTokenToUpstream()); - } - 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.api.Oauth2 parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.Oauth2) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object header_ = ""; - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @return The header. - */ - public java.lang.String getHeader() { - java.lang.Object ref = header_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - header_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @return The bytes for header. - */ - public com.google.protobuf.ByteString - getHeaderBytes() { - java.lang.Object ref = header_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - header_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @param value The header to set. - * @return This builder for chaining. - */ - public Builder setHeader( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - header_ = value; - onChanged(); - return this; - } - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @return This builder for chaining. - */ - public Builder clearHeader() { - - header_ = getDefaultInstance().getHeader(); - onChanged(); - return this; - } - /** - *
-     * name of the header containing the JWT
-     * 
- * - * string header = 1; - * @param value The bytes for header to set. - * @return This builder for chaining. - */ - public Builder setHeaderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - header_ = value; - onChanged(); - return this; - } - - private boolean sendTokenToUpstream_ ; - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 2; - * @return The sendTokenToUpstream. - */ - @java.lang.Override - public boolean getSendTokenToUpstream() { - return sendTokenToUpstream_; - } - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 2; - * @param value The sendTokenToUpstream to set. - * @return This builder for chaining. - */ - public Builder setSendTokenToUpstream(boolean value) { - - sendTokenToUpstream_ = value; - onChanged(); - return this; - } - /** - *
-     * send the token to upstream
-     * 
- * - * bool sendTokenToUpstream = 2; - * @return This builder for chaining. - */ - public Builder clearSendTokenToUpstream() { - - sendTokenToUpstream_ = 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.api.Oauth2) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.Oauth2) - private static final org.wso2.apk.enforcer.discovery.api.Oauth2 DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.Oauth2(); - } - - public static org.wso2.apk.enforcer.discovery.api.Oauth2 getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Oauth2 parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Oauth2(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Oauth2 getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Oauth2OrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Oauth2OrBuilder.java deleted file mode 100644 index 1c8bd7ce7b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Oauth2OrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface Oauth2OrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.Oauth2) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * name of the header containing the JWT
-   * 
- * - * string header = 1; - * @return The header. - */ - java.lang.String getHeader(); - /** - *
-   * name of the header containing the JWT
-   * 
- * - * string header = 1; - * @return The bytes for header. - */ - com.google.protobuf.ByteString - getHeaderBytes(); - - /** - *
-   * send the token to upstream
-   * 
- * - * bool sendTokenToUpstream = 2; - * @return The sendTokenToUpstream. - */ - boolean getSendTokenToUpstream(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Operation.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Operation.java deleted file mode 100644 index b6a529edb5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Operation.java +++ /dev/null @@ -1,1440 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Operation model which maps to a particular http methods
- * 
- * - * Protobuf type {@code wso2.discovery.api.Operation} - */ -public final class Operation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.Operation) - OperationOrBuilder { -private static final long serialVersionUID = 0L; - // Use Operation.newBuilder() to construct. - private Operation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Operation() { - method_ = ""; - tier_ = ""; - scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - matchID_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Operation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Operation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - method_ = s; - break; - } - case 18: { - org.wso2.apk.enforcer.discovery.api.APIAuthentication.Builder subBuilder = null; - if (apiAuthentication_ != null) { - subBuilder = apiAuthentication_.toBuilder(); - } - apiAuthentication_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.APIAuthentication.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(apiAuthentication_); - apiAuthentication_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - tier_ = s; - break; - } - case 34: { - org.wso2.apk.enforcer.discovery.api.OperationPolicies.Builder subBuilder = null; - if (policies_ != null) { - subBuilder = policies_.toBuilder(); - } - policies_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.OperationPolicies.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policies_); - policies_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - scopes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - scopes_.add(s); - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - matchID_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - scopes_ = scopes_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Operation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Operation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Operation.class, org.wso2.apk.enforcer.discovery.api.Operation.Builder.class); - } - - public static final int METHOD_FIELD_NUMBER = 1; - private volatile java.lang.Object method_; - /** - * string method = 1; - * @return The method. - */ - @java.lang.Override - public java.lang.String getMethod() { - java.lang.Object ref = method_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - method_ = s; - return s; - } - } - /** - * string method = 1; - * @return The bytes for method. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getMethodBytes() { - java.lang.Object ref = method_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - method_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APIAUTHENTICATION_FIELD_NUMBER = 2; - private org.wso2.apk.enforcer.discovery.api.APIAuthentication apiAuthentication_; - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - * @return Whether the apiAuthentication field is set. - */ - @java.lang.Override - public boolean hasApiAuthentication() { - return apiAuthentication_ != null; - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - * @return The apiAuthentication. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIAuthentication getApiAuthentication() { - return apiAuthentication_ == null ? org.wso2.apk.enforcer.discovery.api.APIAuthentication.getDefaultInstance() : apiAuthentication_; - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.APIAuthenticationOrBuilder getApiAuthenticationOrBuilder() { - return getApiAuthentication(); - } - - public static final int TIER_FIELD_NUMBER = 3; - private volatile java.lang.Object tier_; - /** - * string tier = 3; - * @return The tier. - */ - @java.lang.Override - public java.lang.String getTier() { - java.lang.Object ref = tier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tier_ = s; - return s; - } - } - /** - * string tier = 3; - * @return The bytes for tier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTierBytes() { - java.lang.Object ref = tier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int POLICIES_FIELD_NUMBER = 4; - private org.wso2.apk.enforcer.discovery.api.OperationPolicies policies_; - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - * @return Whether the policies field is set. - */ - @java.lang.Override - public boolean hasPolicies() { - return policies_ != null; - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - * @return The policies. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.OperationPolicies getPolicies() { - return policies_ == null ? org.wso2.apk.enforcer.discovery.api.OperationPolicies.getDefaultInstance() : policies_; - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.OperationPoliciesOrBuilder getPoliciesOrBuilder() { - return getPolicies(); - } - - public static final int SCOPES_FIELD_NUMBER = 5; - private com.google.protobuf.LazyStringList scopes_; - /** - * repeated string scopes = 5; - * @return A list containing the scopes. - */ - public com.google.protobuf.ProtocolStringList - getScopesList() { - return scopes_; - } - /** - * repeated string scopes = 5; - * @return The count of scopes. - */ - public int getScopesCount() { - return scopes_.size(); - } - /** - * repeated string scopes = 5; - * @param index The index of the element to return. - * @return The scopes at the given index. - */ - public java.lang.String getScopes(int index) { - return scopes_.get(index); - } - /** - * repeated string scopes = 5; - * @param index The index of the value to return. - * @return The bytes of the scopes at the given index. - */ - public com.google.protobuf.ByteString - getScopesBytes(int index) { - return scopes_.getByteString(index); - } - - public static final int MATCHID_FIELD_NUMBER = 6; - private volatile java.lang.Object matchID_; - /** - *
-   * MockedApiConfig mockedApiConfig = 6;
-   * 
- * - * string matchID = 6; - * @return The matchID. - */ - @java.lang.Override - public java.lang.String getMatchID() { - java.lang.Object ref = matchID_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - matchID_ = s; - return s; - } - } - /** - *
-   * MockedApiConfig mockedApiConfig = 6;
-   * 
- * - * string matchID = 6; - * @return The bytes for matchID. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getMatchIDBytes() { - java.lang.Object ref = matchID_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - matchID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getMethodBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); - } - if (apiAuthentication_ != null) { - output.writeMessage(2, getApiAuthentication()); - } - if (!getTierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tier_); - } - if (policies_ != null) { - output.writeMessage(4, getPolicies()); - } - for (int i = 0; i < scopes_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, scopes_.getRaw(i)); - } - if (!getMatchIDBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, matchID_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getMethodBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); - } - if (apiAuthentication_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getApiAuthentication()); - } - if (!getTierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, tier_); - } - if (policies_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getPolicies()); - } - { - int dataSize = 0; - for (int i = 0; i < scopes_.size(); i++) { - dataSize += computeStringSizeNoTag(scopes_.getRaw(i)); - } - size += dataSize; - size += 1 * getScopesList().size(); - } - if (!getMatchIDBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, matchID_); - } - 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.api.Operation)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.Operation other = (org.wso2.apk.enforcer.discovery.api.Operation) obj; - - if (!getMethod() - .equals(other.getMethod())) return false; - if (hasApiAuthentication() != other.hasApiAuthentication()) return false; - if (hasApiAuthentication()) { - if (!getApiAuthentication() - .equals(other.getApiAuthentication())) return false; - } - if (!getTier() - .equals(other.getTier())) return false; - if (hasPolicies() != other.hasPolicies()) return false; - if (hasPolicies()) { - if (!getPolicies() - .equals(other.getPolicies())) return false; - } - if (!getScopesList() - .equals(other.getScopesList())) return false; - if (!getMatchID() - .equals(other.getMatchID())) 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) + METHOD_FIELD_NUMBER; - hash = (53 * hash) + getMethod().hashCode(); - if (hasApiAuthentication()) { - hash = (37 * hash) + APIAUTHENTICATION_FIELD_NUMBER; - hash = (53 * hash) + getApiAuthentication().hashCode(); - } - hash = (37 * hash) + TIER_FIELD_NUMBER; - hash = (53 * hash) + getTier().hashCode(); - if (hasPolicies()) { - hash = (37 * hash) + POLICIES_FIELD_NUMBER; - hash = (53 * hash) + getPolicies().hashCode(); - } - if (getScopesCount() > 0) { - hash = (37 * hash) + SCOPES_FIELD_NUMBER; - hash = (53 * hash) + getScopesList().hashCode(); - } - hash = (37 * hash) + MATCHID_FIELD_NUMBER; - hash = (53 * hash) + getMatchID().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.Operation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Operation 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.api.Operation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Operation 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.api.Operation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Operation 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.api.Operation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Operation 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.api.Operation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Operation 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.api.Operation 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.api.Operation 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.api.Operation 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; - } - /** - *
-   * Operation model which maps to a particular http methods
-   * 
- * - * Protobuf type {@code wso2.discovery.api.Operation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.Operation) - org.wso2.apk.enforcer.discovery.api.OperationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Operation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Operation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Operation.class, org.wso2.apk.enforcer.discovery.api.Operation.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.Operation.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(); - method_ = ""; - - if (apiAuthenticationBuilder_ == null) { - apiAuthentication_ = null; - } else { - apiAuthentication_ = null; - apiAuthenticationBuilder_ = null; - } - tier_ = ""; - - if (policiesBuilder_ == null) { - policies_ = null; - } else { - policies_ = null; - policiesBuilder_ = null; - } - scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - matchID_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Operation_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Operation getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.Operation.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Operation build() { - org.wso2.apk.enforcer.discovery.api.Operation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Operation buildPartial() { - org.wso2.apk.enforcer.discovery.api.Operation result = new org.wso2.apk.enforcer.discovery.api.Operation(this); - int from_bitField0_ = bitField0_; - result.method_ = method_; - if (apiAuthenticationBuilder_ == null) { - result.apiAuthentication_ = apiAuthentication_; - } else { - result.apiAuthentication_ = apiAuthenticationBuilder_.build(); - } - result.tier_ = tier_; - if (policiesBuilder_ == null) { - result.policies_ = policies_; - } else { - result.policies_ = policiesBuilder_.build(); - } - if (((bitField0_ & 0x00000001) != 0)) { - scopes_ = scopes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.scopes_ = scopes_; - result.matchID_ = matchID_; - 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.api.Operation) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.Operation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.Operation other) { - if (other == org.wso2.apk.enforcer.discovery.api.Operation.getDefaultInstance()) return this; - if (!other.getMethod().isEmpty()) { - method_ = other.method_; - onChanged(); - } - if (other.hasApiAuthentication()) { - mergeApiAuthentication(other.getApiAuthentication()); - } - if (!other.getTier().isEmpty()) { - tier_ = other.tier_; - onChanged(); - } - if (other.hasPolicies()) { - mergePolicies(other.getPolicies()); - } - if (!other.scopes_.isEmpty()) { - if (scopes_.isEmpty()) { - scopes_ = other.scopes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureScopesIsMutable(); - scopes_.addAll(other.scopes_); - } - onChanged(); - } - if (!other.getMatchID().isEmpty()) { - matchID_ = other.matchID_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.Operation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.Operation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object method_ = ""; - /** - * string method = 1; - * @return The method. - */ - public java.lang.String getMethod() { - java.lang.Object ref = method_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - method_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string method = 1; - * @return The bytes for method. - */ - public com.google.protobuf.ByteString - getMethodBytes() { - java.lang.Object ref = method_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - method_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string method = 1; - * @param value The method to set. - * @return This builder for chaining. - */ - public Builder setMethod( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - method_ = value; - onChanged(); - return this; - } - /** - * string method = 1; - * @return This builder for chaining. - */ - public Builder clearMethod() { - - method_ = getDefaultInstance().getMethod(); - onChanged(); - return this; - } - /** - * string method = 1; - * @param value The bytes for method to set. - * @return This builder for chaining. - */ - public Builder setMethodBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - method_ = value; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.api.APIAuthentication apiAuthentication_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.APIAuthentication, org.wso2.apk.enforcer.discovery.api.APIAuthentication.Builder, org.wso2.apk.enforcer.discovery.api.APIAuthenticationOrBuilder> apiAuthenticationBuilder_; - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - * @return Whether the apiAuthentication field is set. - */ - public boolean hasApiAuthentication() { - return apiAuthenticationBuilder_ != null || apiAuthentication_ != null; - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - * @return The apiAuthentication. - */ - public org.wso2.apk.enforcer.discovery.api.APIAuthentication getApiAuthentication() { - if (apiAuthenticationBuilder_ == null) { - return apiAuthentication_ == null ? org.wso2.apk.enforcer.discovery.api.APIAuthentication.getDefaultInstance() : apiAuthentication_; - } else { - return apiAuthenticationBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - public Builder setApiAuthentication(org.wso2.apk.enforcer.discovery.api.APIAuthentication value) { - if (apiAuthenticationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - apiAuthentication_ = value; - onChanged(); - } else { - apiAuthenticationBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - public Builder setApiAuthentication( - org.wso2.apk.enforcer.discovery.api.APIAuthentication.Builder builderForValue) { - if (apiAuthenticationBuilder_ == null) { - apiAuthentication_ = builderForValue.build(); - onChanged(); - } else { - apiAuthenticationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - public Builder mergeApiAuthentication(org.wso2.apk.enforcer.discovery.api.APIAuthentication value) { - if (apiAuthenticationBuilder_ == null) { - if (apiAuthentication_ != null) { - apiAuthentication_ = - org.wso2.apk.enforcer.discovery.api.APIAuthentication.newBuilder(apiAuthentication_).mergeFrom(value).buildPartial(); - } else { - apiAuthentication_ = value; - } - onChanged(); - } else { - apiAuthenticationBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - public Builder clearApiAuthentication() { - if (apiAuthenticationBuilder_ == null) { - apiAuthentication_ = null; - onChanged(); - } else { - apiAuthentication_ = null; - apiAuthenticationBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - public org.wso2.apk.enforcer.discovery.api.APIAuthentication.Builder getApiAuthenticationBuilder() { - - onChanged(); - return getApiAuthenticationFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - public org.wso2.apk.enforcer.discovery.api.APIAuthenticationOrBuilder getApiAuthenticationOrBuilder() { - if (apiAuthenticationBuilder_ != null) { - return apiAuthenticationBuilder_.getMessageOrBuilder(); - } else { - return apiAuthentication_ == null ? - org.wso2.apk.enforcer.discovery.api.APIAuthentication.getDefaultInstance() : apiAuthentication_; - } - } - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.APIAuthentication, org.wso2.apk.enforcer.discovery.api.APIAuthentication.Builder, org.wso2.apk.enforcer.discovery.api.APIAuthenticationOrBuilder> - getApiAuthenticationFieldBuilder() { - if (apiAuthenticationBuilder_ == null) { - apiAuthenticationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.APIAuthentication, org.wso2.apk.enforcer.discovery.api.APIAuthentication.Builder, org.wso2.apk.enforcer.discovery.api.APIAuthenticationOrBuilder>( - getApiAuthentication(), - getParentForChildren(), - isClean()); - apiAuthentication_ = null; - } - return apiAuthenticationBuilder_; - } - - private java.lang.Object tier_ = ""; - /** - * string tier = 3; - * @return The tier. - */ - public java.lang.String getTier() { - java.lang.Object ref = tier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string tier = 3; - * @return The bytes for tier. - */ - public com.google.protobuf.ByteString - getTierBytes() { - java.lang.Object ref = tier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string tier = 3; - * @param value The tier to set. - * @return This builder for chaining. - */ - public Builder setTier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tier_ = value; - onChanged(); - return this; - } - /** - * string tier = 3; - * @return This builder for chaining. - */ - public Builder clearTier() { - - tier_ = getDefaultInstance().getTier(); - onChanged(); - return this; - } - /** - * string tier = 3; - * @param value The bytes for tier to set. - * @return This builder for chaining. - */ - public Builder setTierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tier_ = value; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.api.OperationPolicies policies_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.OperationPolicies, org.wso2.apk.enforcer.discovery.api.OperationPolicies.Builder, org.wso2.apk.enforcer.discovery.api.OperationPoliciesOrBuilder> policiesBuilder_; - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - * @return Whether the policies field is set. - */ - public boolean hasPolicies() { - return policiesBuilder_ != null || policies_ != null; - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - * @return The policies. - */ - public org.wso2.apk.enforcer.discovery.api.OperationPolicies getPolicies() { - if (policiesBuilder_ == null) { - return policies_ == null ? org.wso2.apk.enforcer.discovery.api.OperationPolicies.getDefaultInstance() : policies_; - } else { - return policiesBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - public Builder setPolicies(org.wso2.apk.enforcer.discovery.api.OperationPolicies value) { - if (policiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - policies_ = value; - onChanged(); - } else { - policiesBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - public Builder setPolicies( - org.wso2.apk.enforcer.discovery.api.OperationPolicies.Builder builderForValue) { - if (policiesBuilder_ == null) { - policies_ = builderForValue.build(); - onChanged(); - } else { - policiesBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - public Builder mergePolicies(org.wso2.apk.enforcer.discovery.api.OperationPolicies value) { - if (policiesBuilder_ == null) { - if (policies_ != null) { - policies_ = - org.wso2.apk.enforcer.discovery.api.OperationPolicies.newBuilder(policies_).mergeFrom(value).buildPartial(); - } else { - policies_ = value; - } - onChanged(); - } else { - policiesBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - public Builder clearPolicies() { - if (policiesBuilder_ == null) { - policies_ = null; - onChanged(); - } else { - policies_ = null; - policiesBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - public org.wso2.apk.enforcer.discovery.api.OperationPolicies.Builder getPoliciesBuilder() { - - onChanged(); - return getPoliciesFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - public org.wso2.apk.enforcer.discovery.api.OperationPoliciesOrBuilder getPoliciesOrBuilder() { - if (policiesBuilder_ != null) { - return policiesBuilder_.getMessageOrBuilder(); - } else { - return policies_ == null ? - org.wso2.apk.enforcer.discovery.api.OperationPolicies.getDefaultInstance() : policies_; - } - } - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.OperationPolicies, org.wso2.apk.enforcer.discovery.api.OperationPolicies.Builder, org.wso2.apk.enforcer.discovery.api.OperationPoliciesOrBuilder> - getPoliciesFieldBuilder() { - if (policiesBuilder_ == null) { - policiesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.OperationPolicies, org.wso2.apk.enforcer.discovery.api.OperationPolicies.Builder, org.wso2.apk.enforcer.discovery.api.OperationPoliciesOrBuilder>( - getPolicies(), - getParentForChildren(), - isClean()); - policies_ = null; - } - return policiesBuilder_; - } - - private com.google.protobuf.LazyStringList scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureScopesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - scopes_ = new com.google.protobuf.LazyStringArrayList(scopes_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string scopes = 5; - * @return A list containing the scopes. - */ - public com.google.protobuf.ProtocolStringList - getScopesList() { - return scopes_.getUnmodifiableView(); - } - /** - * repeated string scopes = 5; - * @return The count of scopes. - */ - public int getScopesCount() { - return scopes_.size(); - } - /** - * repeated string scopes = 5; - * @param index The index of the element to return. - * @return The scopes at the given index. - */ - public java.lang.String getScopes(int index) { - return scopes_.get(index); - } - /** - * repeated string scopes = 5; - * @param index The index of the value to return. - * @return The bytes of the scopes at the given index. - */ - public com.google.protobuf.ByteString - getScopesBytes(int index) { - return scopes_.getByteString(index); - } - /** - * repeated string scopes = 5; - * @param index The index to set the value at. - * @param value The scopes to set. - * @return This builder for chaining. - */ - public Builder setScopes( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureScopesIsMutable(); - scopes_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string scopes = 5; - * @param value The scopes to add. - * @return This builder for chaining. - */ - public Builder addScopes( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureScopesIsMutable(); - scopes_.add(value); - onChanged(); - return this; - } - /** - * repeated string scopes = 5; - * @param values The scopes to add. - * @return This builder for chaining. - */ - public Builder addAllScopes( - java.lang.Iterable values) { - ensureScopesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, scopes_); - onChanged(); - return this; - } - /** - * repeated string scopes = 5; - * @return This builder for chaining. - */ - public Builder clearScopes() { - scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string scopes = 5; - * @param value The bytes of the scopes to add. - * @return This builder for chaining. - */ - public Builder addScopesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureScopesIsMutable(); - scopes_.add(value); - onChanged(); - return this; - } - - private java.lang.Object matchID_ = ""; - /** - *
-     * MockedApiConfig mockedApiConfig = 6;
-     * 
- * - * string matchID = 6; - * @return The matchID. - */ - public java.lang.String getMatchID() { - java.lang.Object ref = matchID_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - matchID_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * MockedApiConfig mockedApiConfig = 6;
-     * 
- * - * string matchID = 6; - * @return The bytes for matchID. - */ - public com.google.protobuf.ByteString - getMatchIDBytes() { - java.lang.Object ref = matchID_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - matchID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * MockedApiConfig mockedApiConfig = 6;
-     * 
- * - * string matchID = 6; - * @param value The matchID to set. - * @return This builder for chaining. - */ - public Builder setMatchID( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - matchID_ = value; - onChanged(); - return this; - } - /** - *
-     * MockedApiConfig mockedApiConfig = 6;
-     * 
- * - * string matchID = 6; - * @return This builder for chaining. - */ - public Builder clearMatchID() { - - matchID_ = getDefaultInstance().getMatchID(); - onChanged(); - return this; - } - /** - *
-     * MockedApiConfig mockedApiConfig = 6;
-     * 
- * - * string matchID = 6; - * @param value The bytes for matchID to set. - * @return This builder for chaining. - */ - public Builder setMatchIDBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - matchID_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.api.Operation) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.Operation) - private static final org.wso2.apk.enforcer.discovery.api.Operation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.Operation(); - } - - public static org.wso2.apk.enforcer.discovery.api.Operation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Operation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Operation(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.api.Operation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationOrBuilder.java deleted file mode 100644 index c8185fa4ab..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationOrBuilder.java +++ /dev/null @@ -1,108 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface OperationOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.Operation) - com.google.protobuf.MessageOrBuilder { - - /** - * string method = 1; - * @return The method. - */ - java.lang.String getMethod(); - /** - * string method = 1; - * @return The bytes for method. - */ - com.google.protobuf.ByteString - getMethodBytes(); - - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - * @return Whether the apiAuthentication field is set. - */ - boolean hasApiAuthentication(); - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - * @return The apiAuthentication. - */ - org.wso2.apk.enforcer.discovery.api.APIAuthentication getApiAuthentication(); - /** - * .wso2.discovery.api.APIAuthentication apiAuthentication = 2; - */ - org.wso2.apk.enforcer.discovery.api.APIAuthenticationOrBuilder getApiAuthenticationOrBuilder(); - - /** - * string tier = 3; - * @return The tier. - */ - java.lang.String getTier(); - /** - * string tier = 3; - * @return The bytes for tier. - */ - com.google.protobuf.ByteString - getTierBytes(); - - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - * @return Whether the policies field is set. - */ - boolean hasPolicies(); - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - * @return The policies. - */ - org.wso2.apk.enforcer.discovery.api.OperationPolicies getPolicies(); - /** - * .wso2.discovery.api.OperationPolicies policies = 4; - */ - org.wso2.apk.enforcer.discovery.api.OperationPoliciesOrBuilder getPoliciesOrBuilder(); - - /** - * repeated string scopes = 5; - * @return A list containing the scopes. - */ - java.util.List - getScopesList(); - /** - * repeated string scopes = 5; - * @return The count of scopes. - */ - int getScopesCount(); - /** - * repeated string scopes = 5; - * @param index The index of the element to return. - * @return The scopes at the given index. - */ - java.lang.String getScopes(int index); - /** - * repeated string scopes = 5; - * @param index The index of the value to return. - * @return The bytes of the scopes at the given index. - */ - com.google.protobuf.ByteString - getScopesBytes(int index); - - /** - *
-   * MockedApiConfig mockedApiConfig = 6;
-   * 
- * - * string matchID = 6; - * @return The matchID. - */ - java.lang.String getMatchID(); - /** - *
-   * MockedApiConfig mockedApiConfig = 6;
-   * 
- * - * string matchID = 6; - * @return The bytes for matchID. - */ - com.google.protobuf.ByteString - getMatchIDBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationPolicies.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationPolicies.java deleted file mode 100644 index 0fae42082e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationPolicies.java +++ /dev/null @@ -1,1474 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * OperationPolicies holds policies of the APIM operations
- * 
- * - * Protobuf type {@code wso2.discovery.api.OperationPolicies} - */ -public final class OperationPolicies extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.OperationPolicies) - OperationPoliciesOrBuilder { -private static final long serialVersionUID = 0L; - // Use OperationPolicies.newBuilder() to construct. - private OperationPolicies(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OperationPolicies() { - request_ = java.util.Collections.emptyList(); - response_ = java.util.Collections.emptyList(); - fault_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OperationPolicies(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OperationPolicies( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - request_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - request_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.Policy.parser(), extensionRegistry)); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - response_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - response_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.Policy.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - fault_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - fault_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.Policy.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - request_ = java.util.Collections.unmodifiableList(request_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - response_ = java.util.Collections.unmodifiableList(response_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - fault_ = java.util.Collections.unmodifiableList(fault_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_OperationPolicies_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_OperationPolicies_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.OperationPolicies.class, org.wso2.apk.enforcer.discovery.api.OperationPolicies.Builder.class); - } - - public static final int REQUEST_FIELD_NUMBER = 1; - private java.util.List request_; - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - @java.lang.Override - public java.util.List getRequestList() { - return request_; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - @java.lang.Override - public java.util.List - getRequestOrBuilderList() { - return request_; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - @java.lang.Override - public int getRequestCount() { - return request_.size(); - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Policy getRequest(int index) { - return request_.get(index); - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getRequestOrBuilder( - int index) { - return request_.get(index); - } - - public static final int RESPONSE_FIELD_NUMBER = 2; - private java.util.List response_; - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - @java.lang.Override - public java.util.List getResponseList() { - return response_; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - @java.lang.Override - public java.util.List - getResponseOrBuilderList() { - return response_; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - @java.lang.Override - public int getResponseCount() { - return response_.size(); - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Policy getResponse(int index) { - return response_.get(index); - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getResponseOrBuilder( - int index) { - return response_.get(index); - } - - public static final int FAULT_FIELD_NUMBER = 3; - private java.util.List fault_; - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - @java.lang.Override - public java.util.List getFaultList() { - return fault_; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - @java.lang.Override - public java.util.List - getFaultOrBuilderList() { - return fault_; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - @java.lang.Override - public int getFaultCount() { - return fault_.size(); - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Policy getFault(int index) { - return fault_.get(index); - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getFaultOrBuilder( - int index) { - return fault_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < request_.size(); i++) { - output.writeMessage(1, request_.get(i)); - } - for (int i = 0; i < response_.size(); i++) { - output.writeMessage(2, response_.get(i)); - } - for (int i = 0; i < fault_.size(); i++) { - output.writeMessage(3, fault_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < request_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, request_.get(i)); - } - for (int i = 0; i < response_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, response_.get(i)); - } - for (int i = 0; i < fault_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, fault_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.api.OperationPolicies)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.OperationPolicies other = (org.wso2.apk.enforcer.discovery.api.OperationPolicies) obj; - - if (!getRequestList() - .equals(other.getRequestList())) return false; - if (!getResponseList() - .equals(other.getResponseList())) return false; - if (!getFaultList() - .equals(other.getFaultList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getRequestCount() > 0) { - hash = (37 * hash) + REQUEST_FIELD_NUMBER; - hash = (53 * hash) + getRequestList().hashCode(); - } - if (getResponseCount() > 0) { - hash = (37 * hash) + RESPONSE_FIELD_NUMBER; - hash = (53 * hash) + getResponseList().hashCode(); - } - if (getFaultCount() > 0) { - hash = (37 * hash) + FAULT_FIELD_NUMBER; - hash = (53 * hash) + getFaultList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.OperationPolicies parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.OperationPolicies 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.api.OperationPolicies parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.OperationPolicies 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.api.OperationPolicies parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.OperationPolicies 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.api.OperationPolicies parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.OperationPolicies 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.api.OperationPolicies parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.OperationPolicies 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.api.OperationPolicies 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.api.OperationPolicies 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.api.OperationPolicies 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; - } - /** - *
-   * OperationPolicies holds policies of the APIM operations
-   * 
- * - * Protobuf type {@code wso2.discovery.api.OperationPolicies} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.OperationPolicies) - org.wso2.apk.enforcer.discovery.api.OperationPoliciesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_OperationPolicies_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_OperationPolicies_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.OperationPolicies.class, org.wso2.apk.enforcer.discovery.api.OperationPolicies.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.OperationPolicies.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getRequestFieldBuilder(); - getResponseFieldBuilder(); - getFaultFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (requestBuilder_ == null) { - request_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - requestBuilder_.clear(); - } - if (responseBuilder_ == null) { - response_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - responseBuilder_.clear(); - } - if (faultBuilder_ == null) { - fault_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - faultBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_OperationPolicies_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.OperationPolicies getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.OperationPolicies.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.OperationPolicies build() { - org.wso2.apk.enforcer.discovery.api.OperationPolicies result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.OperationPolicies buildPartial() { - org.wso2.apk.enforcer.discovery.api.OperationPolicies result = new org.wso2.apk.enforcer.discovery.api.OperationPolicies(this); - int from_bitField0_ = bitField0_; - if (requestBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - request_ = java.util.Collections.unmodifiableList(request_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.request_ = request_; - } else { - result.request_ = requestBuilder_.build(); - } - if (responseBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - response_ = java.util.Collections.unmodifiableList(response_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.response_ = response_; - } else { - result.response_ = responseBuilder_.build(); - } - if (faultBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - fault_ = java.util.Collections.unmodifiableList(fault_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.fault_ = fault_; - } else { - result.fault_ = faultBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.OperationPolicies) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.OperationPolicies)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.OperationPolicies other) { - if (other == org.wso2.apk.enforcer.discovery.api.OperationPolicies.getDefaultInstance()) return this; - if (requestBuilder_ == null) { - if (!other.request_.isEmpty()) { - if (request_.isEmpty()) { - request_ = other.request_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRequestIsMutable(); - request_.addAll(other.request_); - } - onChanged(); - } - } else { - if (!other.request_.isEmpty()) { - if (requestBuilder_.isEmpty()) { - requestBuilder_.dispose(); - requestBuilder_ = null; - request_ = other.request_; - bitField0_ = (bitField0_ & ~0x00000001); - requestBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getRequestFieldBuilder() : null; - } else { - requestBuilder_.addAllMessages(other.request_); - } - } - } - if (responseBuilder_ == null) { - if (!other.response_.isEmpty()) { - if (response_.isEmpty()) { - response_ = other.response_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureResponseIsMutable(); - response_.addAll(other.response_); - } - onChanged(); - } - } else { - if (!other.response_.isEmpty()) { - if (responseBuilder_.isEmpty()) { - responseBuilder_.dispose(); - responseBuilder_ = null; - response_ = other.response_; - bitField0_ = (bitField0_ & ~0x00000002); - responseBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResponseFieldBuilder() : null; - } else { - responseBuilder_.addAllMessages(other.response_); - } - } - } - if (faultBuilder_ == null) { - if (!other.fault_.isEmpty()) { - if (fault_.isEmpty()) { - fault_ = other.fault_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureFaultIsMutable(); - fault_.addAll(other.fault_); - } - onChanged(); - } - } else { - if (!other.fault_.isEmpty()) { - if (faultBuilder_.isEmpty()) { - faultBuilder_.dispose(); - faultBuilder_ = null; - fault_ = other.fault_; - bitField0_ = (bitField0_ & ~0x00000004); - faultBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFaultFieldBuilder() : null; - } else { - faultBuilder_.addAllMessages(other.fault_); - } - } - } - 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.api.OperationPolicies parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.OperationPolicies) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List request_ = - java.util.Collections.emptyList(); - private void ensureRequestIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - request_ = new java.util.ArrayList(request_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder> requestBuilder_; - - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public java.util.List getRequestList() { - if (requestBuilder_ == null) { - return java.util.Collections.unmodifiableList(request_); - } else { - return requestBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public int getRequestCount() { - if (requestBuilder_ == null) { - return request_.size(); - } else { - return requestBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public org.wso2.apk.enforcer.discovery.api.Policy getRequest(int index) { - if (requestBuilder_ == null) { - return request_.get(index); - } else { - return requestBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder setRequest( - int index, org.wso2.apk.enforcer.discovery.api.Policy value) { - if (requestBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequestIsMutable(); - request_.set(index, value); - onChanged(); - } else { - requestBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder setRequest( - int index, org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (requestBuilder_ == null) { - ensureRequestIsMutable(); - request_.set(index, builderForValue.build()); - onChanged(); - } else { - requestBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder addRequest(org.wso2.apk.enforcer.discovery.api.Policy value) { - if (requestBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequestIsMutable(); - request_.add(value); - onChanged(); - } else { - requestBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder addRequest( - int index, org.wso2.apk.enforcer.discovery.api.Policy value) { - if (requestBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequestIsMutable(); - request_.add(index, value); - onChanged(); - } else { - requestBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder addRequest( - org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (requestBuilder_ == null) { - ensureRequestIsMutable(); - request_.add(builderForValue.build()); - onChanged(); - } else { - requestBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder addRequest( - int index, org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (requestBuilder_ == null) { - ensureRequestIsMutable(); - request_.add(index, builderForValue.build()); - onChanged(); - } else { - requestBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder addAllRequest( - java.lang.Iterable values) { - if (requestBuilder_ == null) { - ensureRequestIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, request_); - onChanged(); - } else { - requestBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder clearRequest() { - if (requestBuilder_ == null) { - request_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - requestBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public Builder removeRequest(int index) { - if (requestBuilder_ == null) { - ensureRequestIsMutable(); - request_.remove(index); - onChanged(); - } else { - requestBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder getRequestBuilder( - int index) { - return getRequestFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getRequestOrBuilder( - int index) { - if (requestBuilder_ == null) { - return request_.get(index); } else { - return requestBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public java.util.List - getRequestOrBuilderList() { - if (requestBuilder_ != null) { - return requestBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(request_); - } - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder addRequestBuilder() { - return getRequestFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.Policy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder addRequestBuilder( - int index) { - return getRequestFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.Policy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - public java.util.List - getRequestBuilderList() { - return getRequestFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder> - getRequestFieldBuilder() { - if (requestBuilder_ == null) { - requestBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder>( - request_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - request_ = null; - } - return requestBuilder_; - } - - private java.util.List response_ = - java.util.Collections.emptyList(); - private void ensureResponseIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - response_ = new java.util.ArrayList(response_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder> responseBuilder_; - - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public java.util.List getResponseList() { - if (responseBuilder_ == null) { - return java.util.Collections.unmodifiableList(response_); - } else { - return responseBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public int getResponseCount() { - if (responseBuilder_ == null) { - return response_.size(); - } else { - return responseBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public org.wso2.apk.enforcer.discovery.api.Policy getResponse(int index) { - if (responseBuilder_ == null) { - return response_.get(index); - } else { - return responseBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder setResponse( - int index, org.wso2.apk.enforcer.discovery.api.Policy value) { - if (responseBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponseIsMutable(); - response_.set(index, value); - onChanged(); - } else { - responseBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder setResponse( - int index, org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (responseBuilder_ == null) { - ensureResponseIsMutable(); - response_.set(index, builderForValue.build()); - onChanged(); - } else { - responseBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder addResponse(org.wso2.apk.enforcer.discovery.api.Policy value) { - if (responseBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponseIsMutable(); - response_.add(value); - onChanged(); - } else { - responseBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder addResponse( - int index, org.wso2.apk.enforcer.discovery.api.Policy value) { - if (responseBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponseIsMutable(); - response_.add(index, value); - onChanged(); - } else { - responseBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder addResponse( - org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (responseBuilder_ == null) { - ensureResponseIsMutable(); - response_.add(builderForValue.build()); - onChanged(); - } else { - responseBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder addResponse( - int index, org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (responseBuilder_ == null) { - ensureResponseIsMutable(); - response_.add(index, builderForValue.build()); - onChanged(); - } else { - responseBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder addAllResponse( - java.lang.Iterable values) { - if (responseBuilder_ == null) { - ensureResponseIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, response_); - onChanged(); - } else { - responseBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder clearResponse() { - if (responseBuilder_ == null) { - response_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - responseBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public Builder removeResponse(int index) { - if (responseBuilder_ == null) { - ensureResponseIsMutable(); - response_.remove(index); - onChanged(); - } else { - responseBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder getResponseBuilder( - int index) { - return getResponseFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getResponseOrBuilder( - int index) { - if (responseBuilder_ == null) { - return response_.get(index); } else { - return responseBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public java.util.List - getResponseOrBuilderList() { - if (responseBuilder_ != null) { - return responseBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(response_); - } - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder addResponseBuilder() { - return getResponseFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.Policy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder addResponseBuilder( - int index) { - return getResponseFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.Policy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - public java.util.List - getResponseBuilderList() { - return getResponseFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder> - getResponseFieldBuilder() { - if (responseBuilder_ == null) { - responseBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder>( - response_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - response_ = null; - } - return responseBuilder_; - } - - private java.util.List fault_ = - java.util.Collections.emptyList(); - private void ensureFaultIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - fault_ = new java.util.ArrayList(fault_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder> faultBuilder_; - - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public java.util.List getFaultList() { - if (faultBuilder_ == null) { - return java.util.Collections.unmodifiableList(fault_); - } else { - return faultBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public int getFaultCount() { - if (faultBuilder_ == null) { - return fault_.size(); - } else { - return faultBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public org.wso2.apk.enforcer.discovery.api.Policy getFault(int index) { - if (faultBuilder_ == null) { - return fault_.get(index); - } else { - return faultBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder setFault( - int index, org.wso2.apk.enforcer.discovery.api.Policy value) { - if (faultBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFaultIsMutable(); - fault_.set(index, value); - onChanged(); - } else { - faultBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder setFault( - int index, org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (faultBuilder_ == null) { - ensureFaultIsMutable(); - fault_.set(index, builderForValue.build()); - onChanged(); - } else { - faultBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder addFault(org.wso2.apk.enforcer.discovery.api.Policy value) { - if (faultBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFaultIsMutable(); - fault_.add(value); - onChanged(); - } else { - faultBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder addFault( - int index, org.wso2.apk.enforcer.discovery.api.Policy value) { - if (faultBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFaultIsMutable(); - fault_.add(index, value); - onChanged(); - } else { - faultBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder addFault( - org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (faultBuilder_ == null) { - ensureFaultIsMutable(); - fault_.add(builderForValue.build()); - onChanged(); - } else { - faultBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder addFault( - int index, org.wso2.apk.enforcer.discovery.api.Policy.Builder builderForValue) { - if (faultBuilder_ == null) { - ensureFaultIsMutable(); - fault_.add(index, builderForValue.build()); - onChanged(); - } else { - faultBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder addAllFault( - java.lang.Iterable values) { - if (faultBuilder_ == null) { - ensureFaultIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, fault_); - onChanged(); - } else { - faultBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder clearFault() { - if (faultBuilder_ == null) { - fault_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - faultBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public Builder removeFault(int index) { - if (faultBuilder_ == null) { - ensureFaultIsMutable(); - fault_.remove(index); - onChanged(); - } else { - faultBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder getFaultBuilder( - int index) { - return getFaultFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getFaultOrBuilder( - int index) { - if (faultBuilder_ == null) { - return fault_.get(index); } else { - return faultBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public java.util.List - getFaultOrBuilderList() { - if (faultBuilder_ != null) { - return faultBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(fault_); - } - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder addFaultBuilder() { - return getFaultFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.Policy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public org.wso2.apk.enforcer.discovery.api.Policy.Builder addFaultBuilder( - int index) { - return getFaultFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.Policy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - public java.util.List - getFaultBuilderList() { - return getFaultFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder> - getFaultFieldBuilder() { - if (faultBuilder_ == null) { - faultBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Policy, org.wso2.apk.enforcer.discovery.api.Policy.Builder, org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder>( - fault_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - fault_ = null; - } - return faultBuilder_; - } - @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.api.OperationPolicies) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.OperationPolicies) - private static final org.wso2.apk.enforcer.discovery.api.OperationPolicies DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.OperationPolicies(); - } - - public static org.wso2.apk.enforcer.discovery.api.OperationPolicies getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OperationPolicies parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OperationPolicies(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.api.OperationPolicies getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationPoliciesOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationPoliciesOrBuilder.java deleted file mode 100644 index 3ade5baf08..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/OperationPoliciesOrBuilder.java +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface OperationPoliciesOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.OperationPolicies) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - java.util.List - getRequestList(); - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - org.wso2.apk.enforcer.discovery.api.Policy getRequest(int index); - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - int getRequestCount(); - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - java.util.List - getRequestOrBuilderList(); - /** - * repeated .wso2.discovery.api.Policy request = 1; - */ - org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getRequestOrBuilder( - int index); - - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - java.util.List - getResponseList(); - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - org.wso2.apk.enforcer.discovery.api.Policy getResponse(int index); - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - int getResponseCount(); - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - java.util.List - getResponseOrBuilderList(); - /** - * repeated .wso2.discovery.api.Policy response = 2; - */ - org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getResponseOrBuilder( - int index); - - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - java.util.List - getFaultList(); - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - org.wso2.apk.enforcer.discovery.api.Policy getFault(int index); - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - int getFaultCount(); - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - java.util.List - getFaultOrBuilderList(); - /** - * repeated .wso2.discovery.api.Policy fault = 3; - */ - org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder getFaultOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Policy.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Policy.java deleted file mode 100644 index b14dd8ec1e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Policy.java +++ /dev/null @@ -1,851 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Policy holds APIM policies
- * 
- * - * Protobuf type {@code wso2.discovery.api.Policy} - */ -public final class Policy extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.Policy) - PolicyOrBuilder { -private static final long serialVersionUID = 0L; - // Use Policy.newBuilder() to construct. - private Policy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Policy() { - action_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Policy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Policy( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - action_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - parameters_ = com.google.protobuf.MapField.newMapField( - ParametersDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - parameters__ = input.readMessage( - ParametersDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - parameters_.getMutableMap().put( - parameters__.getKey(), parameters__.getValue()); - 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.api.ResourceProto.internal_static_wso2_discovery_api_Policy_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetParameters(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Policy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Policy.class, org.wso2.apk.enforcer.discovery.api.Policy.Builder.class); - } - - public static final int ACTION_FIELD_NUMBER = 1; - private volatile java.lang.Object action_; - /** - * string action = 1; - * @return The action. - */ - @java.lang.Override - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } - } - /** - * string action = 1; - * @return The bytes for action. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PARAMETERS_FIELD_NUMBER = 2; - private static final class ParametersDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Policy_ParametersEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> parameters_; - private com.google.protobuf.MapField - internalGetParameters() { - if (parameters_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ParametersDefaultEntryHolder.defaultEntry); - } - return parameters_; - } - - public int getParametersCount() { - return internalGetParameters().getMap().size(); - } - /** - * map<string, string> parameters = 2; - */ - - @java.lang.Override - public boolean containsParameters( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetParameters().getMap().containsKey(key); - } - /** - * Use {@link #getParametersMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getParameters() { - return getParametersMap(); - } - /** - * map<string, string> parameters = 2; - */ - @java.lang.Override - - public java.util.Map getParametersMap() { - return internalGetParameters().getMap(); - } - /** - * map<string, string> parameters = 2; - */ - @java.lang.Override - - public java.lang.String getParametersOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetParameters().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> parameters = 2; - */ - @java.lang.Override - - public java.lang.String getParametersOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetParameters().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - 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 (!getActionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, action_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetParameters(), - ParametersDefaultEntryHolder.defaultEntry, - 2); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getActionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, action_); - } - for (java.util.Map.Entry entry - : internalGetParameters().getMap().entrySet()) { - com.google.protobuf.MapEntry - parameters__ = ParametersDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, parameters__); - } - 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.api.Policy)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.Policy other = (org.wso2.apk.enforcer.discovery.api.Policy) obj; - - if (!getAction() - .equals(other.getAction())) return false; - if (!internalGetParameters().equals( - other.internalGetParameters())) 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) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + getAction().hashCode(); - if (!internalGetParameters().getMap().isEmpty()) { - hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; - hash = (53 * hash) + internalGetParameters().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.Policy parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Policy 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.api.Policy parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Policy 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.api.Policy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Policy 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.api.Policy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Policy 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.api.Policy parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Policy 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.api.Policy 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.api.Policy 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.api.Policy 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; - } - /** - *
-   * Policy holds APIM policies
-   * 
- * - * Protobuf type {@code wso2.discovery.api.Policy} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.Policy) - org.wso2.apk.enforcer.discovery.api.PolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Policy_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetParameters(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableParameters(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Policy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Policy.class, org.wso2.apk.enforcer.discovery.api.Policy.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.Policy.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(); - action_ = ""; - - internalGetMutableParameters().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Policy_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Policy getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.Policy.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Policy build() { - org.wso2.apk.enforcer.discovery.api.Policy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Policy buildPartial() { - org.wso2.apk.enforcer.discovery.api.Policy result = new org.wso2.apk.enforcer.discovery.api.Policy(this); - int from_bitField0_ = bitField0_; - result.action_ = action_; - result.parameters_ = internalGetParameters(); - result.parameters_.makeImmutable(); - 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.api.Policy) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.Policy)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.Policy other) { - if (other == org.wso2.apk.enforcer.discovery.api.Policy.getDefaultInstance()) return this; - if (!other.getAction().isEmpty()) { - action_ = other.action_; - onChanged(); - } - internalGetMutableParameters().mergeFrom( - other.internalGetParameters()); - 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.api.Policy parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.Policy) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object action_ = ""; - /** - * string action = 1; - * @return The action. - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string action = 1; - * @return The bytes for action. - */ - public com.google.protobuf.ByteString - getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string action = 1; - * @param value The action to set. - * @return This builder for chaining. - */ - public Builder setAction( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - action_ = value; - onChanged(); - return this; - } - /** - * string action = 1; - * @return This builder for chaining. - */ - public Builder clearAction() { - - action_ = getDefaultInstance().getAction(); - onChanged(); - return this; - } - /** - * string action = 1; - * @param value The bytes for action to set. - * @return This builder for chaining. - */ - public Builder setActionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - action_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> parameters_; - private com.google.protobuf.MapField - internalGetParameters() { - if (parameters_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ParametersDefaultEntryHolder.defaultEntry); - } - return parameters_; - } - private com.google.protobuf.MapField - internalGetMutableParameters() { - onChanged();; - if (parameters_ == null) { - parameters_ = com.google.protobuf.MapField.newMapField( - ParametersDefaultEntryHolder.defaultEntry); - } - if (!parameters_.isMutable()) { - parameters_ = parameters_.copy(); - } - return parameters_; - } - - public int getParametersCount() { - return internalGetParameters().getMap().size(); - } - /** - * map<string, string> parameters = 2; - */ - - @java.lang.Override - public boolean containsParameters( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetParameters().getMap().containsKey(key); - } - /** - * Use {@link #getParametersMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getParameters() { - return getParametersMap(); - } - /** - * map<string, string> parameters = 2; - */ - @java.lang.Override - - public java.util.Map getParametersMap() { - return internalGetParameters().getMap(); - } - /** - * map<string, string> parameters = 2; - */ - @java.lang.Override - - public java.lang.String getParametersOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetParameters().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> parameters = 2; - */ - @java.lang.Override - - public java.lang.String getParametersOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetParameters().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearParameters() { - internalGetMutableParameters().getMutableMap() - .clear(); - return this; - } - /** - * map<string, string> parameters = 2; - */ - - public Builder removeParameters( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableParameters().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableParameters() { - return internalGetMutableParameters().getMutableMap(); - } - /** - * map<string, string> parameters = 2; - */ - public Builder putParameters( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableParameters().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, string> parameters = 2; - */ - - public Builder putAllParameters( - java.util.Map values) { - internalGetMutableParameters().getMutableMap() - .putAll(values); - 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.api.Policy) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.Policy) - private static final org.wso2.apk.enforcer.discovery.api.Policy DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.Policy(); - } - - public static org.wso2.apk.enforcer.discovery.api.Policy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Policy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Policy(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.api.Policy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/PolicyOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/PolicyOrBuilder.java deleted file mode 100644 index ccd53e0983..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/PolicyOrBuilder.java +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface PolicyOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.Policy) - com.google.protobuf.MessageOrBuilder { - - /** - * string action = 1; - * @return The action. - */ - java.lang.String getAction(); - /** - * string action = 1; - * @return The bytes for action. - */ - com.google.protobuf.ByteString - getActionBytes(); - - /** - * map<string, string> parameters = 2; - */ - int getParametersCount(); - /** - * map<string, string> parameters = 2; - */ - boolean containsParameters( - java.lang.String key); - /** - * Use {@link #getParametersMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getParameters(); - /** - * map<string, string> parameters = 2; - */ - java.util.Map - getParametersMap(); - /** - * map<string, string> parameters = 2; - */ - - java.lang.String getParametersOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - * map<string, string> parameters = 2; - */ - - java.lang.String getParametersOrThrow( - java.lang.String key); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Resource.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Resource.java deleted file mode 100644 index da769d77da..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/Resource.java +++ /dev/null @@ -1,1590 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Resource config model
- * 
- * - * Protobuf type {@code wso2.discovery.api.Resource} - */ -public final class Resource extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.Resource) - ResourceOrBuilder { -private static final long serialVersionUID = 0L; - // Use Resource.newBuilder() to construct. - private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Resource() { - id_ = ""; - path_ = ""; - methods_ = java.util.Collections.emptyList(); - endpointSecurity_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Resource(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Resource( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - id_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - path_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - methods_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - methods_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.Operation.parser(), extensionRegistry)); - break; - } - case 34: { - org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder subBuilder = null; - if (endpoints_ != null) { - subBuilder = endpoints_.toBuilder(); - } - endpoints_ = input.readMessage(org.wso2.apk.enforcer.discovery.api.EndpointCluster.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endpoints_); - endpoints_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - endpointSecurity_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - endpointSecurity_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.api.SecurityInfo.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - methods_ = java.util.Collections.unmodifiableList(methods_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - endpointSecurity_ = java.util.Collections.unmodifiableList(endpointSecurity_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Resource_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Resource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Resource.class, org.wso2.apk.enforcer.discovery.api.Resource.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; - /** - * string id = 1; - * @return The id. - */ - @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } - } - /** - * string id = 1; - * @return The bytes for id. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PATH_FIELD_NUMBER = 2; - private volatile java.lang.Object path_; - /** - * string path = 2; - * @return The path. - */ - @java.lang.Override - public java.lang.String getPath() { - java.lang.Object ref = path_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - path_ = s; - return s; - } - } - /** - * string path = 2; - * @return The bytes for path. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPathBytes() { - java.lang.Object ref = path_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - path_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METHODS_FIELD_NUMBER = 3; - private java.util.List methods_; - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - @java.lang.Override - public java.util.List getMethodsList() { - return methods_; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - @java.lang.Override - public java.util.List - getMethodsOrBuilderList() { - return methods_; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - @java.lang.Override - public int getMethodsCount() { - return methods_.size(); - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Operation getMethods(int index) { - return methods_.get(index); - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.OperationOrBuilder getMethodsOrBuilder( - int index) { - return methods_.get(index); - } - - public static final int ENDPOINTS_FIELD_NUMBER = 4; - private org.wso2.apk.enforcer.discovery.api.EndpointCluster endpoints_; - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - * @return Whether the endpoints field is set. - */ - @java.lang.Override - public boolean hasEndpoints() { - return endpoints_ != null; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - * @return The endpoints. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointCluster getEndpoints() { - return endpoints_ == null ? org.wso2.apk.enforcer.discovery.api.EndpointCluster.getDefaultInstance() : endpoints_; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder getEndpointsOrBuilder() { - return getEndpoints(); - } - - public static final int ENDPOINTSECURITY_FIELD_NUMBER = 5; - private java.util.List endpointSecurity_; - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - @java.lang.Override - public java.util.List getEndpointSecurityList() { - return endpointSecurity_; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - @java.lang.Override - public java.util.List - getEndpointSecurityOrBuilderList() { - return endpointSecurity_; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - @java.lang.Override - public int getEndpointSecurityCount() { - return endpointSecurity_.size(); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.SecurityInfo getEndpointSecurity(int index) { - return endpointSecurity_.get(index); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder getEndpointSecurityOrBuilder( - int index) { - return endpointSecurity_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); - } - if (!getPathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, path_); - } - for (int i = 0; i < methods_.size(); i++) { - output.writeMessage(3, methods_.get(i)); - } - if (endpoints_ != null) { - output.writeMessage(4, getEndpoints()); - } - for (int i = 0; i < endpointSecurity_.size(); i++) { - output.writeMessage(5, endpointSecurity_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); - } - if (!getPathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, path_); - } - for (int i = 0; i < methods_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, methods_.get(i)); - } - if (endpoints_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getEndpoints()); - } - for (int i = 0; i < endpointSecurity_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, endpointSecurity_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.api.Resource)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.Resource other = (org.wso2.apk.enforcer.discovery.api.Resource) obj; - - if (!getId() - .equals(other.getId())) return false; - if (!getPath() - .equals(other.getPath())) return false; - if (!getMethodsList() - .equals(other.getMethodsList())) return false; - if (hasEndpoints() != other.hasEndpoints()) return false; - if (hasEndpoints()) { - if (!getEndpoints() - .equals(other.getEndpoints())) return false; - } - if (!getEndpointSecurityList() - .equals(other.getEndpointSecurityList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + PATH_FIELD_NUMBER; - hash = (53 * hash) + getPath().hashCode(); - if (getMethodsCount() > 0) { - hash = (37 * hash) + METHODS_FIELD_NUMBER; - hash = (53 * hash) + getMethodsList().hashCode(); - } - if (hasEndpoints()) { - hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; - hash = (53 * hash) + getEndpoints().hashCode(); - } - if (getEndpointSecurityCount() > 0) { - hash = (37 * hash) + ENDPOINTSECURITY_FIELD_NUMBER; - hash = (53 * hash) + getEndpointSecurityList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.Resource parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Resource 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.api.Resource parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Resource 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.api.Resource parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.Resource 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.api.Resource parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Resource 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.api.Resource parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.Resource 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.api.Resource 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.api.Resource 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.api.Resource 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; - } - /** - *
-   * Resource config model
-   * 
- * - * Protobuf type {@code wso2.discovery.api.Resource} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.Resource) - org.wso2.apk.enforcer.discovery.api.ResourceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Resource_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Resource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.Resource.class, org.wso2.apk.enforcer.discovery.api.Resource.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.Resource.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getMethodsFieldBuilder(); - getEndpointSecurityFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = ""; - - path_ = ""; - - if (methodsBuilder_ == null) { - methods_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - methodsBuilder_.clear(); - } - if (endpointsBuilder_ == null) { - endpoints_ = null; - } else { - endpoints_ = null; - endpointsBuilder_ = null; - } - if (endpointSecurityBuilder_ == null) { - endpointSecurity_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - endpointSecurityBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.ResourceProto.internal_static_wso2_discovery_api_Resource_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Resource getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.Resource.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Resource build() { - org.wso2.apk.enforcer.discovery.api.Resource result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.Resource buildPartial() { - org.wso2.apk.enforcer.discovery.api.Resource result = new org.wso2.apk.enforcer.discovery.api.Resource(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - result.path_ = path_; - if (methodsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - methods_ = java.util.Collections.unmodifiableList(methods_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.methods_ = methods_; - } else { - result.methods_ = methodsBuilder_.build(); - } - if (endpointsBuilder_ == null) { - result.endpoints_ = endpoints_; - } else { - result.endpoints_ = endpointsBuilder_.build(); - } - if (endpointSecurityBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - endpointSecurity_ = java.util.Collections.unmodifiableList(endpointSecurity_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.endpointSecurity_ = endpointSecurity_; - } else { - result.endpointSecurity_ = endpointSecurityBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.api.Resource) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.Resource)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.Resource other) { - if (other == org.wso2.apk.enforcer.discovery.api.Resource.getDefaultInstance()) return this; - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (!other.getPath().isEmpty()) { - path_ = other.path_; - onChanged(); - } - if (methodsBuilder_ == null) { - if (!other.methods_.isEmpty()) { - if (methods_.isEmpty()) { - methods_ = other.methods_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureMethodsIsMutable(); - methods_.addAll(other.methods_); - } - onChanged(); - } - } else { - if (!other.methods_.isEmpty()) { - if (methodsBuilder_.isEmpty()) { - methodsBuilder_.dispose(); - methodsBuilder_ = null; - methods_ = other.methods_; - bitField0_ = (bitField0_ & ~0x00000001); - methodsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getMethodsFieldBuilder() : null; - } else { - methodsBuilder_.addAllMessages(other.methods_); - } - } - } - if (other.hasEndpoints()) { - mergeEndpoints(other.getEndpoints()); - } - if (endpointSecurityBuilder_ == null) { - if (!other.endpointSecurity_.isEmpty()) { - if (endpointSecurity_.isEmpty()) { - endpointSecurity_ = other.endpointSecurity_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.addAll(other.endpointSecurity_); - } - onChanged(); - } - } else { - if (!other.endpointSecurity_.isEmpty()) { - if (endpointSecurityBuilder_.isEmpty()) { - endpointSecurityBuilder_.dispose(); - endpointSecurityBuilder_ = null; - endpointSecurity_ = other.endpointSecurity_; - bitField0_ = (bitField0_ & ~0x00000002); - endpointSecurityBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEndpointSecurityFieldBuilder() : null; - } else { - endpointSecurityBuilder_.addAllMessages(other.endpointSecurity_); - } - } - } - 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.api.Resource parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.Resource) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object id_ = ""; - /** - * string id = 1; - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string id = 1; - * @return The bytes for id. - */ - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string id = 1; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - id_ = value; - onChanged(); - return this; - } - /** - * string id = 1; - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - * string id = 1; - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; - } - - private java.lang.Object path_ = ""; - /** - * string path = 2; - * @return The path. - */ - public java.lang.String getPath() { - java.lang.Object ref = path_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - path_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string path = 2; - * @return The bytes for path. - */ - public com.google.protobuf.ByteString - getPathBytes() { - java.lang.Object ref = path_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - path_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string path = 2; - * @param value The path to set. - * @return This builder for chaining. - */ - public Builder setPath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - path_ = value; - onChanged(); - return this; - } - /** - * string path = 2; - * @return This builder for chaining. - */ - public Builder clearPath() { - - path_ = getDefaultInstance().getPath(); - onChanged(); - return this; - } - /** - * string path = 2; - * @param value The bytes for path to set. - * @return This builder for chaining. - */ - public Builder setPathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - path_ = value; - onChanged(); - return this; - } - - private java.util.List methods_ = - java.util.Collections.emptyList(); - private void ensureMethodsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - methods_ = new java.util.ArrayList(methods_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Operation, org.wso2.apk.enforcer.discovery.api.Operation.Builder, org.wso2.apk.enforcer.discovery.api.OperationOrBuilder> methodsBuilder_; - - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public java.util.List getMethodsList() { - if (methodsBuilder_ == null) { - return java.util.Collections.unmodifiableList(methods_); - } else { - return methodsBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public int getMethodsCount() { - if (methodsBuilder_ == null) { - return methods_.size(); - } else { - return methodsBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public org.wso2.apk.enforcer.discovery.api.Operation getMethods(int index) { - if (methodsBuilder_ == null) { - return methods_.get(index); - } else { - return methodsBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder setMethods( - int index, org.wso2.apk.enforcer.discovery.api.Operation value) { - if (methodsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMethodsIsMutable(); - methods_.set(index, value); - onChanged(); - } else { - methodsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder setMethods( - int index, org.wso2.apk.enforcer.discovery.api.Operation.Builder builderForValue) { - if (methodsBuilder_ == null) { - ensureMethodsIsMutable(); - methods_.set(index, builderForValue.build()); - onChanged(); - } else { - methodsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder addMethods(org.wso2.apk.enforcer.discovery.api.Operation value) { - if (methodsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMethodsIsMutable(); - methods_.add(value); - onChanged(); - } else { - methodsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder addMethods( - int index, org.wso2.apk.enforcer.discovery.api.Operation value) { - if (methodsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMethodsIsMutable(); - methods_.add(index, value); - onChanged(); - } else { - methodsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder addMethods( - org.wso2.apk.enforcer.discovery.api.Operation.Builder builderForValue) { - if (methodsBuilder_ == null) { - ensureMethodsIsMutable(); - methods_.add(builderForValue.build()); - onChanged(); - } else { - methodsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder addMethods( - int index, org.wso2.apk.enforcer.discovery.api.Operation.Builder builderForValue) { - if (methodsBuilder_ == null) { - ensureMethodsIsMutable(); - methods_.add(index, builderForValue.build()); - onChanged(); - } else { - methodsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder addAllMethods( - java.lang.Iterable values) { - if (methodsBuilder_ == null) { - ensureMethodsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, methods_); - onChanged(); - } else { - methodsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder clearMethods() { - if (methodsBuilder_ == null) { - methods_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - methodsBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public Builder removeMethods(int index) { - if (methodsBuilder_ == null) { - ensureMethodsIsMutable(); - methods_.remove(index); - onChanged(); - } else { - methodsBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public org.wso2.apk.enforcer.discovery.api.Operation.Builder getMethodsBuilder( - int index) { - return getMethodsFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public org.wso2.apk.enforcer.discovery.api.OperationOrBuilder getMethodsOrBuilder( - int index) { - if (methodsBuilder_ == null) { - return methods_.get(index); } else { - return methodsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public java.util.List - getMethodsOrBuilderList() { - if (methodsBuilder_ != null) { - return methodsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(methods_); - } - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public org.wso2.apk.enforcer.discovery.api.Operation.Builder addMethodsBuilder() { - return getMethodsFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.Operation.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public org.wso2.apk.enforcer.discovery.api.Operation.Builder addMethodsBuilder( - int index) { - return getMethodsFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.Operation.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - public java.util.List - getMethodsBuilderList() { - return getMethodsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Operation, org.wso2.apk.enforcer.discovery.api.Operation.Builder, org.wso2.apk.enforcer.discovery.api.OperationOrBuilder> - getMethodsFieldBuilder() { - if (methodsBuilder_ == null) { - methodsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.Operation, org.wso2.apk.enforcer.discovery.api.Operation.Builder, org.wso2.apk.enforcer.discovery.api.OperationOrBuilder>( - methods_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - methods_ = null; - } - return methodsBuilder_; - } - - private org.wso2.apk.enforcer.discovery.api.EndpointCluster endpoints_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointCluster, org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder> endpointsBuilder_; - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - * @return Whether the endpoints field is set. - */ - public boolean hasEndpoints() { - return endpointsBuilder_ != null || endpoints_ != null; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - * @return The endpoints. - */ - public org.wso2.apk.enforcer.discovery.api.EndpointCluster getEndpoints() { - if (endpointsBuilder_ == null) { - return endpoints_ == null ? org.wso2.apk.enforcer.discovery.api.EndpointCluster.getDefaultInstance() : endpoints_; - } else { - return endpointsBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - public Builder setEndpoints(org.wso2.apk.enforcer.discovery.api.EndpointCluster value) { - if (endpointsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endpoints_ = value; - onChanged(); - } else { - endpointsBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - public Builder setEndpoints( - org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder builderForValue) { - if (endpointsBuilder_ == null) { - endpoints_ = builderForValue.build(); - onChanged(); - } else { - endpointsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - public Builder mergeEndpoints(org.wso2.apk.enforcer.discovery.api.EndpointCluster value) { - if (endpointsBuilder_ == null) { - if (endpoints_ != null) { - endpoints_ = - org.wso2.apk.enforcer.discovery.api.EndpointCluster.newBuilder(endpoints_).mergeFrom(value).buildPartial(); - } else { - endpoints_ = value; - } - onChanged(); - } else { - endpointsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - public Builder clearEndpoints() { - if (endpointsBuilder_ == null) { - endpoints_ = null; - onChanged(); - } else { - endpoints_ = null; - endpointsBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - public org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder getEndpointsBuilder() { - - onChanged(); - return getEndpointsFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - public org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder getEndpointsOrBuilder() { - if (endpointsBuilder_ != null) { - return endpointsBuilder_.getMessageOrBuilder(); - } else { - return endpoints_ == null ? - org.wso2.apk.enforcer.discovery.api.EndpointCluster.getDefaultInstance() : endpoints_; - } - } - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointCluster, org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder> - getEndpointsFieldBuilder() { - if (endpointsBuilder_ == null) { - endpointsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.EndpointCluster, org.wso2.apk.enforcer.discovery.api.EndpointCluster.Builder, org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder>( - getEndpoints(), - getParentForChildren(), - isClean()); - endpoints_ = null; - } - return endpointsBuilder_; - } - - private java.util.List endpointSecurity_ = - java.util.Collections.emptyList(); - private void ensureEndpointSecurityIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - endpointSecurity_ = new java.util.ArrayList(endpointSecurity_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.SecurityInfo, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder, org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder> endpointSecurityBuilder_; - - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public java.util.List getEndpointSecurityList() { - if (endpointSecurityBuilder_ == null) { - return java.util.Collections.unmodifiableList(endpointSecurity_); - } else { - return endpointSecurityBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public int getEndpointSecurityCount() { - if (endpointSecurityBuilder_ == null) { - return endpointSecurity_.size(); - } else { - return endpointSecurityBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfo getEndpointSecurity(int index) { - if (endpointSecurityBuilder_ == null) { - return endpointSecurity_.get(index); - } else { - return endpointSecurityBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder setEndpointSecurity( - int index, org.wso2.apk.enforcer.discovery.api.SecurityInfo value) { - if (endpointSecurityBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointSecurityIsMutable(); - endpointSecurity_.set(index, value); - onChanged(); - } else { - endpointSecurityBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder setEndpointSecurity( - int index, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder builderForValue) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.set(index, builderForValue.build()); - onChanged(); - } else { - endpointSecurityBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder addEndpointSecurity(org.wso2.apk.enforcer.discovery.api.SecurityInfo value) { - if (endpointSecurityBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointSecurityIsMutable(); - endpointSecurity_.add(value); - onChanged(); - } else { - endpointSecurityBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder addEndpointSecurity( - int index, org.wso2.apk.enforcer.discovery.api.SecurityInfo value) { - if (endpointSecurityBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointSecurityIsMutable(); - endpointSecurity_.add(index, value); - onChanged(); - } else { - endpointSecurityBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder addEndpointSecurity( - org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder builderForValue) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.add(builderForValue.build()); - onChanged(); - } else { - endpointSecurityBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder addEndpointSecurity( - int index, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder builderForValue) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.add(index, builderForValue.build()); - onChanged(); - } else { - endpointSecurityBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder addAllEndpointSecurity( - java.lang.Iterable values) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, endpointSecurity_); - onChanged(); - } else { - endpointSecurityBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder clearEndpointSecurity() { - if (endpointSecurityBuilder_ == null) { - endpointSecurity_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - endpointSecurityBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public Builder removeEndpointSecurity(int index) { - if (endpointSecurityBuilder_ == null) { - ensureEndpointSecurityIsMutable(); - endpointSecurity_.remove(index); - onChanged(); - } else { - endpointSecurityBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder getEndpointSecurityBuilder( - int index) { - return getEndpointSecurityFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder getEndpointSecurityOrBuilder( - int index) { - if (endpointSecurityBuilder_ == null) { - return endpointSecurity_.get(index); } else { - return endpointSecurityBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public java.util.List - getEndpointSecurityOrBuilderList() { - if (endpointSecurityBuilder_ != null) { - return endpointSecurityBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(endpointSecurity_); - } - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder addEndpointSecurityBuilder() { - return getEndpointSecurityFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.api.SecurityInfo.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder addEndpointSecurityBuilder( - int index) { - return getEndpointSecurityFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.api.SecurityInfo.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - public java.util.List - getEndpointSecurityBuilderList() { - return getEndpointSecurityFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.SecurityInfo, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder, org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder> - getEndpointSecurityFieldBuilder() { - if (endpointSecurityBuilder_ == null) { - endpointSecurityBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.api.SecurityInfo, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder, org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder>( - endpointSecurity_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - endpointSecurity_ = null; - } - return endpointSecurityBuilder_; - } - @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.api.Resource) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.Resource) - private static final org.wso2.apk.enforcer.discovery.api.Resource DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.Resource(); - } - - public static org.wso2.apk.enforcer.discovery.api.Resource getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Resource parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Resource(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.api.Resource getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ResourceOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ResourceOrBuilder.java deleted file mode 100644 index 596509d015..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ResourceOrBuilder.java +++ /dev/null @@ -1,96 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface ResourceOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.Resource) - com.google.protobuf.MessageOrBuilder { - - /** - * string id = 1; - * @return The id. - */ - java.lang.String getId(); - /** - * string id = 1; - * @return The bytes for id. - */ - com.google.protobuf.ByteString - getIdBytes(); - - /** - * string path = 2; - * @return The path. - */ - java.lang.String getPath(); - /** - * string path = 2; - * @return The bytes for path. - */ - com.google.protobuf.ByteString - getPathBytes(); - - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - java.util.List - getMethodsList(); - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - org.wso2.apk.enforcer.discovery.api.Operation getMethods(int index); - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - int getMethodsCount(); - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - java.util.List - getMethodsOrBuilderList(); - /** - * repeated .wso2.discovery.api.Operation methods = 3; - */ - org.wso2.apk.enforcer.discovery.api.OperationOrBuilder getMethodsOrBuilder( - int index); - - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - * @return Whether the endpoints field is set. - */ - boolean hasEndpoints(); - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - * @return The endpoints. - */ - org.wso2.apk.enforcer.discovery.api.EndpointCluster getEndpoints(); - /** - * .wso2.discovery.api.EndpointCluster endpoints = 4; - */ - org.wso2.apk.enforcer.discovery.api.EndpointClusterOrBuilder getEndpointsOrBuilder(); - - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - java.util.List - getEndpointSecurityList(); - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - org.wso2.apk.enforcer.discovery.api.SecurityInfo getEndpointSecurity(int index); - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - int getEndpointSecurityCount(); - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - java.util.List - getEndpointSecurityOrBuilderList(); - /** - * repeated .wso2.discovery.api.SecurityInfo endpointSecurity = 5; - */ - org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder getEndpointSecurityOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ResourceProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ResourceProto.java deleted file mode 100644 index 3b26d4fccd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ResourceProto.java +++ /dev/null @@ -1,121 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/Resource.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class ResourceProto { - private ResourceProto() {} - 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_api_Resource_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Resource_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_Operation_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Operation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_OperationPolicies_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_OperationPolicies_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_Policy_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Policy_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_Policy_ParametersEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_Policy_ParametersEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n!wso2/discovery/api/Resource.proto\022\022wso" + - "2.discovery.api\032)wso2/discovery/api/endp" + - "oint_cluster.proto\032+wso2/discovery/api/a" + - "pi_authentication.proto\032&wso2/discovery/" + - "api/security_info.proto\"\310\001\n\010Resource\022\n\n\002" + - "id\030\001 \001(\t\022\014\n\004path\030\002 \001(\t\022.\n\007methods\030\003 \003(\0132" + - "\035.wso2.discovery.api.Operation\0226\n\tendpoi" + - "nts\030\004 \001(\0132#.wso2.discovery.api.EndpointC" + - "luster\022:\n\020endpointSecurity\030\005 \003(\0132 .wso2." + - "discovery.api.SecurityInfo\"\305\001\n\tOperation" + - "\022\016\n\006method\030\001 \001(\t\022@\n\021apiAuthentication\030\002 " + - "\001(\0132%.wso2.discovery.api.APIAuthenticati" + - "on\022\014\n\004tier\030\003 \001(\t\0227\n\010policies\030\004 \001(\0132%.wso" + - "2.discovery.api.OperationPolicies\022\016\n\006sco" + - "pes\030\005 \003(\t\022\017\n\007matchID\030\006 \001(\t\"\231\001\n\021Operation" + - "Policies\022+\n\007request\030\001 \003(\0132\032.wso2.discove" + - "ry.api.Policy\022,\n\010response\030\002 \003(\0132\032.wso2.d" + - "iscovery.api.Policy\022)\n\005fault\030\003 \003(\0132\032.wso" + - "2.discovery.api.Policy\"\213\001\n\006Policy\022\016\n\006act" + - "ion\030\001 \001(\t\022>\n\nparameters\030\002 \003(\0132*.wso2.dis" + - "covery.api.Policy.ParametersEntry\0321\n\017Par" + - "ametersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + - ":\0028\001Bu\n#org.wso2.apk.enforcer.discovery." + - "apiB\rResourceProtoP\001Z=github.com/envoypr" + - "oxy/go-control-plane/wso2/discovery/api;" + - "apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.getDescriptor(), - }); - internal_static_wso2_discovery_api_Resource_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_Resource_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Resource_descriptor, - new java.lang.String[] { "Id", "Path", "Methods", "Endpoints", "EndpointSecurity", }); - internal_static_wso2_discovery_api_Operation_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_api_Operation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Operation_descriptor, - new java.lang.String[] { "Method", "ApiAuthentication", "Tier", "Policies", "Scopes", "MatchID", }); - internal_static_wso2_discovery_api_OperationPolicies_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_wso2_discovery_api_OperationPolicies_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_OperationPolicies_descriptor, - new java.lang.String[] { "Request", "Response", "Fault", }); - internal_static_wso2_discovery_api_Policy_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_wso2_discovery_api_Policy_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Policy_descriptor, - new java.lang.String[] { "Action", "Parameters", }); - internal_static_wso2_discovery_api_Policy_ParametersEntry_descriptor = - internal_static_wso2_discovery_api_Policy_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_api_Policy_ParametersEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_Policy_ParametersEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.api.APIAuthenticationProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/RetryConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/RetryConfig.java deleted file mode 100644 index 9ad98af91e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/RetryConfig.java +++ /dev/null @@ -1,663 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - * Protobuf type {@code wso2.discovery.api.RetryConfig} - */ -public final class RetryConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.RetryConfig) - RetryConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use RetryConfig.newBuilder() to construct. - private RetryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RetryConfig() { - statusCodes_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RetryConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RetryConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - count_ = input.readUInt32(); - break; - } - case 16: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - statusCodes_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - statusCodes_.addInt(input.readUInt32()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - statusCodes_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - statusCodes_.addInt(input.readUInt32()); - } - input.popLimit(limit); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - statusCodes_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_RetryConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_RetryConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.RetryConfig.class, org.wso2.apk.enforcer.discovery.api.RetryConfig.Builder.class); - } - - public static final int COUNT_FIELD_NUMBER = 1; - private int count_; - /** - * uint32 count = 1; - * @return The count. - */ - @java.lang.Override - public int getCount() { - return count_; - } - - public static final int STATUSCODES_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.IntList statusCodes_; - /** - * repeated uint32 statusCodes = 2; - * @return A list containing the statusCodes. - */ - @java.lang.Override - public java.util.List - getStatusCodesList() { - return statusCodes_; - } - /** - * repeated uint32 statusCodes = 2; - * @return The count of statusCodes. - */ - public int getStatusCodesCount() { - return statusCodes_.size(); - } - /** - * repeated uint32 statusCodes = 2; - * @param index The index of the element to return. - * @return The statusCodes at the given index. - */ - public int getStatusCodes(int index) { - return statusCodes_.getInt(index); - } - private int statusCodesMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (count_ != 0) { - output.writeUInt32(1, count_); - } - if (getStatusCodesList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(statusCodesMemoizedSerializedSize); - } - for (int i = 0; i < statusCodes_.size(); i++) { - output.writeUInt32NoTag(statusCodes_.getInt(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (count_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, count_); - } - { - int dataSize = 0; - for (int i = 0; i < statusCodes_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(statusCodes_.getInt(i)); - } - size += dataSize; - if (!getStatusCodesList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - statusCodesMemoizedSerializedSize = dataSize; - } - 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.api.RetryConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.RetryConfig other = (org.wso2.apk.enforcer.discovery.api.RetryConfig) obj; - - if (getCount() - != other.getCount()) return false; - if (!getStatusCodesList() - .equals(other.getStatusCodesList())) 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) + COUNT_FIELD_NUMBER; - hash = (53 * hash) + getCount(); - if (getStatusCodesCount() > 0) { - hash = (37 * hash) + STATUSCODES_FIELD_NUMBER; - hash = (53 * hash) + getStatusCodesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.RetryConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.RetryConfig 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.api.RetryConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.RetryConfig 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.api.RetryConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.RetryConfig 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.api.RetryConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.RetryConfig 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.api.RetryConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.RetryConfig 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.api.RetryConfig 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.api.RetryConfig 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.api.RetryConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.api.RetryConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.RetryConfig) - org.wso2.apk.enforcer.discovery.api.RetryConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_RetryConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_RetryConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.RetryConfig.class, org.wso2.apk.enforcer.discovery.api.RetryConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.RetryConfig.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(); - count_ = 0; - - statusCodes_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_RetryConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.RetryConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.RetryConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.RetryConfig build() { - org.wso2.apk.enforcer.discovery.api.RetryConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.RetryConfig buildPartial() { - org.wso2.apk.enforcer.discovery.api.RetryConfig result = new org.wso2.apk.enforcer.discovery.api.RetryConfig(this); - int from_bitField0_ = bitField0_; - result.count_ = count_; - if (((bitField0_ & 0x00000001) != 0)) { - statusCodes_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.statusCodes_ = statusCodes_; - 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.api.RetryConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.RetryConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.RetryConfig other) { - if (other == org.wso2.apk.enforcer.discovery.api.RetryConfig.getDefaultInstance()) return this; - if (other.getCount() != 0) { - setCount(other.getCount()); - } - if (!other.statusCodes_.isEmpty()) { - if (statusCodes_.isEmpty()) { - statusCodes_ = other.statusCodes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureStatusCodesIsMutable(); - statusCodes_.addAll(other.statusCodes_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.RetryConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.RetryConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int count_ ; - /** - * uint32 count = 1; - * @return The count. - */ - @java.lang.Override - public int getCount() { - return count_; - } - /** - * uint32 count = 1; - * @param value The count to set. - * @return This builder for chaining. - */ - public Builder setCount(int value) { - - count_ = value; - onChanged(); - return this; - } - /** - * uint32 count = 1; - * @return This builder for chaining. - */ - public Builder clearCount() { - - count_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList statusCodes_ = emptyIntList(); - private void ensureStatusCodesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - statusCodes_ = mutableCopy(statusCodes_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated uint32 statusCodes = 2; - * @return A list containing the statusCodes. - */ - public java.util.List - getStatusCodesList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(statusCodes_) : statusCodes_; - } - /** - * repeated uint32 statusCodes = 2; - * @return The count of statusCodes. - */ - public int getStatusCodesCount() { - return statusCodes_.size(); - } - /** - * repeated uint32 statusCodes = 2; - * @param index The index of the element to return. - * @return The statusCodes at the given index. - */ - public int getStatusCodes(int index) { - return statusCodes_.getInt(index); - } - /** - * repeated uint32 statusCodes = 2; - * @param index The index to set the value at. - * @param value The statusCodes to set. - * @return This builder for chaining. - */ - public Builder setStatusCodes( - int index, int value) { - ensureStatusCodesIsMutable(); - statusCodes_.setInt(index, value); - onChanged(); - return this; - } - /** - * repeated uint32 statusCodes = 2; - * @param value The statusCodes to add. - * @return This builder for chaining. - */ - public Builder addStatusCodes(int value) { - ensureStatusCodesIsMutable(); - statusCodes_.addInt(value); - onChanged(); - return this; - } - /** - * repeated uint32 statusCodes = 2; - * @param values The statusCodes to add. - * @return This builder for chaining. - */ - public Builder addAllStatusCodes( - java.lang.Iterable values) { - ensureStatusCodesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, statusCodes_); - onChanged(); - return this; - } - /** - * repeated uint32 statusCodes = 2; - * @return This builder for chaining. - */ - public Builder clearStatusCodes() { - statusCodes_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.api.RetryConfig) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.RetryConfig) - private static final org.wso2.apk.enforcer.discovery.api.RetryConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.RetryConfig(); - } - - public static org.wso2.apk.enforcer.discovery.api.RetryConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RetryConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RetryConfig(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.api.RetryConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/RetryConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/RetryConfigOrBuilder.java deleted file mode 100644 index 73b75941b7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/RetryConfigOrBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface RetryConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.RetryConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 count = 1; - * @return The count. - */ - int getCount(); - - /** - * repeated uint32 statusCodes = 2; - * @return A list containing the statusCodes. - */ - java.util.List getStatusCodesList(); - /** - * repeated uint32 statusCodes = 2; - * @return The count of statusCodes. - */ - int getStatusCodesCount(); - /** - * repeated uint32 statusCodes = 2; - * @param index The index of the element to return. - * @return The statusCodes at the given index. - */ - int getStatusCodes(int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfo.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfo.java deleted file mode 100644 index 76591bd43e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfo.java +++ /dev/null @@ -1,1192 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/security_info.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Endpoint config model
- * 
- * - * Protobuf type {@code wso2.discovery.api.SecurityInfo} - */ -public final class SecurityInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.SecurityInfo) - SecurityInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use SecurityInfo.newBuilder() to construct. - private SecurityInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SecurityInfo() { - password_ = ""; - securityType_ = ""; - username_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SecurityInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SecurityInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - password_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - customParameters_ = com.google.protobuf.MapField.newMapField( - CustomParametersDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - customParameters__ = input.readMessage( - CustomParametersDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - customParameters_.getMutableMap().put( - customParameters__.getKey(), customParameters__.getValue()); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - securityType_ = s; - break; - } - case 32: { - - enabled_ = input.readBool(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - username_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.internal_static_wso2_discovery_api_SecurityInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetCustomParameters(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.internal_static_wso2_discovery_api_SecurityInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.SecurityInfo.class, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder.class); - } - - public static final int PASSWORD_FIELD_NUMBER = 1; - private volatile java.lang.Object password_; - /** - * string password = 1; - * @return The password. - */ - @java.lang.Override - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } - } - /** - * string password = 1; - * @return The bytes for password. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOMPARAMETERS_FIELD_NUMBER = 2; - private static final class CustomParametersDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.internal_static_wso2_discovery_api_SecurityInfo_CustomParametersEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> customParameters_; - private com.google.protobuf.MapField - internalGetCustomParameters() { - if (customParameters_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CustomParametersDefaultEntryHolder.defaultEntry); - } - return customParameters_; - } - - public int getCustomParametersCount() { - return internalGetCustomParameters().getMap().size(); - } - /** - * map<string, string> customParameters = 2; - */ - - @java.lang.Override - public boolean containsCustomParameters( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetCustomParameters().getMap().containsKey(key); - } - /** - * Use {@link #getCustomParametersMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getCustomParameters() { - return getCustomParametersMap(); - } - /** - * map<string, string> customParameters = 2; - */ - @java.lang.Override - - public java.util.Map getCustomParametersMap() { - return internalGetCustomParameters().getMap(); - } - /** - * map<string, string> customParameters = 2; - */ - @java.lang.Override - - public java.lang.String getCustomParametersOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCustomParameters().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> customParameters = 2; - */ - @java.lang.Override - - public java.lang.String getCustomParametersOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCustomParameters().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int SECURITYTYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object securityType_; - /** - * string securityType = 3; - * @return The securityType. - */ - @java.lang.Override - public java.lang.String getSecurityType() { - java.lang.Object ref = securityType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - securityType_ = s; - return s; - } - } - /** - * string securityType = 3; - * @return The bytes for securityType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSecurityTypeBytes() { - java.lang.Object ref = securityType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - securityType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENABLED_FIELD_NUMBER = 4; - private boolean enabled_; - /** - * bool enabled = 4; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int USERNAME_FIELD_NUMBER = 5; - private volatile java.lang.Object username_; - /** - * string username = 5; - * @return The username. - */ - @java.lang.Override - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } - } - /** - * string username = 5; - * @return The bytes for username. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getPasswordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, password_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetCustomParameters(), - CustomParametersDefaultEntryHolder.defaultEntry, - 2); - if (!getSecurityTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, securityType_); - } - if (enabled_ != false) { - output.writeBool(4, enabled_); - } - if (!getUsernameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, username_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getPasswordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, password_); - } - for (java.util.Map.Entry entry - : internalGetCustomParameters().getMap().entrySet()) { - com.google.protobuf.MapEntry - customParameters__ = CustomParametersDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, customParameters__); - } - if (!getSecurityTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, securityType_); - } - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, enabled_); - } - if (!getUsernameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, username_); - } - 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.api.SecurityInfo)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.SecurityInfo other = (org.wso2.apk.enforcer.discovery.api.SecurityInfo) obj; - - if (!getPassword() - .equals(other.getPassword())) return false; - if (!internalGetCustomParameters().equals( - other.internalGetCustomParameters())) return false; - if (!getSecurityType() - .equals(other.getSecurityType())) return false; - if (getEnabled() - != other.getEnabled()) return false; - if (!getUsername() - .equals(other.getUsername())) 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) + PASSWORD_FIELD_NUMBER; - hash = (53 * hash) + getPassword().hashCode(); - if (!internalGetCustomParameters().getMap().isEmpty()) { - hash = (37 * hash) + CUSTOMPARAMETERS_FIELD_NUMBER; - hash = (53 * hash) + internalGetCustomParameters().hashCode(); - } - hash = (37 * hash) + SECURITYTYPE_FIELD_NUMBER; - hash = (53 * hash) + getSecurityType().hashCode(); - hash = (37 * hash) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - hash = (37 * hash) + USERNAME_FIELD_NUMBER; - hash = (53 * hash) + getUsername().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.SecurityInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.SecurityInfo 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.api.SecurityInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.SecurityInfo 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.api.SecurityInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.SecurityInfo 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.api.SecurityInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.SecurityInfo 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.api.SecurityInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.SecurityInfo 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.api.SecurityInfo 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.api.SecurityInfo 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.api.SecurityInfo 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; - } - /** - *
-   * Endpoint config model
-   * 
- * - * Protobuf type {@code wso2.discovery.api.SecurityInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.SecurityInfo) - org.wso2.apk.enforcer.discovery.api.SecurityInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.internal_static_wso2_discovery_api_SecurityInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetCustomParameters(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableCustomParameters(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.internal_static_wso2_discovery_api_SecurityInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.SecurityInfo.class, org.wso2.apk.enforcer.discovery.api.SecurityInfo.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.SecurityInfo.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(); - password_ = ""; - - internalGetMutableCustomParameters().clear(); - securityType_ = ""; - - enabled_ = false; - - username_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.SecurityInfoProto.internal_static_wso2_discovery_api_SecurityInfo_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.SecurityInfo getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.SecurityInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.SecurityInfo build() { - org.wso2.apk.enforcer.discovery.api.SecurityInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.SecurityInfo buildPartial() { - org.wso2.apk.enforcer.discovery.api.SecurityInfo result = new org.wso2.apk.enforcer.discovery.api.SecurityInfo(this); - int from_bitField0_ = bitField0_; - result.password_ = password_; - result.customParameters_ = internalGetCustomParameters(); - result.customParameters_.makeImmutable(); - result.securityType_ = securityType_; - result.enabled_ = enabled_; - result.username_ = username_; - 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.api.SecurityInfo) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.SecurityInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.SecurityInfo other) { - if (other == org.wso2.apk.enforcer.discovery.api.SecurityInfo.getDefaultInstance()) return this; - if (!other.getPassword().isEmpty()) { - password_ = other.password_; - onChanged(); - } - internalGetMutableCustomParameters().mergeFrom( - other.internalGetCustomParameters()); - if (!other.getSecurityType().isEmpty()) { - securityType_ = other.securityType_; - onChanged(); - } - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (!other.getUsername().isEmpty()) { - username_ = other.username_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.SecurityInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.SecurityInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object password_ = ""; - /** - * string password = 1; - * @return The password. - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string password = 1; - * @return The bytes for password. - */ - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string password = 1; - * @param value The password to set. - * @return This builder for chaining. - */ - public Builder setPassword( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - password_ = value; - onChanged(); - return this; - } - /** - * string password = 1; - * @return This builder for chaining. - */ - public Builder clearPassword() { - - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - /** - * string password = 1; - * @param value The bytes for password to set. - * @return This builder for chaining. - */ - public Builder setPasswordBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - password_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> customParameters_; - private com.google.protobuf.MapField - internalGetCustomParameters() { - if (customParameters_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CustomParametersDefaultEntryHolder.defaultEntry); - } - return customParameters_; - } - private com.google.protobuf.MapField - internalGetMutableCustomParameters() { - onChanged();; - if (customParameters_ == null) { - customParameters_ = com.google.protobuf.MapField.newMapField( - CustomParametersDefaultEntryHolder.defaultEntry); - } - if (!customParameters_.isMutable()) { - customParameters_ = customParameters_.copy(); - } - return customParameters_; - } - - public int getCustomParametersCount() { - return internalGetCustomParameters().getMap().size(); - } - /** - * map<string, string> customParameters = 2; - */ - - @java.lang.Override - public boolean containsCustomParameters( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetCustomParameters().getMap().containsKey(key); - } - /** - * Use {@link #getCustomParametersMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getCustomParameters() { - return getCustomParametersMap(); - } - /** - * map<string, string> customParameters = 2; - */ - @java.lang.Override - - public java.util.Map getCustomParametersMap() { - return internalGetCustomParameters().getMap(); - } - /** - * map<string, string> customParameters = 2; - */ - @java.lang.Override - - public java.lang.String getCustomParametersOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCustomParameters().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> customParameters = 2; - */ - @java.lang.Override - - public java.lang.String getCustomParametersOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCustomParameters().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearCustomParameters() { - internalGetMutableCustomParameters().getMutableMap() - .clear(); - return this; - } - /** - * map<string, string> customParameters = 2; - */ - - public Builder removeCustomParameters( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableCustomParameters().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableCustomParameters() { - return internalGetMutableCustomParameters().getMutableMap(); - } - /** - * map<string, string> customParameters = 2; - */ - public Builder putCustomParameters( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableCustomParameters().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, string> customParameters = 2; - */ - - public Builder putAllCustomParameters( - java.util.Map values) { - internalGetMutableCustomParameters().getMutableMap() - .putAll(values); - return this; - } - - private java.lang.Object securityType_ = ""; - /** - * string securityType = 3; - * @return The securityType. - */ - public java.lang.String getSecurityType() { - java.lang.Object ref = securityType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - securityType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string securityType = 3; - * @return The bytes for securityType. - */ - public com.google.protobuf.ByteString - getSecurityTypeBytes() { - java.lang.Object ref = securityType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - securityType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string securityType = 3; - * @param value The securityType to set. - * @return This builder for chaining. - */ - public Builder setSecurityType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - securityType_ = value; - onChanged(); - return this; - } - /** - * string securityType = 3; - * @return This builder for chaining. - */ - public Builder clearSecurityType() { - - securityType_ = getDefaultInstance().getSecurityType(); - onChanged(); - return this; - } - /** - * string securityType = 3; - * @param value The bytes for securityType to set. - * @return This builder for chaining. - */ - public Builder setSecurityTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - securityType_ = value; - onChanged(); - return this; - } - - private boolean enabled_ ; - /** - * bool enabled = 4; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 4; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * bool enabled = 4; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private java.lang.Object username_ = ""; - /** - * string username = 5; - * @return The username. - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string username = 5; - * @return The bytes for username. - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string username = 5; - * @param value The username to set. - * @return This builder for chaining. - */ - public Builder setUsername( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - username_ = value; - onChanged(); - return this; - } - /** - * string username = 5; - * @return This builder for chaining. - */ - public Builder clearUsername() { - - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - /** - * string username = 5; - * @param value The bytes for username to set. - * @return This builder for chaining. - */ - public Builder setUsernameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - username_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.api.SecurityInfo) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.SecurityInfo) - private static final org.wso2.apk.enforcer.discovery.api.SecurityInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.SecurityInfo(); - } - - public static org.wso2.apk.enforcer.discovery.api.SecurityInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SecurityInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SecurityInfo(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.api.SecurityInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfoOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfoOrBuilder.java deleted file mode 100644 index e547e116b4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfoOrBuilder.java +++ /dev/null @@ -1,85 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/security_info.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface SecurityInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.SecurityInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * string password = 1; - * @return The password. - */ - java.lang.String getPassword(); - /** - * string password = 1; - * @return The bytes for password. - */ - com.google.protobuf.ByteString - getPasswordBytes(); - - /** - * map<string, string> customParameters = 2; - */ - int getCustomParametersCount(); - /** - * map<string, string> customParameters = 2; - */ - boolean containsCustomParameters( - java.lang.String key); - /** - * Use {@link #getCustomParametersMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getCustomParameters(); - /** - * map<string, string> customParameters = 2; - */ - java.util.Map - getCustomParametersMap(); - /** - * map<string, string> customParameters = 2; - */ - - java.lang.String getCustomParametersOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - * map<string, string> customParameters = 2; - */ - - java.lang.String getCustomParametersOrThrow( - java.lang.String key); - - /** - * string securityType = 3; - * @return The securityType. - */ - java.lang.String getSecurityType(); - /** - * string securityType = 3; - * @return The bytes for securityType. - */ - com.google.protobuf.ByteString - getSecurityTypeBytes(); - - /** - * bool enabled = 4; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * string username = 5; - * @return The username. - */ - java.lang.String getUsername(); - /** - * string username = 5; - * @return The bytes for username. - */ - com.google.protobuf.ByteString - getUsernameBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfoProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfoProto.java deleted file mode 100644 index acfc5b8202..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/SecurityInfoProto.java +++ /dev/null @@ -1,67 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/security_info.proto - -package org.wso2.apk.enforcer.discovery.api; - -public final class SecurityInfoProto { - private SecurityInfoProto() {} - 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_api_SecurityInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_SecurityInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_api_SecurityInfo_CustomParametersEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_api_SecurityInfo_CustomParametersEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n&wso2/discovery/api/security_info.proto" + - "\022\022wso2.discovery.api\"\344\001\n\014SecurityInfo\022\020\n" + - "\010password\030\001 \001(\t\022P\n\020customParameters\030\002 \003(" + - "\01326.wso2.discovery.api.SecurityInfo.Cust" + - "omParametersEntry\022\024\n\014securityType\030\003 \001(\t\022" + - "\017\n\007enabled\030\004 \001(\010\022\020\n\010username\030\005 \001(\t\0327\n\025Cu" + - "stomParametersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + - "e\030\002 \001(\t:\0028\001By\n#org.wso2.apk.enforcer.dis" + - "covery.apiB\021SecurityInfoProtoP\001Z=github." + - "com/envoyproxy/go-control-plane/wso2/dis" + - "covery/api;apib\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_api_SecurityInfo_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_api_SecurityInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_SecurityInfo_descriptor, - new java.lang.String[] { "Password", "CustomParameters", "SecurityType", "Enabled", "Username", }); - internal_static_wso2_discovery_api_SecurityInfo_CustomParametersEntry_descriptor = - internal_static_wso2_discovery_api_SecurityInfo_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_api_SecurityInfo_CustomParametersEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_api_SecurityInfo_CustomParametersEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TestConsoleKeyOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TestConsoleKeyOrBuilder.java deleted file mode 100644 index 588d5ef08e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TestConsoleKeyOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/api_authentication.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface TestConsoleKeyOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.TestConsoleKey) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * name of the header containing the test key
-   * 
- * - * string header = 1; - * @return The header. - */ - java.lang.String getHeader(); - /** - *
-   * name of the header containing the test key
-   * 
- * - * string header = 1; - * @return The bytes for header. - */ - com.google.protobuf.ByteString - getHeaderBytes(); - - /** - *
-   * send the token to upstream
-   * 
- * - * bool sendTokenToUpstream = 2; - * @return The sendTokenToUpstream. - */ - boolean getSendTokenToUpstream(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TimeoutConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TimeoutConfig.java deleted file mode 100644 index 74d06d3981..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TimeoutConfig.java +++ /dev/null @@ -1,483 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - * Protobuf type {@code wso2.discovery.api.TimeoutConfig} - */ -public final class TimeoutConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.TimeoutConfig) - TimeoutConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use TimeoutConfig.newBuilder() to construct. - private TimeoutConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TimeoutConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TimeoutConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TimeoutConfig( - 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: { - - routeTimeoutInMillis_ = input.readUInt32(); - 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.api.EndpointClusterProto.internal_static_wso2_discovery_api_TimeoutConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_TimeoutConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.TimeoutConfig.class, org.wso2.apk.enforcer.discovery.api.TimeoutConfig.Builder.class); - } - - public static final int ROUTETIMEOUTINMILLIS_FIELD_NUMBER = 1; - private int routeTimeoutInMillis_; - /** - * uint32 routeTimeoutInMillis = 1; - * @return The routeTimeoutInMillis. - */ - @java.lang.Override - public int getRouteTimeoutInMillis() { - return routeTimeoutInMillis_; - } - - 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 (routeTimeoutInMillis_ != 0) { - output.writeUInt32(1, routeTimeoutInMillis_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (routeTimeoutInMillis_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, routeTimeoutInMillis_); - } - 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.api.TimeoutConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.TimeoutConfig other = (org.wso2.apk.enforcer.discovery.api.TimeoutConfig) obj; - - if (getRouteTimeoutInMillis() - != other.getRouteTimeoutInMillis()) 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) + ROUTETIMEOUTINMILLIS_FIELD_NUMBER; - hash = (53 * hash) + getRouteTimeoutInMillis(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.TimeoutConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.TimeoutConfig 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.api.TimeoutConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.TimeoutConfig 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.api.TimeoutConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.TimeoutConfig 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.api.TimeoutConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.TimeoutConfig 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.api.TimeoutConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.TimeoutConfig 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.api.TimeoutConfig 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.api.TimeoutConfig 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.api.TimeoutConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.api.TimeoutConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.TimeoutConfig) - org.wso2.apk.enforcer.discovery.api.TimeoutConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_TimeoutConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_TimeoutConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.TimeoutConfig.class, org.wso2.apk.enforcer.discovery.api.TimeoutConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.TimeoutConfig.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(); - routeTimeoutInMillis_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.EndpointClusterProto.internal_static_wso2_discovery_api_TimeoutConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.TimeoutConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.TimeoutConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.TimeoutConfig build() { - org.wso2.apk.enforcer.discovery.api.TimeoutConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.TimeoutConfig buildPartial() { - org.wso2.apk.enforcer.discovery.api.TimeoutConfig result = new org.wso2.apk.enforcer.discovery.api.TimeoutConfig(this); - result.routeTimeoutInMillis_ = routeTimeoutInMillis_; - 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.api.TimeoutConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.TimeoutConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.TimeoutConfig other) { - if (other == org.wso2.apk.enforcer.discovery.api.TimeoutConfig.getDefaultInstance()) return this; - if (other.getRouteTimeoutInMillis() != 0) { - setRouteTimeoutInMillis(other.getRouteTimeoutInMillis()); - } - 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.api.TimeoutConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.TimeoutConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int routeTimeoutInMillis_ ; - /** - * uint32 routeTimeoutInMillis = 1; - * @return The routeTimeoutInMillis. - */ - @java.lang.Override - public int getRouteTimeoutInMillis() { - return routeTimeoutInMillis_; - } - /** - * uint32 routeTimeoutInMillis = 1; - * @param value The routeTimeoutInMillis to set. - * @return This builder for chaining. - */ - public Builder setRouteTimeoutInMillis(int value) { - - routeTimeoutInMillis_ = value; - onChanged(); - return this; - } - /** - * uint32 routeTimeoutInMillis = 1; - * @return This builder for chaining. - */ - public Builder clearRouteTimeoutInMillis() { - - routeTimeoutInMillis_ = 0; - 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.api.TimeoutConfig) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.TimeoutConfig) - private static final org.wso2.apk.enforcer.discovery.api.TimeoutConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.TimeoutConfig(); - } - - public static org.wso2.apk.enforcer.discovery.api.TimeoutConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TimeoutConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TimeoutConfig(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.api.TimeoutConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TimeoutConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TimeoutConfigOrBuilder.java deleted file mode 100644 index b3578c79e9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/TimeoutConfigOrBuilder.java +++ /dev/null @@ -1,15 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/endpoint_cluster.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface TimeoutConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.TimeoutConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 routeTimeoutInMillis = 1; - * @return The routeTimeoutInMillis. - */ - int getRouteTimeoutInMillis(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ValueDetails.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ValueDetails.java deleted file mode 100644 index a192e47b9c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ValueDetails.java +++ /dev/null @@ -1,703 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/ai_provider.proto - -package org.wso2.apk.enforcer.discovery.api; - -/** - *
- * Holds ValueDetails configs
- * 
- * - * Protobuf type {@code wso2.discovery.api.ValueDetails} - */ -public final class ValueDetails extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.api.ValueDetails) - ValueDetailsOrBuilder { -private static final long serialVersionUID = 0L; - // Use ValueDetails.newBuilder() to construct. - private ValueDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ValueDetails() { - in_ = ""; - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ValueDetails(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ValueDetails( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - in_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_ValueDetails_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_ValueDetails_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.ValueDetails.class, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder.class); - } - - public static final int IN_FIELD_NUMBER = 1; - private volatile java.lang.Object in_; - /** - * string in = 1; - * @return The in. - */ - @java.lang.Override - public java.lang.String getIn() { - java.lang.Object ref = in_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - in_ = s; - return s; - } - } - /** - * string in = 1; - * @return The bytes for in. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getInBytes() { - java.lang.Object ref = in_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - in_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALUE_FIELD_NUMBER = 2; - private volatile java.lang.Object value_; - /** - * string value = 2; - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } - } - /** - * string value = 2; - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getInBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, in_); - } - if (!getValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getInBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, in_); - } - if (!getValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); - } - 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.api.ValueDetails)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.api.ValueDetails other = (org.wso2.apk.enforcer.discovery.api.ValueDetails) obj; - - if (!getIn() - .equals(other.getIn())) return false; - if (!getValue() - .equals(other.getValue())) 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) + IN_FIELD_NUMBER; - hash = (53 * hash) + getIn().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.api.ValueDetails parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.ValueDetails 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.api.ValueDetails parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.ValueDetails 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.api.ValueDetails parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.api.ValueDetails 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.api.ValueDetails parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.ValueDetails 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.api.ValueDetails parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.api.ValueDetails 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.api.ValueDetails 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.api.ValueDetails 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.api.ValueDetails 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; - } - /** - *
-   * Holds ValueDetails configs
-   * 
- * - * Protobuf type {@code wso2.discovery.api.ValueDetails} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.api.ValueDetails) - org.wso2.apk.enforcer.discovery.api.ValueDetailsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_ValueDetails_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_ValueDetails_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.api.ValueDetails.class, org.wso2.apk.enforcer.discovery.api.ValueDetails.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.api.ValueDetails.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(); - in_ = ""; - - value_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.api.AIProviderProto.internal_static_wso2_discovery_api_ValueDetails_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetails getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetails build() { - org.wso2.apk.enforcer.discovery.api.ValueDetails result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.api.ValueDetails buildPartial() { - org.wso2.apk.enforcer.discovery.api.ValueDetails result = new org.wso2.apk.enforcer.discovery.api.ValueDetails(this); - result.in_ = in_; - result.value_ = value_; - 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.api.ValueDetails) { - return mergeFrom((org.wso2.apk.enforcer.discovery.api.ValueDetails)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.api.ValueDetails other) { - if (other == org.wso2.apk.enforcer.discovery.api.ValueDetails.getDefaultInstance()) return this; - if (!other.getIn().isEmpty()) { - in_ = other.in_; - onChanged(); - } - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.api.ValueDetails parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.api.ValueDetails) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object in_ = ""; - /** - * string in = 1; - * @return The in. - */ - public java.lang.String getIn() { - java.lang.Object ref = in_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - in_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string in = 1; - * @return The bytes for in. - */ - public com.google.protobuf.ByteString - getInBytes() { - java.lang.Object ref = in_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - in_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string in = 1; - * @param value The in to set. - * @return This builder for chaining. - */ - public Builder setIn( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - in_ = value; - onChanged(); - return this; - } - /** - * string in = 1; - * @return This builder for chaining. - */ - public Builder clearIn() { - - in_ = getDefaultInstance().getIn(); - onChanged(); - return this; - } - /** - * string in = 1; - * @param value The bytes for in to set. - * @return This builder for chaining. - */ - public Builder setInBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - in_ = value; - onChanged(); - return this; - } - - private java.lang.Object value_ = ""; - /** - * string value = 2; - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string value = 2; - * @return The bytes for value. - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string value = 2; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * string value = 2; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - * string value = 2; - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.api.ValueDetails) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.api.ValueDetails) - private static final org.wso2.apk.enforcer.discovery.api.ValueDetails DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.api.ValueDetails(); - } - - public static org.wso2.apk.enforcer.discovery.api.ValueDetails getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ValueDetails parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ValueDetails(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.api.ValueDetails getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ValueDetailsOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ValueDetailsOrBuilder.java deleted file mode 100644 index fe49f6cf30..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/api/ValueDetailsOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/api/ai_provider.proto - -package org.wso2.apk.enforcer.discovery.api; - -public interface ValueDetailsOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.api.ValueDetails) - com.google.protobuf.MessageOrBuilder { - - /** - * string in = 1; - * @return The in. - */ - java.lang.String getIn(); - /** - * string in = 1; - * @return The bytes for in. - */ - com.google.protobuf.ByteString - getInBytes(); - - /** - * string value = 2; - * @return The value. - */ - java.lang.String getValue(); - /** - * string value = 2; - * @return The bytes for value. - */ - com.google.protobuf.ByteString - getValueBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/apkmgt/ApkMgtApplicationProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/apkmgt/ApkMgtApplicationProto.java deleted file mode 100644 index bc8f204bfc..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/apkmgt/ApkMgtApplicationProto.java +++ /dev/null @@ -1,4365 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/apkmgt/application.proto - -package org.wso2.apk.enforcer.discovery.apkmgt; - -public final class ApkMgtApplicationProto { - private ApkMgtApplicationProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - public interface ApplicationOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.apkmgt.Application) - com.google.protobuf.MessageOrBuilder { - - /** - * string uuid = 1; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * string name = 2; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 2; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string owner = 3; - * @return The owner. - */ - java.lang.String getOwner(); - /** - * string owner = 3; - * @return The bytes for owner. - */ - com.google.protobuf.ByteString - getOwnerBytes(); - - /** - * map<string, string> attributes = 4; - */ - int getAttributesCount(); - /** - * map<string, string> attributes = 4; - */ - boolean containsAttributes( - java.lang.String key); - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getAttributes(); - /** - * map<string, string> attributes = 4; - */ - java.util.Map - getAttributesMap(); - /** - * map<string, string> attributes = 4; - */ - - java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - * map<string, string> attributes = 4; - */ - - java.lang.String getAttributesOrThrow( - java.lang.String key); - - /** - * string subscriber = 5; - * @return The subscriber. - */ - java.lang.String getSubscriber(); - /** - * string subscriber = 5; - * @return The bytes for subscriber. - */ - com.google.protobuf.ByteString - getSubscriberBytes(); - - /** - * string organization = 6; - * @return The organization. - */ - java.lang.String getOrganization(); - /** - * string organization = 6; - * @return The bytes for organization. - */ - com.google.protobuf.ByteString - getOrganizationBytes(); - - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - java.util.List - getSubscriptionsList(); - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription getSubscriptions(int index); - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - int getSubscriptionsCount(); - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - java.util.List - getSubscriptionsOrBuilderList(); - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.SubscriptionOrBuilder getSubscriptionsOrBuilder( - int index); - - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - java.util.List - getConsumerKeysList(); - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey getConsumerKeys(int index); - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - int getConsumerKeysCount(); - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - java.util.List - getConsumerKeysOrBuilderList(); - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKeyOrBuilder getConsumerKeysOrBuilder( - int index); - } - /** - * Protobuf type {@code wso2.discovery.apkmgt.Application} - */ - public static final class Application extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.apkmgt.Application) - ApplicationOrBuilder { - private static final long serialVersionUID = 0L; - // Use Application.newBuilder() to construct. - private Application(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Application() { - uuid_ = ""; - name_ = ""; - owner_ = ""; - subscriber_ = ""; - organization_ = ""; - subscriptions_ = java.util.Collections.emptyList(); - consumerKeys_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Application(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Application( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - owner_ = s; - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - attributes_ = com.google.protobuf.MapField.newMapField( - AttributesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - attributes__ = input.readMessage( - AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attributes_.getMutableMap().put( - attributes__.getKey(), attributes__.getValue()); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - subscriber_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - organization_ = s; - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - subscriptions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - subscriptions_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.parser(), extensionRegistry)); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - consumerKeys_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - consumerKeys_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - subscriptions_ = java.util.Collections.unmodifiableList(subscriptions_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - consumerKeys_ = java.util.Collections.unmodifiableList(consumerKeys_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Application_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 4: - return internalGetAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Application_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application.class, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application.Builder.class); - } - - public static final int UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object uuid_; - /** - * string uuid = 1; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - * string name = 2; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 2; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OWNER_FIELD_NUMBER = 3; - private volatile java.lang.Object owner_; - /** - * string owner = 3; - * @return The owner. - */ - @java.lang.Override - public java.lang.String getOwner() { - java.lang.Object ref = owner_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - owner_ = s; - return s; - } - } - /** - * string owner = 3; - * @return The bytes for owner. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOwnerBytes() { - java.lang.Object ref = owner_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - owner_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ATTRIBUTES_FIELD_NUMBER = 4; - private static final class AttributesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Application_AttributesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> attributes_; - private com.google.protobuf.MapField - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * map<string, string> attributes = 4; - */ - - @java.lang.Override - public boolean containsAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttributes().getMap().containsKey(key); - } - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * map<string, string> attributes = 4; - */ - @java.lang.Override - - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * map<string, string> attributes = 4; - */ - @java.lang.Override - - public java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> attributes = 4; - */ - @java.lang.Override - - public java.lang.String getAttributesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int SUBSCRIBER_FIELD_NUMBER = 5; - private volatile java.lang.Object subscriber_; - /** - * string subscriber = 5; - * @return The subscriber. - */ - @java.lang.Override - public java.lang.String getSubscriber() { - java.lang.Object ref = subscriber_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscriber_ = s; - return s; - } - } - /** - * string subscriber = 5; - * @return The bytes for subscriber. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSubscriberBytes() { - java.lang.Object ref = subscriber_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subscriber_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATION_FIELD_NUMBER = 6; - private volatile java.lang.Object organization_; - /** - * string organization = 6; - * @return The organization. - */ - @java.lang.Override - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } - } - /** - * string organization = 6; - * @return The bytes for organization. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SUBSCRIPTIONS_FIELD_NUMBER = 7; - private java.util.List subscriptions_; - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - @java.lang.Override - public java.util.List getSubscriptionsList() { - return subscriptions_; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - @java.lang.Override - public java.util.List - getSubscriptionsOrBuilderList() { - return subscriptions_; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - @java.lang.Override - public int getSubscriptionsCount() { - return subscriptions_.size(); - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription getSubscriptions(int index) { - return subscriptions_.get(index); - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.SubscriptionOrBuilder getSubscriptionsOrBuilder( - int index) { - return subscriptions_.get(index); - } - - public static final int CONSUMERKEYS_FIELD_NUMBER = 8; - private java.util.List consumerKeys_; - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - @java.lang.Override - public java.util.List getConsumerKeysList() { - return consumerKeys_; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - @java.lang.Override - public java.util.List - getConsumerKeysOrBuilderList() { - return consumerKeys_; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - @java.lang.Override - public int getConsumerKeysCount() { - return consumerKeys_.size(); - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey getConsumerKeys(int index) { - return consumerKeys_.get(index); - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKeyOrBuilder getConsumerKeysOrBuilder( - int index) { - return consumerKeys_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (!getOwnerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, owner_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttributes(), - AttributesDefaultEntryHolder.defaultEntry, - 4); - if (!getSubscriberBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, subscriber_); - } - if (!getOrganizationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, organization_); - } - for (int i = 0; i < subscriptions_.size(); i++) { - output.writeMessage(7, subscriptions_.get(i)); - } - for (int i = 0; i < consumerKeys_.size(); i++) { - output.writeMessage(8, consumerKeys_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (!getOwnerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, owner_); - } - for (java.util.Map.Entry entry - : internalGetAttributes().getMap().entrySet()) { - com.google.protobuf.MapEntry - attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, attributes__); - } - if (!getSubscriberBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, subscriber_); - } - if (!getOrganizationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, organization_); - } - for (int i = 0; i < subscriptions_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, subscriptions_.get(i)); - } - for (int i = 0; i < consumerKeys_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, consumerKeys_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application other = (org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application) obj; - - if (!getUuid() - .equals(other.getUuid())) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getOwner() - .equals(other.getOwner())) return false; - if (!internalGetAttributes().equals( - other.internalGetAttributes())) return false; - if (!getSubscriber() - .equals(other.getSubscriber())) return false; - if (!getOrganization() - .equals(other.getOrganization())) return false; - if (!getSubscriptionsList() - .equals(other.getSubscriptionsList())) return false; - if (!getConsumerKeysList() - .equals(other.getConsumerKeysList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + OWNER_FIELD_NUMBER; - hash = (53 * hash) + getOwner().hashCode(); - if (!internalGetAttributes().getMap().isEmpty()) { - hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttributes().hashCode(); - } - hash = (37 * hash) + SUBSCRIBER_FIELD_NUMBER; - hash = (53 * hash) + getSubscriber().hashCode(); - hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; - hash = (53 * hash) + getOrganization().hashCode(); - if (getSubscriptionsCount() > 0) { - hash = (37 * hash) + SUBSCRIPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getSubscriptionsList().hashCode(); - } - if (getConsumerKeysCount() > 0) { - hash = (37 * hash) + CONSUMERKEYS_FIELD_NUMBER; - hash = (53 * hash) + getConsumerKeysList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application 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.apkmgt.ApkMgtApplicationProto.Application parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application 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.apkmgt.ApkMgtApplicationProto.Application parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application 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.apkmgt.ApkMgtApplicationProto.Application parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application 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.apkmgt.ApkMgtApplicationProto.Application parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application 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.apkmgt.ApkMgtApplicationProto.Application 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.apkmgt.ApkMgtApplicationProto.Application 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.apkmgt.ApkMgtApplicationProto.Application prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.apkmgt.Application} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.apkmgt.Application) - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ApplicationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Application_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 4: - return internalGetAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 4: - return internalGetMutableAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Application_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application.class, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getSubscriptionsFieldBuilder(); - getConsumerKeysFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - uuid_ = ""; - - name_ = ""; - - owner_ = ""; - - internalGetMutableAttributes().clear(); - subscriber_ = ""; - - organization_ = ""; - - if (subscriptionsBuilder_ == null) { - subscriptions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - subscriptionsBuilder_.clear(); - } - if (consumerKeysBuilder_ == null) { - consumerKeys_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - consumerKeysBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Application_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application build() { - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application buildPartial() { - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application result = new org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application(this); - int from_bitField0_ = bitField0_; - result.uuid_ = uuid_; - result.name_ = name_; - result.owner_ = owner_; - result.attributes_ = internalGetAttributes(); - result.attributes_.makeImmutable(); - result.subscriber_ = subscriber_; - result.organization_ = organization_; - if (subscriptionsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - subscriptions_ = java.util.Collections.unmodifiableList(subscriptions_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.subscriptions_ = subscriptions_; - } else { - result.subscriptions_ = subscriptionsBuilder_.build(); - } - if (consumerKeysBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - consumerKeys_ = java.util.Collections.unmodifiableList(consumerKeys_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.consumerKeys_ = consumerKeys_; - } else { - result.consumerKeys_ = consumerKeysBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application) { - return mergeFrom((org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application other) { - if (other == org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application.getDefaultInstance()) return this; - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getOwner().isEmpty()) { - owner_ = other.owner_; - onChanged(); - } - internalGetMutableAttributes().mergeFrom( - other.internalGetAttributes()); - if (!other.getSubscriber().isEmpty()) { - subscriber_ = other.subscriber_; - onChanged(); - } - if (!other.getOrganization().isEmpty()) { - organization_ = other.organization_; - onChanged(); - } - if (subscriptionsBuilder_ == null) { - if (!other.subscriptions_.isEmpty()) { - if (subscriptions_.isEmpty()) { - subscriptions_ = other.subscriptions_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureSubscriptionsIsMutable(); - subscriptions_.addAll(other.subscriptions_); - } - onChanged(); - } - } else { - if (!other.subscriptions_.isEmpty()) { - if (subscriptionsBuilder_.isEmpty()) { - subscriptionsBuilder_.dispose(); - subscriptionsBuilder_ = null; - subscriptions_ = other.subscriptions_; - bitField0_ = (bitField0_ & ~0x00000002); - subscriptionsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSubscriptionsFieldBuilder() : null; - } else { - subscriptionsBuilder_.addAllMessages(other.subscriptions_); - } - } - } - if (consumerKeysBuilder_ == null) { - if (!other.consumerKeys_.isEmpty()) { - if (consumerKeys_.isEmpty()) { - consumerKeys_ = other.consumerKeys_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureConsumerKeysIsMutable(); - consumerKeys_.addAll(other.consumerKeys_); - } - onChanged(); - } - } else { - if (!other.consumerKeys_.isEmpty()) { - if (consumerKeysBuilder_.isEmpty()) { - consumerKeysBuilder_.dispose(); - consumerKeysBuilder_ = null; - consumerKeys_ = other.consumerKeys_; - bitField0_ = (bitField0_ & ~0x00000004); - consumerKeysBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConsumerKeysFieldBuilder() : null; - } else { - consumerKeysBuilder_.addAllMessages(other.consumerKeys_); - } - } - } - 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.apkmgt.ApkMgtApplicationProto.Application parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 1; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 1; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 1; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 1; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 2; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 2; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 2; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 2; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 2; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object owner_ = ""; - /** - * string owner = 3; - * @return The owner. - */ - public java.lang.String getOwner() { - java.lang.Object ref = owner_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - owner_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string owner = 3; - * @return The bytes for owner. - */ - public com.google.protobuf.ByteString - getOwnerBytes() { - java.lang.Object ref = owner_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - owner_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string owner = 3; - * @param value The owner to set. - * @return This builder for chaining. - */ - public Builder setOwner( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - owner_ = value; - onChanged(); - return this; - } - /** - * string owner = 3; - * @return This builder for chaining. - */ - public Builder clearOwner() { - - owner_ = getDefaultInstance().getOwner(); - onChanged(); - return this; - } - /** - * string owner = 3; - * @param value The bytes for owner to set. - * @return This builder for chaining. - */ - public Builder setOwnerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - owner_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> attributes_; - private com.google.protobuf.MapField - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - private com.google.protobuf.MapField - internalGetMutableAttributes() { - onChanged();; - if (attributes_ == null) { - attributes_ = com.google.protobuf.MapField.newMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - if (!attributes_.isMutable()) { - attributes_ = attributes_.copy(); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * map<string, string> attributes = 4; - */ - - @java.lang.Override - public boolean containsAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttributes().getMap().containsKey(key); - } - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * map<string, string> attributes = 4; - */ - @java.lang.Override - - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * map<string, string> attributes = 4; - */ - @java.lang.Override - - public java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> attributes = 4; - */ - @java.lang.Override - - public java.lang.String getAttributesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttributes() { - internalGetMutableAttributes().getMutableMap() - .clear(); - return this; - } - /** - * map<string, string> attributes = 4; - */ - - public Builder removeAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttributes().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAttributes() { - return internalGetMutableAttributes().getMutableMap(); - } - /** - * map<string, string> attributes = 4; - */ - public Builder putAttributes( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttributes().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, string> attributes = 4; - */ - - public Builder putAllAttributes( - java.util.Map values) { - internalGetMutableAttributes().getMutableMap() - .putAll(values); - return this; - } - - private java.lang.Object subscriber_ = ""; - /** - * string subscriber = 5; - * @return The subscriber. - */ - public java.lang.String getSubscriber() { - java.lang.Object ref = subscriber_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscriber_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string subscriber = 5; - * @return The bytes for subscriber. - */ - public com.google.protobuf.ByteString - getSubscriberBytes() { - java.lang.Object ref = subscriber_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subscriber_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string subscriber = 5; - * @param value The subscriber to set. - * @return This builder for chaining. - */ - public Builder setSubscriber( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - subscriber_ = value; - onChanged(); - return this; - } - /** - * string subscriber = 5; - * @return This builder for chaining. - */ - public Builder clearSubscriber() { - - subscriber_ = getDefaultInstance().getSubscriber(); - onChanged(); - return this; - } - /** - * string subscriber = 5; - * @param value The bytes for subscriber to set. - * @return This builder for chaining. - */ - public Builder setSubscriberBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - subscriber_ = value; - onChanged(); - return this; - } - - private java.lang.Object organization_ = ""; - /** - * string organization = 6; - * @return The organization. - */ - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organization = 6; - * @return The bytes for organization. - */ - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organization = 6; - * @param value The organization to set. - * @return This builder for chaining. - */ - public Builder setOrganization( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organization_ = value; - onChanged(); - return this; - } - /** - * string organization = 6; - * @return This builder for chaining. - */ - public Builder clearOrganization() { - - organization_ = getDefaultInstance().getOrganization(); - onChanged(); - return this; - } - /** - * string organization = 6; - * @param value The bytes for organization to set. - * @return This builder for chaining. - */ - public Builder setOrganizationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organization_ = value; - onChanged(); - return this; - } - - private java.util.List subscriptions_ = - java.util.Collections.emptyList(); - private void ensureSubscriptionsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - subscriptions_ = new java.util.ArrayList(subscriptions_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.SubscriptionOrBuilder> subscriptionsBuilder_; - - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public java.util.List getSubscriptionsList() { - if (subscriptionsBuilder_ == null) { - return java.util.Collections.unmodifiableList(subscriptions_); - } else { - return subscriptionsBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public int getSubscriptionsCount() { - if (subscriptionsBuilder_ == null) { - return subscriptions_.size(); - } else { - return subscriptionsBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription getSubscriptions(int index) { - if (subscriptionsBuilder_ == null) { - return subscriptions_.get(index); - } else { - return subscriptionsBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder setSubscriptions( - int index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription value) { - if (subscriptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSubscriptionsIsMutable(); - subscriptions_.set(index, value); - onChanged(); - } else { - subscriptionsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder setSubscriptions( - int index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder builderForValue) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.set(index, builderForValue.build()); - onChanged(); - } else { - subscriptionsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder addSubscriptions(org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription value) { - if (subscriptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSubscriptionsIsMutable(); - subscriptions_.add(value); - onChanged(); - } else { - subscriptionsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder addSubscriptions( - int index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription value) { - if (subscriptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSubscriptionsIsMutable(); - subscriptions_.add(index, value); - onChanged(); - } else { - subscriptionsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder addSubscriptions( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder builderForValue) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.add(builderForValue.build()); - onChanged(); - } else { - subscriptionsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder addSubscriptions( - int index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder builderForValue) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.add(index, builderForValue.build()); - onChanged(); - } else { - subscriptionsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder addAllSubscriptions( - java.lang.Iterable values) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, subscriptions_); - onChanged(); - } else { - subscriptionsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder clearSubscriptions() { - if (subscriptionsBuilder_ == null) { - subscriptions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - subscriptionsBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public Builder removeSubscriptions(int index) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.remove(index); - onChanged(); - } else { - subscriptionsBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder getSubscriptionsBuilder( - int index) { - return getSubscriptionsFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.SubscriptionOrBuilder getSubscriptionsOrBuilder( - int index) { - if (subscriptionsBuilder_ == null) { - return subscriptions_.get(index); } else { - return subscriptionsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public java.util.List - getSubscriptionsOrBuilderList() { - if (subscriptionsBuilder_ != null) { - return subscriptionsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(subscriptions_); - } - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder addSubscriptionsBuilder() { - return getSubscriptionsFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder addSubscriptionsBuilder( - int index) { - return getSubscriptionsFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.apkmgt.Subscription subscriptions = 7; - */ - public java.util.List - getSubscriptionsBuilderList() { - return getSubscriptionsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.SubscriptionOrBuilder> - getSubscriptionsFieldBuilder() { - if (subscriptionsBuilder_ == null) { - subscriptionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.SubscriptionOrBuilder>( - subscriptions_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - subscriptions_ = null; - } - return subscriptionsBuilder_; - } - - private java.util.List consumerKeys_ = - java.util.Collections.emptyList(); - private void ensureConsumerKeysIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - consumerKeys_ = new java.util.ArrayList(consumerKeys_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKeyOrBuilder> consumerKeysBuilder_; - - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public java.util.List getConsumerKeysList() { - if (consumerKeysBuilder_ == null) { - return java.util.Collections.unmodifiableList(consumerKeys_); - } else { - return consumerKeysBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public int getConsumerKeysCount() { - if (consumerKeysBuilder_ == null) { - return consumerKeys_.size(); - } else { - return consumerKeysBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey getConsumerKeys(int index) { - if (consumerKeysBuilder_ == null) { - return consumerKeys_.get(index); - } else { - return consumerKeysBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder setConsumerKeys( - int index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey value) { - if (consumerKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConsumerKeysIsMutable(); - consumerKeys_.set(index, value); - onChanged(); - } else { - consumerKeysBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder setConsumerKeys( - int index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder builderForValue) { - if (consumerKeysBuilder_ == null) { - ensureConsumerKeysIsMutable(); - consumerKeys_.set(index, builderForValue.build()); - onChanged(); - } else { - consumerKeysBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder addConsumerKeys(org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey value) { - if (consumerKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConsumerKeysIsMutable(); - consumerKeys_.add(value); - onChanged(); - } else { - consumerKeysBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder addConsumerKeys( - int index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey value) { - if (consumerKeysBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConsumerKeysIsMutable(); - consumerKeys_.add(index, value); - onChanged(); - } else { - consumerKeysBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder addConsumerKeys( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder builderForValue) { - if (consumerKeysBuilder_ == null) { - ensureConsumerKeysIsMutable(); - consumerKeys_.add(builderForValue.build()); - onChanged(); - } else { - consumerKeysBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder addConsumerKeys( - int index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder builderForValue) { - if (consumerKeysBuilder_ == null) { - ensureConsumerKeysIsMutable(); - consumerKeys_.add(index, builderForValue.build()); - onChanged(); - } else { - consumerKeysBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder addAllConsumerKeys( - java.lang.Iterable values) { - if (consumerKeysBuilder_ == null) { - ensureConsumerKeysIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, consumerKeys_); - onChanged(); - } else { - consumerKeysBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder clearConsumerKeys() { - if (consumerKeysBuilder_ == null) { - consumerKeys_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - consumerKeysBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public Builder removeConsumerKeys(int index) { - if (consumerKeysBuilder_ == null) { - ensureConsumerKeysIsMutable(); - consumerKeys_.remove(index); - onChanged(); - } else { - consumerKeysBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder getConsumerKeysBuilder( - int index) { - return getConsumerKeysFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKeyOrBuilder getConsumerKeysOrBuilder( - int index) { - if (consumerKeysBuilder_ == null) { - return consumerKeys_.get(index); } else { - return consumerKeysBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public java.util.List - getConsumerKeysOrBuilderList() { - if (consumerKeysBuilder_ != null) { - return consumerKeysBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(consumerKeys_); - } - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder addConsumerKeysBuilder() { - return getConsumerKeysFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder addConsumerKeysBuilder( - int index) { - return getConsumerKeysFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.apkmgt.ConsumerKey consumerKeys = 8; - */ - public java.util.List - getConsumerKeysBuilderList() { - return getConsumerKeysFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKeyOrBuilder> - getConsumerKeysFieldBuilder() { - if (consumerKeysBuilder_ == null) { - consumerKeysBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKeyOrBuilder>( - consumerKeys_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - consumerKeys_ = null; - } - return consumerKeysBuilder_; - } - @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.apkmgt.Application) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.apkmgt.Application) - private static final org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application(); - } - - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Application getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Application parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Application(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.apkmgt.ApkMgtApplicationProto.Application getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ConsumerKeyOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.apkmgt.ConsumerKey) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 1; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 1; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * string keyManager = 2; - * @return The keyManager. - */ - java.lang.String getKeyManager(); - /** - * string keyManager = 2; - * @return The bytes for keyManager. - */ - com.google.protobuf.ByteString - getKeyManagerBytes(); - } - /** - * Protobuf type {@code wso2.discovery.apkmgt.ConsumerKey} - */ - public static final class ConsumerKey extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.apkmgt.ConsumerKey) - ConsumerKeyOrBuilder { - private static final long serialVersionUID = 0L; - // Use ConsumerKey.newBuilder() to construct. - private ConsumerKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ConsumerKey() { - key_ = ""; - keyManager_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ConsumerKey(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ConsumerKey( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - keyManager_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_ConsumerKey_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_ConsumerKey_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.class, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; - /** - * string key = 1; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEYMANAGER_FIELD_NUMBER = 2; - private volatile java.lang.Object keyManager_; - /** - * string keyManager = 2; - * @return The keyManager. - */ - @java.lang.Override - public java.lang.String getKeyManager() { - java.lang.Object ref = keyManager_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyManager_ = s; - return s; - } - } - /** - * string keyManager = 2; - * @return The bytes for keyManager. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyManagerBytes() { - java.lang.Object ref = keyManager_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - keyManager_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); - } - if (!getKeyManagerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keyManager_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); - } - if (!getKeyManagerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keyManager_); - } - 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.apkmgt.ApkMgtApplicationProto.ConsumerKey)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey other = (org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (!getKeyManager() - .equals(other.getKeyManager())) 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) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + KEYMANAGER_FIELD_NUMBER; - hash = (53 * hash) + getKeyManager().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey 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.apkmgt.ApkMgtApplicationProto.ConsumerKey parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey 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.apkmgt.ApkMgtApplicationProto.ConsumerKey parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey 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.apkmgt.ApkMgtApplicationProto.ConsumerKey parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey 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.apkmgt.ApkMgtApplicationProto.ConsumerKey parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey 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.apkmgt.ApkMgtApplicationProto.ConsumerKey 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.apkmgt.ApkMgtApplicationProto.ConsumerKey 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.apkmgt.ApkMgtApplicationProto.ConsumerKey prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.apkmgt.ConsumerKey} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.apkmgt.ConsumerKey) - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKeyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_ConsumerKey_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_ConsumerKey_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.class, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.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(); - key_ = ""; - - keyManager_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_ConsumerKey_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey build() { - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey buildPartial() { - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey result = new org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey(this); - result.key_ = key_; - result.keyManager_ = keyManager_; - 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.apkmgt.ApkMgtApplicationProto.ConsumerKey) { - return mergeFrom((org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey other) { - if (other == org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (!other.getKeyManager().isEmpty()) { - keyManager_ = other.keyManager_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 1; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 1; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 1; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 1; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private java.lang.Object keyManager_ = ""; - /** - * string keyManager = 2; - * @return The keyManager. - */ - public java.lang.String getKeyManager() { - java.lang.Object ref = keyManager_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyManager_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string keyManager = 2; - * @return The bytes for keyManager. - */ - public com.google.protobuf.ByteString - getKeyManagerBytes() { - java.lang.Object ref = keyManager_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - keyManager_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string keyManager = 2; - * @param value The keyManager to set. - * @return This builder for chaining. - */ - public Builder setKeyManager( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - keyManager_ = value; - onChanged(); - return this; - } - /** - * string keyManager = 2; - * @return This builder for chaining. - */ - public Builder clearKeyManager() { - - keyManager_ = getDefaultInstance().getKeyManager(); - onChanged(); - return this; - } - /** - * string keyManager = 2; - * @param value The bytes for keyManager to set. - * @return This builder for chaining. - */ - public Builder setKeyManagerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - keyManager_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.apkmgt.ConsumerKey) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.apkmgt.ConsumerKey) - private static final org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey(); - } - - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.ConsumerKey getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ConsumerKey parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ConsumerKey(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.apkmgt.ApkMgtApplicationProto.ConsumerKey getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface SubscriptionOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.apkmgt.Subscription) - com.google.protobuf.MessageOrBuilder { - - /** - * string uuid = 1; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * string apiUuid = 2; - * @return The apiUuid. - */ - java.lang.String getApiUuid(); - /** - * string apiUuid = 2; - * @return The bytes for apiUuid. - */ - com.google.protobuf.ByteString - getApiUuidBytes(); - - /** - * string policyId = 3; - * @return The policyId. - */ - java.lang.String getPolicyId(); - /** - * string policyId = 3; - * @return The bytes for policyId. - */ - com.google.protobuf.ByteString - getPolicyIdBytes(); - - /** - * string subscriptionStatus = 4; - * @return The subscriptionStatus. - */ - java.lang.String getSubscriptionStatus(); - /** - * string subscriptionStatus = 4; - * @return The bytes for subscriptionStatus. - */ - com.google.protobuf.ByteString - getSubscriptionStatusBytes(); - - /** - * string organization = 5; - * @return The organization. - */ - java.lang.String getOrganization(); - /** - * string organization = 5; - * @return The bytes for organization. - */ - com.google.protobuf.ByteString - getOrganizationBytes(); - - /** - * string createdBy = 6; - * @return The createdBy. - */ - java.lang.String getCreatedBy(); - /** - * string createdBy = 6; - * @return The bytes for createdBy. - */ - com.google.protobuf.ByteString - getCreatedByBytes(); - } - /** - * Protobuf type {@code wso2.discovery.apkmgt.Subscription} - */ - public static final class Subscription extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.apkmgt.Subscription) - SubscriptionOrBuilder { - private static final long serialVersionUID = 0L; - // Use Subscription.newBuilder() to construct. - private Subscription(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Subscription() { - uuid_ = ""; - apiUuid_ = ""; - policyId_ = ""; - subscriptionStatus_ = ""; - organization_ = ""; - createdBy_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Subscription(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Subscription( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - apiUuid_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - policyId_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - subscriptionStatus_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - organization_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - createdBy_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Subscription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Subscription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.class, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder.class); - } - - public static final int UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object uuid_; - /** - * string uuid = 1; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APIUUID_FIELD_NUMBER = 2; - private volatile java.lang.Object apiUuid_; - /** - * string apiUuid = 2; - * @return The apiUuid. - */ - @java.lang.Override - public java.lang.String getApiUuid() { - java.lang.Object ref = apiUuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - apiUuid_ = s; - return s; - } - } - /** - * string apiUuid = 2; - * @return The bytes for apiUuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApiUuidBytes() { - java.lang.Object ref = apiUuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - apiUuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int POLICYID_FIELD_NUMBER = 3; - private volatile java.lang.Object policyId_; - /** - * string policyId = 3; - * @return The policyId. - */ - @java.lang.Override - public java.lang.String getPolicyId() { - java.lang.Object ref = policyId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyId_ = s; - return s; - } - } - /** - * string policyId = 3; - * @return The bytes for policyId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPolicyIdBytes() { - java.lang.Object ref = policyId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SUBSCRIPTIONSTATUS_FIELD_NUMBER = 4; - private volatile java.lang.Object subscriptionStatus_; - /** - * string subscriptionStatus = 4; - * @return The subscriptionStatus. - */ - @java.lang.Override - public java.lang.String getSubscriptionStatus() { - java.lang.Object ref = subscriptionStatus_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscriptionStatus_ = s; - return s; - } - } - /** - * string subscriptionStatus = 4; - * @return The bytes for subscriptionStatus. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSubscriptionStatusBytes() { - java.lang.Object ref = subscriptionStatus_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subscriptionStatus_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATION_FIELD_NUMBER = 5; - private volatile java.lang.Object organization_; - /** - * string organization = 5; - * @return The organization. - */ - @java.lang.Override - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } - } - /** - * string organization = 5; - * @return The bytes for organization. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREATEDBY_FIELD_NUMBER = 6; - private volatile java.lang.Object createdBy_; - /** - * string createdBy = 6; - * @return The createdBy. - */ - @java.lang.Override - public java.lang.String getCreatedBy() { - java.lang.Object ref = createdBy_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - createdBy_ = s; - return s; - } - } - /** - * string createdBy = 6; - * @return The bytes for createdBy. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCreatedByBytes() { - java.lang.Object ref = createdBy_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - createdBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); - } - if (!getApiUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, apiUuid_); - } - if (!getPolicyIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, policyId_); - } - if (!getSubscriptionStatusBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, subscriptionStatus_); - } - if (!getOrganizationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, organization_); - } - if (!getCreatedByBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, createdBy_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); - } - if (!getApiUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, apiUuid_); - } - if (!getPolicyIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, policyId_); - } - if (!getSubscriptionStatusBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, subscriptionStatus_); - } - if (!getOrganizationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, organization_); - } - if (!getCreatedByBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, createdBy_); - } - 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.apkmgt.ApkMgtApplicationProto.Subscription)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription other = (org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription) obj; - - if (!getUuid() - .equals(other.getUuid())) return false; - if (!getApiUuid() - .equals(other.getApiUuid())) return false; - if (!getPolicyId() - .equals(other.getPolicyId())) return false; - if (!getSubscriptionStatus() - .equals(other.getSubscriptionStatus())) return false; - if (!getOrganization() - .equals(other.getOrganization())) return false; - if (!getCreatedBy() - .equals(other.getCreatedBy())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + APIUUID_FIELD_NUMBER; - hash = (53 * hash) + getApiUuid().hashCode(); - hash = (37 * hash) + POLICYID_FIELD_NUMBER; - hash = (53 * hash) + getPolicyId().hashCode(); - hash = (37 * hash) + SUBSCRIPTIONSTATUS_FIELD_NUMBER; - hash = (53 * hash) + getSubscriptionStatus().hashCode(); - hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; - hash = (53 * hash) + getOrganization().hashCode(); - hash = (37 * hash) + CREATEDBY_FIELD_NUMBER; - hash = (53 * hash) + getCreatedBy().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription 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.apkmgt.ApkMgtApplicationProto.Subscription parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription 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.apkmgt.ApkMgtApplicationProto.Subscription parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription 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.apkmgt.ApkMgtApplicationProto.Subscription parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription 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.apkmgt.ApkMgtApplicationProto.Subscription parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription 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.apkmgt.ApkMgtApplicationProto.Subscription 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.apkmgt.ApkMgtApplicationProto.Subscription 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.apkmgt.ApkMgtApplicationProto.Subscription prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.apkmgt.Subscription} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.apkmgt.Subscription) - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.SubscriptionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Subscription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Subscription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.class, org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - uuid_ = ""; - - apiUuid_ = ""; - - policyId_ = ""; - - subscriptionStatus_ = ""; - - organization_ = ""; - - createdBy_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.internal_static_wso2_discovery_apkmgt_Subscription_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription build() { - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription buildPartial() { - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription result = new org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription(this); - result.uuid_ = uuid_; - result.apiUuid_ = apiUuid_; - result.policyId_ = policyId_; - result.subscriptionStatus_ = subscriptionStatus_; - result.organization_ = organization_; - result.createdBy_ = createdBy_; - 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.apkmgt.ApkMgtApplicationProto.Subscription) { - return mergeFrom((org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription other) { - if (other == org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription.getDefaultInstance()) return this; - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (!other.getApiUuid().isEmpty()) { - apiUuid_ = other.apiUuid_; - onChanged(); - } - if (!other.getPolicyId().isEmpty()) { - policyId_ = other.policyId_; - onChanged(); - } - if (!other.getSubscriptionStatus().isEmpty()) { - subscriptionStatus_ = other.subscriptionStatus_; - onChanged(); - } - if (!other.getOrganization().isEmpty()) { - organization_ = other.organization_; - onChanged(); - } - if (!other.getCreatedBy().isEmpty()) { - createdBy_ = other.createdBy_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 1; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 1; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 1; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 1; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private java.lang.Object apiUuid_ = ""; - /** - * string apiUuid = 2; - * @return The apiUuid. - */ - public java.lang.String getApiUuid() { - java.lang.Object ref = apiUuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - apiUuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string apiUuid = 2; - * @return The bytes for apiUuid. - */ - public com.google.protobuf.ByteString - getApiUuidBytes() { - java.lang.Object ref = apiUuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - apiUuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string apiUuid = 2; - * @param value The apiUuid to set. - * @return This builder for chaining. - */ - public Builder setApiUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - apiUuid_ = value; - onChanged(); - return this; - } - /** - * string apiUuid = 2; - * @return This builder for chaining. - */ - public Builder clearApiUuid() { - - apiUuid_ = getDefaultInstance().getApiUuid(); - onChanged(); - return this; - } - /** - * string apiUuid = 2; - * @param value The bytes for apiUuid to set. - * @return This builder for chaining. - */ - public Builder setApiUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - apiUuid_ = value; - onChanged(); - return this; - } - - private java.lang.Object policyId_ = ""; - /** - * string policyId = 3; - * @return The policyId. - */ - public java.lang.String getPolicyId() { - java.lang.Object ref = policyId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string policyId = 3; - * @return The bytes for policyId. - */ - public com.google.protobuf.ByteString - getPolicyIdBytes() { - java.lang.Object ref = policyId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string policyId = 3; - * @param value The policyId to set. - * @return This builder for chaining. - */ - public Builder setPolicyId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - policyId_ = value; - onChanged(); - return this; - } - /** - * string policyId = 3; - * @return This builder for chaining. - */ - public Builder clearPolicyId() { - - policyId_ = getDefaultInstance().getPolicyId(); - onChanged(); - return this; - } - /** - * string policyId = 3; - * @param value The bytes for policyId to set. - * @return This builder for chaining. - */ - public Builder setPolicyIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - policyId_ = value; - onChanged(); - return this; - } - - private java.lang.Object subscriptionStatus_ = ""; - /** - * string subscriptionStatus = 4; - * @return The subscriptionStatus. - */ - public java.lang.String getSubscriptionStatus() { - java.lang.Object ref = subscriptionStatus_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscriptionStatus_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string subscriptionStatus = 4; - * @return The bytes for subscriptionStatus. - */ - public com.google.protobuf.ByteString - getSubscriptionStatusBytes() { - java.lang.Object ref = subscriptionStatus_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subscriptionStatus_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string subscriptionStatus = 4; - * @param value The subscriptionStatus to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionStatus( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - subscriptionStatus_ = value; - onChanged(); - return this; - } - /** - * string subscriptionStatus = 4; - * @return This builder for chaining. - */ - public Builder clearSubscriptionStatus() { - - subscriptionStatus_ = getDefaultInstance().getSubscriptionStatus(); - onChanged(); - return this; - } - /** - * string subscriptionStatus = 4; - * @param value The bytes for subscriptionStatus to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionStatusBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - subscriptionStatus_ = value; - onChanged(); - return this; - } - - private java.lang.Object organization_ = ""; - /** - * string organization = 5; - * @return The organization. - */ - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organization = 5; - * @return The bytes for organization. - */ - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organization = 5; - * @param value The organization to set. - * @return This builder for chaining. - */ - public Builder setOrganization( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organization_ = value; - onChanged(); - return this; - } - /** - * string organization = 5; - * @return This builder for chaining. - */ - public Builder clearOrganization() { - - organization_ = getDefaultInstance().getOrganization(); - onChanged(); - return this; - } - /** - * string organization = 5; - * @param value The bytes for organization to set. - * @return This builder for chaining. - */ - public Builder setOrganizationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organization_ = value; - onChanged(); - return this; - } - - private java.lang.Object createdBy_ = ""; - /** - * string createdBy = 6; - * @return The createdBy. - */ - public java.lang.String getCreatedBy() { - java.lang.Object ref = createdBy_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - createdBy_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string createdBy = 6; - * @return The bytes for createdBy. - */ - public com.google.protobuf.ByteString - getCreatedByBytes() { - java.lang.Object ref = createdBy_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - createdBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string createdBy = 6; - * @param value The createdBy to set. - * @return This builder for chaining. - */ - public Builder setCreatedBy( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - createdBy_ = value; - onChanged(); - return this; - } - /** - * string createdBy = 6; - * @return This builder for chaining. - */ - public Builder clearCreatedBy() { - - createdBy_ = getDefaultInstance().getCreatedBy(); - onChanged(); - return this; - } - /** - * string createdBy = 6; - * @param value The bytes for createdBy to set. - * @return This builder for chaining. - */ - public Builder setCreatedByBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - createdBy_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.apkmgt.Subscription) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.apkmgt.Subscription) - private static final org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription(); - } - - public static org.wso2.apk.enforcer.discovery.apkmgt.ApkMgtApplicationProto.Subscription getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Subscription parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Subscription(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.apkmgt.ApkMgtApplicationProto.Subscription getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_apkmgt_Application_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_apkmgt_Application_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_apkmgt_Application_AttributesEntry_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_apkmgt_Application_AttributesEntry_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_apkmgt_ConsumerKey_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_apkmgt_ConsumerKey_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_apkmgt_Subscription_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_apkmgt_Subscription_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\'wso2/discovery/apkmgt/application.prot" + - "o\022\025wso2.discovery.apkmgt\"\323\002\n\013Application" + - "\022\014\n\004uuid\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\r\n\005owner\030\003 " + - "\001(\t\022F\n\nattributes\030\004 \003(\01322.wso2.discovery" + - ".apkmgt.Application.AttributesEntry\022\022\n\ns" + - "ubscriber\030\005 \001(\t\022\024\n\014organization\030\006 \001(\t\022:\n" + - "\rsubscriptions\030\007 \003(\0132#.wso2.discovery.ap" + - "kmgt.Subscription\0228\n\014consumerKeys\030\010 \003(\0132" + - "\".wso2.discovery.apkmgt.ConsumerKey\0321\n\017A" + - "ttributesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + - "(\t:\0028\001\".\n\013ConsumerKey\022\013\n\003key\030\001 \001(\t\022\022\n\nke" + - "yManager\030\002 \001(\t\"\204\001\n\014Subscription\022\014\n\004uuid\030" + - "\001 \001(\t\022\017\n\007apiUuid\030\002 \001(\t\022\020\n\010policyId\030\003 \001(\t" + - "\022\032\n\022subscriptionStatus\030\004 \001(\t\022\024\n\014organiza" + - "tion\030\005 \001(\t\022\021\n\tcreatedBy\030\006 \001(\tB\235\001\n&org.ws" + - "o2.apk.enforcer.discovery.apkmgtB\026ApkMgt" + - "ApplicationProtoP\000ZYgithub.com/envoyprox" + - "y/go-control-plane/wso2/discovery/apkmgt" + - "application;apkmgtapplicationb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_apkmgt_Application_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_apkmgt_Application_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_apkmgt_Application_descriptor, - new java.lang.String[] { "Uuid", "Name", "Owner", "Attributes", "Subscriber", "Organization", "Subscriptions", "ConsumerKeys", }); - internal_static_wso2_discovery_apkmgt_Application_AttributesEntry_descriptor = - internal_static_wso2_discovery_apkmgt_Application_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_apkmgt_Application_AttributesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_apkmgt_Application_AttributesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_wso2_discovery_apkmgt_ConsumerKey_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_apkmgt_ConsumerKey_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_apkmgt_ConsumerKey_descriptor, - new java.lang.String[] { "Key", "KeyManager", }); - internal_static_wso2_discovery_apkmgt_Subscription_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_wso2_discovery_apkmgt_Subscription_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_apkmgt_Subscription_descriptor, - new java.lang.String[] { "Uuid", "ApiUuid", "PolicyId", "SubscriptionStatus", "Organization", "CreatedBy", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/common/XDSCommonUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/common/XDSCommonUtils.java deleted file mode 100644 index 7edac21ff0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/common/XDSCommonUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.discovery.common; - -import com.google.protobuf.Struct; -import com.google.protobuf.Value; -import io.envoyproxy.envoy.config.core.v3.Node; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; - -/** - * Common utility functions used by XDS clients. - */ -public class XDSCommonUtils { - private static final Struct nodeMetadata = generateNodeMetadata(); - - public static Node generateXDSNode(String nodeId) { - return Node.newBuilder().setId(nodeId).setMetadata(nodeMetadata).build(); - } - - private static Struct generateNodeMetadata() { - return Struct.newBuilder().putFields(AdapterConstants.NODE_IDENTIFIER_KEY, - Value.newBuilder().setStringValue(ConfigHolder.getInstance().getEnvVarConfig().getInstanceIdentifier()) - .build()) - .build(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcer.java deleted file mode 100644 index 8e9e4343a4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcer.java +++ /dev/null @@ -1,768 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/api_key_enforcer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Listener and client certificate store model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.APIKeyEnforcer} - */ -public final class APIKeyEnforcer extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.APIKeyEnforcer) - APIKeyEnforcerOrBuilder { -private static final long serialVersionUID = 0L; - // Use APIKeyEnforcer.newBuilder() to construct. - private APIKeyEnforcer(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private APIKeyEnforcer() { - issuer_ = ""; - certificateFilePath_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new APIKeyEnforcer(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private APIKeyEnforcer( - 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: { - - enabled_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - issuer_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - certificateFilePath_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerProto.internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerProto.internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.class, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int ISSUER_FIELD_NUMBER = 2; - private volatile java.lang.Object issuer_; - /** - * string issuer = 2; - * @return The issuer. - */ - @java.lang.Override - public java.lang.String getIssuer() { - java.lang.Object ref = issuer_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - issuer_ = s; - return s; - } - } - /** - * string issuer = 2; - * @return The bytes for issuer. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIssuerBytes() { - java.lang.Object ref = issuer_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - issuer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CERTIFICATEFILEPATH_FIELD_NUMBER = 3; - private volatile java.lang.Object certificateFilePath_; - /** - * string certificateFilePath = 3; - * @return The certificateFilePath. - */ - @java.lang.Override - public java.lang.String getCertificateFilePath() { - java.lang.Object ref = certificateFilePath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificateFilePath_ = s; - return s; - } - } - /** - * string certificateFilePath = 3; - * @return The bytes for certificateFilePath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCertificateFilePathBytes() { - java.lang.Object ref = certificateFilePath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificateFilePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (enabled_ != false) { - output.writeBool(1, enabled_); - } - if (!getIssuerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, issuer_); - } - if (!getCertificateFilePathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, certificateFilePath_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enabled_); - } - if (!getIssuerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, issuer_); - } - if (!getCertificateFilePathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, certificateFilePath_); - } - 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.APIKeyEnforcer)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer other = (org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer) obj; - - if (getEnabled() - != other.getEnabled()) return false; - if (!getIssuer() - .equals(other.getIssuer())) return false; - if (!getCertificateFilePath() - .equals(other.getCertificateFilePath())) 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) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - hash = (37 * hash) + ISSUER_FIELD_NUMBER; - hash = (53 * hash) + getIssuer().hashCode(); - hash = (37 * hash) + CERTIFICATEFILEPATH_FIELD_NUMBER; - hash = (53 * hash) + getCertificateFilePath().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer 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.APIKeyEnforcer parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer 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.APIKeyEnforcer parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer 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.APIKeyEnforcer 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.APIKeyEnforcer 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.APIKeyEnforcer 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.APIKeyEnforcer 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.APIKeyEnforcer 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.APIKeyEnforcer 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.APIKeyEnforcer 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; - } - /** - *
-   * Listener and client certificate store model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.APIKeyEnforcer} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.APIKeyEnforcer) - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerProto.internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerProto.internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.class, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.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(); - enabled_ = false; - - issuer_ = ""; - - certificateFilePath_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerProto.internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer build() { - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer result = new org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer(this); - result.enabled_ = enabled_; - result.issuer_ = issuer_; - result.certificateFilePath_ = certificateFilePath_; - 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.APIKeyEnforcer) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (!other.getIssuer().isEmpty()) { - issuer_ = other.issuer_; - onChanged(); - } - if (!other.getCertificateFilePath().isEmpty()) { - certificateFilePath_ = other.certificateFilePath_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enabled_ ; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 1; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * bool enabled = 1; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private java.lang.Object issuer_ = ""; - /** - * string issuer = 2; - * @return The issuer. - */ - public java.lang.String getIssuer() { - java.lang.Object ref = issuer_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - issuer_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string issuer = 2; - * @return The bytes for issuer. - */ - public com.google.protobuf.ByteString - getIssuerBytes() { - java.lang.Object ref = issuer_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - issuer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string issuer = 2; - * @param value The issuer to set. - * @return This builder for chaining. - */ - public Builder setIssuer( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - issuer_ = value; - onChanged(); - return this; - } - /** - * string issuer = 2; - * @return This builder for chaining. - */ - public Builder clearIssuer() { - - issuer_ = getDefaultInstance().getIssuer(); - onChanged(); - return this; - } - /** - * string issuer = 2; - * @param value The bytes for issuer to set. - * @return This builder for chaining. - */ - public Builder setIssuerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - issuer_ = value; - onChanged(); - return this; - } - - private java.lang.Object certificateFilePath_ = ""; - /** - * string certificateFilePath = 3; - * @return The certificateFilePath. - */ - public java.lang.String getCertificateFilePath() { - java.lang.Object ref = certificateFilePath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificateFilePath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string certificateFilePath = 3; - * @return The bytes for certificateFilePath. - */ - public com.google.protobuf.ByteString - getCertificateFilePathBytes() { - java.lang.Object ref = certificateFilePath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificateFilePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string certificateFilePath = 3; - * @param value The certificateFilePath to set. - * @return This builder for chaining. - */ - public Builder setCertificateFilePath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - certificateFilePath_ = value; - onChanged(); - return this; - } - /** - * string certificateFilePath = 3; - * @return This builder for chaining. - */ - public Builder clearCertificateFilePath() { - - certificateFilePath_ = getDefaultInstance().getCertificateFilePath(); - onChanged(); - return this; - } - /** - * string certificateFilePath = 3; - * @param value The bytes for certificateFilePath to set. - * @return This builder for chaining. - */ - public Builder setCertificateFilePathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - certificateFilePath_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.config.enforcer.APIKeyEnforcer) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.APIKeyEnforcer) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public APIKeyEnforcer parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new APIKeyEnforcer(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.APIKeyEnforcer getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcerOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcerOrBuilder.java deleted file mode 100644 index 329fc56b66..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcerOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/api_key_enforcer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface APIKeyEnforcerOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.APIKeyEnforcer) - com.google.protobuf.MessageOrBuilder { - - /** - * bool enabled = 1; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * string issuer = 2; - * @return The issuer. - */ - java.lang.String getIssuer(); - /** - * string issuer = 2; - * @return The bytes for issuer. - */ - com.google.protobuf.ByteString - getIssuerBytes(); - - /** - * string certificateFilePath = 3; - * @return The certificateFilePath. - */ - java.lang.String getCertificateFilePath(); - /** - * string certificateFilePath = 3; - * @return The bytes for certificateFilePath. - */ - com.google.protobuf.ByteString - getCertificateFilePathBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcerProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcerProto.java deleted file mode 100644 index c221efca09..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/APIKeyEnforcerProto.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/api_key_enforcer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class APIKeyEnforcerProto { - private APIKeyEnforcerProto() {} - 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_APIKeyEnforcer_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n5wso2/discovery/config/enforcer/api_key" + - "_enforcer.proto\022\036wso2.discovery.config.e" + - "nforcer\"N\n\016APIKeyEnforcer\022\017\n\007enabled\030\001 \001" + - "(\010\022\016\n\006issuer\030\002 \001(\t\022\033\n\023certificateFilePat" + - "h\030\003 \001(\tB\230\001\n/org.wso2.apk.enforcer.discov" + - "ery.config.enforcerB\023APIKeyEnforcerProto" + - "P\001ZNgithub.com/envoyproxy/go-control-pla" + - "ne/wso2/discovery/config/enforcer;enforc" + - "erb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_APIKeyEnforcer_descriptor, - new java.lang.String[] { "Enabled", "Issuer", "CertificateFilePath", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Analytics.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Analytics.java deleted file mode 100644 index 4ebb36cb45..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Analytics.java +++ /dev/null @@ -1,1490 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/analytics.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - * Protobuf type {@code wso2.discovery.config.enforcer.Analytics} - */ -public final class Analytics extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Analytics) - AnalyticsOrBuilder { -private static final long serialVersionUID = 0L; - // Use Analytics.newBuilder() to construct. - private Analytics(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Analytics() { - analyticsPublisher_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Analytics(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Analytics( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - enabled_ = input.readBool(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - analyticsPublisher_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - analyticsPublisher_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.parser(), extensionRegistry)); - break; - } - case 26: { - org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder subBuilder = null; - if (service_ != null) { - subBuilder = service_.toBuilder(); - } - service_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Service.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(service_); - service_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - properties_ = com.google.protobuf.MapField.newMapField( - PropertiesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - properties__ = input.readMessage( - PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - properties_.getMutableMap().put( - properties__.getKey(), properties__.getValue()); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - analyticsPublisher_ = java.util.Collections.unmodifiableList(analyticsPublisher_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsProto.internal_static_wso2_discovery_config_enforcer_Analytics_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 4: - return internalGetProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsProto.internal_static_wso2_discovery_config_enforcer_Analytics_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.class, org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int ANALYTICS_PUBLISHER_FIELD_NUMBER = 2; - private java.util.List analyticsPublisher_; - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - @java.lang.Override - public java.util.List getAnalyticsPublisherList() { - return analyticsPublisher_; - } - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - @java.lang.Override - public java.util.List - getAnalyticsPublisherOrBuilderList() { - return analyticsPublisher_; - } - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - @java.lang.Override - public int getAnalyticsPublisherCount() { - return analyticsPublisher_.size(); - } - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher getAnalyticsPublisher(int index) { - return analyticsPublisher_.get(index); - } - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherOrBuilder getAnalyticsPublisherOrBuilder( - int index) { - return analyticsPublisher_.get(index); - } - - public static final int SERVICE_FIELD_NUMBER = 3; - private org.wso2.apk.enforcer.discovery.config.enforcer.Service service_; - /** - *
-   * Receiver grpc Service Configuration
-   * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - * @return Whether the service field is set. - */ - @java.lang.Override - public boolean hasService() { - return service_ != null; - } - /** - *
-   * Receiver grpc Service Configuration
-   * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - * @return The service. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Service getService() { - return service_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Service.getDefaultInstance() : service_; - } - /** - *
-   * Receiver grpc Service Configuration
-   * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder getServiceOrBuilder() { - return getService(); - } - - public static final int PROPERTIES_FIELD_NUMBER = 4; - private static final class PropertiesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsProto.internal_static_wso2_discovery_config_enforcer_Analytics_PropertiesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> properties_; - private com.google.protobuf.MapField - internalGetProperties() { - if (properties_ == null) { - return com.google.protobuf.MapField.emptyMapField( - PropertiesDefaultEntryHolder.defaultEntry); - } - return properties_; - } - - public int getPropertiesCount() { - return internalGetProperties().getMap().size(); - } - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - - @java.lang.Override - public boolean containsProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetProperties().getMap().containsKey(key); - } - /** - * Use {@link #getPropertiesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getProperties() { - return getPropertiesMap(); - } - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - @java.lang.Override - - public java.util.Map getPropertiesMap() { - return internalGetProperties().getMap(); - } - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - @java.lang.Override - - public java.lang.String getPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - @java.lang.Override - - public java.lang.String getPropertiesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetProperties().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - 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 (enabled_ != false) { - output.writeBool(1, enabled_); - } - for (int i = 0; i < analyticsPublisher_.size(); i++) { - output.writeMessage(2, analyticsPublisher_.get(i)); - } - if (service_ != null) { - output.writeMessage(3, getService()); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetProperties(), - PropertiesDefaultEntryHolder.defaultEntry, - 4); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enabled_); - } - for (int i = 0; i < analyticsPublisher_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, analyticsPublisher_.get(i)); - } - if (service_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getService()); - } - for (java.util.Map.Entry entry - : internalGetProperties().getMap().entrySet()) { - com.google.protobuf.MapEntry - properties__ = PropertiesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, properties__); - } - 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.Analytics)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics other = (org.wso2.apk.enforcer.discovery.config.enforcer.Analytics) obj; - - if (getEnabled() - != other.getEnabled()) return false; - if (!getAnalyticsPublisherList() - .equals(other.getAnalyticsPublisherList())) return false; - if (hasService() != other.hasService()) return false; - if (hasService()) { - if (!getService() - .equals(other.getService())) return false; - } - if (!internalGetProperties().equals( - other.internalGetProperties())) 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) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - if (getAnalyticsPublisherCount() > 0) { - hash = (37 * hash) + ANALYTICS_PUBLISHER_FIELD_NUMBER; - hash = (53 * hash) + getAnalyticsPublisherList().hashCode(); - } - if (hasService()) { - hash = (37 * hash) + SERVICE_FIELD_NUMBER; - hash = (53 * hash) + getService().hashCode(); - } - if (!internalGetProperties().getMap().isEmpty()) { - hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; - hash = (53 * hash) + internalGetProperties().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Analytics parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Analytics 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.Analytics parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Analytics 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.Analytics parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Analytics 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.Analytics 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.Analytics 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.Analytics 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.Analytics 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.Analytics 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.Analytics 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.Analytics prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.config.enforcer.Analytics} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Analytics) - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsProto.internal_static_wso2_discovery_config_enforcer_Analytics_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 4: - return internalGetProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 4: - return internalGetMutableProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsProto.internal_static_wso2_discovery_config_enforcer_Analytics_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.class, org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAnalyticsPublisherFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - enabled_ = false; - - if (analyticsPublisherBuilder_ == null) { - analyticsPublisher_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - analyticsPublisherBuilder_.clear(); - } - if (serviceBuilder_ == null) { - service_ = null; - } else { - service_ = null; - serviceBuilder_ = null; - } - internalGetMutableProperties().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsProto.internal_static_wso2_discovery_config_enforcer_Analytics_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics result = new org.wso2.apk.enforcer.discovery.config.enforcer.Analytics(this); - int from_bitField0_ = bitField0_; - result.enabled_ = enabled_; - if (analyticsPublisherBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - analyticsPublisher_ = java.util.Collections.unmodifiableList(analyticsPublisher_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.analyticsPublisher_ = analyticsPublisher_; - } else { - result.analyticsPublisher_ = analyticsPublisherBuilder_.build(); - } - if (serviceBuilder_ == null) { - result.service_ = service_; - } else { - result.service_ = serviceBuilder_.build(); - } - result.properties_ = internalGetProperties(); - result.properties_.makeImmutable(); - 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.Analytics) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Analytics)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Analytics other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (analyticsPublisherBuilder_ == null) { - if (!other.analyticsPublisher_.isEmpty()) { - if (analyticsPublisher_.isEmpty()) { - analyticsPublisher_ = other.analyticsPublisher_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAnalyticsPublisherIsMutable(); - analyticsPublisher_.addAll(other.analyticsPublisher_); - } - onChanged(); - } - } else { - if (!other.analyticsPublisher_.isEmpty()) { - if (analyticsPublisherBuilder_.isEmpty()) { - analyticsPublisherBuilder_.dispose(); - analyticsPublisherBuilder_ = null; - analyticsPublisher_ = other.analyticsPublisher_; - bitField0_ = (bitField0_ & ~0x00000001); - analyticsPublisherBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAnalyticsPublisherFieldBuilder() : null; - } else { - analyticsPublisherBuilder_.addAllMessages(other.analyticsPublisher_); - } - } - } - if (other.hasService()) { - mergeService(other.getService()); - } - internalGetMutableProperties().mergeFrom( - other.internalGetProperties()); - 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.Analytics parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Analytics) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private boolean enabled_ ; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 1; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * bool enabled = 1; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private java.util.List analyticsPublisher_ = - java.util.Collections.emptyList(); - private void ensureAnalyticsPublisherIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - analyticsPublisher_ = new java.util.ArrayList(analyticsPublisher_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherOrBuilder> analyticsPublisherBuilder_; - - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public java.util.List getAnalyticsPublisherList() { - if (analyticsPublisherBuilder_ == null) { - return java.util.Collections.unmodifiableList(analyticsPublisher_); - } else { - return analyticsPublisherBuilder_.getMessageList(); - } - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public int getAnalyticsPublisherCount() { - if (analyticsPublisherBuilder_ == null) { - return analyticsPublisher_.size(); - } else { - return analyticsPublisherBuilder_.getCount(); - } - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher getAnalyticsPublisher(int index) { - if (analyticsPublisherBuilder_ == null) { - return analyticsPublisher_.get(index); - } else { - return analyticsPublisherBuilder_.getMessage(index); - } - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder setAnalyticsPublisher( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher value) { - if (analyticsPublisherBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnalyticsPublisherIsMutable(); - analyticsPublisher_.set(index, value); - onChanged(); - } else { - analyticsPublisherBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder setAnalyticsPublisher( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder builderForValue) { - if (analyticsPublisherBuilder_ == null) { - ensureAnalyticsPublisherIsMutable(); - analyticsPublisher_.set(index, builderForValue.build()); - onChanged(); - } else { - analyticsPublisherBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder addAnalyticsPublisher(org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher value) { - if (analyticsPublisherBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnalyticsPublisherIsMutable(); - analyticsPublisher_.add(value); - onChanged(); - } else { - analyticsPublisherBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder addAnalyticsPublisher( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher value) { - if (analyticsPublisherBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnalyticsPublisherIsMutable(); - analyticsPublisher_.add(index, value); - onChanged(); - } else { - analyticsPublisherBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder addAnalyticsPublisher( - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder builderForValue) { - if (analyticsPublisherBuilder_ == null) { - ensureAnalyticsPublisherIsMutable(); - analyticsPublisher_.add(builderForValue.build()); - onChanged(); - } else { - analyticsPublisherBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder addAnalyticsPublisher( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder builderForValue) { - if (analyticsPublisherBuilder_ == null) { - ensureAnalyticsPublisherIsMutable(); - analyticsPublisher_.add(index, builderForValue.build()); - onChanged(); - } else { - analyticsPublisherBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder addAllAnalyticsPublisher( - java.lang.Iterable values) { - if (analyticsPublisherBuilder_ == null) { - ensureAnalyticsPublisherIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, analyticsPublisher_); - onChanged(); - } else { - analyticsPublisherBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder clearAnalyticsPublisher() { - if (analyticsPublisherBuilder_ == null) { - analyticsPublisher_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - analyticsPublisherBuilder_.clear(); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public Builder removeAnalyticsPublisher(int index) { - if (analyticsPublisherBuilder_ == null) { - ensureAnalyticsPublisherIsMutable(); - analyticsPublisher_.remove(index); - onChanged(); - } else { - analyticsPublisherBuilder_.remove(index); - } - return this; - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder getAnalyticsPublisherBuilder( - int index) { - return getAnalyticsPublisherFieldBuilder().getBuilder(index); - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherOrBuilder getAnalyticsPublisherOrBuilder( - int index) { - if (analyticsPublisherBuilder_ == null) { - return analyticsPublisher_.get(index); } else { - return analyticsPublisherBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public java.util.List - getAnalyticsPublisherOrBuilderList() { - if (analyticsPublisherBuilder_ != null) { - return analyticsPublisherBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(analyticsPublisher_); - } - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder addAnalyticsPublisherBuilder() { - return getAnalyticsPublisherFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.getDefaultInstance()); - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder addAnalyticsPublisherBuilder( - int index) { - return getAnalyticsPublisherFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.getDefaultInstance()); - } - /** - *
-     * Analytics Publishers
-     * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - public java.util.List - getAnalyticsPublisherBuilderList() { - return getAnalyticsPublisherFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherOrBuilder> - getAnalyticsPublisherFieldBuilder() { - if (analyticsPublisherBuilder_ == null) { - analyticsPublisherBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherOrBuilder>( - analyticsPublisher_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - analyticsPublisher_ = null; - } - return analyticsPublisherBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.Service service_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Service, org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder> serviceBuilder_; - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - * @return Whether the service field is set. - */ - public boolean hasService() { - return serviceBuilder_ != null || service_ != null; - } - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - * @return The service. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Service getService() { - if (serviceBuilder_ == null) { - return service_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Service.getDefaultInstance() : service_; - } else { - return serviceBuilder_.getMessage(); - } - } - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - public Builder setService(org.wso2.apk.enforcer.discovery.config.enforcer.Service value) { - if (serviceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - service_ = value; - onChanged(); - } else { - serviceBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - public Builder setService( - org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder builderForValue) { - if (serviceBuilder_ == null) { - service_ = builderForValue.build(); - onChanged(); - } else { - serviceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - public Builder mergeService(org.wso2.apk.enforcer.discovery.config.enforcer.Service value) { - if (serviceBuilder_ == null) { - if (service_ != null) { - service_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Service.newBuilder(service_).mergeFrom(value).buildPartial(); - } else { - service_ = value; - } - onChanged(); - } else { - serviceBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - public Builder clearService() { - if (serviceBuilder_ == null) { - service_ = null; - onChanged(); - } else { - service_ = null; - serviceBuilder_ = null; - } - - return this; - } - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder getServiceBuilder() { - - onChanged(); - return getServiceFieldBuilder().getBuilder(); - } - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder getServiceOrBuilder() { - if (serviceBuilder_ != null) { - return serviceBuilder_.getMessageOrBuilder(); - } else { - return service_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Service.getDefaultInstance() : service_; - } - } - /** - *
-     * Receiver grpc Service Configuration
-     * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Service, org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder> - getServiceFieldBuilder() { - if (serviceBuilder_ == null) { - serviceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Service, org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder>( - getService(), - getParentForChildren(), - isClean()); - service_ = null; - } - return serviceBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> properties_; - private com.google.protobuf.MapField - internalGetProperties() { - if (properties_ == null) { - return com.google.protobuf.MapField.emptyMapField( - PropertiesDefaultEntryHolder.defaultEntry); - } - return properties_; - } - private com.google.protobuf.MapField - internalGetMutableProperties() { - onChanged();; - if (properties_ == null) { - properties_ = com.google.protobuf.MapField.newMapField( - PropertiesDefaultEntryHolder.defaultEntry); - } - if (!properties_.isMutable()) { - properties_ = properties_.copy(); - } - return properties_; - } - - public int getPropertiesCount() { - return internalGetProperties().getMap().size(); - } - /** - *
-     * Analytics type
-     * 
- * - * map<string, string> properties = 4; - */ - - @java.lang.Override - public boolean containsProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetProperties().getMap().containsKey(key); - } - /** - * Use {@link #getPropertiesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getProperties() { - return getPropertiesMap(); - } - /** - *
-     * Analytics type
-     * 
- * - * map<string, string> properties = 4; - */ - @java.lang.Override - - public java.util.Map getPropertiesMap() { - return internalGetProperties().getMap(); - } - /** - *
-     * Analytics type
-     * 
- * - * map<string, string> properties = 4; - */ - @java.lang.Override - - public java.lang.String getPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * Analytics type
-     * 
- * - * map<string, string> properties = 4; - */ - @java.lang.Override - - public java.lang.String getPropertiesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetProperties().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearProperties() { - internalGetMutableProperties().getMutableMap() - .clear(); - return this; - } - /** - *
-     * Analytics type
-     * 
- * - * map<string, string> properties = 4; - */ - - public Builder removeProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableProperties().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableProperties() { - return internalGetMutableProperties().getMutableMap(); - } - /** - *
-     * Analytics type
-     * 
- * - * map<string, string> properties = 4; - */ - public Builder putProperties( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableProperties().getMutableMap() - .put(key, value); - return this; - } - /** - *
-     * Analytics type
-     * 
- * - * map<string, string> properties = 4; - */ - - public Builder putAllProperties( - java.util.Map values) { - internalGetMutableProperties().getMutableMap() - .putAll(values); - 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.Analytics) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Analytics) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Analytics DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Analytics(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Analytics getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Analytics parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Analytics(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.Analytics getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsOrBuilder.java deleted file mode 100644 index 527016baa6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsOrBuilder.java +++ /dev/null @@ -1,140 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/analytics.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface AnalyticsOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Analytics) - com.google.protobuf.MessageOrBuilder { - - /** - * bool enabled = 1; - * @return The enabled. - */ - boolean getEnabled(); - - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - java.util.List - getAnalyticsPublisherList(); - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher getAnalyticsPublisher(int index); - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - int getAnalyticsPublisherCount(); - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - java.util.List - getAnalyticsPublisherOrBuilderList(); - /** - *
-   * Analytics Publishers
-   * 
- * - * repeated .wso2.discovery.config.enforcer.AnalyticsPublisher analytics_publisher = 2; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherOrBuilder getAnalyticsPublisherOrBuilder( - int index); - - /** - *
-   * Receiver grpc Service Configuration
-   * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - * @return Whether the service field is set. - */ - boolean hasService(); - /** - *
-   * Receiver grpc Service Configuration
-   * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - * @return The service. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.Service getService(); - /** - *
-   * Receiver grpc Service Configuration
-   * 
- * - * .wso2.discovery.config.enforcer.Service service = 3; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder getServiceOrBuilder(); - - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - int getPropertiesCount(); - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - boolean containsProperties( - java.lang.String key); - /** - * Use {@link #getPropertiesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getProperties(); - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - java.util.Map - getPropertiesMap(); - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - - java.lang.String getPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - *
-   * Analytics type
-   * 
- * - * map<string, string> properties = 4; - */ - - java.lang.String getPropertiesOrThrow( - java.lang.String key); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsProto.java deleted file mode 100644 index a3bbbe4e3f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsProto.java +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/analytics.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class AnalyticsProto { - private AnalyticsProto() {} - 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_Analytics_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Analytics_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_config_enforcer_Analytics_PropertiesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Analytics_PropertiesEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n.wso2/discovery/config/enforcer/analyti" + - "cs.proto\022\036wso2.discovery.config.enforcer" + - "\032,wso2/discovery/config/enforcer/service" + - ".proto\0328wso2/discovery/config/enforcer/a" + - "nalytics_publisher.proto\"\251\002\n\tAnalytics\022\017" + - "\n\007enabled\030\001 \001(\010\022O\n\023analytics_publisher\030\002" + - " \003(\01322.wso2.discovery.config.enforcer.An" + - "alyticsPublisher\0228\n\007service\030\003 \001(\0132\'.wso2" + - ".discovery.config.enforcer.Service\022M\n\npr" + - "operties\030\004 \003(\01329.wso2.discovery.config.e" + - "nforcer.Analytics.PropertiesEntry\0321\n\017Pro" + - "pertiesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + - ":\0028\001B\223\001\n/org.wso2.apk.enforcer.discovery" + - ".config.enforcerB\016AnalyticsProtoP\001ZNgith" + - "ub.com/envoyproxy/go-control-plane/wso2/" + - "discovery/config/enforcer;enforcerb\006prot" + - "o3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.config.enforcer.ServiceProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherProto.getDescriptor(), - }); - internal_static_wso2_discovery_config_enforcer_Analytics_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Analytics_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Analytics_descriptor, - new java.lang.String[] { "Enabled", "AnalyticsPublisher", "Service", "Properties", }); - internal_static_wso2_discovery_config_enforcer_Analytics_PropertiesEntry_descriptor = - internal_static_wso2_discovery_config_enforcer_Analytics_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Analytics_PropertiesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Analytics_PropertiesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - org.wso2.apk.enforcer.discovery.config.enforcer.ServiceProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisher.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisher.java deleted file mode 100644 index de7795fc2c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisher.java +++ /dev/null @@ -1,980 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/analytics_publisher.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - * Protobuf type {@code wso2.discovery.config.enforcer.AnalyticsPublisher} - */ -public final class AnalyticsPublisher extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.AnalyticsPublisher) - AnalyticsPublisherOrBuilder { -private static final long serialVersionUID = 0L; - // Use AnalyticsPublisher.newBuilder() to construct. - private AnalyticsPublisher(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AnalyticsPublisher() { - type_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AnalyticsPublisher(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AnalyticsPublisher( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - enabled_ = input.readBool(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - configProperties_ = com.google.protobuf.MapField.newMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - configProperties__ = input.readMessage( - ConfigPropertiesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - configProperties_.getMutableMap().put( - configProperties__.getKey(), configProperties__.getValue()); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherProto.internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherProto.internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.class, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int CONFIGPROPERTIES_FIELD_NUMBER = 2; - private static final class ConfigPropertiesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherProto.internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_ConfigPropertiesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> configProperties_; - private com.google.protobuf.MapField - internalGetConfigProperties() { - if (configProperties_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - return configProperties_; - } - - public int getConfigPropertiesCount() { - return internalGetConfigProperties().getMap().size(); - } - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - - @java.lang.Override - public boolean containsConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetConfigProperties().getMap().containsKey(key); - } - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getConfigProperties() { - return getConfigPropertiesMap(); - } - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - @java.lang.Override - - public java.util.Map getConfigPropertiesMap() { - return internalGetConfigProperties().getMap(); - } - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int TYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object type_; - /** - *
-   * Analytics type
-   * 
- * - * string type = 3; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - *
-   * Analytics type
-   * 
- * - * string type = 3; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (enabled_ != false) { - output.writeBool(1, enabled_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetConfigProperties(), - ConfigPropertiesDefaultEntryHolder.defaultEntry, - 2); - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enabled_); - } - for (java.util.Map.Entry entry - : internalGetConfigProperties().getMap().entrySet()) { - com.google.protobuf.MapEntry - configProperties__ = ConfigPropertiesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, configProperties__); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); - } - 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.AnalyticsPublisher)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher other = (org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher) obj; - - if (getEnabled() - != other.getEnabled()) return false; - if (!internalGetConfigProperties().equals( - other.internalGetConfigProperties())) return false; - if (!getType() - .equals(other.getType())) 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) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - if (!internalGetConfigProperties().getMap().isEmpty()) { - hash = (37 * hash) + CONFIGPROPERTIES_FIELD_NUMBER; - hash = (53 * hash) + internalGetConfigProperties().hashCode(); - } - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher 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.AnalyticsPublisher parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher 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.AnalyticsPublisher parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher 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.AnalyticsPublisher 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.AnalyticsPublisher 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.AnalyticsPublisher 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.AnalyticsPublisher 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.AnalyticsPublisher 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.AnalyticsPublisher 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.AnalyticsPublisher prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.config.enforcer.AnalyticsPublisher} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.AnalyticsPublisher) - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherProto.internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherProto.internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.class, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.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(); - enabled_ = false; - - internalGetMutableConfigProperties().clear(); - type_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisherProto.internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher build() { - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher result = new org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher(this); - int from_bitField0_ = bitField0_; - result.enabled_ = enabled_; - result.configProperties_ = internalGetConfigProperties(); - result.configProperties_.makeImmutable(); - result.type_ = type_; - 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.AnalyticsPublisher) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher.getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - internalGetMutableConfigProperties().mergeFrom( - other.internalGetConfigProperties()); - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private boolean enabled_ ; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 1; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * bool enabled = 1; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> configProperties_; - private com.google.protobuf.MapField - internalGetConfigProperties() { - if (configProperties_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - return configProperties_; - } - private com.google.protobuf.MapField - internalGetMutableConfigProperties() { - onChanged();; - if (configProperties_ == null) { - configProperties_ = com.google.protobuf.MapField.newMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - if (!configProperties_.isMutable()) { - configProperties_ = configProperties_.copy(); - } - return configProperties_; - } - - public int getConfigPropertiesCount() { - return internalGetConfigProperties().getMap().size(); - } - /** - *
-     * Analytics Publisher Configurations
-     * 
- * - * map<string, string> configProperties = 2; - */ - - @java.lang.Override - public boolean containsConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetConfigProperties().getMap().containsKey(key); - } - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getConfigProperties() { - return getConfigPropertiesMap(); - } - /** - *
-     * Analytics Publisher Configurations
-     * 
- * - * map<string, string> configProperties = 2; - */ - @java.lang.Override - - public java.util.Map getConfigPropertiesMap() { - return internalGetConfigProperties().getMap(); - } - /** - *
-     * Analytics Publisher Configurations
-     * 
- * - * map<string, string> configProperties = 2; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * Analytics Publisher Configurations
-     * 
- * - * map<string, string> configProperties = 2; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearConfigProperties() { - internalGetMutableConfigProperties().getMutableMap() - .clear(); - return this; - } - /** - *
-     * Analytics Publisher Configurations
-     * 
- * - * map<string, string> configProperties = 2; - */ - - public Builder removeConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableConfigProperties().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableConfigProperties() { - return internalGetMutableConfigProperties().getMutableMap(); - } - /** - *
-     * Analytics Publisher Configurations
-     * 
- * - * map<string, string> configProperties = 2; - */ - public Builder putConfigProperties( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableConfigProperties().getMutableMap() - .put(key, value); - return this; - } - /** - *
-     * Analytics Publisher Configurations
-     * 
- * - * map<string, string> configProperties = 2; - */ - - public Builder putAllConfigProperties( - java.util.Map values) { - internalGetMutableConfigProperties().getMutableMap() - .putAll(values); - return this; - } - - private java.lang.Object type_ = ""; - /** - *
-     * Analytics type
-     * 
- * - * string type = 3; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Analytics type
-     * 
- * - * string type = 3; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Analytics type
-     * 
- * - * string type = 3; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - *
-     * Analytics type
-     * 
- * - * string type = 3; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - *
-     * Analytics type
-     * 
- * - * string type = 3; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - @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.AnalyticsPublisher) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.AnalyticsPublisher) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsPublisher getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnalyticsPublisher parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyticsPublisher(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.AnalyticsPublisher getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisherOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisherOrBuilder.java deleted file mode 100644 index c0b60bc90a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisherOrBuilder.java +++ /dev/null @@ -1,89 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/analytics_publisher.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface AnalyticsPublisherOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.AnalyticsPublisher) - com.google.protobuf.MessageOrBuilder { - - /** - * bool enabled = 1; - * @return The enabled. - */ - boolean getEnabled(); - - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - int getConfigPropertiesCount(); - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - boolean containsConfigProperties( - java.lang.String key); - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getConfigProperties(); - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - java.util.Map - getConfigPropertiesMap(); - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - - java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - *
-   * Analytics Publisher Configurations
-   * 
- * - * map<string, string> configProperties = 2; - */ - - java.lang.String getConfigPropertiesOrThrow( - java.lang.String key); - - /** - *
-   * Analytics type
-   * 
- * - * string type = 3; - * @return The type. - */ - java.lang.String getType(); - /** - *
-   * Analytics type
-   * 
- * - * string type = 3; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisherProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisherProto.java deleted file mode 100644 index cb95e9049d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AnalyticsPublisherProto.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/analytics_publisher.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class AnalyticsPublisherProto { - private AnalyticsPublisherProto() {} - 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_AnalyticsPublisher_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_ConfigPropertiesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_ConfigPropertiesEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n8wso2/discovery/config/enforcer/analyti" + - "cs_publisher.proto\022\036wso2.discovery.confi" + - "g.enforcer\"\320\001\n\022AnalyticsPublisher\022\017\n\007ena" + - "bled\030\001 \001(\010\022b\n\020configProperties\030\002 \003(\0132H.w" + - "so2.discovery.config.enforcer.AnalyticsP" + - "ublisher.ConfigPropertiesEntry\022\014\n\004type\030\003" + - " \001(\t\0327\n\025ConfigPropertiesEntry\022\013\n\003key\030\001 \001" + - "(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\234\001\n/org.wso2.apk.e" + - "nforcer.discovery.config.enforcerB\027Analy" + - "ticsPublisherProtoP\001ZNgithub.com/envoypr" + - "oxy/go-control-plane/wso2/discovery/conf" + - "ig/enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_descriptor, - new java.lang.String[] { "Enabled", "ConfigProperties", "Type", }); - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_ConfigPropertiesEntry_descriptor = - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_ConfigPropertiesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_AnalyticsPublisher_ConfigPropertiesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeader.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeader.java deleted file mode 100644 index a5dd1cb1f5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeader.java +++ /dev/null @@ -1,812 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/auth_header.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Listener and client certificate store model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.AuthHeader} - */ -public final class AuthHeader extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.AuthHeader) - AuthHeaderOrBuilder { -private static final long serialVersionUID = 0L; - // Use AuthHeader.newBuilder() to construct. - private AuthHeader(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AuthHeader() { - authorizationHeader_ = ""; - testConsoleHeaderName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AuthHeader(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AuthHeader( - 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: { - - enableOutboundAuthHeader_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - authorizationHeader_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - testConsoleHeaderName_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeaderProto.internal_static_wso2_discovery_config_enforcer_AuthHeader_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeaderProto.internal_static_wso2_discovery_config_enforcer_AuthHeader_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader.class, org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader.Builder.class); - } - - public static final int ENABLEOUTBOUNDAUTHHEADER_FIELD_NUMBER = 1; - private boolean enableOutboundAuthHeader_; - /** - *
-   * Enable outbound auth header
-   * 
- * - * bool enableOutboundAuthHeader = 1; - * @return The enableOutboundAuthHeader. - */ - @java.lang.Override - public boolean getEnableOutboundAuthHeader() { - return enableOutboundAuthHeader_; - } - - public static final int AUTHORIZATIONHEADER_FIELD_NUMBER = 2; - private volatile java.lang.Object authorizationHeader_; - /** - *
-   * Auth header name
-   * 
- * - * string authorizationHeader = 2; - * @return The authorizationHeader. - */ - @java.lang.Override - public java.lang.String getAuthorizationHeader() { - java.lang.Object ref = authorizationHeader_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - authorizationHeader_ = s; - return s; - } - } - /** - *
-   * Auth header name
-   * 
- * - * string authorizationHeader = 2; - * @return The bytes for authorizationHeader. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAuthorizationHeaderBytes() { - java.lang.Object ref = authorizationHeader_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - authorizationHeader_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TESTCONSOLEHEADERNAME_FIELD_NUMBER = 3; - private volatile java.lang.Object testConsoleHeaderName_; - /** - * string testConsoleHeaderName = 3; - * @return The testConsoleHeaderName. - */ - @java.lang.Override - public java.lang.String getTestConsoleHeaderName() { - java.lang.Object ref = testConsoleHeaderName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - testConsoleHeaderName_ = s; - return s; - } - } - /** - * string testConsoleHeaderName = 3; - * @return The bytes for testConsoleHeaderName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTestConsoleHeaderNameBytes() { - java.lang.Object ref = testConsoleHeaderName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - testConsoleHeaderName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (enableOutboundAuthHeader_ != false) { - output.writeBool(1, enableOutboundAuthHeader_); - } - if (!getAuthorizationHeaderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, authorizationHeader_); - } - if (!getTestConsoleHeaderNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, testConsoleHeaderName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enableOutboundAuthHeader_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enableOutboundAuthHeader_); - } - if (!getAuthorizationHeaderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, authorizationHeader_); - } - if (!getTestConsoleHeaderNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, testConsoleHeaderName_); - } - 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.AuthHeader)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader other = (org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader) obj; - - if (getEnableOutboundAuthHeader() - != other.getEnableOutboundAuthHeader()) return false; - if (!getAuthorizationHeader() - .equals(other.getAuthorizationHeader())) return false; - if (!getTestConsoleHeaderName() - .equals(other.getTestConsoleHeaderName())) 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) + ENABLEOUTBOUNDAUTHHEADER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableOutboundAuthHeader()); - hash = (37 * hash) + AUTHORIZATIONHEADER_FIELD_NUMBER; - hash = (53 * hash) + getAuthorizationHeader().hashCode(); - hash = (37 * hash) + TESTCONSOLEHEADERNAME_FIELD_NUMBER; - hash = (53 * hash) + getTestConsoleHeaderName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader 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.AuthHeader parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader 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.AuthHeader parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader 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.AuthHeader 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.AuthHeader 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.AuthHeader 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.AuthHeader 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.AuthHeader 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.AuthHeader 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.AuthHeader 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; - } - /** - *
-   * Listener and client certificate store model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.AuthHeader} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.AuthHeader) - org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeaderOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeaderProto.internal_static_wso2_discovery_config_enforcer_AuthHeader_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeaderProto.internal_static_wso2_discovery_config_enforcer_AuthHeader_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader.class, org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader.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(); - enableOutboundAuthHeader_ = false; - - authorizationHeader_ = ""; - - testConsoleHeaderName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeaderProto.internal_static_wso2_discovery_config_enforcer_AuthHeader_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader build() { - org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader result = new org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader(this); - result.enableOutboundAuthHeader_ = enableOutboundAuthHeader_; - result.authorizationHeader_ = authorizationHeader_; - result.testConsoleHeaderName_ = testConsoleHeaderName_; - 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.AuthHeader) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader.getDefaultInstance()) return this; - if (other.getEnableOutboundAuthHeader() != false) { - setEnableOutboundAuthHeader(other.getEnableOutboundAuthHeader()); - } - if (!other.getAuthorizationHeader().isEmpty()) { - authorizationHeader_ = other.authorizationHeader_; - onChanged(); - } - if (!other.getTestConsoleHeaderName().isEmpty()) { - testConsoleHeaderName_ = other.testConsoleHeaderName_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enableOutboundAuthHeader_ ; - /** - *
-     * Enable outbound auth header
-     * 
- * - * bool enableOutboundAuthHeader = 1; - * @return The enableOutboundAuthHeader. - */ - @java.lang.Override - public boolean getEnableOutboundAuthHeader() { - return enableOutboundAuthHeader_; - } - /** - *
-     * Enable outbound auth header
-     * 
- * - * bool enableOutboundAuthHeader = 1; - * @param value The enableOutboundAuthHeader to set. - * @return This builder for chaining. - */ - public Builder setEnableOutboundAuthHeader(boolean value) { - - enableOutboundAuthHeader_ = value; - onChanged(); - return this; - } - /** - *
-     * Enable outbound auth header
-     * 
- * - * bool enableOutboundAuthHeader = 1; - * @return This builder for chaining. - */ - public Builder clearEnableOutboundAuthHeader() { - - enableOutboundAuthHeader_ = false; - onChanged(); - return this; - } - - private java.lang.Object authorizationHeader_ = ""; - /** - *
-     * Auth header name
-     * 
- * - * string authorizationHeader = 2; - * @return The authorizationHeader. - */ - public java.lang.String getAuthorizationHeader() { - java.lang.Object ref = authorizationHeader_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - authorizationHeader_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Auth header name
-     * 
- * - * string authorizationHeader = 2; - * @return The bytes for authorizationHeader. - */ - public com.google.protobuf.ByteString - getAuthorizationHeaderBytes() { - java.lang.Object ref = authorizationHeader_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - authorizationHeader_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Auth header name
-     * 
- * - * string authorizationHeader = 2; - * @param value The authorizationHeader to set. - * @return This builder for chaining. - */ - public Builder setAuthorizationHeader( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - authorizationHeader_ = value; - onChanged(); - return this; - } - /** - *
-     * Auth header name
-     * 
- * - * string authorizationHeader = 2; - * @return This builder for chaining. - */ - public Builder clearAuthorizationHeader() { - - authorizationHeader_ = getDefaultInstance().getAuthorizationHeader(); - onChanged(); - return this; - } - /** - *
-     * Auth header name
-     * 
- * - * string authorizationHeader = 2; - * @param value The bytes for authorizationHeader to set. - * @return This builder for chaining. - */ - public Builder setAuthorizationHeaderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - authorizationHeader_ = value; - onChanged(); - return this; - } - - private java.lang.Object testConsoleHeaderName_ = ""; - /** - * string testConsoleHeaderName = 3; - * @return The testConsoleHeaderName. - */ - public java.lang.String getTestConsoleHeaderName() { - java.lang.Object ref = testConsoleHeaderName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - testConsoleHeaderName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string testConsoleHeaderName = 3; - * @return The bytes for testConsoleHeaderName. - */ - public com.google.protobuf.ByteString - getTestConsoleHeaderNameBytes() { - java.lang.Object ref = testConsoleHeaderName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - testConsoleHeaderName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string testConsoleHeaderName = 3; - * @param value The testConsoleHeaderName to set. - * @return This builder for chaining. - */ - public Builder setTestConsoleHeaderName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - testConsoleHeaderName_ = value; - onChanged(); - return this; - } - /** - * string testConsoleHeaderName = 3; - * @return This builder for chaining. - */ - public Builder clearTestConsoleHeaderName() { - - testConsoleHeaderName_ = getDefaultInstance().getTestConsoleHeaderName(); - onChanged(); - return this; - } - /** - * string testConsoleHeaderName = 3; - * @param value The bytes for testConsoleHeaderName to set. - * @return This builder for chaining. - */ - public Builder setTestConsoleHeaderNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - testConsoleHeaderName_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.config.enforcer.AuthHeader) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.AuthHeader) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.AuthHeader getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AuthHeader parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AuthHeader(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.AuthHeader getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeaderOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeaderOrBuilder.java deleted file mode 100644 index 35a7f5992c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeaderOrBuilder.java +++ /dev/null @@ -1,51 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/auth_header.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface AuthHeaderOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.AuthHeader) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Enable outbound auth header
-   * 
- * - * bool enableOutboundAuthHeader = 1; - * @return The enableOutboundAuthHeader. - */ - boolean getEnableOutboundAuthHeader(); - - /** - *
-   * Auth header name
-   * 
- * - * string authorizationHeader = 2; - * @return The authorizationHeader. - */ - java.lang.String getAuthorizationHeader(); - /** - *
-   * Auth header name
-   * 
- * - * string authorizationHeader = 2; - * @return The bytes for authorizationHeader. - */ - com.google.protobuf.ByteString - getAuthorizationHeaderBytes(); - - /** - * string testConsoleHeaderName = 3; - * @return The testConsoleHeaderName. - */ - java.lang.String getTestConsoleHeaderName(); - /** - * string testConsoleHeaderName = 3; - * @return The bytes for testConsoleHeaderName. - */ - com.google.protobuf.ByteString - getTestConsoleHeaderNameBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeaderProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeaderProto.java deleted file mode 100644 index 1f9fa43988..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/AuthHeaderProto.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/auth_header.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class AuthHeaderProto { - private AuthHeaderProto() {} - 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_AuthHeader_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_AuthHeader_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/auth_he" + - "ader.proto\022\036wso2.discovery.config.enforc" + - "er\"j\n\nAuthHeader\022 \n\030enableOutboundAuthHe" + - "ader\030\001 \001(\010\022\033\n\023authorizationHeader\030\002 \001(\t\022" + - "\035\n\025testConsoleHeaderName\030\003 \001(\tB\224\001\n/org.w" + - "so2.apk.enforcer.discovery.config.enforc" + - "erB\017AuthHeaderProtoP\001ZNgithub.com/envoyp" + - "roxy/go-control-plane/wso2/discovery/con" + - "fig/enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_AuthHeader_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_AuthHeader_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_AuthHeader_descriptor, - new java.lang.String[] { "EnableOutboundAuthHeader", "AuthorizationHeader", "TestConsoleHeaderName", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Cache.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Cache.java deleted file mode 100644 index f3b9021bb0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Cache.java +++ /dev/null @@ -1,620 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/cache.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * JWT Generator model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Cache} - */ -public final class Cache extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Cache) - CacheOrBuilder { -private static final long serialVersionUID = 0L; - // Use Cache.newBuilder() to construct. - private Cache(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Cache() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Cache(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Cache( - 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; - } - case 16: { - - maximumSize_ = input.readInt32(); - break; - } - case 24: { - - expiryTime_ = input.readSInt32(); - 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.CacheProto.internal_static_wso2_discovery_config_enforcer_Cache_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CacheProto.internal_static_wso2_discovery_config_enforcer_Cache_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Cache.class, org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder.class); - } - - public static final int ENABLE_FIELD_NUMBER = 1; - private boolean enable_; - /** - * bool enable = 1; - * @return The enable. - */ - @java.lang.Override - public boolean getEnable() { - return enable_; - } - - public static final int MAXIMUMSIZE_FIELD_NUMBER = 2; - private int maximumSize_; - /** - * int32 maximumSize = 2; - * @return The maximumSize. - */ - @java.lang.Override - public int getMaximumSize() { - return maximumSize_; - } - - public static final int EXPIRYTIME_FIELD_NUMBER = 3; - private int expiryTime_; - /** - * sint32 expiryTime = 3; - * @return The expiryTime. - */ - @java.lang.Override - public int getExpiryTime() { - return expiryTime_; - } - - 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_); - } - if (maximumSize_ != 0) { - output.writeInt32(2, maximumSize_); - } - if (expiryTime_ != 0) { - output.writeSInt32(3, expiryTime_); - } - 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_); - } - if (maximumSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, maximumSize_); - } - if (expiryTime_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeSInt32Size(3, expiryTime_); - } - 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.Cache)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Cache other = (org.wso2.apk.enforcer.discovery.config.enforcer.Cache) obj; - - if (getEnable() - != other.getEnable()) return false; - if (getMaximumSize() - != other.getMaximumSize()) return false; - if (getExpiryTime() - != other.getExpiryTime()) 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 = (37 * hash) + MAXIMUMSIZE_FIELD_NUMBER; - hash = (53 * hash) + getMaximumSize(); - hash = (37 * hash) + EXPIRYTIME_FIELD_NUMBER; - hash = (53 * hash) + getExpiryTime(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Cache parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Cache 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.Cache parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Cache 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.Cache parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Cache 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.Cache 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.Cache 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.Cache 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.Cache 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.Cache 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.Cache 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.Cache 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; - } - /** - *
-   * JWT Generator model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Cache} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Cache) - org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CacheProto.internal_static_wso2_discovery_config_enforcer_Cache_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CacheProto.internal_static_wso2_discovery_config_enforcer_Cache_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Cache.class, org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Cache.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; - - maximumSize_ = 0; - - expiryTime_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CacheProto.internal_static_wso2_discovery_config_enforcer_Cache_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Cache getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Cache.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Cache build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Cache result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Cache buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Cache result = new org.wso2.apk.enforcer.discovery.config.enforcer.Cache(this); - result.enable_ = enable_; - result.maximumSize_ = maximumSize_; - result.expiryTime_ = expiryTime_; - 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.Cache) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Cache)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Cache other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Cache.getDefaultInstance()) return this; - if (other.getEnable() != false) { - setEnable(other.getEnable()); - } - if (other.getMaximumSize() != 0) { - setMaximumSize(other.getMaximumSize()); - } - if (other.getExpiryTime() != 0) { - setExpiryTime(other.getExpiryTime()); - } - 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.Cache parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Cache) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enable_ ; - /** - * bool enable = 1; - * @return The enable. - */ - @java.lang.Override - public boolean getEnable() { - return enable_; - } - /** - * bool enable = 1; - * @param value The enable to set. - * @return This builder for chaining. - */ - public Builder setEnable(boolean value) { - - enable_ = value; - onChanged(); - return this; - } - /** - * bool enable = 1; - * @return This builder for chaining. - */ - public Builder clearEnable() { - - enable_ = false; - onChanged(); - return this; - } - - private int maximumSize_ ; - /** - * int32 maximumSize = 2; - * @return The maximumSize. - */ - @java.lang.Override - public int getMaximumSize() { - return maximumSize_; - } - /** - * int32 maximumSize = 2; - * @param value The maximumSize to set. - * @return This builder for chaining. - */ - public Builder setMaximumSize(int value) { - - maximumSize_ = value; - onChanged(); - return this; - } - /** - * int32 maximumSize = 2; - * @return This builder for chaining. - */ - public Builder clearMaximumSize() { - - maximumSize_ = 0; - onChanged(); - return this; - } - - private int expiryTime_ ; - /** - * sint32 expiryTime = 3; - * @return The expiryTime. - */ - @java.lang.Override - public int getExpiryTime() { - return expiryTime_; - } - /** - * sint32 expiryTime = 3; - * @param value The expiryTime to set. - * @return This builder for chaining. - */ - public Builder setExpiryTime(int value) { - - expiryTime_ = value; - onChanged(); - return this; - } - /** - * sint32 expiryTime = 3; - * @return This builder for chaining. - */ - public Builder clearExpiryTime() { - - expiryTime_ = 0; - 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.Cache) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Cache) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Cache DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Cache(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Cache getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Cache parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Cache(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.Cache getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CacheOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CacheOrBuilder.java deleted file mode 100644 index f9f319381e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CacheOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/cache.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface CacheOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Cache) - com.google.protobuf.MessageOrBuilder { - - /** - * bool enable = 1; - * @return The enable. - */ - boolean getEnable(); - - /** - * int32 maximumSize = 2; - * @return The maximumSize. - */ - int getMaximumSize(); - - /** - * sint32 expiryTime = 3; - * @return The expiryTime. - */ - int getExpiryTime(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CacheProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CacheProto.java deleted file mode 100644 index 9bbc752161..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CacheProto.java +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/cache.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class CacheProto { - private CacheProto() {} - 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_Cache_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Cache_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n*wso2/discovery/config/enforcer/cache.p" + - "roto\022\036wso2.discovery.config.enforcer\"@\n\005" + - "Cache\022\016\n\006enable\030\001 \001(\010\022\023\n\013maximumSize\030\002 \001" + - "(\005\022\022\n\nexpiryTime\030\003 \001(\021B\217\001\n/org.wso2.apk." + - "enforcer.discovery.config.enforcerB\nCach" + - "eProtoP\001ZNgithub.com/envoyproxy/go-contr" + - "ol-plane/wso2/discovery/config/enforcer;" + - "enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_Cache_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Cache_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Cache_descriptor, - new java.lang.String[] { "Enable", "MaximumSize", "ExpiryTime", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStore.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStore.java deleted file mode 100644 index 36534951cd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStore.java +++ /dev/null @@ -1,932 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/cert.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Listener and client certificate store model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.CertStore} - */ -public final class CertStore extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.CertStore) - CertStoreOrBuilder { -private static final long serialVersionUID = 0L; - // Use CertStore.newBuilder() to construct. - private CertStore(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CertStore() { - location_ = ""; - type_ = ""; - password_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CertStore(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CertStore( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - location_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - password_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreProto.internal_static_wso2_discovery_config_enforcer_CertStore_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreProto.internal_static_wso2_discovery_config_enforcer_CertStore_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.class, org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder.class); - } - - public static final int LOCATION_FIELD_NUMBER = 1; - private volatile java.lang.Object location_; - /** - *
-   * Path to the certificate store. Ex: keystore jks
-   * 
- * - * string location = 1; - * @return The location. - */ - @java.lang.Override - public java.lang.String getLocation() { - java.lang.Object ref = location_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - location_ = s; - return s; - } - } - /** - *
-   * Path to the certificate store. Ex: keystore jks
-   * 
- * - * string location = 1; - * @return The bytes for location. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLocationBytes() { - java.lang.Object ref = location_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - location_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object type_; - /** - *
-   * Certificate store type
-   * Ex: jks
-   * 
- * - * string type = 2; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - *
-   * Certificate store type
-   * Ex: jks
-   * 
- * - * string type = 2; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PASSWORD_FIELD_NUMBER = 3; - private volatile java.lang.Object password_; - /** - *
-   * Certificate store password
-   * 
- * - * string password = 3; - * @return The password. - */ - @java.lang.Override - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } - } - /** - *
-   * Certificate store password
-   * 
- * - * string password = 3; - * @return The bytes for password. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getLocationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); - } - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - if (!getPasswordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, password_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getLocationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - if (!getPasswordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, password_); - } - 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.CertStore)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore other = (org.wso2.apk.enforcer.discovery.config.enforcer.CertStore) obj; - - if (!getLocation() - .equals(other.getLocation())) return false; - if (!getType() - .equals(other.getType())) return false; - if (!getPassword() - .equals(other.getPassword())) 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) + LOCATION_FIELD_NUMBER; - hash = (53 * hash) + getLocation().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + PASSWORD_FIELD_NUMBER; - hash = (53 * hash) + getPassword().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.CertStore parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.CertStore 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.CertStore parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.CertStore 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.CertStore parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.CertStore 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.CertStore 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.CertStore 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.CertStore 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.CertStore 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.CertStore 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.CertStore 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.CertStore 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; - } - /** - *
-   * Listener and client certificate store model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.CertStore} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.CertStore) - org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreProto.internal_static_wso2_discovery_config_enforcer_CertStore_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreProto.internal_static_wso2_discovery_config_enforcer_CertStore_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.class, org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.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(); - location_ = ""; - - type_ = ""; - - password_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreProto.internal_static_wso2_discovery_config_enforcer_CertStore_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore build() { - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore result = new org.wso2.apk.enforcer.discovery.config.enforcer.CertStore(this); - result.location_ = location_; - result.type_ = type_; - result.password_ = password_; - 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.CertStore) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.CertStore)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.CertStore other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.getDefaultInstance()) return this; - if (!other.getLocation().isEmpty()) { - location_ = other.location_; - onChanged(); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (!other.getPassword().isEmpty()) { - password_ = other.password_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.CertStore) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object location_ = ""; - /** - *
-     * Path to the certificate store. Ex: keystore jks
-     * 
- * - * string location = 1; - * @return The location. - */ - public java.lang.String getLocation() { - java.lang.Object ref = location_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - location_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Path to the certificate store. Ex: keystore jks
-     * 
- * - * string location = 1; - * @return The bytes for location. - */ - public com.google.protobuf.ByteString - getLocationBytes() { - java.lang.Object ref = location_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - location_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Path to the certificate store. Ex: keystore jks
-     * 
- * - * string location = 1; - * @param value The location to set. - * @return This builder for chaining. - */ - public Builder setLocation( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - location_ = value; - onChanged(); - return this; - } - /** - *
-     * Path to the certificate store. Ex: keystore jks
-     * 
- * - * string location = 1; - * @return This builder for chaining. - */ - public Builder clearLocation() { - - location_ = getDefaultInstance().getLocation(); - onChanged(); - return this; - } - /** - *
-     * Path to the certificate store. Ex: keystore jks
-     * 
- * - * string location = 1; - * @param value The bytes for location to set. - * @return This builder for chaining. - */ - public Builder setLocationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - location_ = value; - onChanged(); - return this; - } - - private java.lang.Object type_ = ""; - /** - *
-     * Certificate store type
-     * Ex: jks
-     * 
- * - * string type = 2; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Certificate store type
-     * Ex: jks
-     * 
- * - * string type = 2; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Certificate store type
-     * Ex: jks
-     * 
- * - * string type = 2; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - *
-     * Certificate store type
-     * Ex: jks
-     * 
- * - * string type = 2; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - *
-     * Certificate store type
-     * Ex: jks
-     * 
- * - * string type = 2; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private java.lang.Object password_ = ""; - /** - *
-     * Certificate store password
-     * 
- * - * string password = 3; - * @return The password. - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Certificate store password
-     * 
- * - * string password = 3; - * @return The bytes for password. - */ - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Certificate store password
-     * 
- * - * string password = 3; - * @param value The password to set. - * @return This builder for chaining. - */ - public Builder setPassword( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - password_ = value; - onChanged(); - return this; - } - /** - *
-     * Certificate store password
-     * 
- * - * string password = 3; - * @return This builder for chaining. - */ - public Builder clearPassword() { - - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - /** - *
-     * Certificate store password
-     * 
- * - * string password = 3; - * @param value The bytes for password to set. - * @return This builder for chaining. - */ - public Builder setPasswordBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - password_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.config.enforcer.CertStore) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.CertStore) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.CertStore DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.CertStore(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.CertStore getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CertStore parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CertStore(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.CertStore getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStoreOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStoreOrBuilder.java deleted file mode 100644 index c00d0c4e90..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStoreOrBuilder.java +++ /dev/null @@ -1,71 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/cert.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface CertStoreOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.CertStore) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Path to the certificate store. Ex: keystore jks
-   * 
- * - * string location = 1; - * @return The location. - */ - java.lang.String getLocation(); - /** - *
-   * Path to the certificate store. Ex: keystore jks
-   * 
- * - * string location = 1; - * @return The bytes for location. - */ - com.google.protobuf.ByteString - getLocationBytes(); - - /** - *
-   * Certificate store type
-   * Ex: jks
-   * 
- * - * string type = 2; - * @return The type. - */ - java.lang.String getType(); - /** - *
-   * Certificate store type
-   * Ex: jks
-   * 
- * - * string type = 2; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - *
-   * Certificate store password
-   * 
- * - * string password = 3; - * @return The password. - */ - java.lang.String getPassword(); - /** - *
-   * Certificate store password
-   * 
- * - * string password = 3; - * @return The bytes for password. - */ - com.google.protobuf.ByteString - getPasswordBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStoreProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStoreProto.java deleted file mode 100644 index 47b16b25da..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/CertStoreProto.java +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/cert.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class CertStoreProto { - private CertStoreProto() {} - 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_CertStore_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_CertStore_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n)wso2/discovery/config/enforcer/cert.pr" + - "oto\022\036wso2.discovery.config.enforcer\"=\n\tC" + - "ertStore\022\020\n\010location\030\001 \001(\t\022\014\n\004type\030\002 \001(\t" + - "\022\020\n\010password\030\003 \001(\tB\223\001\n/org.wso2.apk.enfo" + - "rcer.discovery.config.enforcerB\016CertStor" + - "eProtoP\001ZNgithub.com/envoyproxy/go-contr" + - "ol-plane/wso2/discovery/config/enforcer;" + - "enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_CertStore_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_CertStore_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_CertStore_descriptor, - new java.lang.String[] { "Location", "Type", "Password", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMapping.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMapping.java deleted file mode 100644 index 1ced623159..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMapping.java +++ /dev/null @@ -1,759 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/claim_mapping.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Claim mapping model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.ClaimMapping} - */ -public final class ClaimMapping extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.ClaimMapping) - ClaimMappingOrBuilder { -private static final long serialVersionUID = 0L; - // Use ClaimMapping.newBuilder() to construct. - private ClaimMapping(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ClaimMapping() { - remoteClaim_ = ""; - localClaim_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ClaimMapping(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ClaimMapping( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - remoteClaim_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - localClaim_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingProto.internal_static_wso2_discovery_config_enforcer_ClaimMapping_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingProto.internal_static_wso2_discovery_config_enforcer_ClaimMapping_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.class, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder.class); - } - - public static final int REMOTECLAIM_FIELD_NUMBER = 1; - private volatile java.lang.Object remoteClaim_; - /** - *
-   * Remote claim
-   * 
- * - * string remoteClaim = 1; - * @return The remoteClaim. - */ - @java.lang.Override - public java.lang.String getRemoteClaim() { - java.lang.Object ref = remoteClaim_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - remoteClaim_ = s; - return s; - } - } - /** - *
-   * Remote claim
-   * 
- * - * string remoteClaim = 1; - * @return The bytes for remoteClaim. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRemoteClaimBytes() { - java.lang.Object ref = remoteClaim_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - remoteClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LOCALCLAIM_FIELD_NUMBER = 2; - private volatile java.lang.Object localClaim_; - /** - *
-   * Local claim
-   * 
- * - * string localClaim = 2; - * @return The localClaim. - */ - @java.lang.Override - public java.lang.String getLocalClaim() { - java.lang.Object ref = localClaim_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - localClaim_ = s; - return s; - } - } - /** - *
-   * Local claim
-   * 
- * - * string localClaim = 2; - * @return The bytes for localClaim. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLocalClaimBytes() { - java.lang.Object ref = localClaim_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - localClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getRemoteClaimBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, remoteClaim_); - } - if (!getLocalClaimBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, localClaim_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getRemoteClaimBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, remoteClaim_); - } - if (!getLocalClaimBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, localClaim_); - } - 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.ClaimMapping)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping other = (org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping) obj; - - if (!getRemoteClaim() - .equals(other.getRemoteClaim())) return false; - if (!getLocalClaim() - .equals(other.getLocalClaim())) 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) + REMOTECLAIM_FIELD_NUMBER; - hash = (53 * hash) + getRemoteClaim().hashCode(); - hash = (37 * hash) + LOCALCLAIM_FIELD_NUMBER; - hash = (53 * hash) + getLocalClaim().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping 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.ClaimMapping parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping 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.ClaimMapping parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping 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.ClaimMapping 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.ClaimMapping 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.ClaimMapping 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.ClaimMapping 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.ClaimMapping 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.ClaimMapping 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.ClaimMapping 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; - } - /** - *
-   * Claim mapping model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.ClaimMapping} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.ClaimMapping) - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingProto.internal_static_wso2_discovery_config_enforcer_ClaimMapping_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingProto.internal_static_wso2_discovery_config_enforcer_ClaimMapping_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.class, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.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(); - remoteClaim_ = ""; - - localClaim_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingProto.internal_static_wso2_discovery_config_enforcer_ClaimMapping_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping build() { - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping result = new org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping(this); - result.remoteClaim_ = remoteClaim_; - result.localClaim_ = localClaim_; - 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.ClaimMapping) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.getDefaultInstance()) return this; - if (!other.getRemoteClaim().isEmpty()) { - remoteClaim_ = other.remoteClaim_; - onChanged(); - } - if (!other.getLocalClaim().isEmpty()) { - localClaim_ = other.localClaim_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object remoteClaim_ = ""; - /** - *
-     * Remote claim
-     * 
- * - * string remoteClaim = 1; - * @return The remoteClaim. - */ - public java.lang.String getRemoteClaim() { - java.lang.Object ref = remoteClaim_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - remoteClaim_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Remote claim
-     * 
- * - * string remoteClaim = 1; - * @return The bytes for remoteClaim. - */ - public com.google.protobuf.ByteString - getRemoteClaimBytes() { - java.lang.Object ref = remoteClaim_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - remoteClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Remote claim
-     * 
- * - * string remoteClaim = 1; - * @param value The remoteClaim to set. - * @return This builder for chaining. - */ - public Builder setRemoteClaim( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - remoteClaim_ = value; - onChanged(); - return this; - } - /** - *
-     * Remote claim
-     * 
- * - * string remoteClaim = 1; - * @return This builder for chaining. - */ - public Builder clearRemoteClaim() { - - remoteClaim_ = getDefaultInstance().getRemoteClaim(); - onChanged(); - return this; - } - /** - *
-     * Remote claim
-     * 
- * - * string remoteClaim = 1; - * @param value The bytes for remoteClaim to set. - * @return This builder for chaining. - */ - public Builder setRemoteClaimBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - remoteClaim_ = value; - onChanged(); - return this; - } - - private java.lang.Object localClaim_ = ""; - /** - *
-     * Local claim
-     * 
- * - * string localClaim = 2; - * @return The localClaim. - */ - public java.lang.String getLocalClaim() { - java.lang.Object ref = localClaim_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - localClaim_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Local claim
-     * 
- * - * string localClaim = 2; - * @return The bytes for localClaim. - */ - public com.google.protobuf.ByteString - getLocalClaimBytes() { - java.lang.Object ref = localClaim_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - localClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Local claim
-     * 
- * - * string localClaim = 2; - * @param value The localClaim to set. - * @return This builder for chaining. - */ - public Builder setLocalClaim( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - localClaim_ = value; - onChanged(); - return this; - } - /** - *
-     * Local claim
-     * 
- * - * string localClaim = 2; - * @return This builder for chaining. - */ - public Builder clearLocalClaim() { - - localClaim_ = getDefaultInstance().getLocalClaim(); - onChanged(); - return this; - } - /** - *
-     * Local claim
-     * 
- * - * string localClaim = 2; - * @param value The bytes for localClaim to set. - * @return This builder for chaining. - */ - public Builder setLocalClaimBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - localClaim_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.config.enforcer.ClaimMapping) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.ClaimMapping) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClaimMapping parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClaimMapping(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.ClaimMapping getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMappingOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMappingOrBuilder.java deleted file mode 100644 index 335e0692ec..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMappingOrBuilder.java +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/claim_mapping.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface ClaimMappingOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.ClaimMapping) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Remote claim
-   * 
- * - * string remoteClaim = 1; - * @return The remoteClaim. - */ - java.lang.String getRemoteClaim(); - /** - *
-   * Remote claim
-   * 
- * - * string remoteClaim = 1; - * @return The bytes for remoteClaim. - */ - com.google.protobuf.ByteString - getRemoteClaimBytes(); - - /** - *
-   * Local claim
-   * 
- * - * string localClaim = 2; - * @return The localClaim. - */ - java.lang.String getLocalClaim(); - /** - *
-   * Local claim
-   * 
- * - * string localClaim = 2; - * @return The bytes for localClaim. - */ - com.google.protobuf.ByteString - getLocalClaimBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMappingProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMappingProto.java deleted file mode 100644 index 4c97e1d11e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ClaimMappingProto.java +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/claim_mapping.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class ClaimMappingProto { - private ClaimMappingProto() {} - 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_ClaimMapping_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_ClaimMapping_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n2wso2/discovery/config/enforcer/claim_m" + - "apping.proto\022\036wso2.discovery.config.enfo" + - "rcer\"7\n\014ClaimMapping\022\023\n\013remoteClaim\030\001 \001(" + - "\t\022\022\n\nlocalClaim\030\002 \001(\tB\226\001\n/org.wso2.apk.e" + - "nforcer.discovery.config.enforcerB\021Claim" + - "MappingProtoP\001ZNgithub.com/envoyproxy/go" + - "-control-plane/wso2/discovery/config/enf" + - "orcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_ClaimMapping_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_ClaimMapping_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_ClaimMapping_descriptor, - new java.lang.String[] { "RemoteClaim", "LocalClaim", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} 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 deleted file mode 100644 index 3a427d967a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Config.java +++ /dev/null @@ -1,3229 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/config.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Enforcer config model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Config} - */ -public final class Config extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Config) - ConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use Config.newBuilder() to construct. - private Config(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Config() { - filters_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Config(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Config( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - org.wso2.apk.enforcer.discovery.config.enforcer.Security.Builder subBuilder = null; - if (security_ != null) { - subBuilder = security_.toBuilder(); - } - security_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Security.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(security_); - security_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder subBuilder = null; - if (keystore_ != null) { - subBuilder = keystore_.toBuilder(); - } - keystore_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(keystore_); - keystore_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder subBuilder = null; - if (truststore_ != null) { - subBuilder = truststore_.toBuilder(); - } - truststore_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(truststore_); - truststore_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder subBuilder = null; - if (authService_ != null) { - subBuilder = authService_.toBuilder(); - } - authService_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Service.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(authService_); - authService_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.Builder subBuilder = null; - if (jwtGenerator_ != null) { - subBuilder = jwtGenerator_.toBuilder(); - } - jwtGenerator_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(jwtGenerator_); - jwtGenerator_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder subBuilder = null; - if (cache_ != null) { - subBuilder = cache_.toBuilder(); - } - cache_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Cache.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(cache_); - cache_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder subBuilder = null; - if (analytics_ != null) { - subBuilder = analytics_.toBuilder(); - } - analytics_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(analytics_); - analytics_ = subBuilder.buildPartial(); - } - - break; - } - case 66: { - org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder subBuilder = null; - if (management_ != null) { - subBuilder = management_.toBuilder(); - } - management_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Management.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(management_); - management_ = subBuilder.buildPartial(); - } - - break; - } - case 74: { - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder subBuilder = null; - if (tracing_ != null) { - subBuilder = tracing_.toBuilder(); - } - tracing_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tracing_); - tracing_ = subBuilder.buildPartial(); - } - - break; - } - case 82: { - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder subBuilder = null; - if (metrics_ != null) { - subBuilder = metrics_.toBuilder(); - } - metrics_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metrics_); - metrics_ = subBuilder.buildPartial(); - } - - break; - } - case 90: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - filters_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - filters_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Filter.parser(), extensionRegistry)); - break; - } - case 98: { - org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder subBuilder = null; - if (soap_ != null) { - subBuilder = soap_.toBuilder(); - } - soap_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Soap.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(soap_); - soap_ = subBuilder.buildPartial(); - } - - break; - } - case 104: { - - mandateSubscriptionValidation_ = input.readBool(); - break; - } - case 114: { - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.Builder subBuilder = null; - if (httpClient_ != null) { - subBuilder = httpClient_.toBuilder(); - } - httpClient_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(httpClient_); - httpClient_ = subBuilder.buildPartial(); - } - - break; - } - case 120: { - - mandateInternalKeyValidation_ = input.readBool(); - break; - } - case 128: { - - enableGatewayClassController_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - filters_ = java.util.Collections.unmodifiableList(filters_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ConfigProto.internal_static_wso2_discovery_config_enforcer_Config_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ConfigProto.internal_static_wso2_discovery_config_enforcer_Config_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Config.class, org.wso2.apk.enforcer.discovery.config.enforcer.Config.Builder.class); - } - - public static final int SECURITY_FIELD_NUMBER = 1; - private org.wso2.apk.enforcer.discovery.config.enforcer.Security security_; - /** - * .wso2.discovery.config.enforcer.Security security = 1; - * @return Whether the security field is set. - */ - @java.lang.Override - public boolean hasSecurity() { - return security_ != null; - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - * @return The security. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Security getSecurity() { - return security_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Security.getDefaultInstance() : security_; - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.SecurityOrBuilder getSecurityOrBuilder() { - return getSecurity(); - } - - public static final int KEYSTORE_FIELD_NUMBER = 2; - private org.wso2.apk.enforcer.discovery.config.enforcer.CertStore keystore_; - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - * @return Whether the keystore field is set. - */ - @java.lang.Override - public boolean hasKeystore() { - return keystore_ != null; - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - * @return The keystore. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore getKeystore() { - return keystore_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.getDefaultInstance() : keystore_; - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder getKeystoreOrBuilder() { - return getKeystore(); - } - - public static final int TRUSTSTORE_FIELD_NUMBER = 3; - private org.wso2.apk.enforcer.discovery.config.enforcer.CertStore truststore_; - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - * @return Whether the truststore field is set. - */ - @java.lang.Override - public boolean hasTruststore() { - return truststore_ != null; - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - * @return The truststore. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore getTruststore() { - return truststore_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.getDefaultInstance() : truststore_; - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder getTruststoreOrBuilder() { - return getTruststore(); - } - - public static final int AUTHSERVICE_FIELD_NUMBER = 4; - private org.wso2.apk.enforcer.discovery.config.enforcer.Service authService_; - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - * @return Whether the authService field is set. - */ - @java.lang.Override - public boolean hasAuthService() { - return authService_ != null; - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - * @return The authService. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Service getAuthService() { - return authService_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Service.getDefaultInstance() : authService_; - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder getAuthServiceOrBuilder() { - return getAuthService(); - } - - public static final int JWTGENERATOR_FIELD_NUMBER = 5; - private org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator jwtGenerator_; - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - * @return Whether the jwtGenerator field is set. - */ - @java.lang.Override - public boolean hasJwtGenerator() { - return jwtGenerator_ != null; - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - * @return The jwtGenerator. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator getJwtGenerator() { - return jwtGenerator_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.getDefaultInstance() : jwtGenerator_; - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder getJwtGeneratorOrBuilder() { - return getJwtGenerator(); - } - - public static final int CACHE_FIELD_NUMBER = 6; - private org.wso2.apk.enforcer.discovery.config.enforcer.Cache cache_; - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - * @return Whether the cache field is set. - */ - @java.lang.Override - public boolean hasCache() { - return cache_ != null; - } - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - * @return The cache. - */ - @java.lang.Override - 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 = 6; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder getCacheOrBuilder() { - return getCache(); - } - - public static final int ANALYTICS_FIELD_NUMBER = 7; - private org.wso2.apk.enforcer.discovery.config.enforcer.Analytics analytics_; - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - * @return Whether the analytics field is set. - */ - @java.lang.Override - public boolean hasAnalytics() { - return analytics_ != null; - } - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - * @return The analytics. - */ - @java.lang.Override - 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 = 7; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder getAnalyticsOrBuilder() { - return getAnalytics(); - } - - public static final int MANAGEMENT_FIELD_NUMBER = 8; - private org.wso2.apk.enforcer.discovery.config.enforcer.Management management_; - /** - * .wso2.discovery.config.enforcer.Management management = 8; - * @return Whether the management field is set. - */ - @java.lang.Override - public boolean hasManagement() { - return management_ != null; - } - /** - * .wso2.discovery.config.enforcer.Management management = 8; - * @return The management. - */ - @java.lang.Override - 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 = 8; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder getManagementOrBuilder() { - return getManagement(); - } - - public static final int TRACING_FIELD_NUMBER = 9; - private org.wso2.apk.enforcer.discovery.config.enforcer.Tracing tracing_; - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - * @return Whether the tracing field is set. - */ - @java.lang.Override - public boolean hasTracing() { - return tracing_ != null; - } - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - * @return The tracing. - */ - @java.lang.Override - 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 = 9; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder getTracingOrBuilder() { - return getTracing(); - } - - public static final int METRICS_FIELD_NUMBER = 10; - private org.wso2.apk.enforcer.discovery.config.enforcer.Metrics metrics_; - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - * @return Whether the metrics field is set. - */ - @java.lang.Override - public boolean hasMetrics() { - return metrics_ != null; - } - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - * @return The metrics. - */ - @java.lang.Override - 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 = 10; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder getMetricsOrBuilder() { - return getMetrics(); - } - - public static final int FILTERS_FIELD_NUMBER = 11; - private java.util.List filters_; - /** - * 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 = 11; - */ - @java.lang.Override - public java.util.List - getFiltersOrBuilderList() { - return filters_; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - @java.lang.Override - public int getFiltersCount() { - return filters_.size(); - } - /** - * 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 = 11; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder getFiltersOrBuilder( - int index) { - return filters_.get(index); - } - - public static final int SOAP_FIELD_NUMBER = 12; - private org.wso2.apk.enforcer.discovery.config.enforcer.Soap soap_; - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - * @return Whether the soap field is set. - */ - @java.lang.Override - public boolean hasSoap() { - return soap_ != null; - } - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - * @return The soap. - */ - @java.lang.Override - 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 = 12; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder getSoapOrBuilder() { - return getSoap(); - } - - public static final int MANDATESUBSCRIPTIONVALIDATION_FIELD_NUMBER = 13; - private boolean mandateSubscriptionValidation_; - /** - * bool mandateSubscriptionValidation = 13; - * @return The mandateSubscriptionValidation. - */ - @java.lang.Override - public boolean getMandateSubscriptionValidation() { - return mandateSubscriptionValidation_; - } - - public static final int HTTPCLIENT_FIELD_NUMBER = 14; - private org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient httpClient_; - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - * @return Whether the httpClient field is set. - */ - @java.lang.Override - public boolean hasHttpClient() { - return httpClient_ != null; - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - * @return The httpClient. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient getHttpClient() { - return httpClient_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.getDefaultInstance() : httpClient_; - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientOrBuilder getHttpClientOrBuilder() { - return getHttpClient(); - } - - public static final int MANDATEINTERNALKEYVALIDATION_FIELD_NUMBER = 15; - private boolean mandateInternalKeyValidation_; - /** - * bool mandateInternalKeyValidation = 15; - * @return The mandateInternalKeyValidation. - */ - @java.lang.Override - public boolean getMandateInternalKeyValidation() { - return mandateInternalKeyValidation_; - } - - public static final int ENABLEGATEWAYCLASSCONTROLLER_FIELD_NUMBER = 16; - private boolean enableGatewayClassController_; - /** - * bool enableGatewayClassController = 16; - * @return The enableGatewayClassController. - */ - @java.lang.Override - public boolean getEnableGatewayClassController() { - return enableGatewayClassController_; - } - - 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 (security_ != null) { - output.writeMessage(1, getSecurity()); - } - if (keystore_ != null) { - output.writeMessage(2, getKeystore()); - } - if (truststore_ != null) { - output.writeMessage(3, getTruststore()); - } - if (authService_ != null) { - output.writeMessage(4, getAuthService()); - } - if (jwtGenerator_ != null) { - output.writeMessage(5, getJwtGenerator()); - } - if (cache_ != null) { - output.writeMessage(6, getCache()); - } - if (analytics_ != null) { - output.writeMessage(7, getAnalytics()); - } - if (management_ != null) { - output.writeMessage(8, getManagement()); - } - if (tracing_ != null) { - output.writeMessage(9, getTracing()); - } - if (metrics_ != null) { - output.writeMessage(10, getMetrics()); - } - for (int i = 0; i < filters_.size(); i++) { - output.writeMessage(11, filters_.get(i)); - } - if (soap_ != null) { - output.writeMessage(12, getSoap()); - } - if (mandateSubscriptionValidation_ != false) { - output.writeBool(13, mandateSubscriptionValidation_); - } - if (httpClient_ != null) { - output.writeMessage(14, getHttpClient()); - } - if (mandateInternalKeyValidation_ != false) { - output.writeBool(15, mandateInternalKeyValidation_); - } - if (enableGatewayClassController_ != false) { - output.writeBool(16, enableGatewayClassController_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (security_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getSecurity()); - } - if (keystore_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getKeystore()); - } - if (truststore_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getTruststore()); - } - if (authService_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getAuthService()); - } - if (jwtGenerator_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getJwtGenerator()); - } - if (cache_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getCache()); - } - if (analytics_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getAnalytics()); - } - if (management_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getManagement()); - } - if (tracing_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, getTracing()); - } - if (metrics_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, getMetrics()); - } - for (int i = 0; i < filters_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, filters_.get(i)); - } - if (soap_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, getSoap()); - } - if (mandateSubscriptionValidation_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(13, mandateSubscriptionValidation_); - } - if (httpClient_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, getHttpClient()); - } - if (mandateInternalKeyValidation_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(15, mandateInternalKeyValidation_); - } - if (enableGatewayClassController_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(16, enableGatewayClassController_); - } - 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.Config)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Config other = (org.wso2.apk.enforcer.discovery.config.enforcer.Config) obj; - - if (hasSecurity() != other.hasSecurity()) return false; - if (hasSecurity()) { - if (!getSecurity() - .equals(other.getSecurity())) return false; - } - if (hasKeystore() != other.hasKeystore()) return false; - if (hasKeystore()) { - if (!getKeystore() - .equals(other.getKeystore())) return false; - } - if (hasTruststore() != other.hasTruststore()) return false; - if (hasTruststore()) { - if (!getTruststore() - .equals(other.getTruststore())) return false; - } - if (hasAuthService() != other.hasAuthService()) return false; - if (hasAuthService()) { - if (!getAuthService() - .equals(other.getAuthService())) return false; - } - if (hasJwtGenerator() != other.hasJwtGenerator()) return false; - if (hasJwtGenerator()) { - if (!getJwtGenerator() - .equals(other.getJwtGenerator())) return false; - } - if (hasCache() != other.hasCache()) return false; - if (hasCache()) { - if (!getCache() - .equals(other.getCache())) return false; - } - if (hasAnalytics() != other.hasAnalytics()) return false; - if (hasAnalytics()) { - if (!getAnalytics() - .equals(other.getAnalytics())) return false; - } - if (hasManagement() != other.hasManagement()) return false; - if (hasManagement()) { - if (!getManagement() - .equals(other.getManagement())) return false; - } - if (hasTracing() != other.hasTracing()) return false; - if (hasTracing()) { - if (!getTracing() - .equals(other.getTracing())) return false; - } - if (hasMetrics() != other.hasMetrics()) return false; - if (hasMetrics()) { - if (!getMetrics() - .equals(other.getMetrics())) return false; - } - if (!getFiltersList() - .equals(other.getFiltersList())) return false; - if (hasSoap() != other.hasSoap()) return false; - if (hasSoap()) { - if (!getSoap() - .equals(other.getSoap())) return false; - } - if (getMandateSubscriptionValidation() - != other.getMandateSubscriptionValidation()) return false; - if (hasHttpClient() != other.hasHttpClient()) return false; - if (hasHttpClient()) { - if (!getHttpClient() - .equals(other.getHttpClient())) return false; - } - if (getMandateInternalKeyValidation() - != other.getMandateInternalKeyValidation()) return false; - if (getEnableGatewayClassController() - != other.getEnableGatewayClassController()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSecurity()) { - hash = (37 * hash) + SECURITY_FIELD_NUMBER; - hash = (53 * hash) + getSecurity().hashCode(); - } - if (hasKeystore()) { - hash = (37 * hash) + KEYSTORE_FIELD_NUMBER; - hash = (53 * hash) + getKeystore().hashCode(); - } - if (hasTruststore()) { - hash = (37 * hash) + TRUSTSTORE_FIELD_NUMBER; - hash = (53 * hash) + getTruststore().hashCode(); - } - if (hasAuthService()) { - hash = (37 * hash) + AUTHSERVICE_FIELD_NUMBER; - hash = (53 * hash) + getAuthService().hashCode(); - } - if (hasJwtGenerator()) { - hash = (37 * hash) + JWTGENERATOR_FIELD_NUMBER; - hash = (53 * hash) + getJwtGenerator().hashCode(); - } - if (hasCache()) { - hash = (37 * hash) + CACHE_FIELD_NUMBER; - hash = (53 * hash) + getCache().hashCode(); - } - if (hasAnalytics()) { - hash = (37 * hash) + ANALYTICS_FIELD_NUMBER; - hash = (53 * hash) + getAnalytics().hashCode(); - } - if (hasManagement()) { - hash = (37 * hash) + MANAGEMENT_FIELD_NUMBER; - hash = (53 * hash) + getManagement().hashCode(); - } - if (hasTracing()) { - hash = (37 * hash) + TRACING_FIELD_NUMBER; - hash = (53 * hash) + getTracing().hashCode(); - } - if (hasMetrics()) { - hash = (37 * hash) + METRICS_FIELD_NUMBER; - hash = (53 * hash) + getMetrics().hashCode(); - } - if (getFiltersCount() > 0) { - hash = (37 * hash) + FILTERS_FIELD_NUMBER; - hash = (53 * hash) + getFiltersList().hashCode(); - } - if (hasSoap()) { - hash = (37 * hash) + SOAP_FIELD_NUMBER; - hash = (53 * hash) + getSoap().hashCode(); - } - hash = (37 * hash) + MANDATESUBSCRIPTIONVALIDATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getMandateSubscriptionValidation()); - if (hasHttpClient()) { - hash = (37 * hash) + HTTPCLIENT_FIELD_NUMBER; - hash = (53 * hash) + getHttpClient().hashCode(); - } - hash = (37 * hash) + MANDATEINTERNALKEYVALIDATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getMandateInternalKeyValidation()); - hash = (37 * hash) + ENABLEGATEWAYCLASSCONTROLLER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableGatewayClassController()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Config parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Config 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.Config parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Config 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.Config parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Config 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.Config 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.Config 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.Config 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.Config 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.Config 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.Config 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.Config 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; - } - /** - *
-   * Enforcer config model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Config} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Config) - org.wso2.apk.enforcer.discovery.config.enforcer.ConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ConfigProto.internal_static_wso2_discovery_config_enforcer_Config_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ConfigProto.internal_static_wso2_discovery_config_enforcer_Config_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Config.class, org.wso2.apk.enforcer.discovery.config.enforcer.Config.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Config.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getFiltersFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (securityBuilder_ == null) { - security_ = null; - } else { - security_ = null; - securityBuilder_ = null; - } - if (keystoreBuilder_ == null) { - keystore_ = null; - } else { - keystore_ = null; - keystoreBuilder_ = null; - } - if (truststoreBuilder_ == null) { - truststore_ = null; - } else { - truststore_ = null; - truststoreBuilder_ = null; - } - if (authServiceBuilder_ == null) { - authService_ = null; - } else { - authService_ = null; - authServiceBuilder_ = null; - } - if (jwtGeneratorBuilder_ == null) { - jwtGenerator_ = null; - } else { - jwtGenerator_ = null; - jwtGeneratorBuilder_ = null; - } - if (cacheBuilder_ == null) { - cache_ = null; - } else { - cache_ = null; - cacheBuilder_ = null; - } - if (analyticsBuilder_ == null) { - analytics_ = null; - } else { - analytics_ = null; - analyticsBuilder_ = null; - } - if (managementBuilder_ == null) { - management_ = null; - } else { - management_ = null; - managementBuilder_ = null; - } - if (tracingBuilder_ == null) { - tracing_ = null; - } else { - tracing_ = null; - tracingBuilder_ = null; - } - if (metricsBuilder_ == null) { - metrics_ = null; - } else { - metrics_ = null; - metricsBuilder_ = null; - } - if (filtersBuilder_ == null) { - filters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - filtersBuilder_.clear(); - } - if (soapBuilder_ == null) { - soap_ = null; - } else { - soap_ = null; - soapBuilder_ = null; - } - mandateSubscriptionValidation_ = false; - - if (httpClientBuilder_ == null) { - httpClient_ = null; - } else { - httpClient_ = null; - httpClientBuilder_ = null; - } - mandateInternalKeyValidation_ = false; - - enableGatewayClassController_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ConfigProto.internal_static_wso2_discovery_config_enforcer_Config_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Config getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Config.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Config build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Config result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Config buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Config result = new org.wso2.apk.enforcer.discovery.config.enforcer.Config(this); - int from_bitField0_ = bitField0_; - if (securityBuilder_ == null) { - result.security_ = security_; - } else { - result.security_ = securityBuilder_.build(); - } - if (keystoreBuilder_ == null) { - result.keystore_ = keystore_; - } else { - result.keystore_ = keystoreBuilder_.build(); - } - if (truststoreBuilder_ == null) { - result.truststore_ = truststore_; - } else { - result.truststore_ = truststoreBuilder_.build(); - } - if (authServiceBuilder_ == null) { - result.authService_ = authService_; - } else { - result.authService_ = authServiceBuilder_.build(); - } - if (jwtGeneratorBuilder_ == null) { - result.jwtGenerator_ = jwtGenerator_; - } else { - result.jwtGenerator_ = jwtGeneratorBuilder_.build(); - } - if (cacheBuilder_ == null) { - result.cache_ = cache_; - } else { - result.cache_ = cacheBuilder_.build(); - } - if (analyticsBuilder_ == null) { - result.analytics_ = analytics_; - } else { - result.analytics_ = analyticsBuilder_.build(); - } - if (managementBuilder_ == null) { - result.management_ = management_; - } else { - result.management_ = managementBuilder_.build(); - } - if (tracingBuilder_ == null) { - result.tracing_ = tracing_; - } else { - result.tracing_ = tracingBuilder_.build(); - } - if (metricsBuilder_ == null) { - result.metrics_ = metrics_; - } else { - result.metrics_ = metricsBuilder_.build(); - } - if (filtersBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - filters_ = java.util.Collections.unmodifiableList(filters_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.filters_ = filters_; - } else { - result.filters_ = filtersBuilder_.build(); - } - if (soapBuilder_ == null) { - result.soap_ = soap_; - } else { - result.soap_ = soapBuilder_.build(); - } - result.mandateSubscriptionValidation_ = mandateSubscriptionValidation_; - if (httpClientBuilder_ == null) { - result.httpClient_ = httpClient_; - } else { - result.httpClient_ = httpClientBuilder_.build(); - } - result.mandateInternalKeyValidation_ = mandateInternalKeyValidation_; - result.enableGatewayClassController_ = enableGatewayClassController_; - 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.Config) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Config)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Config other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Config.getDefaultInstance()) return this; - if (other.hasSecurity()) { - mergeSecurity(other.getSecurity()); - } - if (other.hasKeystore()) { - mergeKeystore(other.getKeystore()); - } - if (other.hasTruststore()) { - mergeTruststore(other.getTruststore()); - } - if (other.hasAuthService()) { - mergeAuthService(other.getAuthService()); - } - if (other.hasJwtGenerator()) { - mergeJwtGenerator(other.getJwtGenerator()); - } - if (other.hasCache()) { - mergeCache(other.getCache()); - } - if (other.hasAnalytics()) { - mergeAnalytics(other.getAnalytics()); - } - if (other.hasManagement()) { - mergeManagement(other.getManagement()); - } - if (other.hasTracing()) { - mergeTracing(other.getTracing()); - } - if (other.hasMetrics()) { - mergeMetrics(other.getMetrics()); - } - if (filtersBuilder_ == null) { - if (!other.filters_.isEmpty()) { - if (filters_.isEmpty()) { - filters_ = other.filters_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFiltersIsMutable(); - filters_.addAll(other.filters_); - } - onChanged(); - } - } else { - if (!other.filters_.isEmpty()) { - if (filtersBuilder_.isEmpty()) { - filtersBuilder_.dispose(); - filtersBuilder_ = null; - filters_ = other.filters_; - bitField0_ = (bitField0_ & ~0x00000001); - filtersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFiltersFieldBuilder() : null; - } else { - filtersBuilder_.addAllMessages(other.filters_); - } - } - } - if (other.hasSoap()) { - mergeSoap(other.getSoap()); - } - if (other.getMandateSubscriptionValidation() != false) { - setMandateSubscriptionValidation(other.getMandateSubscriptionValidation()); - } - if (other.hasHttpClient()) { - mergeHttpClient(other.getHttpClient()); - } - if (other.getMandateInternalKeyValidation() != false) { - setMandateInternalKeyValidation(other.getMandateInternalKeyValidation()); - } - if (other.getEnableGatewayClassController() != false) { - setEnableGatewayClassController(other.getEnableGatewayClassController()); - } - 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.Config parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Config) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private org.wso2.apk.enforcer.discovery.config.enforcer.Security security_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Security, org.wso2.apk.enforcer.discovery.config.enforcer.Security.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.SecurityOrBuilder> securityBuilder_; - /** - * .wso2.discovery.config.enforcer.Security security = 1; - * @return Whether the security field is set. - */ - public boolean hasSecurity() { - return securityBuilder_ != null || security_ != null; - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - * @return The security. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Security getSecurity() { - if (securityBuilder_ == null) { - return security_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Security.getDefaultInstance() : security_; - } else { - return securityBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - public Builder setSecurity(org.wso2.apk.enforcer.discovery.config.enforcer.Security value) { - if (securityBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - security_ = value; - onChanged(); - } else { - securityBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - public Builder setSecurity( - org.wso2.apk.enforcer.discovery.config.enforcer.Security.Builder builderForValue) { - if (securityBuilder_ == null) { - security_ = builderForValue.build(); - onChanged(); - } else { - securityBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - public Builder mergeSecurity(org.wso2.apk.enforcer.discovery.config.enforcer.Security value) { - if (securityBuilder_ == null) { - if (security_ != null) { - security_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Security.newBuilder(security_).mergeFrom(value).buildPartial(); - } else { - security_ = value; - } - onChanged(); - } else { - securityBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - public Builder clearSecurity() { - if (securityBuilder_ == null) { - security_ = null; - onChanged(); - } else { - security_ = null; - securityBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Security.Builder getSecurityBuilder() { - - onChanged(); - return getSecurityFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.SecurityOrBuilder getSecurityOrBuilder() { - if (securityBuilder_ != null) { - return securityBuilder_.getMessageOrBuilder(); - } else { - return security_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Security.getDefaultInstance() : security_; - } - } - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Security, org.wso2.apk.enforcer.discovery.config.enforcer.Security.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.SecurityOrBuilder> - getSecurityFieldBuilder() { - if (securityBuilder_ == null) { - securityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Security, org.wso2.apk.enforcer.discovery.config.enforcer.Security.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.SecurityOrBuilder>( - getSecurity(), - getParentForChildren(), - isClean()); - security_ = null; - } - return securityBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.CertStore keystore_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore, org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder> keystoreBuilder_; - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - * @return Whether the keystore field is set. - */ - public boolean hasKeystore() { - return keystoreBuilder_ != null || keystore_ != null; - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - * @return The keystore. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore getKeystore() { - if (keystoreBuilder_ == null) { - return keystore_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.getDefaultInstance() : keystore_; - } else { - return keystoreBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - public Builder setKeystore(org.wso2.apk.enforcer.discovery.config.enforcer.CertStore value) { - if (keystoreBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - keystore_ = value; - onChanged(); - } else { - keystoreBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - public Builder setKeystore( - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder builderForValue) { - if (keystoreBuilder_ == null) { - keystore_ = builderForValue.build(); - onChanged(); - } else { - keystoreBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - public Builder mergeKeystore(org.wso2.apk.enforcer.discovery.config.enforcer.CertStore value) { - if (keystoreBuilder_ == null) { - if (keystore_ != null) { - keystore_ = - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.newBuilder(keystore_).mergeFrom(value).buildPartial(); - } else { - keystore_ = value; - } - onChanged(); - } else { - keystoreBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - public Builder clearKeystore() { - if (keystoreBuilder_ == null) { - keystore_ = null; - onChanged(); - } else { - keystore_ = null; - keystoreBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder getKeystoreBuilder() { - - onChanged(); - return getKeystoreFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder getKeystoreOrBuilder() { - if (keystoreBuilder_ != null) { - return keystoreBuilder_.getMessageOrBuilder(); - } else { - return keystore_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.getDefaultInstance() : keystore_; - } - } - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore, org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder> - getKeystoreFieldBuilder() { - if (keystoreBuilder_ == null) { - keystoreBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore, org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder>( - getKeystore(), - getParentForChildren(), - isClean()); - keystore_ = null; - } - return keystoreBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.CertStore truststore_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore, org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder> truststoreBuilder_; - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - * @return Whether the truststore field is set. - */ - public boolean hasTruststore() { - return truststoreBuilder_ != null || truststore_ != null; - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - * @return The truststore. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore getTruststore() { - if (truststoreBuilder_ == null) { - return truststore_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.getDefaultInstance() : truststore_; - } else { - return truststoreBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - public Builder setTruststore(org.wso2.apk.enforcer.discovery.config.enforcer.CertStore value) { - if (truststoreBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - truststore_ = value; - onChanged(); - } else { - truststoreBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - public Builder setTruststore( - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder builderForValue) { - if (truststoreBuilder_ == null) { - truststore_ = builderForValue.build(); - onChanged(); - } else { - truststoreBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - public Builder mergeTruststore(org.wso2.apk.enforcer.discovery.config.enforcer.CertStore value) { - if (truststoreBuilder_ == null) { - if (truststore_ != null) { - truststore_ = - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.newBuilder(truststore_).mergeFrom(value).buildPartial(); - } else { - truststore_ = value; - } - onChanged(); - } else { - truststoreBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - public Builder clearTruststore() { - if (truststoreBuilder_ == null) { - truststore_ = null; - onChanged(); - } else { - truststore_ = null; - truststoreBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder getTruststoreBuilder() { - - onChanged(); - return getTruststoreFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder getTruststoreOrBuilder() { - if (truststoreBuilder_ != null) { - return truststoreBuilder_.getMessageOrBuilder(); - } else { - return truststore_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.getDefaultInstance() : truststore_; - } - } - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore, org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder> - getTruststoreFieldBuilder() { - if (truststoreBuilder_ == null) { - truststoreBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore, org.wso2.apk.enforcer.discovery.config.enforcer.CertStore.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder>( - getTruststore(), - getParentForChildren(), - isClean()); - truststore_ = null; - } - return truststoreBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.Service authService_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Service, org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder> authServiceBuilder_; - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - * @return Whether the authService field is set. - */ - public boolean hasAuthService() { - return authServiceBuilder_ != null || authService_ != null; - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - * @return The authService. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Service getAuthService() { - if (authServiceBuilder_ == null) { - return authService_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Service.getDefaultInstance() : authService_; - } else { - return authServiceBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - public Builder setAuthService(org.wso2.apk.enforcer.discovery.config.enforcer.Service value) { - if (authServiceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - authService_ = value; - onChanged(); - } else { - authServiceBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - public Builder setAuthService( - org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder builderForValue) { - if (authServiceBuilder_ == null) { - authService_ = builderForValue.build(); - onChanged(); - } else { - authServiceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - public Builder mergeAuthService(org.wso2.apk.enforcer.discovery.config.enforcer.Service value) { - if (authServiceBuilder_ == null) { - if (authService_ != null) { - authService_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Service.newBuilder(authService_).mergeFrom(value).buildPartial(); - } else { - authService_ = value; - } - onChanged(); - } else { - authServiceBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - public Builder clearAuthService() { - if (authServiceBuilder_ == null) { - authService_ = null; - onChanged(); - } else { - authService_ = null; - authServiceBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder getAuthServiceBuilder() { - - onChanged(); - return getAuthServiceFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder getAuthServiceOrBuilder() { - if (authServiceBuilder_ != null) { - return authServiceBuilder_.getMessageOrBuilder(); - } else { - return authService_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Service.getDefaultInstance() : authService_; - } - } - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Service, org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder> - getAuthServiceFieldBuilder() { - if (authServiceBuilder_ == null) { - authServiceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Service, org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder>( - getAuthService(), - getParentForChildren(), - isClean()); - authService_ = null; - } - return authServiceBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator jwtGenerator_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator, org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder> jwtGeneratorBuilder_; - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - * @return Whether the jwtGenerator field is set. - */ - public boolean hasJwtGenerator() { - return jwtGeneratorBuilder_ != null || jwtGenerator_ != null; - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - * @return The jwtGenerator. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator getJwtGenerator() { - if (jwtGeneratorBuilder_ == null) { - return jwtGenerator_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.getDefaultInstance() : jwtGenerator_; - } else { - return jwtGeneratorBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - public Builder setJwtGenerator(org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator value) { - if (jwtGeneratorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - jwtGenerator_ = value; - onChanged(); - } else { - jwtGeneratorBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - public Builder setJwtGenerator( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.Builder builderForValue) { - if (jwtGeneratorBuilder_ == null) { - jwtGenerator_ = builderForValue.build(); - onChanged(); - } else { - jwtGeneratorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - public Builder mergeJwtGenerator(org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator value) { - if (jwtGeneratorBuilder_ == null) { - if (jwtGenerator_ != null) { - jwtGenerator_ = - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.newBuilder(jwtGenerator_).mergeFrom(value).buildPartial(); - } else { - jwtGenerator_ = value; - } - onChanged(); - } else { - jwtGeneratorBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - public Builder clearJwtGenerator() { - if (jwtGeneratorBuilder_ == null) { - jwtGenerator_ = null; - onChanged(); - } else { - jwtGenerator_ = null; - jwtGeneratorBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.Builder getJwtGeneratorBuilder() { - - onChanged(); - return getJwtGeneratorFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder getJwtGeneratorOrBuilder() { - if (jwtGeneratorBuilder_ != null) { - return jwtGeneratorBuilder_.getMessageOrBuilder(); - } else { - return jwtGenerator_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.getDefaultInstance() : jwtGenerator_; - } - } - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator, org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder> - getJwtGeneratorFieldBuilder() { - if (jwtGeneratorBuilder_ == null) { - jwtGeneratorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator, org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder>( - getJwtGenerator(), - getParentForChildren(), - isClean()); - jwtGenerator_ = null; - } - return jwtGeneratorBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.Cache cache_; - 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 = 6; - * @return Whether the cache field is set. - */ - public boolean hasCache() { - return cacheBuilder_ != null || cache_ != null; - } - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - * @return The cache. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Cache getCache() { - if (cacheBuilder_ == null) { - return cache_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Cache.getDefaultInstance() : cache_; - } else { - return cacheBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - */ - public Builder setCache(org.wso2.apk.enforcer.discovery.config.enforcer.Cache value) { - if (cacheBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - cache_ = value; - onChanged(); - } else { - cacheBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - */ - public Builder setCache( - org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder builderForValue) { - if (cacheBuilder_ == null) { - cache_ = builderForValue.build(); - onChanged(); - } else { - cacheBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - */ - public Builder mergeCache(org.wso2.apk.enforcer.discovery.config.enforcer.Cache value) { - if (cacheBuilder_ == null) { - if (cache_ != null) { - cache_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Cache.newBuilder(cache_).mergeFrom(value).buildPartial(); - } else { - cache_ = value; - } - onChanged(); - } else { - cacheBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - */ - public Builder clearCache() { - if (cacheBuilder_ == null) { - cache_ = null; - onChanged(); - } else { - cache_ = null; - cacheBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder getCacheBuilder() { - - onChanged(); - return getCacheFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder getCacheOrBuilder() { - if (cacheBuilder_ != null) { - return cacheBuilder_.getMessageOrBuilder(); - } else { - return cache_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Cache.getDefaultInstance() : cache_; - } - } - /** - * .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> - getCacheFieldBuilder() { - if (cacheBuilder_ == null) { - cacheBuilder_ = new 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>( - getCache(), - getParentForChildren(), - isClean()); - cache_ = null; - } - return cacheBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.Analytics analytics_; - 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 = 7; - * @return Whether the analytics field is set. - */ - public boolean hasAnalytics() { - return analyticsBuilder_ != null || analytics_ != null; - } - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - * @return The analytics. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics getAnalytics() { - if (analyticsBuilder_ == null) { - return analytics_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.getDefaultInstance() : analytics_; - } else { - return analyticsBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - */ - public Builder setAnalytics(org.wso2.apk.enforcer.discovery.config.enforcer.Analytics value) { - if (analyticsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - analytics_ = value; - onChanged(); - } else { - analyticsBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - */ - public Builder setAnalytics( - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder builderForValue) { - if (analyticsBuilder_ == null) { - analytics_ = builderForValue.build(); - onChanged(); - } else { - analyticsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - */ - public Builder mergeAnalytics(org.wso2.apk.enforcer.discovery.config.enforcer.Analytics value) { - if (analyticsBuilder_ == null) { - if (analytics_ != null) { - analytics_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.newBuilder(analytics_).mergeFrom(value).buildPartial(); - } else { - analytics_ = value; - } - onChanged(); - } else { - analyticsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - */ - public Builder clearAnalytics() { - if (analyticsBuilder_ == null) { - analytics_ = null; - onChanged(); - } else { - analytics_ = null; - analyticsBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder getAnalyticsBuilder() { - - onChanged(); - return getAnalyticsFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder getAnalyticsOrBuilder() { - if (analyticsBuilder_ != null) { - return analyticsBuilder_.getMessageOrBuilder(); - } else { - return analytics_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.getDefaultInstance() : analytics_; - } - } - /** - * .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> - getAnalyticsFieldBuilder() { - if (analyticsBuilder_ == null) { - analyticsBuilder_ = new 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>( - getAnalytics(), - getParentForChildren(), - isClean()); - analytics_ = null; - } - return analyticsBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.Management management_; - 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 = 8; - * @return Whether the management field is set. - */ - public boolean hasManagement() { - return managementBuilder_ != null || management_ != null; - } - /** - * .wso2.discovery.config.enforcer.Management management = 8; - * @return The management. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Management getManagement() { - if (managementBuilder_ == null) { - return management_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Management.getDefaultInstance() : management_; - } else { - return managementBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.Management management = 8; - */ - public Builder setManagement(org.wso2.apk.enforcer.discovery.config.enforcer.Management value) { - if (managementBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - management_ = value; - onChanged(); - } else { - managementBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Management management = 8; - */ - public Builder setManagement( - org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder builderForValue) { - if (managementBuilder_ == null) { - management_ = builderForValue.build(); - onChanged(); - } else { - managementBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Management management = 8; - */ - public Builder mergeManagement(org.wso2.apk.enforcer.discovery.config.enforcer.Management value) { - if (managementBuilder_ == null) { - if (management_ != null) { - management_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Management.newBuilder(management_).mergeFrom(value).buildPartial(); - } else { - management_ = value; - } - onChanged(); - } else { - managementBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Management management = 8; - */ - public Builder clearManagement() { - if (managementBuilder_ == null) { - management_ = null; - onChanged(); - } else { - management_ = null; - managementBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Management management = 8; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder getManagementBuilder() { - - onChanged(); - return getManagementFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.Management management = 8; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder getManagementOrBuilder() { - if (managementBuilder_ != null) { - return managementBuilder_.getMessageOrBuilder(); - } else { - return management_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Management.getDefaultInstance() : management_; - } - } - /** - * .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> - getManagementFieldBuilder() { - if (managementBuilder_ == null) { - managementBuilder_ = new 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>( - getManagement(), - getParentForChildren(), - isClean()); - management_ = null; - } - return managementBuilder_; - } - - 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 = 9; - * @return Whether the tracing field is set. - */ - public boolean hasTracing() { - return tracingBuilder_ != null || tracing_ != null; - } - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - * @return The tracing. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing getTracing() { - if (tracingBuilder_ == null) { - return tracing_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.getDefaultInstance() : tracing_; - } else { - return tracingBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - */ - public Builder setTracing(org.wso2.apk.enforcer.discovery.config.enforcer.Tracing value) { - if (tracingBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tracing_ = value; - onChanged(); - } else { - tracingBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - */ - public Builder setTracing( - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder builderForValue) { - if (tracingBuilder_ == null) { - tracing_ = builderForValue.build(); - onChanged(); - } else { - tracingBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - */ - public Builder mergeTracing(org.wso2.apk.enforcer.discovery.config.enforcer.Tracing value) { - if (tracingBuilder_ == null) { - if (tracing_ != null) { - tracing_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.newBuilder(tracing_).mergeFrom(value).buildPartial(); - } else { - tracing_ = value; - } - onChanged(); - } else { - tracingBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - */ - public Builder clearTracing() { - if (tracingBuilder_ == null) { - tracing_ = null; - onChanged(); - } else { - tracing_ = null; - tracingBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder getTracingBuilder() { - - onChanged(); - return getTracingFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder getTracingOrBuilder() { - if (tracingBuilder_ != null) { - return tracingBuilder_.getMessageOrBuilder(); - } else { - return tracing_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.getDefaultInstance() : tracing_; - } - } - /** - * .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> - getTracingFieldBuilder() { - if (tracingBuilder_ == null) { - tracingBuilder_ = new 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>( - getTracing(), - getParentForChildren(), - isClean()); - tracing_ = null; - } - return tracingBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.Metrics metrics_; - 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 = 10; - * @return Whether the metrics field is set. - */ - public boolean hasMetrics() { - return metricsBuilder_ != null || metrics_ != null; - } - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - * @return The metrics. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics getMetrics() { - if (metricsBuilder_ == null) { - return metrics_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.getDefaultInstance() : metrics_; - } else { - return metricsBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - */ - public Builder setMetrics(org.wso2.apk.enforcer.discovery.config.enforcer.Metrics value) { - if (metricsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metrics_ = value; - onChanged(); - } else { - metricsBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - */ - public Builder setMetrics( - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder builderForValue) { - if (metricsBuilder_ == null) { - metrics_ = builderForValue.build(); - onChanged(); - } else { - metricsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - */ - public Builder mergeMetrics(org.wso2.apk.enforcer.discovery.config.enforcer.Metrics value) { - if (metricsBuilder_ == null) { - if (metrics_ != null) { - metrics_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.newBuilder(metrics_).mergeFrom(value).buildPartial(); - } else { - metrics_ = value; - } - onChanged(); - } else { - metricsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - */ - public Builder clearMetrics() { - if (metricsBuilder_ == null) { - metrics_ = null; - onChanged(); - } else { - metrics_ = null; - metricsBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder getMetricsBuilder() { - - onChanged(); - return getMetricsFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder getMetricsOrBuilder() { - if (metricsBuilder_ != null) { - return metricsBuilder_.getMessageOrBuilder(); - } else { - return metrics_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.getDefaultInstance() : metrics_; - } - } - /** - * .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> - getMetricsFieldBuilder() { - if (metricsBuilder_ == null) { - metricsBuilder_ = new 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>( - getMetrics(), - getParentForChildren(), - isClean()); - metrics_ = null; - } - return metricsBuilder_; - } - - private java.util.List filters_ = - java.util.Collections.emptyList(); - private void ensureFiltersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - filters_ = new java.util.ArrayList(filters_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - 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 = 11; - */ - public java.util.List getFiltersList() { - if (filtersBuilder_ == null) { - return java.util.Collections.unmodifiableList(filters_); - } else { - return filtersBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public int getFiltersCount() { - if (filtersBuilder_ == null) { - return filters_.size(); - } else { - return filtersBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Filter getFilters(int index) { - if (filtersBuilder_ == null) { - return filters_.get(index); - } else { - return filtersBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder setFilters( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter value) { - if (filtersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFiltersIsMutable(); - filters_.set(index, value); - onChanged(); - } else { - filtersBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder setFilters( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder builderForValue) { - if (filtersBuilder_ == null) { - ensureFiltersIsMutable(); - filters_.set(index, builderForValue.build()); - onChanged(); - } else { - filtersBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder addFilters(org.wso2.apk.enforcer.discovery.config.enforcer.Filter value) { - if (filtersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFiltersIsMutable(); - filters_.add(value); - onChanged(); - } else { - filtersBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder addFilters( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter value) { - if (filtersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFiltersIsMutable(); - filters_.add(index, value); - onChanged(); - } else { - filtersBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder addFilters( - org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder builderForValue) { - if (filtersBuilder_ == null) { - ensureFiltersIsMutable(); - filters_.add(builderForValue.build()); - onChanged(); - } else { - filtersBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder addFilters( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder builderForValue) { - if (filtersBuilder_ == null) { - ensureFiltersIsMutable(); - filters_.add(index, builderForValue.build()); - onChanged(); - } else { - filtersBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder addAllFilters( - java.lang.Iterable values) { - if (filtersBuilder_ == null) { - ensureFiltersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, filters_); - onChanged(); - } else { - filtersBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder clearFilters() { - if (filtersBuilder_ == null) { - filters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - filtersBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public Builder removeFilters(int index) { - if (filtersBuilder_ == null) { - ensureFiltersIsMutable(); - filters_.remove(index); - onChanged(); - } else { - filtersBuilder_.remove(index); - } - return this; - } - /** - * 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 = 11; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder getFiltersOrBuilder( - int index) { - if (filtersBuilder_ == null) { - return filters_.get(index); } else { - return filtersBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public java.util.List - getFiltersOrBuilderList() { - if (filtersBuilder_ != null) { - return filtersBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(filters_); - } - } - /** - * 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 = 11; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder addFiltersBuilder( - int index) { - return getFiltersFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - public java.util.List - getFiltersBuilderList() { - return getFiltersFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - 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> - getFiltersFieldBuilder() { - if (filtersBuilder_ == null) { - filtersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - 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>( - filters_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - filters_ = null; - } - return filtersBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.Soap soap_; - 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 = 12; - * @return Whether the soap field is set. - */ - public boolean hasSoap() { - return soapBuilder_ != null || soap_ != null; - } - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - * @return The soap. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Soap getSoap() { - if (soapBuilder_ == null) { - return soap_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Soap.getDefaultInstance() : soap_; - } else { - return soapBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - */ - public Builder setSoap(org.wso2.apk.enforcer.discovery.config.enforcer.Soap value) { - if (soapBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - soap_ = value; - onChanged(); - } else { - soapBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - */ - public Builder setSoap( - org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder builderForValue) { - if (soapBuilder_ == null) { - soap_ = builderForValue.build(); - onChanged(); - } else { - soapBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - */ - public Builder mergeSoap(org.wso2.apk.enforcer.discovery.config.enforcer.Soap value) { - if (soapBuilder_ == null) { - if (soap_ != null) { - soap_ = - org.wso2.apk.enforcer.discovery.config.enforcer.Soap.newBuilder(soap_).mergeFrom(value).buildPartial(); - } else { - soap_ = value; - } - onChanged(); - } else { - soapBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - */ - public Builder clearSoap() { - if (soapBuilder_ == null) { - soap_ = null; - onChanged(); - } else { - soap_ = null; - soapBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder getSoapBuilder() { - - onChanged(); - return getSoapFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.Soap soap = 12; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder getSoapOrBuilder() { - if (soapBuilder_ != null) { - return soapBuilder_.getMessageOrBuilder(); - } else { - return soap_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.Soap.getDefaultInstance() : soap_; - } - } - /** - * .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> - getSoapFieldBuilder() { - if (soapBuilder_ == null) { - soapBuilder_ = new 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>( - getSoap(), - getParentForChildren(), - isClean()); - soap_ = null; - } - return soapBuilder_; - } - - private boolean mandateSubscriptionValidation_ ; - /** - * bool mandateSubscriptionValidation = 13; - * @return The mandateSubscriptionValidation. - */ - @java.lang.Override - public boolean getMandateSubscriptionValidation() { - return mandateSubscriptionValidation_; - } - /** - * bool mandateSubscriptionValidation = 13; - * @param value The mandateSubscriptionValidation to set. - * @return This builder for chaining. - */ - public Builder setMandateSubscriptionValidation(boolean value) { - - mandateSubscriptionValidation_ = value; - onChanged(); - return this; - } - /** - * bool mandateSubscriptionValidation = 13; - * @return This builder for chaining. - */ - public Builder clearMandateSubscriptionValidation() { - - mandateSubscriptionValidation_ = false; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient httpClient_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient, org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientOrBuilder> httpClientBuilder_; - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - * @return Whether the httpClient field is set. - */ - public boolean hasHttpClient() { - return httpClientBuilder_ != null || httpClient_ != null; - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - * @return The httpClient. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient getHttpClient() { - if (httpClientBuilder_ == null) { - return httpClient_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.getDefaultInstance() : httpClient_; - } else { - return httpClientBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - public Builder setHttpClient(org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient value) { - if (httpClientBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - httpClient_ = value; - onChanged(); - } else { - httpClientBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - public Builder setHttpClient( - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.Builder builderForValue) { - if (httpClientBuilder_ == null) { - httpClient_ = builderForValue.build(); - onChanged(); - } else { - httpClientBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - public Builder mergeHttpClient(org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient value) { - if (httpClientBuilder_ == null) { - if (httpClient_ != null) { - httpClient_ = - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.newBuilder(httpClient_).mergeFrom(value).buildPartial(); - } else { - httpClient_ = value; - } - onChanged(); - } else { - httpClientBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - public Builder clearHttpClient() { - if (httpClientBuilder_ == null) { - httpClient_ = null; - onChanged(); - } else { - httpClient_ = null; - httpClientBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.Builder getHttpClientBuilder() { - - onChanged(); - return getHttpClientFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientOrBuilder getHttpClientOrBuilder() { - if (httpClientBuilder_ != null) { - return httpClientBuilder_.getMessageOrBuilder(); - } else { - return httpClient_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.getDefaultInstance() : httpClient_; - } - } - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient, org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientOrBuilder> - getHttpClientFieldBuilder() { - if (httpClientBuilder_ == null) { - httpClientBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient, org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientOrBuilder>( - getHttpClient(), - getParentForChildren(), - isClean()); - httpClient_ = null; - } - return httpClientBuilder_; - } - - private boolean mandateInternalKeyValidation_ ; - /** - * bool mandateInternalKeyValidation = 15; - * @return The mandateInternalKeyValidation. - */ - @java.lang.Override - public boolean getMandateInternalKeyValidation() { - return mandateInternalKeyValidation_; - } - /** - * bool mandateInternalKeyValidation = 15; - * @param value The mandateInternalKeyValidation to set. - * @return This builder for chaining. - */ - public Builder setMandateInternalKeyValidation(boolean value) { - - mandateInternalKeyValidation_ = value; - onChanged(); - return this; - } - /** - * bool mandateInternalKeyValidation = 15; - * @return This builder for chaining. - */ - public Builder clearMandateInternalKeyValidation() { - - mandateInternalKeyValidation_ = false; - onChanged(); - return this; - } - - private boolean enableGatewayClassController_ ; - /** - * bool enableGatewayClassController = 16; - * @return The enableGatewayClassController. - */ - @java.lang.Override - public boolean getEnableGatewayClassController() { - return enableGatewayClassController_; - } - /** - * bool enableGatewayClassController = 16; - * @param value The enableGatewayClassController to set. - * @return This builder for chaining. - */ - public Builder setEnableGatewayClassController(boolean value) { - - enableGatewayClassController_ = value; - onChanged(); - return this; - } - /** - * bool enableGatewayClassController = 16; - * @return This builder for chaining. - */ - public Builder clearEnableGatewayClassController() { - - enableGatewayClassController_ = 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.Config) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Config) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Config DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Config(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Config getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Config parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Config(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.Config getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 78cc44cf37..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigOrBuilder.java +++ /dev/null @@ -1,231 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/config.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface ConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Config) - com.google.protobuf.MessageOrBuilder { - - /** - * .wso2.discovery.config.enforcer.Security security = 1; - * @return Whether the security field is set. - */ - boolean hasSecurity(); - /** - * .wso2.discovery.config.enforcer.Security security = 1; - * @return The security. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.Security getSecurity(); - /** - * .wso2.discovery.config.enforcer.Security security = 1; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.SecurityOrBuilder getSecurityOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - * @return Whether the keystore field is set. - */ - boolean hasKeystore(); - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - * @return The keystore. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore getKeystore(); - /** - * .wso2.discovery.config.enforcer.CertStore keystore = 2; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder getKeystoreOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - * @return Whether the truststore field is set. - */ - boolean hasTruststore(); - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - * @return The truststore. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.CertStore getTruststore(); - /** - * .wso2.discovery.config.enforcer.CertStore truststore = 3; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreOrBuilder getTruststoreOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - * @return Whether the authService field is set. - */ - boolean hasAuthService(); - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - * @return The authService. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.Service getAuthService(); - /** - * .wso2.discovery.config.enforcer.Service authService = 4; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder getAuthServiceOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - * @return Whether the jwtGenerator field is set. - */ - boolean hasJwtGenerator(); - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - * @return The jwtGenerator. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator getJwtGenerator(); - /** - * .wso2.discovery.config.enforcer.JWTGenerator jwtGenerator = 5; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder getJwtGeneratorOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.Cache cache = 6; - * @return Whether the cache field is set. - */ - boolean hasCache(); - /** - * .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 = 6; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder getCacheOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.Analytics analytics = 7; - * @return Whether the analytics field is set. - */ - boolean hasAnalytics(); - /** - * .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 = 7; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder getAnalyticsOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.Management management = 8; - * @return Whether the management field is set. - */ - boolean hasManagement(); - /** - * .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 = 8; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder getManagementOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 9; - * @return Whether the tracing field is set. - */ - boolean hasTracing(); - /** - * .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 = 9; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder getTracingOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.Metrics metrics = 10; - * @return Whether the metrics field is set. - */ - boolean hasMetrics(); - /** - * .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 = 10; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder getMetricsOrBuilder(); - - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - java.util.List - getFiltersList(); - /** - * 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 = 11; - */ - int getFiltersCount(); - /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 11; - */ - java.util.List - getFiltersOrBuilderList(); - /** - * 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 = 12; - * @return Whether the soap field is set. - */ - boolean hasSoap(); - /** - * .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 = 12; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder getSoapOrBuilder(); - - /** - * bool mandateSubscriptionValidation = 13; - * @return The mandateSubscriptionValidation. - */ - boolean getMandateSubscriptionValidation(); - - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - * @return Whether the httpClient field is set. - */ - boolean hasHttpClient(); - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - * @return The httpClient. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient getHttpClient(); - /** - * .wso2.discovery.config.enforcer.HttpClient httpClient = 14; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientOrBuilder getHttpClientOrBuilder(); - - /** - * bool mandateInternalKeyValidation = 15; - * @return The mandateInternalKeyValidation. - */ - boolean getMandateInternalKeyValidation(); - - /** - * bool enableGatewayClassController = 16; - * @return The enableGatewayClassController. - */ - boolean getEnableGatewayClassController(); -} 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 deleted file mode 100644 index 23291675f4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigProto.java +++ /dev/null @@ -1,112 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/config.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class ConfigProto { - private ConfigProto() {} - 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_Config_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Config_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n+wso2/discovery/config/enforcer/config." + - "proto\022\036wso2.discovery.config.enforcer\032)w" + - "so2/discovery/config/enforcer/cert.proto" + - "\032,wso2/discovery/config/enforcer/service" + - ".proto\0322wso2/discovery/config/enforcer/j" + - "wt_generator.proto\032*wso2/discovery/confi" + - "g/enforcer/cache.proto\032.wso2/discovery/c" + - "onfig/enforcer/analytics.proto\032-wso2/dis" + - "covery/config/enforcer/security.proto\032/w" + - "so2/discovery/config/enforcer/management" + - ".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\032+wso2/discove" + - "ry/config/enforcer/client.proto\"\212\007\n\006Conf" + - "ig\022:\n\010security\030\001 \001(\0132(.wso2.discovery.co" + - "nfig.enforcer.Security\022;\n\010keystore\030\002 \001(\013" + - "2).wso2.discovery.config.enforcer.CertSt" + - "ore\022=\n\ntruststore\030\003 \001(\0132).wso2.discovery" + - ".config.enforcer.CertStore\022<\n\013authServic" + - "e\030\004 \001(\0132\'.wso2.discovery.config.enforcer" + - ".Service\022B\n\014jwtGenerator\030\005 \001(\0132,.wso2.di" + - "scovery.config.enforcer.JWTGenerator\0224\n\005" + - "cache\030\006 \001(\0132%.wso2.discovery.config.enfo" + - "rcer.Cache\022<\n\tanalytics\030\007 \001(\0132).wso2.dis" + - "covery.config.enforcer.Analytics\022>\n\nmana" + - "gement\030\010 \001(\0132*.wso2.discovery.config.enf" + - "orcer.Management\0228\n\007tracing\030\t \001(\0132\'.wso2" + - ".discovery.config.enforcer.Tracing\0228\n\007me" + - "trics\030\n \001(\0132\'.wso2.discovery.config.enfo" + - "rcer.Metrics\0227\n\007filters\030\013 \003(\0132&.wso2.dis" + - "covery.config.enforcer.Filter\0222\n\004soap\030\014 " + - "\001(\0132$.wso2.discovery.config.enforcer.Soa" + - "p\022%\n\035mandateSubscriptionValidation\030\r \001(\010" + - "\022>\n\nhttpClient\030\016 \001(\0132*.wso2.discovery.co" + - "nfig.enforcer.HttpClient\022$\n\034mandateInter" + - "nalKeyValidation\030\017 \001(\010\022$\n\034enableGatewayC" + - "lassController\030\020 \001(\010B\220\001\n/org.wso2.apk.en" + - "forcer.discovery.config.enforcerB\013Config" + - "ProtoP\001ZNgithub.com/envoyproxy/go-contro" + - "l-plane/wso2/discovery/config/enforcer;e" + - "nforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - 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(), - org.wso2.apk.enforcer.discovery.config.enforcer.CacheProto.getDescriptor(), - 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.FilterProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.config.enforcer.soapProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientProto.getDescriptor(), - }); - internal_static_wso2_discovery_config_enforcer_Config_descriptor = - getDescriptor().getMessageTypes().get(0); - 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", "Tracing", "Metrics", "Filters", "Soap", "MandateSubscriptionValidation", "HttpClient", "MandateInternalKeyValidation", "EnableGatewayClassController", }); - 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(); - org.wso2.apk.enforcer.discovery.config.enforcer.CacheProto.getDescriptor(); - 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.FilterProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.config.enforcer.soapProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Filter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Filter.java deleted file mode 100644 index b2d71336a0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Filter.java +++ /dev/null @@ -1,1003 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/filter.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Filter model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Filter} - */ -public final class Filter extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Filter) - FilterOrBuilder { -private static final long serialVersionUID = 0L; - // Use Filter.newBuilder() to construct. - private Filter(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Filter() { - className_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Filter(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Filter( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - className_ = s; - break; - } - case 16: { - - position_ = input.readInt32(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - configProperties_ = com.google.protobuf.MapField.newMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - configProperties__ = input.readMessage( - ConfigPropertiesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - configProperties_.getMutableMap().put( - configProperties__.getKey(), configProperties__.getValue()); - 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.FilterProto.internal_static_wso2_discovery_config_enforcer_Filter_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.FilterProto.internal_static_wso2_discovery_config_enforcer_Filter_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Filter.class, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder.class); - } - - public static final int CLASSNAME_FIELD_NUMBER = 1; - private volatile java.lang.Object className_; - /** - *
-   * fully-qualified name of the filter containing class.
-   * 
- * - * string className = 1; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - java.lang.Object ref = className_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - className_ = s; - return s; - } - } - /** - *
-   * fully-qualified name of the filter containing class.
-   * 
- * - * string className = 1; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - java.lang.Object ref = className_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - className_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int POSITION_FIELD_NUMBER = 2; - private int position_; - /** - *
-   * position in the filter chain.
-   * 
- * - * int32 position = 2; - * @return The position. - */ - @java.lang.Override - public int getPosition() { - return position_; - } - - public static final int CONFIGPROPERTIES_FIELD_NUMBER = 3; - private static final class ConfigPropertiesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.config.enforcer.FilterProto.internal_static_wso2_discovery_config_enforcer_Filter_ConfigPropertiesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> configProperties_; - private com.google.protobuf.MapField - internalGetConfigProperties() { - if (configProperties_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - return configProperties_; - } - - public int getConfigPropertiesCount() { - return internalGetConfigProperties().getMap().size(); - } - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - - @java.lang.Override - public boolean containsConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetConfigProperties().getMap().containsKey(key); - } - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getConfigProperties() { - return getConfigPropertiesMap(); - } - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.util.Map getConfigPropertiesMap() { - return internalGetConfigProperties().getMap(); - } - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - 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 (!getClassNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, className_); - } - if (position_ != 0) { - output.writeInt32(2, position_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetConfigProperties(), - ConfigPropertiesDefaultEntryHolder.defaultEntry, - 3); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getClassNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, className_); - } - if (position_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, position_); - } - for (java.util.Map.Entry entry - : internalGetConfigProperties().getMap().entrySet()) { - com.google.protobuf.MapEntry - configProperties__ = ConfigPropertiesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, configProperties__); - } - 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.Filter)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Filter other = (org.wso2.apk.enforcer.discovery.config.enforcer.Filter) obj; - - if (!getClassName() - .equals(other.getClassName())) return false; - if (getPosition() - != other.getPosition()) return false; - if (!internalGetConfigProperties().equals( - other.internalGetConfigProperties())) 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) + CLASSNAME_FIELD_NUMBER; - hash = (53 * hash) + getClassName().hashCode(); - hash = (37 * hash) + POSITION_FIELD_NUMBER; - hash = (53 * hash) + getPosition(); - if (!internalGetConfigProperties().getMap().isEmpty()) { - hash = (37 * hash) + CONFIGPROPERTIES_FIELD_NUMBER; - hash = (53 * hash) + internalGetConfigProperties().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Filter parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Filter 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.Filter parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Filter 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.Filter parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Filter 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.Filter 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.Filter 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.Filter 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.Filter 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.Filter 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.Filter 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.Filter 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; - } - /** - *
-   * Filter model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Filter} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Filter) - org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.FilterProto.internal_static_wso2_discovery_config_enforcer_Filter_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 3: - return internalGetMutableConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.FilterProto.internal_static_wso2_discovery_config_enforcer_Filter_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Filter.class, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Filter.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(); - className_ = ""; - - position_ = 0; - - internalGetMutableConfigProperties().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.FilterProto.internal_static_wso2_discovery_config_enforcer_Filter_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Filter getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Filter.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Filter build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Filter result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Filter buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Filter result = new org.wso2.apk.enforcer.discovery.config.enforcer.Filter(this); - int from_bitField0_ = bitField0_; - result.className_ = className_; - result.position_ = position_; - result.configProperties_ = internalGetConfigProperties(); - result.configProperties_.makeImmutable(); - 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.Filter) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Filter)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Filter other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Filter.getDefaultInstance()) return this; - if (!other.getClassName().isEmpty()) { - className_ = other.className_; - onChanged(); - } - if (other.getPosition() != 0) { - setPosition(other.getPosition()); - } - internalGetMutableConfigProperties().mergeFrom( - other.internalGetConfigProperties()); - 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.Filter parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Filter) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object className_ = ""; - /** - *
-     * fully-qualified name of the filter containing class.
-     * 
- * - * string className = 1; - * @return The className. - */ - public java.lang.String getClassName() { - java.lang.Object ref = className_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - className_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * fully-qualified name of the filter containing class.
-     * 
- * - * string className = 1; - * @return The bytes for className. - */ - public com.google.protobuf.ByteString - getClassNameBytes() { - java.lang.Object ref = className_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - className_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * fully-qualified name of the filter containing class.
-     * 
- * - * string className = 1; - * @param value The className to set. - * @return This builder for chaining. - */ - public Builder setClassName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - className_ = value; - onChanged(); - return this; - } - /** - *
-     * fully-qualified name of the filter containing class.
-     * 
- * - * string className = 1; - * @return This builder for chaining. - */ - public Builder clearClassName() { - - className_ = getDefaultInstance().getClassName(); - onChanged(); - return this; - } - /** - *
-     * fully-qualified name of the filter containing class.
-     * 
- * - * string className = 1; - * @param value The bytes for className to set. - * @return This builder for chaining. - */ - public Builder setClassNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - className_ = value; - onChanged(); - return this; - } - - private int position_ ; - /** - *
-     * position in the filter chain.
-     * 
- * - * int32 position = 2; - * @return The position. - */ - @java.lang.Override - public int getPosition() { - return position_; - } - /** - *
-     * position in the filter chain.
-     * 
- * - * int32 position = 2; - * @param value The position to set. - * @return This builder for chaining. - */ - public Builder setPosition(int value) { - - position_ = value; - onChanged(); - return this; - } - /** - *
-     * position in the filter chain.
-     * 
- * - * int32 position = 2; - * @return This builder for chaining. - */ - public Builder clearPosition() { - - position_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> configProperties_; - private com.google.protobuf.MapField - internalGetConfigProperties() { - if (configProperties_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - return configProperties_; - } - private com.google.protobuf.MapField - internalGetMutableConfigProperties() { - onChanged();; - if (configProperties_ == null) { - configProperties_ = com.google.protobuf.MapField.newMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - if (!configProperties_.isMutable()) { - configProperties_ = configProperties_.copy(); - } - return configProperties_; - } - - public int getConfigPropertiesCount() { - return internalGetConfigProperties().getMap().size(); - } - /** - *
-     * Per Filter Configurations.
-     * 
- * - * map<string, string> configProperties = 3; - */ - - @java.lang.Override - public boolean containsConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetConfigProperties().getMap().containsKey(key); - } - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getConfigProperties() { - return getConfigPropertiesMap(); - } - /** - *
-     * Per Filter Configurations.
-     * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.util.Map getConfigPropertiesMap() { - return internalGetConfigProperties().getMap(); - } - /** - *
-     * Per Filter Configurations.
-     * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * Per Filter Configurations.
-     * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearConfigProperties() { - internalGetMutableConfigProperties().getMutableMap() - .clear(); - return this; - } - /** - *
-     * Per Filter Configurations.
-     * 
- * - * map<string, string> configProperties = 3; - */ - - public Builder removeConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableConfigProperties().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableConfigProperties() { - return internalGetMutableConfigProperties().getMutableMap(); - } - /** - *
-     * Per Filter Configurations.
-     * 
- * - * map<string, string> configProperties = 3; - */ - public Builder putConfigProperties( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableConfigProperties().getMutableMap() - .put(key, value); - return this; - } - /** - *
-     * Per Filter Configurations.
-     * 
- * - * map<string, string> configProperties = 3; - */ - - public Builder putAllConfigProperties( - java.util.Map values) { - internalGetMutableConfigProperties().getMutableMap() - .putAll(values); - 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.Filter) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Filter) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Filter DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Filter(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Filter getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Filter parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Filter(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.Filter getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/FilterOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/FilterOrBuilder.java deleted file mode 100644 index c8e80f61af..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/FilterOrBuilder.java +++ /dev/null @@ -1,93 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/filter.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface FilterOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Filter) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * fully-qualified name of the filter containing class.
-   * 
- * - * string className = 1; - * @return The className. - */ - java.lang.String getClassName(); - /** - *
-   * fully-qualified name of the filter containing class.
-   * 
- * - * string className = 1; - * @return The bytes for className. - */ - com.google.protobuf.ByteString - getClassNameBytes(); - - /** - *
-   * position in the filter chain.
-   * 
- * - * int32 position = 2; - * @return The position. - */ - int getPosition(); - - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - int getConfigPropertiesCount(); - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - boolean containsConfigProperties( - java.lang.String key); - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getConfigProperties(); - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - java.util.Map - getConfigPropertiesMap(); - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - - java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - *
-   * Per Filter Configurations.
-   * 
- * - * map<string, string> configProperties = 3; - */ - - java.lang.String getConfigPropertiesOrThrow( - java.lang.String key); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/FilterProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/FilterProto.java deleted file mode 100644 index 3b62de2603..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/FilterProto.java +++ /dev/null @@ -1,67 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/filter.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class FilterProto { - private FilterProto() {} - 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_Filter_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Filter_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_config_enforcer_Filter_ConfigPropertiesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Filter_ConfigPropertiesEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n+wso2/discovery/config/enforcer/filter." + - "proto\022\036wso2.discovery.config.enforcer\"\276\001" + - "\n\006Filter\022\021\n\tclassName\030\001 \001(\t\022\020\n\010position\030" + - "\002 \001(\005\022V\n\020configProperties\030\003 \003(\0132<.wso2.d" + - "iscovery.config.enforcer.Filter.ConfigPr" + - "opertiesEntry\0327\n\025ConfigPropertiesEntry\022\013" + - "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\220\001\n/org.w" + - "so2.apk.enforcer.discovery.config.enforc" + - "erB\013FilterProtoP\001ZNgithub.com/envoyproxy" + - "/go-control-plane/wso2/discovery/config/" + - "enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_Filter_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Filter_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Filter_descriptor, - new java.lang.String[] { "ClassName", "Position", "ConfigProperties", }); - internal_static_wso2_discovery_config_enforcer_Filter_ConfigPropertiesEntry_descriptor = - internal_static_wso2_discovery_config_enforcer_Filter_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Filter_ConfigPropertiesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Filter_ConfigPropertiesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClient.java deleted file mode 100644 index c21f18bc0a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClient.java +++ /dev/null @@ -1,994 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/client.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Model for enforcer management user
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.HttpClient} - */ -public final class HttpClient extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.HttpClient) - HttpClientOrBuilder { -private static final long serialVersionUID = 0L; - // Use HttpClient.newBuilder() to construct. - private HttpClient(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private HttpClient() { - hostnameVerifier_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new HttpClient(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private HttpClient( - 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: { - - skipSSl_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - hostnameVerifier_ = s; - break; - } - case 24: { - - maxTotalConnections_ = input.readInt32(); - break; - } - case 32: { - - maxConnectionsPerRoute_ = input.readInt32(); - break; - } - case 40: { - - connectTimeout_ = input.readInt32(); - break; - } - case 48: { - - socketTimeout_ = input.readInt32(); - 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.HttpClientProto.internal_static_wso2_discovery_config_enforcer_HttpClient_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientProto.internal_static_wso2_discovery_config_enforcer_HttpClient_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.class, org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.Builder.class); - } - - public static final int SKIPSSL_FIELD_NUMBER = 1; - private boolean skipSSl_; - /** - *
-   * Disable SSL Verification
-   * 
- * - * bool skipSSl = 1; - * @return The skipSSl. - */ - @java.lang.Override - public boolean getSkipSSl() { - return skipSSl_; - } - - public static final int HOSTNAMEVERIFIER_FIELD_NUMBER = 2; - private volatile java.lang.Object hostnameVerifier_; - /** - *
-   * Hostname Verifier
-   * 
- * - * string hostnameVerifier = 2; - * @return The hostnameVerifier. - */ - @java.lang.Override - public java.lang.String getHostnameVerifier() { - java.lang.Object ref = hostnameVerifier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - hostnameVerifier_ = s; - return s; - } - } - /** - *
-   * Hostname Verifier
-   * 
- * - * string hostnameVerifier = 2; - * @return The bytes for hostnameVerifier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getHostnameVerifierBytes() { - java.lang.Object ref = hostnameVerifier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostnameVerifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAXTOTALCONNECTIONS_FIELD_NUMBER = 3; - private int maxTotalConnections_; - /** - *
-   * MaxtotalConnections
-   * 
- * - * int32 maxTotalConnections = 3; - * @return The maxTotalConnections. - */ - @java.lang.Override - public int getMaxTotalConnections() { - return maxTotalConnections_; - } - - public static final int MAXCONNECTIONSPERROUTE_FIELD_NUMBER = 4; - private int maxConnectionsPerRoute_; - /** - *
-   * MaxConnectionsPerRoute
-   * 
- * - * int32 maxConnectionsPerRoute = 4; - * @return The maxConnectionsPerRoute. - */ - @java.lang.Override - public int getMaxConnectionsPerRoute() { - return maxConnectionsPerRoute_; - } - - public static final int CONNECTTIMEOUT_FIELD_NUMBER = 5; - private int connectTimeout_; - /** - *
-   * ConnectTimeout
-   * 
- * - * int32 connectTimeout = 5; - * @return The connectTimeout. - */ - @java.lang.Override - public int getConnectTimeout() { - return connectTimeout_; - } - - public static final int SOCKETTIMEOUT_FIELD_NUMBER = 6; - private int socketTimeout_; - /** - *
-   * SocketTimeout
-   * 
- * - * int32 socketTimeout = 6; - * @return The socketTimeout. - */ - @java.lang.Override - public int getSocketTimeout() { - return socketTimeout_; - } - - 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 (skipSSl_ != false) { - output.writeBool(1, skipSSl_); - } - if (!getHostnameVerifierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, hostnameVerifier_); - } - if (maxTotalConnections_ != 0) { - output.writeInt32(3, maxTotalConnections_); - } - if (maxConnectionsPerRoute_ != 0) { - output.writeInt32(4, maxConnectionsPerRoute_); - } - if (connectTimeout_ != 0) { - output.writeInt32(5, connectTimeout_); - } - if (socketTimeout_ != 0) { - output.writeInt32(6, socketTimeout_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (skipSSl_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, skipSSl_); - } - if (!getHostnameVerifierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, hostnameVerifier_); - } - if (maxTotalConnections_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, maxTotalConnections_); - } - if (maxConnectionsPerRoute_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, maxConnectionsPerRoute_); - } - if (connectTimeout_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, connectTimeout_); - } - if (socketTimeout_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, socketTimeout_); - } - 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.HttpClient)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient other = (org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient) obj; - - if (getSkipSSl() - != other.getSkipSSl()) return false; - if (!getHostnameVerifier() - .equals(other.getHostnameVerifier())) return false; - if (getMaxTotalConnections() - != other.getMaxTotalConnections()) return false; - if (getMaxConnectionsPerRoute() - != other.getMaxConnectionsPerRoute()) return false; - if (getConnectTimeout() - != other.getConnectTimeout()) return false; - if (getSocketTimeout() - != other.getSocketTimeout()) 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) + SKIPSSL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSkipSSl()); - hash = (37 * hash) + HOSTNAMEVERIFIER_FIELD_NUMBER; - hash = (53 * hash) + getHostnameVerifier().hashCode(); - hash = (37 * hash) + MAXTOTALCONNECTIONS_FIELD_NUMBER; - hash = (53 * hash) + getMaxTotalConnections(); - hash = (37 * hash) + MAXCONNECTIONSPERROUTE_FIELD_NUMBER; - hash = (53 * hash) + getMaxConnectionsPerRoute(); - hash = (37 * hash) + CONNECTTIMEOUT_FIELD_NUMBER; - hash = (53 * hash) + getConnectTimeout(); - hash = (37 * hash) + SOCKETTIMEOUT_FIELD_NUMBER; - hash = (53 * hash) + getSocketTimeout(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient 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.HttpClient parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient 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.HttpClient parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient 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.HttpClient 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.HttpClient 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.HttpClient 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.HttpClient 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.HttpClient 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.HttpClient 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.HttpClient 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 enforcer management user
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.HttpClient} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.HttpClient) - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientProto.internal_static_wso2_discovery_config_enforcer_HttpClient_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientProto.internal_static_wso2_discovery_config_enforcer_HttpClient_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.class, org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.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(); - skipSSl_ = false; - - hostnameVerifier_ = ""; - - maxTotalConnections_ = 0; - - maxConnectionsPerRoute_ = 0; - - connectTimeout_ = 0; - - socketTimeout_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.HttpClientProto.internal_static_wso2_discovery_config_enforcer_HttpClient_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient build() { - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient result = new org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient(this); - result.skipSSl_ = skipSSl_; - result.hostnameVerifier_ = hostnameVerifier_; - result.maxTotalConnections_ = maxTotalConnections_; - result.maxConnectionsPerRoute_ = maxConnectionsPerRoute_; - result.connectTimeout_ = connectTimeout_; - result.socketTimeout_ = socketTimeout_; - 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.HttpClient) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient.getDefaultInstance()) return this; - if (other.getSkipSSl() != false) { - setSkipSSl(other.getSkipSSl()); - } - if (!other.getHostnameVerifier().isEmpty()) { - hostnameVerifier_ = other.hostnameVerifier_; - onChanged(); - } - if (other.getMaxTotalConnections() != 0) { - setMaxTotalConnections(other.getMaxTotalConnections()); - } - if (other.getMaxConnectionsPerRoute() != 0) { - setMaxConnectionsPerRoute(other.getMaxConnectionsPerRoute()); - } - if (other.getConnectTimeout() != 0) { - setConnectTimeout(other.getConnectTimeout()); - } - if (other.getSocketTimeout() != 0) { - setSocketTimeout(other.getSocketTimeout()); - } - 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.HttpClient parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean skipSSl_ ; - /** - *
-     * Disable SSL Verification
-     * 
- * - * bool skipSSl = 1; - * @return The skipSSl. - */ - @java.lang.Override - public boolean getSkipSSl() { - return skipSSl_; - } - /** - *
-     * Disable SSL Verification
-     * 
- * - * bool skipSSl = 1; - * @param value The skipSSl to set. - * @return This builder for chaining. - */ - public Builder setSkipSSl(boolean value) { - - skipSSl_ = value; - onChanged(); - return this; - } - /** - *
-     * Disable SSL Verification
-     * 
- * - * bool skipSSl = 1; - * @return This builder for chaining. - */ - public Builder clearSkipSSl() { - - skipSSl_ = false; - onChanged(); - return this; - } - - private java.lang.Object hostnameVerifier_ = ""; - /** - *
-     * Hostname Verifier
-     * 
- * - * string hostnameVerifier = 2; - * @return The hostnameVerifier. - */ - public java.lang.String getHostnameVerifier() { - java.lang.Object ref = hostnameVerifier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - hostnameVerifier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Hostname Verifier
-     * 
- * - * string hostnameVerifier = 2; - * @return The bytes for hostnameVerifier. - */ - public com.google.protobuf.ByteString - getHostnameVerifierBytes() { - java.lang.Object ref = hostnameVerifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostnameVerifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Hostname Verifier
-     * 
- * - * string hostnameVerifier = 2; - * @param value The hostnameVerifier to set. - * @return This builder for chaining. - */ - public Builder setHostnameVerifier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - hostnameVerifier_ = value; - onChanged(); - return this; - } - /** - *
-     * Hostname Verifier
-     * 
- * - * string hostnameVerifier = 2; - * @return This builder for chaining. - */ - public Builder clearHostnameVerifier() { - - hostnameVerifier_ = getDefaultInstance().getHostnameVerifier(); - onChanged(); - return this; - } - /** - *
-     * Hostname Verifier
-     * 
- * - * string hostnameVerifier = 2; - * @param value The bytes for hostnameVerifier to set. - * @return This builder for chaining. - */ - public Builder setHostnameVerifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - hostnameVerifier_ = value; - onChanged(); - return this; - } - - private int maxTotalConnections_ ; - /** - *
-     * MaxtotalConnections
-     * 
- * - * int32 maxTotalConnections = 3; - * @return The maxTotalConnections. - */ - @java.lang.Override - public int getMaxTotalConnections() { - return maxTotalConnections_; - } - /** - *
-     * MaxtotalConnections
-     * 
- * - * int32 maxTotalConnections = 3; - * @param value The maxTotalConnections to set. - * @return This builder for chaining. - */ - public Builder setMaxTotalConnections(int value) { - - maxTotalConnections_ = value; - onChanged(); - return this; - } - /** - *
-     * MaxtotalConnections
-     * 
- * - * int32 maxTotalConnections = 3; - * @return This builder for chaining. - */ - public Builder clearMaxTotalConnections() { - - maxTotalConnections_ = 0; - onChanged(); - return this; - } - - private int maxConnectionsPerRoute_ ; - /** - *
-     * MaxConnectionsPerRoute
-     * 
- * - * int32 maxConnectionsPerRoute = 4; - * @return The maxConnectionsPerRoute. - */ - @java.lang.Override - public int getMaxConnectionsPerRoute() { - return maxConnectionsPerRoute_; - } - /** - *
-     * MaxConnectionsPerRoute
-     * 
- * - * int32 maxConnectionsPerRoute = 4; - * @param value The maxConnectionsPerRoute to set. - * @return This builder for chaining. - */ - public Builder setMaxConnectionsPerRoute(int value) { - - maxConnectionsPerRoute_ = value; - onChanged(); - return this; - } - /** - *
-     * MaxConnectionsPerRoute
-     * 
- * - * int32 maxConnectionsPerRoute = 4; - * @return This builder for chaining. - */ - public Builder clearMaxConnectionsPerRoute() { - - maxConnectionsPerRoute_ = 0; - onChanged(); - return this; - } - - private int connectTimeout_ ; - /** - *
-     * ConnectTimeout
-     * 
- * - * int32 connectTimeout = 5; - * @return The connectTimeout. - */ - @java.lang.Override - public int getConnectTimeout() { - return connectTimeout_; - } - /** - *
-     * ConnectTimeout
-     * 
- * - * int32 connectTimeout = 5; - * @param value The connectTimeout to set. - * @return This builder for chaining. - */ - public Builder setConnectTimeout(int value) { - - connectTimeout_ = value; - onChanged(); - return this; - } - /** - *
-     * ConnectTimeout
-     * 
- * - * int32 connectTimeout = 5; - * @return This builder for chaining. - */ - public Builder clearConnectTimeout() { - - connectTimeout_ = 0; - onChanged(); - return this; - } - - private int socketTimeout_ ; - /** - *
-     * SocketTimeout
-     * 
- * - * int32 socketTimeout = 6; - * @return The socketTimeout. - */ - @java.lang.Override - public int getSocketTimeout() { - return socketTimeout_; - } - /** - *
-     * SocketTimeout
-     * 
- * - * int32 socketTimeout = 6; - * @param value The socketTimeout to set. - * @return This builder for chaining. - */ - public Builder setSocketTimeout(int value) { - - socketTimeout_ = value; - onChanged(); - return this; - } - /** - *
-     * SocketTimeout
-     * 
- * - * int32 socketTimeout = 6; - * @return This builder for chaining. - */ - public Builder clearSocketTimeout() { - - socketTimeout_ = 0; - 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.HttpClient) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.HttpClient) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.HttpClient getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public HttpClient parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HttpClient(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.HttpClient getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClientOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClientOrBuilder.java deleted file mode 100644 index 4ae0fd19fa..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClientOrBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/client.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface HttpClientOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.HttpClient) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Disable SSL Verification
-   * 
- * - * bool skipSSl = 1; - * @return The skipSSl. - */ - boolean getSkipSSl(); - - /** - *
-   * Hostname Verifier
-   * 
- * - * string hostnameVerifier = 2; - * @return The hostnameVerifier. - */ - java.lang.String getHostnameVerifier(); - /** - *
-   * Hostname Verifier
-   * 
- * - * string hostnameVerifier = 2; - * @return The bytes for hostnameVerifier. - */ - com.google.protobuf.ByteString - getHostnameVerifierBytes(); - - /** - *
-   * MaxtotalConnections
-   * 
- * - * int32 maxTotalConnections = 3; - * @return The maxTotalConnections. - */ - int getMaxTotalConnections(); - - /** - *
-   * MaxConnectionsPerRoute
-   * 
- * - * int32 maxConnectionsPerRoute = 4; - * @return The maxConnectionsPerRoute. - */ - int getMaxConnectionsPerRoute(); - - /** - *
-   * ConnectTimeout
-   * 
- * - * int32 connectTimeout = 5; - * @return The connectTimeout. - */ - int getConnectTimeout(); - - /** - *
-   * SocketTimeout
-   * 
- * - * int32 socketTimeout = 6; - * @return The socketTimeout. - */ - int getSocketTimeout(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClientProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClientProto.java deleted file mode 100644 index e1943cd970..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/HttpClientProto.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/client.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class HttpClientProto { - private HttpClientProto() {} - 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_HttpClient_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_HttpClient_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n+wso2/discovery/config/enforcer/client." + - "proto\022\036wso2.discovery.config.enforcer\"\243\001" + - "\n\nHttpClient\022\017\n\007skipSSl\030\001 \001(\010\022\030\n\020hostnam" + - "eVerifier\030\002 \001(\t\022\033\n\023maxTotalConnections\030\003" + - " \001(\005\022\036\n\026maxConnectionsPerRoute\030\004 \001(\005\022\026\n\016" + - "connectTimeout\030\005 \001(\005\022\025\n\rsocketTimeout\030\006 " + - "\001(\005B\224\001\n/org.wso2.apk.enforcer.discovery." + - "config.enforcerB\017HttpClientProtoP\001ZNgith" + - "ub.com/envoyproxy/go-control-plane/wso2/" + - "discovery/config/enforcer;enforcerb\006prot" + - "o3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_HttpClient_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_HttpClient_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_HttpClient_descriptor, - new java.lang.String[] { "SkipSSl", "HostnameVerifier", "MaxTotalConnections", "MaxConnectionsPerRoute", "ConnectTimeout", "SocketTimeout", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Issuer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Issuer.java deleted file mode 100644 index 3246406ec5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Issuer.java +++ /dev/null @@ -1,1954 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/issuer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Token issuer model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Issuer} - */ -public final class Issuer extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Issuer) - IssuerOrBuilder { -private static final long serialVersionUID = 0L; - // Use Issuer.newBuilder() to construct. - private Issuer(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Issuer() { - name_ = ""; - issuer_ = ""; - certificateAlias_ = ""; - jwksURL_ = ""; - consumerKeyClaim_ = ""; - certificateFilePath_ = ""; - claimMapping_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Issuer(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Issuer( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - issuer_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - certificateAlias_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - jwksURL_ = s; - break; - } - case 40: { - - validateSubscription_ = input.readBool(); - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - consumerKeyClaim_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - certificateFilePath_ = s; - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - claimMapping_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - claimMapping_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - claimMapping_ = java.util.Collections.unmodifiableList(claimMapping_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.IssuerProto.internal_static_wso2_discovery_config_enforcer_Issuer_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.IssuerProto.internal_static_wso2_discovery_config_enforcer_Issuer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Issuer.class, org.wso2.apk.enforcer.discovery.config.enforcer.Issuer.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Issuer name
-   * 
- * - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Issuer name
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ISSUER_FIELD_NUMBER = 2; - private volatile java.lang.Object issuer_; - /** - *
-   * Issuer identifier
-   * 
- * - * string issuer = 2; - * @return The issuer. - */ - @java.lang.Override - public java.lang.String getIssuer() { - java.lang.Object ref = issuer_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - issuer_ = s; - return s; - } - } - /** - *
-   * Issuer identifier
-   * 
- * - * string issuer = 2; - * @return The bytes for issuer. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIssuerBytes() { - java.lang.Object ref = issuer_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - issuer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CERTIFICATEALIAS_FIELD_NUMBER = 3; - private volatile java.lang.Object certificateAlias_; - /** - *
-   * Alias of the local certificate to be used for token validation
-   * with this issuer
-   * 
- * - * string certificateAlias = 3; - * @return The certificateAlias. - */ - @java.lang.Override - public java.lang.String getCertificateAlias() { - java.lang.Object ref = certificateAlias_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificateAlias_ = s; - return s; - } - } - /** - *
-   * Alias of the local certificate to be used for token validation
-   * with this issuer
-   * 
- * - * string certificateAlias = 3; - * @return The bytes for certificateAlias. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCertificateAliasBytes() { - java.lang.Object ref = certificateAlias_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificateAlias_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int JWKSURL_FIELD_NUMBER = 4; - private volatile java.lang.Object jwksURL_; - /** - *
-   * JWKS endpoint of the issuer
-   * 
- * - * string jwksURL = 4; - * @return The jwksURL. - */ - @java.lang.Override - public java.lang.String getJwksURL() { - java.lang.Object ref = jwksURL_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - jwksURL_ = s; - return s; - } - } - /** - *
-   * JWKS endpoint of the issuer
-   * 
- * - * string jwksURL = 4; - * @return The bytes for jwksURL. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getJwksURLBytes() { - java.lang.Object ref = jwksURL_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - jwksURL_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALIDATESUBSCRIPTION_FIELD_NUMBER = 5; - private boolean validateSubscription_; - /** - *
-   * Enable or disable subscription validation for this issuer
-   * 
- * - * bool validateSubscription = 5; - * @return The validateSubscription. - */ - @java.lang.Override - public boolean getValidateSubscription() { - return validateSubscription_; - } - - public static final int CONSUMERKEYCLAIM_FIELD_NUMBER = 6; - private volatile java.lang.Object consumerKeyClaim_; - /** - *
-   * JWT claim that communicates the consumerKey value
-   * 
- * - * string consumerKeyClaim = 6; - * @return The consumerKeyClaim. - */ - @java.lang.Override - public java.lang.String getConsumerKeyClaim() { - java.lang.Object ref = consumerKeyClaim_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - consumerKeyClaim_ = s; - return s; - } - } - /** - *
-   * JWT claim that communicates the consumerKey value
-   * 
- * - * string consumerKeyClaim = 6; - * @return The bytes for consumerKeyClaim. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getConsumerKeyClaimBytes() { - java.lang.Object ref = consumerKeyClaim_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - consumerKeyClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CERTIFICATEFILEPATH_FIELD_NUMBER = 7; - private volatile java.lang.Object certificateFilePath_; - /** - *
-   * FilePath of the public certificate mounted in enforcer container
-   * 
- * - * string certificateFilePath = 7; - * @return The certificateFilePath. - */ - @java.lang.Override - public java.lang.String getCertificateFilePath() { - java.lang.Object ref = certificateFilePath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificateFilePath_ = s; - return s; - } - } - /** - *
-   * FilePath of the public certificate mounted in enforcer container
-   * 
- * - * string certificateFilePath = 7; - * @return The bytes for certificateFilePath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCertificateFilePathBytes() { - java.lang.Object ref = certificateFilePath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificateFilePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLAIMMAPPING_FIELD_NUMBER = 8; - private java.util.List claimMapping_; - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - @java.lang.Override - public java.util.List getClaimMappingList() { - return claimMapping_; - } - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - @java.lang.Override - public java.util.List - getClaimMappingOrBuilderList() { - return claimMapping_; - } - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - @java.lang.Override - public int getClaimMappingCount() { - return claimMapping_.size(); - } - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping getClaimMapping(int index) { - return claimMapping_.get(index); - } - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingOrBuilder getClaimMappingOrBuilder( - int index) { - return claimMapping_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getIssuerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, issuer_); - } - if (!getCertificateAliasBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, certificateAlias_); - } - if (!getJwksURLBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, jwksURL_); - } - if (validateSubscription_ != false) { - output.writeBool(5, validateSubscription_); - } - if (!getConsumerKeyClaimBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, consumerKeyClaim_); - } - if (!getCertificateFilePathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, certificateFilePath_); - } - for (int i = 0; i < claimMapping_.size(); i++) { - output.writeMessage(8, claimMapping_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getIssuerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, issuer_); - } - if (!getCertificateAliasBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, certificateAlias_); - } - if (!getJwksURLBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, jwksURL_); - } - if (validateSubscription_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, validateSubscription_); - } - if (!getConsumerKeyClaimBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, consumerKeyClaim_); - } - if (!getCertificateFilePathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, certificateFilePath_); - } - for (int i = 0; i < claimMapping_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, claimMapping_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.config.enforcer.Issuer)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Issuer other = (org.wso2.apk.enforcer.discovery.config.enforcer.Issuer) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getIssuer() - .equals(other.getIssuer())) return false; - if (!getCertificateAlias() - .equals(other.getCertificateAlias())) return false; - if (!getJwksURL() - .equals(other.getJwksURL())) return false; - if (getValidateSubscription() - != other.getValidateSubscription()) return false; - if (!getConsumerKeyClaim() - .equals(other.getConsumerKeyClaim())) return false; - if (!getCertificateFilePath() - .equals(other.getCertificateFilePath())) return false; - if (!getClaimMappingList() - .equals(other.getClaimMappingList())) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + ISSUER_FIELD_NUMBER; - hash = (53 * hash) + getIssuer().hashCode(); - hash = (37 * hash) + CERTIFICATEALIAS_FIELD_NUMBER; - hash = (53 * hash) + getCertificateAlias().hashCode(); - hash = (37 * hash) + JWKSURL_FIELD_NUMBER; - hash = (53 * hash) + getJwksURL().hashCode(); - hash = (37 * hash) + VALIDATESUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getValidateSubscription()); - hash = (37 * hash) + CONSUMERKEYCLAIM_FIELD_NUMBER; - hash = (53 * hash) + getConsumerKeyClaim().hashCode(); - hash = (37 * hash) + CERTIFICATEFILEPATH_FIELD_NUMBER; - hash = (53 * hash) + getCertificateFilePath().hashCode(); - if (getClaimMappingCount() > 0) { - hash = (37 * hash) + CLAIMMAPPING_FIELD_NUMBER; - hash = (53 * hash) + getClaimMappingList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Issuer parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Issuer 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.Issuer parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Issuer 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.Issuer parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Issuer 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.Issuer 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.Issuer 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.Issuer 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.Issuer 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.Issuer 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.Issuer 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.Issuer 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; - } - /** - *
-   * Token issuer model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Issuer} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Issuer) - org.wso2.apk.enforcer.discovery.config.enforcer.IssuerOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.IssuerProto.internal_static_wso2_discovery_config_enforcer_Issuer_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.IssuerProto.internal_static_wso2_discovery_config_enforcer_Issuer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Issuer.class, org.wso2.apk.enforcer.discovery.config.enforcer.Issuer.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Issuer.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getClaimMappingFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - issuer_ = ""; - - certificateAlias_ = ""; - - jwksURL_ = ""; - - validateSubscription_ = false; - - consumerKeyClaim_ = ""; - - certificateFilePath_ = ""; - - if (claimMappingBuilder_ == null) { - claimMapping_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - claimMappingBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.IssuerProto.internal_static_wso2_discovery_config_enforcer_Issuer_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Issuer getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Issuer.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Issuer build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Issuer result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Issuer buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Issuer result = new org.wso2.apk.enforcer.discovery.config.enforcer.Issuer(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.issuer_ = issuer_; - result.certificateAlias_ = certificateAlias_; - result.jwksURL_ = jwksURL_; - result.validateSubscription_ = validateSubscription_; - result.consumerKeyClaim_ = consumerKeyClaim_; - result.certificateFilePath_ = certificateFilePath_; - if (claimMappingBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - claimMapping_ = java.util.Collections.unmodifiableList(claimMapping_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.claimMapping_ = claimMapping_; - } else { - result.claimMapping_ = claimMappingBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.config.enforcer.Issuer) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Issuer)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Issuer other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Issuer.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getIssuer().isEmpty()) { - issuer_ = other.issuer_; - onChanged(); - } - if (!other.getCertificateAlias().isEmpty()) { - certificateAlias_ = other.certificateAlias_; - onChanged(); - } - if (!other.getJwksURL().isEmpty()) { - jwksURL_ = other.jwksURL_; - onChanged(); - } - if (other.getValidateSubscription() != false) { - setValidateSubscription(other.getValidateSubscription()); - } - if (!other.getConsumerKeyClaim().isEmpty()) { - consumerKeyClaim_ = other.consumerKeyClaim_; - onChanged(); - } - if (!other.getCertificateFilePath().isEmpty()) { - certificateFilePath_ = other.certificateFilePath_; - onChanged(); - } - if (claimMappingBuilder_ == null) { - if (!other.claimMapping_.isEmpty()) { - if (claimMapping_.isEmpty()) { - claimMapping_ = other.claimMapping_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureClaimMappingIsMutable(); - claimMapping_.addAll(other.claimMapping_); - } - onChanged(); - } - } else { - if (!other.claimMapping_.isEmpty()) { - if (claimMappingBuilder_.isEmpty()) { - claimMappingBuilder_.dispose(); - claimMappingBuilder_ = null; - claimMapping_ = other.claimMapping_; - bitField0_ = (bitField0_ & ~0x00000001); - claimMappingBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getClaimMappingFieldBuilder() : null; - } else { - claimMappingBuilder_.addAllMessages(other.claimMapping_); - } - } - } - 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.Issuer parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Issuer) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
-     * Issuer name
-     * 
- * - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Issuer name
-     * 
- * - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Issuer name
-     * 
- * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Issuer name
-     * 
- * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Issuer name
-     * 
- * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object issuer_ = ""; - /** - *
-     * Issuer identifier
-     * 
- * - * string issuer = 2; - * @return The issuer. - */ - public java.lang.String getIssuer() { - java.lang.Object ref = issuer_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - issuer_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Issuer identifier
-     * 
- * - * string issuer = 2; - * @return The bytes for issuer. - */ - public com.google.protobuf.ByteString - getIssuerBytes() { - java.lang.Object ref = issuer_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - issuer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Issuer identifier
-     * 
- * - * string issuer = 2; - * @param value The issuer to set. - * @return This builder for chaining. - */ - public Builder setIssuer( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - issuer_ = value; - onChanged(); - return this; - } - /** - *
-     * Issuer identifier
-     * 
- * - * string issuer = 2; - * @return This builder for chaining. - */ - public Builder clearIssuer() { - - issuer_ = getDefaultInstance().getIssuer(); - onChanged(); - return this; - } - /** - *
-     * Issuer identifier
-     * 
- * - * string issuer = 2; - * @param value The bytes for issuer to set. - * @return This builder for chaining. - */ - public Builder setIssuerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - issuer_ = value; - onChanged(); - return this; - } - - private java.lang.Object certificateAlias_ = ""; - /** - *
-     * Alias of the local certificate to be used for token validation
-     * with this issuer
-     * 
- * - * string certificateAlias = 3; - * @return The certificateAlias. - */ - public java.lang.String getCertificateAlias() { - java.lang.Object ref = certificateAlias_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificateAlias_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Alias of the local certificate to be used for token validation
-     * with this issuer
-     * 
- * - * string certificateAlias = 3; - * @return The bytes for certificateAlias. - */ - public com.google.protobuf.ByteString - getCertificateAliasBytes() { - java.lang.Object ref = certificateAlias_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificateAlias_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Alias of the local certificate to be used for token validation
-     * with this issuer
-     * 
- * - * string certificateAlias = 3; - * @param value The certificateAlias to set. - * @return This builder for chaining. - */ - public Builder setCertificateAlias( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - certificateAlias_ = value; - onChanged(); - return this; - } - /** - *
-     * Alias of the local certificate to be used for token validation
-     * with this issuer
-     * 
- * - * string certificateAlias = 3; - * @return This builder for chaining. - */ - public Builder clearCertificateAlias() { - - certificateAlias_ = getDefaultInstance().getCertificateAlias(); - onChanged(); - return this; - } - /** - *
-     * Alias of the local certificate to be used for token validation
-     * with this issuer
-     * 
- * - * string certificateAlias = 3; - * @param value The bytes for certificateAlias to set. - * @return This builder for chaining. - */ - public Builder setCertificateAliasBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - certificateAlias_ = value; - onChanged(); - return this; - } - - private java.lang.Object jwksURL_ = ""; - /** - *
-     * JWKS endpoint of the issuer
-     * 
- * - * string jwksURL = 4; - * @return The jwksURL. - */ - public java.lang.String getJwksURL() { - java.lang.Object ref = jwksURL_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - jwksURL_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * JWKS endpoint of the issuer
-     * 
- * - * string jwksURL = 4; - * @return The bytes for jwksURL. - */ - public com.google.protobuf.ByteString - getJwksURLBytes() { - java.lang.Object ref = jwksURL_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - jwksURL_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * JWKS endpoint of the issuer
-     * 
- * - * string jwksURL = 4; - * @param value The jwksURL to set. - * @return This builder for chaining. - */ - public Builder setJwksURL( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - jwksURL_ = value; - onChanged(); - return this; - } - /** - *
-     * JWKS endpoint of the issuer
-     * 
- * - * string jwksURL = 4; - * @return This builder for chaining. - */ - public Builder clearJwksURL() { - - jwksURL_ = getDefaultInstance().getJwksURL(); - onChanged(); - return this; - } - /** - *
-     * JWKS endpoint of the issuer
-     * 
- * - * string jwksURL = 4; - * @param value The bytes for jwksURL to set. - * @return This builder for chaining. - */ - public Builder setJwksURLBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - jwksURL_ = value; - onChanged(); - return this; - } - - private boolean validateSubscription_ ; - /** - *
-     * Enable or disable subscription validation for this issuer
-     * 
- * - * bool validateSubscription = 5; - * @return The validateSubscription. - */ - @java.lang.Override - public boolean getValidateSubscription() { - return validateSubscription_; - } - /** - *
-     * Enable or disable subscription validation for this issuer
-     * 
- * - * bool validateSubscription = 5; - * @param value The validateSubscription to set. - * @return This builder for chaining. - */ - public Builder setValidateSubscription(boolean value) { - - validateSubscription_ = value; - onChanged(); - return this; - } - /** - *
-     * Enable or disable subscription validation for this issuer
-     * 
- * - * bool validateSubscription = 5; - * @return This builder for chaining. - */ - public Builder clearValidateSubscription() { - - validateSubscription_ = false; - onChanged(); - return this; - } - - private java.lang.Object consumerKeyClaim_ = ""; - /** - *
-     * JWT claim that communicates the consumerKey value
-     * 
- * - * string consumerKeyClaim = 6; - * @return The consumerKeyClaim. - */ - public java.lang.String getConsumerKeyClaim() { - java.lang.Object ref = consumerKeyClaim_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - consumerKeyClaim_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * JWT claim that communicates the consumerKey value
-     * 
- * - * string consumerKeyClaim = 6; - * @return The bytes for consumerKeyClaim. - */ - public com.google.protobuf.ByteString - getConsumerKeyClaimBytes() { - java.lang.Object ref = consumerKeyClaim_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - consumerKeyClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * JWT claim that communicates the consumerKey value
-     * 
- * - * string consumerKeyClaim = 6; - * @param value The consumerKeyClaim to set. - * @return This builder for chaining. - */ - public Builder setConsumerKeyClaim( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - consumerKeyClaim_ = value; - onChanged(); - return this; - } - /** - *
-     * JWT claim that communicates the consumerKey value
-     * 
- * - * string consumerKeyClaim = 6; - * @return This builder for chaining. - */ - public Builder clearConsumerKeyClaim() { - - consumerKeyClaim_ = getDefaultInstance().getConsumerKeyClaim(); - onChanged(); - return this; - } - /** - *
-     * JWT claim that communicates the consumerKey value
-     * 
- * - * string consumerKeyClaim = 6; - * @param value The bytes for consumerKeyClaim to set. - * @return This builder for chaining. - */ - public Builder setConsumerKeyClaimBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - consumerKeyClaim_ = value; - onChanged(); - return this; - } - - private java.lang.Object certificateFilePath_ = ""; - /** - *
-     * FilePath of the public certificate mounted in enforcer container
-     * 
- * - * string certificateFilePath = 7; - * @return The certificateFilePath. - */ - public java.lang.String getCertificateFilePath() { - java.lang.Object ref = certificateFilePath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificateFilePath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * FilePath of the public certificate mounted in enforcer container
-     * 
- * - * string certificateFilePath = 7; - * @return The bytes for certificateFilePath. - */ - public com.google.protobuf.ByteString - getCertificateFilePathBytes() { - java.lang.Object ref = certificateFilePath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificateFilePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * FilePath of the public certificate mounted in enforcer container
-     * 
- * - * string certificateFilePath = 7; - * @param value The certificateFilePath to set. - * @return This builder for chaining. - */ - public Builder setCertificateFilePath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - certificateFilePath_ = value; - onChanged(); - return this; - } - /** - *
-     * FilePath of the public certificate mounted in enforcer container
-     * 
- * - * string certificateFilePath = 7; - * @return This builder for chaining. - */ - public Builder clearCertificateFilePath() { - - certificateFilePath_ = getDefaultInstance().getCertificateFilePath(); - onChanged(); - return this; - } - /** - *
-     * FilePath of the public certificate mounted in enforcer container
-     * 
- * - * string certificateFilePath = 7; - * @param value The bytes for certificateFilePath to set. - * @return This builder for chaining. - */ - public Builder setCertificateFilePathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - certificateFilePath_ = value; - onChanged(); - return this; - } - - private java.util.List claimMapping_ = - java.util.Collections.emptyList(); - private void ensureClaimMappingIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - claimMapping_ = new java.util.ArrayList(claimMapping_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingOrBuilder> claimMappingBuilder_; - - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public java.util.List getClaimMappingList() { - if (claimMappingBuilder_ == null) { - return java.util.Collections.unmodifiableList(claimMapping_); - } else { - return claimMappingBuilder_.getMessageList(); - } - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public int getClaimMappingCount() { - if (claimMappingBuilder_ == null) { - return claimMapping_.size(); - } else { - return claimMappingBuilder_.getCount(); - } - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping getClaimMapping(int index) { - if (claimMappingBuilder_ == null) { - return claimMapping_.get(index); - } else { - return claimMappingBuilder_.getMessage(index); - } - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder setClaimMapping( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping value) { - if (claimMappingBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureClaimMappingIsMutable(); - claimMapping_.set(index, value); - onChanged(); - } else { - claimMappingBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder setClaimMapping( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder builderForValue) { - if (claimMappingBuilder_ == null) { - ensureClaimMappingIsMutable(); - claimMapping_.set(index, builderForValue.build()); - onChanged(); - } else { - claimMappingBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder addClaimMapping(org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping value) { - if (claimMappingBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureClaimMappingIsMutable(); - claimMapping_.add(value); - onChanged(); - } else { - claimMappingBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder addClaimMapping( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping value) { - if (claimMappingBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureClaimMappingIsMutable(); - claimMapping_.add(index, value); - onChanged(); - } else { - claimMappingBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder addClaimMapping( - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder builderForValue) { - if (claimMappingBuilder_ == null) { - ensureClaimMappingIsMutable(); - claimMapping_.add(builderForValue.build()); - onChanged(); - } else { - claimMappingBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder addClaimMapping( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder builderForValue) { - if (claimMappingBuilder_ == null) { - ensureClaimMappingIsMutable(); - claimMapping_.add(index, builderForValue.build()); - onChanged(); - } else { - claimMappingBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder addAllClaimMapping( - java.lang.Iterable values) { - if (claimMappingBuilder_ == null) { - ensureClaimMappingIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, claimMapping_); - onChanged(); - } else { - claimMappingBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder clearClaimMapping() { - if (claimMappingBuilder_ == null) { - claimMapping_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - claimMappingBuilder_.clear(); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public Builder removeClaimMapping(int index) { - if (claimMappingBuilder_ == null) { - ensureClaimMappingIsMutable(); - claimMapping_.remove(index); - onChanged(); - } else { - claimMappingBuilder_.remove(index); - } - return this; - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder getClaimMappingBuilder( - int index) { - return getClaimMappingFieldBuilder().getBuilder(index); - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingOrBuilder getClaimMappingOrBuilder( - int index) { - if (claimMappingBuilder_ == null) { - return claimMapping_.get(index); } else { - return claimMappingBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public java.util.List - getClaimMappingOrBuilderList() { - if (claimMappingBuilder_ != null) { - return claimMappingBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(claimMapping_); - } - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder addClaimMappingBuilder() { - return getClaimMappingFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.getDefaultInstance()); - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder addClaimMappingBuilder( - int index) { - return getClaimMappingFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.getDefaultInstance()); - } - /** - *
-     * Claim mapping for the issuer
-     * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - public java.util.List - getClaimMappingBuilderList() { - return getClaimMappingFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingOrBuilder> - getClaimMappingFieldBuilder() { - if (claimMappingBuilder_ == null) { - claimMappingBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingOrBuilder>( - claimMapping_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - claimMapping_ = null; - } - return claimMappingBuilder_; - } - @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.Issuer) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Issuer) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Issuer DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Issuer(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Issuer getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Issuer parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Issuer(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.Issuer getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/IssuerOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/IssuerOrBuilder.java deleted file mode 100644 index 270f314c95..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/IssuerOrBuilder.java +++ /dev/null @@ -1,185 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/issuer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface IssuerOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Issuer) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Issuer name
-   * 
- * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Issuer name
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * Issuer identifier
-   * 
- * - * string issuer = 2; - * @return The issuer. - */ - java.lang.String getIssuer(); - /** - *
-   * Issuer identifier
-   * 
- * - * string issuer = 2; - * @return The bytes for issuer. - */ - com.google.protobuf.ByteString - getIssuerBytes(); - - /** - *
-   * Alias of the local certificate to be used for token validation
-   * with this issuer
-   * 
- * - * string certificateAlias = 3; - * @return The certificateAlias. - */ - java.lang.String getCertificateAlias(); - /** - *
-   * Alias of the local certificate to be used for token validation
-   * with this issuer
-   * 
- * - * string certificateAlias = 3; - * @return The bytes for certificateAlias. - */ - com.google.protobuf.ByteString - getCertificateAliasBytes(); - - /** - *
-   * JWKS endpoint of the issuer
-   * 
- * - * string jwksURL = 4; - * @return The jwksURL. - */ - java.lang.String getJwksURL(); - /** - *
-   * JWKS endpoint of the issuer
-   * 
- * - * string jwksURL = 4; - * @return The bytes for jwksURL. - */ - com.google.protobuf.ByteString - getJwksURLBytes(); - - /** - *
-   * Enable or disable subscription validation for this issuer
-   * 
- * - * bool validateSubscription = 5; - * @return The validateSubscription. - */ - boolean getValidateSubscription(); - - /** - *
-   * JWT claim that communicates the consumerKey value
-   * 
- * - * string consumerKeyClaim = 6; - * @return The consumerKeyClaim. - */ - java.lang.String getConsumerKeyClaim(); - /** - *
-   * JWT claim that communicates the consumerKey value
-   * 
- * - * string consumerKeyClaim = 6; - * @return The bytes for consumerKeyClaim. - */ - com.google.protobuf.ByteString - getConsumerKeyClaimBytes(); - - /** - *
-   * FilePath of the public certificate mounted in enforcer container
-   * 
- * - * string certificateFilePath = 7; - * @return The certificateFilePath. - */ - java.lang.String getCertificateFilePath(); - /** - *
-   * FilePath of the public certificate mounted in enforcer container
-   * 
- * - * string certificateFilePath = 7; - * @return The bytes for certificateFilePath. - */ - com.google.protobuf.ByteString - getCertificateFilePathBytes(); - - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - java.util.List - getClaimMappingList(); - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMapping getClaimMapping(int index); - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - int getClaimMappingCount(); - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - java.util.List - getClaimMappingOrBuilderList(); - /** - *
-   * Claim mapping for the issuer
-   * 
- * - * repeated .wso2.discovery.config.enforcer.ClaimMapping claimMapping = 8; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingOrBuilder getClaimMappingOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/IssuerProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/IssuerProto.java deleted file mode 100644 index c693483fd1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/IssuerProto.java +++ /dev/null @@ -1,61 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/issuer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class IssuerProto { - private IssuerProto() {} - 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_Issuer_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Issuer_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n+wso2/discovery/config/enforcer/issuer." + - "proto\022\036wso2.discovery.config.enforcer\0322w" + - "so2/discovery/config/enforcer/claim_mapp" + - "ing.proto\"\352\001\n\006Issuer\022\014\n\004name\030\001 \001(\t\022\016\n\006is" + - "suer\030\002 \001(\t\022\030\n\020certificateAlias\030\003 \001(\t\022\017\n\007" + - "jwksURL\030\004 \001(\t\022\034\n\024validateSubscription\030\005 " + - "\001(\010\022\030\n\020consumerKeyClaim\030\006 \001(\t\022\033\n\023certifi" + - "cateFilePath\030\007 \001(\t\022B\n\014claimMapping\030\010 \003(\013" + - "2,.wso2.discovery.config.enforcer.ClaimM" + - "appingB\220\001\n/org.wso2.apk.enforcer.discove" + - "ry.config.enforcerB\013IssuerProtoP\001ZNgithu" + - "b.com/envoyproxy/go-control-plane/wso2/d" + - "iscovery/config/enforcer;enforcerb\006proto" + - "3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingProto.getDescriptor(), - }); - internal_static_wso2_discovery_config_enforcer_Issuer_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Issuer_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Issuer_descriptor, - new java.lang.String[] { "Name", "Issuer", "CertificateAlias", "JwksURL", "ValidateSubscription", "ConsumerKeyClaim", "CertificateFilePath", "ClaimMapping", }); - org.wso2.apk.enforcer.discovery.config.enforcer.ClaimMappingProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGenerator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGenerator.java deleted file mode 100644 index daa6c895d0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGenerator.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_generator.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * JWT Generator model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.JWTGenerator} - */ -public final class JWTGenerator extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.JWTGenerator) - JWTGeneratorOrBuilder { -private static final long serialVersionUID = 0L; - // Use JWTGenerator.newBuilder() to construct. - private JWTGenerator(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JWTGenerator() { - keypairs_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JWTGenerator(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JWTGenerator( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - keypairs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - keypairs_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - keypairs_ = java.util.Collections.unmodifiableList(keypairs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_JWTGenerator_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_JWTGenerator_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.class, org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.Builder.class); - } - - public static final int KEYPAIRS_FIELD_NUMBER = 1; - private java.util.List keypairs_; - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - @java.lang.Override - public java.util.List getKeypairsList() { - return keypairs_; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - @java.lang.Override - public java.util.List - getKeypairsOrBuilderList() { - return keypairs_; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - @java.lang.Override - public int getKeypairsCount() { - return keypairs_.size(); - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Keypair getKeypairs(int index) { - return keypairs_.get(index); - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.KeypairOrBuilder getKeypairsOrBuilder( - int index) { - return keypairs_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < keypairs_.size(); i++) { - output.writeMessage(1, keypairs_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < keypairs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, keypairs_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator other = (org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator) obj; - - if (!getKeypairsList() - .equals(other.getKeypairsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getKeypairsCount() > 0) { - hash = (37 * hash) + KEYPAIRS_FIELD_NUMBER; - hash = (53 * hash) + getKeypairsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator 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.JWTGenerator parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator 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.JWTGenerator parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator 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.JWTGenerator 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.JWTGenerator 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.JWTGenerator 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.JWTGenerator 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.JWTGenerator 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.JWTGenerator 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.JWTGenerator 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; - } - /** - *
-   * JWT Generator model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.JWTGenerator} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.JWTGenerator) - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_JWTGenerator_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_JWTGenerator_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.class, org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getKeypairsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (keypairsBuilder_ == null) { - keypairs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - keypairsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_JWTGenerator_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator build() { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator result = new org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator(this); - int from_bitField0_ = bitField0_; - if (keypairsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - keypairs_ = java.util.Collections.unmodifiableList(keypairs_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.keypairs_ = keypairs_; - } else { - result.keypairs_ = keypairsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator.getDefaultInstance()) return this; - if (keypairsBuilder_ == null) { - if (!other.keypairs_.isEmpty()) { - if (keypairs_.isEmpty()) { - keypairs_ = other.keypairs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureKeypairsIsMutable(); - keypairs_.addAll(other.keypairs_); - } - onChanged(); - } - } else { - if (!other.keypairs_.isEmpty()) { - if (keypairsBuilder_.isEmpty()) { - keypairsBuilder_.dispose(); - keypairsBuilder_ = null; - keypairs_ = other.keypairs_; - bitField0_ = (bitField0_ & ~0x00000001); - keypairsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getKeypairsFieldBuilder() : null; - } else { - keypairsBuilder_.addAllMessages(other.keypairs_); - } - } - } - 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.JWTGenerator parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List keypairs_ = - java.util.Collections.emptyList(); - private void ensureKeypairsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - keypairs_ = new java.util.ArrayList(keypairs_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.KeypairOrBuilder> keypairsBuilder_; - - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public java.util.List getKeypairsList() { - if (keypairsBuilder_ == null) { - return java.util.Collections.unmodifiableList(keypairs_); - } else { - return keypairsBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public int getKeypairsCount() { - if (keypairsBuilder_ == null) { - return keypairs_.size(); - } else { - return keypairsBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Keypair getKeypairs(int index) { - if (keypairsBuilder_ == null) { - return keypairs_.get(index); - } else { - return keypairsBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder setKeypairs( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair value) { - if (keypairsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKeypairsIsMutable(); - keypairs_.set(index, value); - onChanged(); - } else { - keypairsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder setKeypairs( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder builderForValue) { - if (keypairsBuilder_ == null) { - ensureKeypairsIsMutable(); - keypairs_.set(index, builderForValue.build()); - onChanged(); - } else { - keypairsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder addKeypairs(org.wso2.apk.enforcer.discovery.config.enforcer.Keypair value) { - if (keypairsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKeypairsIsMutable(); - keypairs_.add(value); - onChanged(); - } else { - keypairsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder addKeypairs( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair value) { - if (keypairsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKeypairsIsMutable(); - keypairs_.add(index, value); - onChanged(); - } else { - keypairsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder addKeypairs( - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder builderForValue) { - if (keypairsBuilder_ == null) { - ensureKeypairsIsMutable(); - keypairs_.add(builderForValue.build()); - onChanged(); - } else { - keypairsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder addKeypairs( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder builderForValue) { - if (keypairsBuilder_ == null) { - ensureKeypairsIsMutable(); - keypairs_.add(index, builderForValue.build()); - onChanged(); - } else { - keypairsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder addAllKeypairs( - java.lang.Iterable values) { - if (keypairsBuilder_ == null) { - ensureKeypairsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, keypairs_); - onChanged(); - } else { - keypairsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder clearKeypairs() { - if (keypairsBuilder_ == null) { - keypairs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - keypairsBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public Builder removeKeypairs(int index) { - if (keypairsBuilder_ == null) { - ensureKeypairsIsMutable(); - keypairs_.remove(index); - onChanged(); - } else { - keypairsBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder getKeypairsBuilder( - int index) { - return getKeypairsFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.KeypairOrBuilder getKeypairsOrBuilder( - int index) { - if (keypairsBuilder_ == null) { - return keypairs_.get(index); } else { - return keypairsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public java.util.List - getKeypairsOrBuilderList() { - if (keypairsBuilder_ != null) { - return keypairsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(keypairs_); - } - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder addKeypairsBuilder() { - return getKeypairsFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder addKeypairsBuilder( - int index) { - return getKeypairsFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - public java.util.List - getKeypairsBuilderList() { - return getKeypairsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.KeypairOrBuilder> - getKeypairsFieldBuilder() { - if (keypairsBuilder_ == null) { - keypairsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.KeypairOrBuilder>( - keypairs_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - keypairs_ = null; - } - return keypairsBuilder_; - } - @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.JWTGenerator) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.JWTGenerator) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTGenerator getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JWTGenerator parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JWTGenerator(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.JWTGenerator getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGeneratorOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGeneratorOrBuilder.java deleted file mode 100644 index 3967664670..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGeneratorOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_generator.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface JWTGeneratorOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.JWTGenerator) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - java.util.List - getKeypairsList(); - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair getKeypairs(int index); - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - int getKeypairsCount(); - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - java.util.List - getKeypairsOrBuilderList(); - /** - * repeated .wso2.discovery.config.enforcer.Keypair keypairs = 1; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.KeypairOrBuilder getKeypairsOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGeneratorProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGeneratorProto.java deleted file mode 100644 index 5e542d9382..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTGeneratorProto.java +++ /dev/null @@ -1,67 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_generator.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class JWTGeneratorProto { - private JWTGeneratorProto() {} - 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_JWTGenerator_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_JWTGenerator_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_config_enforcer_Keypair_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Keypair_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n2wso2/discovery/config/enforcer/jwt_gen" + - "erator.proto\022\036wso2.discovery.config.enfo" + - "rcer\"I\n\014JWTGenerator\0229\n\010keypairs\030\001 \003(\0132\'" + - ".wso2.discovery.config.enforcer.Keypair\"" + - "]\n\007Keypair\022\037\n\027public_certificate_path\030\001 " + - "\001(\t\022\030\n\020private_key_path\030\002 \001(\t\022\027\n\017use_for" + - "_signing\030\003 \001(\010B\226\001\n/org.wso2.apk.enforcer" + - ".discovery.config.enforcerB\021JWTGenerator" + - "ProtoP\001ZNgithub.com/envoyproxy/go-contro" + - "l-plane/wso2/discovery/config/enforcer;e" + - "nforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_JWTGenerator_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_JWTGenerator_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_JWTGenerator_descriptor, - new java.lang.String[] { "Keypairs", }); - internal_static_wso2_discovery_config_enforcer_Keypair_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_config_enforcer_Keypair_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Keypair_descriptor, - new java.lang.String[] { "PublicCertificatePath", "PrivateKeyPath", "UseForSigning", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuer.java deleted file mode 100644 index 744521728b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuer.java +++ /dev/null @@ -1,1735 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_issuer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * JWT Issuer model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.JWTIssuer} - */ -public final class JWTIssuer extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.JWTIssuer) - JWTIssuerOrBuilder { -private static final long serialVersionUID = 0L; - // Use JWTIssuer.newBuilder() to construct. - private JWTIssuer(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JWTIssuer() { - issuer_ = ""; - encoding_ = ""; - claimDialect_ = ""; - signingAlgorithm_ = ""; - publicCertificatePath_ = ""; - privateKeyPath_ = ""; - jwtUsers_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JWTIssuer(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JWTIssuer( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - enabled_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - issuer_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - encoding_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - claimDialect_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - signingAlgorithm_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - publicCertificatePath_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - privateKeyPath_ = s; - break; - } - case 64: { - - validityPeriod_ = input.readInt32(); - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - jwtUsers_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - jwtUsers_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - jwtUsers_ = java.util.Collections.unmodifiableList(jwtUsers_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuerProto.internal_static_wso2_discovery_config_enforcer_JWTIssuer_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuerProto.internal_static_wso2_discovery_config_enforcer_JWTIssuer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer.class, org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int ISSUER_FIELD_NUMBER = 2; - private volatile java.lang.Object issuer_; - /** - * string issuer = 2; - * @return The issuer. - */ - @java.lang.Override - public java.lang.String getIssuer() { - java.lang.Object ref = issuer_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - issuer_ = s; - return s; - } - } - /** - * string issuer = 2; - * @return The bytes for issuer. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIssuerBytes() { - java.lang.Object ref = issuer_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - issuer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENCODING_FIELD_NUMBER = 3; - private volatile java.lang.Object encoding_; - /** - * string encoding = 3; - * @return The encoding. - */ - @java.lang.Override - public java.lang.String getEncoding() { - java.lang.Object ref = encoding_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - encoding_ = s; - return s; - } - } - /** - * string encoding = 3; - * @return The bytes for encoding. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEncodingBytes() { - java.lang.Object ref = encoding_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - encoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLAIM_DIALECT_FIELD_NUMBER = 4; - private volatile java.lang.Object claimDialect_; - /** - * string claim_dialect = 4; - * @return The claimDialect. - */ - @java.lang.Override - public java.lang.String getClaimDialect() { - java.lang.Object ref = claimDialect_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - claimDialect_ = s; - return s; - } - } - /** - * string claim_dialect = 4; - * @return The bytes for claimDialect. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClaimDialectBytes() { - java.lang.Object ref = claimDialect_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - claimDialect_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SIGNING_ALGORITHM_FIELD_NUMBER = 5; - private volatile java.lang.Object signingAlgorithm_; - /** - * string signing_algorithm = 5; - * @return The signingAlgorithm. - */ - @java.lang.Override - public java.lang.String getSigningAlgorithm() { - java.lang.Object ref = signingAlgorithm_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - signingAlgorithm_ = s; - return s; - } - } - /** - * string signing_algorithm = 5; - * @return The bytes for signingAlgorithm. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSigningAlgorithmBytes() { - java.lang.Object ref = signingAlgorithm_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - signingAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PUBLIC_CERTIFICATE_PATH_FIELD_NUMBER = 6; - private volatile java.lang.Object publicCertificatePath_; - /** - * string public_certificate_path = 6; - * @return The publicCertificatePath. - */ - @java.lang.Override - public java.lang.String getPublicCertificatePath() { - java.lang.Object ref = publicCertificatePath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - publicCertificatePath_ = s; - return s; - } - } - /** - * string public_certificate_path = 6; - * @return The bytes for publicCertificatePath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPublicCertificatePathBytes() { - java.lang.Object ref = publicCertificatePath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - publicCertificatePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PRIVATE_KEY_PATH_FIELD_NUMBER = 7; - private volatile java.lang.Object privateKeyPath_; - /** - * string private_key_path = 7; - * @return The privateKeyPath. - */ - @java.lang.Override - public java.lang.String getPrivateKeyPath() { - java.lang.Object ref = privateKeyPath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - privateKeyPath_ = s; - return s; - } - } - /** - * string private_key_path = 7; - * @return The bytes for privateKeyPath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPrivateKeyPathBytes() { - java.lang.Object ref = privateKeyPath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - privateKeyPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALIDITY_PERIOD_FIELD_NUMBER = 8; - private int validityPeriod_; - /** - * int32 validity_period = 8; - * @return The validityPeriod. - */ - @java.lang.Override - public int getValidityPeriod() { - return validityPeriod_; - } - - public static final int JWT_USERS_FIELD_NUMBER = 9; - private java.util.List jwtUsers_; - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - @java.lang.Override - public java.util.List getJwtUsersList() { - return jwtUsers_; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - @java.lang.Override - public java.util.List - getJwtUsersOrBuilderList() { - return jwtUsers_; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - @java.lang.Override - public int getJwtUsersCount() { - return jwtUsers_.size(); - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser getJwtUsers(int index) { - return jwtUsers_.get(index); - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserOrBuilder getJwtUsersOrBuilder( - int index) { - return jwtUsers_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (enabled_ != false) { - output.writeBool(1, enabled_); - } - if (!getIssuerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, issuer_); - } - if (!getEncodingBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, encoding_); - } - if (!getClaimDialectBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, claimDialect_); - } - if (!getSigningAlgorithmBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, signingAlgorithm_); - } - if (!getPublicCertificatePathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, publicCertificatePath_); - } - if (!getPrivateKeyPathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, privateKeyPath_); - } - if (validityPeriod_ != 0) { - output.writeInt32(8, validityPeriod_); - } - for (int i = 0; i < jwtUsers_.size(); i++) { - output.writeMessage(9, jwtUsers_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enabled_); - } - if (!getIssuerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, issuer_); - } - if (!getEncodingBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, encoding_); - } - if (!getClaimDialectBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, claimDialect_); - } - if (!getSigningAlgorithmBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, signingAlgorithm_); - } - if (!getPublicCertificatePathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, publicCertificatePath_); - } - if (!getPrivateKeyPathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, privateKeyPath_); - } - if (validityPeriod_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(8, validityPeriod_); - } - for (int i = 0; i < jwtUsers_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, jwtUsers_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer other = (org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer) obj; - - if (getEnabled() - != other.getEnabled()) return false; - if (!getIssuer() - .equals(other.getIssuer())) return false; - if (!getEncoding() - .equals(other.getEncoding())) return false; - if (!getClaimDialect() - .equals(other.getClaimDialect())) return false; - if (!getSigningAlgorithm() - .equals(other.getSigningAlgorithm())) return false; - if (!getPublicCertificatePath() - .equals(other.getPublicCertificatePath())) return false; - if (!getPrivateKeyPath() - .equals(other.getPrivateKeyPath())) return false; - if (getValidityPeriod() - != other.getValidityPeriod()) return false; - if (!getJwtUsersList() - .equals(other.getJwtUsersList())) 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) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - hash = (37 * hash) + ISSUER_FIELD_NUMBER; - hash = (53 * hash) + getIssuer().hashCode(); - hash = (37 * hash) + ENCODING_FIELD_NUMBER; - hash = (53 * hash) + getEncoding().hashCode(); - hash = (37 * hash) + CLAIM_DIALECT_FIELD_NUMBER; - hash = (53 * hash) + getClaimDialect().hashCode(); - hash = (37 * hash) + SIGNING_ALGORITHM_FIELD_NUMBER; - hash = (53 * hash) + getSigningAlgorithm().hashCode(); - hash = (37 * hash) + PUBLIC_CERTIFICATE_PATH_FIELD_NUMBER; - hash = (53 * hash) + getPublicCertificatePath().hashCode(); - hash = (37 * hash) + PRIVATE_KEY_PATH_FIELD_NUMBER; - hash = (53 * hash) + getPrivateKeyPath().hashCode(); - hash = (37 * hash) + VALIDITY_PERIOD_FIELD_NUMBER; - hash = (53 * hash) + getValidityPeriod(); - if (getJwtUsersCount() > 0) { - hash = (37 * hash) + JWT_USERS_FIELD_NUMBER; - hash = (53 * hash) + getJwtUsersList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer 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.JWTIssuer parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer 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.JWTIssuer parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer 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.JWTIssuer 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.JWTIssuer 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.JWTIssuer 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.JWTIssuer 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.JWTIssuer 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.JWTIssuer 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.JWTIssuer 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; - } - /** - *
-   * JWT Issuer model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.JWTIssuer} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.JWTIssuer) - org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuerOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuerProto.internal_static_wso2_discovery_config_enforcer_JWTIssuer_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuerProto.internal_static_wso2_discovery_config_enforcer_JWTIssuer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer.class, org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getJwtUsersFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - enabled_ = false; - - issuer_ = ""; - - encoding_ = ""; - - claimDialect_ = ""; - - signingAlgorithm_ = ""; - - publicCertificatePath_ = ""; - - privateKeyPath_ = ""; - - validityPeriod_ = 0; - - if (jwtUsersBuilder_ == null) { - jwtUsers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - jwtUsersBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuerProto.internal_static_wso2_discovery_config_enforcer_JWTIssuer_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer build() { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer result = new org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer(this); - int from_bitField0_ = bitField0_; - result.enabled_ = enabled_; - result.issuer_ = issuer_; - result.encoding_ = encoding_; - result.claimDialect_ = claimDialect_; - result.signingAlgorithm_ = signingAlgorithm_; - result.publicCertificatePath_ = publicCertificatePath_; - result.privateKeyPath_ = privateKeyPath_; - result.validityPeriod_ = validityPeriod_; - if (jwtUsersBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - jwtUsers_ = java.util.Collections.unmodifiableList(jwtUsers_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.jwtUsers_ = jwtUsers_; - } else { - result.jwtUsers_ = jwtUsersBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer.getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (!other.getIssuer().isEmpty()) { - issuer_ = other.issuer_; - onChanged(); - } - if (!other.getEncoding().isEmpty()) { - encoding_ = other.encoding_; - onChanged(); - } - if (!other.getClaimDialect().isEmpty()) { - claimDialect_ = other.claimDialect_; - onChanged(); - } - if (!other.getSigningAlgorithm().isEmpty()) { - signingAlgorithm_ = other.signingAlgorithm_; - onChanged(); - } - if (!other.getPublicCertificatePath().isEmpty()) { - publicCertificatePath_ = other.publicCertificatePath_; - onChanged(); - } - if (!other.getPrivateKeyPath().isEmpty()) { - privateKeyPath_ = other.privateKeyPath_; - onChanged(); - } - if (other.getValidityPeriod() != 0) { - setValidityPeriod(other.getValidityPeriod()); - } - if (jwtUsersBuilder_ == null) { - if (!other.jwtUsers_.isEmpty()) { - if (jwtUsers_.isEmpty()) { - jwtUsers_ = other.jwtUsers_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureJwtUsersIsMutable(); - jwtUsers_.addAll(other.jwtUsers_); - } - onChanged(); - } - } else { - if (!other.jwtUsers_.isEmpty()) { - if (jwtUsersBuilder_.isEmpty()) { - jwtUsersBuilder_.dispose(); - jwtUsersBuilder_ = null; - jwtUsers_ = other.jwtUsers_; - bitField0_ = (bitField0_ & ~0x00000001); - jwtUsersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getJwtUsersFieldBuilder() : null; - } else { - jwtUsersBuilder_.addAllMessages(other.jwtUsers_); - } - } - } - 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.JWTIssuer parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private boolean enabled_ ; - /** - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 1; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * bool enabled = 1; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private java.lang.Object issuer_ = ""; - /** - * string issuer = 2; - * @return The issuer. - */ - public java.lang.String getIssuer() { - java.lang.Object ref = issuer_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - issuer_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string issuer = 2; - * @return The bytes for issuer. - */ - public com.google.protobuf.ByteString - getIssuerBytes() { - java.lang.Object ref = issuer_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - issuer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string issuer = 2; - * @param value The issuer to set. - * @return This builder for chaining. - */ - public Builder setIssuer( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - issuer_ = value; - onChanged(); - return this; - } - /** - * string issuer = 2; - * @return This builder for chaining. - */ - public Builder clearIssuer() { - - issuer_ = getDefaultInstance().getIssuer(); - onChanged(); - return this; - } - /** - * string issuer = 2; - * @param value The bytes for issuer to set. - * @return This builder for chaining. - */ - public Builder setIssuerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - issuer_ = value; - onChanged(); - return this; - } - - private java.lang.Object encoding_ = ""; - /** - * string encoding = 3; - * @return The encoding. - */ - public java.lang.String getEncoding() { - java.lang.Object ref = encoding_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - encoding_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string encoding = 3; - * @return The bytes for encoding. - */ - public com.google.protobuf.ByteString - getEncodingBytes() { - java.lang.Object ref = encoding_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - encoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string encoding = 3; - * @param value The encoding to set. - * @return This builder for chaining. - */ - public Builder setEncoding( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - encoding_ = value; - onChanged(); - return this; - } - /** - * string encoding = 3; - * @return This builder for chaining. - */ - public Builder clearEncoding() { - - encoding_ = getDefaultInstance().getEncoding(); - onChanged(); - return this; - } - /** - * string encoding = 3; - * @param value The bytes for encoding to set. - * @return This builder for chaining. - */ - public Builder setEncodingBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - encoding_ = value; - onChanged(); - return this; - } - - private java.lang.Object claimDialect_ = ""; - /** - * string claim_dialect = 4; - * @return The claimDialect. - */ - public java.lang.String getClaimDialect() { - java.lang.Object ref = claimDialect_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - claimDialect_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string claim_dialect = 4; - * @return The bytes for claimDialect. - */ - public com.google.protobuf.ByteString - getClaimDialectBytes() { - java.lang.Object ref = claimDialect_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - claimDialect_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string claim_dialect = 4; - * @param value The claimDialect to set. - * @return This builder for chaining. - */ - public Builder setClaimDialect( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - claimDialect_ = value; - onChanged(); - return this; - } - /** - * string claim_dialect = 4; - * @return This builder for chaining. - */ - public Builder clearClaimDialect() { - - claimDialect_ = getDefaultInstance().getClaimDialect(); - onChanged(); - return this; - } - /** - * string claim_dialect = 4; - * @param value The bytes for claimDialect to set. - * @return This builder for chaining. - */ - public Builder setClaimDialectBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - claimDialect_ = value; - onChanged(); - return this; - } - - private java.lang.Object signingAlgorithm_ = ""; - /** - * string signing_algorithm = 5; - * @return The signingAlgorithm. - */ - public java.lang.String getSigningAlgorithm() { - java.lang.Object ref = signingAlgorithm_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - signingAlgorithm_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string signing_algorithm = 5; - * @return The bytes for signingAlgorithm. - */ - public com.google.protobuf.ByteString - getSigningAlgorithmBytes() { - java.lang.Object ref = signingAlgorithm_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - signingAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string signing_algorithm = 5; - * @param value The signingAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setSigningAlgorithm( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - signingAlgorithm_ = value; - onChanged(); - return this; - } - /** - * string signing_algorithm = 5; - * @return This builder for chaining. - */ - public Builder clearSigningAlgorithm() { - - signingAlgorithm_ = getDefaultInstance().getSigningAlgorithm(); - onChanged(); - return this; - } - /** - * string signing_algorithm = 5; - * @param value The bytes for signingAlgorithm to set. - * @return This builder for chaining. - */ - public Builder setSigningAlgorithmBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - signingAlgorithm_ = value; - onChanged(); - return this; - } - - private java.lang.Object publicCertificatePath_ = ""; - /** - * string public_certificate_path = 6; - * @return The publicCertificatePath. - */ - public java.lang.String getPublicCertificatePath() { - java.lang.Object ref = publicCertificatePath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - publicCertificatePath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string public_certificate_path = 6; - * @return The bytes for publicCertificatePath. - */ - public com.google.protobuf.ByteString - getPublicCertificatePathBytes() { - java.lang.Object ref = publicCertificatePath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - publicCertificatePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string public_certificate_path = 6; - * @param value The publicCertificatePath to set. - * @return This builder for chaining. - */ - public Builder setPublicCertificatePath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - publicCertificatePath_ = value; - onChanged(); - return this; - } - /** - * string public_certificate_path = 6; - * @return This builder for chaining. - */ - public Builder clearPublicCertificatePath() { - - publicCertificatePath_ = getDefaultInstance().getPublicCertificatePath(); - onChanged(); - return this; - } - /** - * string public_certificate_path = 6; - * @param value The bytes for publicCertificatePath to set. - * @return This builder for chaining. - */ - public Builder setPublicCertificatePathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - publicCertificatePath_ = value; - onChanged(); - return this; - } - - private java.lang.Object privateKeyPath_ = ""; - /** - * string private_key_path = 7; - * @return The privateKeyPath. - */ - public java.lang.String getPrivateKeyPath() { - java.lang.Object ref = privateKeyPath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - privateKeyPath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string private_key_path = 7; - * @return The bytes for privateKeyPath. - */ - public com.google.protobuf.ByteString - getPrivateKeyPathBytes() { - java.lang.Object ref = privateKeyPath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - privateKeyPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string private_key_path = 7; - * @param value The privateKeyPath to set. - * @return This builder for chaining. - */ - public Builder setPrivateKeyPath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - privateKeyPath_ = value; - onChanged(); - return this; - } - /** - * string private_key_path = 7; - * @return This builder for chaining. - */ - public Builder clearPrivateKeyPath() { - - privateKeyPath_ = getDefaultInstance().getPrivateKeyPath(); - onChanged(); - return this; - } - /** - * string private_key_path = 7; - * @param value The bytes for privateKeyPath to set. - * @return This builder for chaining. - */ - public Builder setPrivateKeyPathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - privateKeyPath_ = value; - onChanged(); - return this; - } - - private int validityPeriod_ ; - /** - * int32 validity_period = 8; - * @return The validityPeriod. - */ - @java.lang.Override - public int getValidityPeriod() { - return validityPeriod_; - } - /** - * int32 validity_period = 8; - * @param value The validityPeriod to set. - * @return This builder for chaining. - */ - public Builder setValidityPeriod(int value) { - - validityPeriod_ = value; - onChanged(); - return this; - } - /** - * int32 validity_period = 8; - * @return This builder for chaining. - */ - public Builder clearValidityPeriod() { - - validityPeriod_ = 0; - onChanged(); - return this; - } - - private java.util.List jwtUsers_ = - java.util.Collections.emptyList(); - private void ensureJwtUsersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - jwtUsers_ = new java.util.ArrayList(jwtUsers_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserOrBuilder> jwtUsersBuilder_; - - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public java.util.List getJwtUsersList() { - if (jwtUsersBuilder_ == null) { - return java.util.Collections.unmodifiableList(jwtUsers_); - } else { - return jwtUsersBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public int getJwtUsersCount() { - if (jwtUsersBuilder_ == null) { - return jwtUsers_.size(); - } else { - return jwtUsersBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser getJwtUsers(int index) { - if (jwtUsersBuilder_ == null) { - return jwtUsers_.get(index); - } else { - return jwtUsersBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder setJwtUsers( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser value) { - if (jwtUsersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJwtUsersIsMutable(); - jwtUsers_.set(index, value); - onChanged(); - } else { - jwtUsersBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder setJwtUsers( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder builderForValue) { - if (jwtUsersBuilder_ == null) { - ensureJwtUsersIsMutable(); - jwtUsers_.set(index, builderForValue.build()); - onChanged(); - } else { - jwtUsersBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder addJwtUsers(org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser value) { - if (jwtUsersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJwtUsersIsMutable(); - jwtUsers_.add(value); - onChanged(); - } else { - jwtUsersBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder addJwtUsers( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser value) { - if (jwtUsersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJwtUsersIsMutable(); - jwtUsers_.add(index, value); - onChanged(); - } else { - jwtUsersBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder addJwtUsers( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder builderForValue) { - if (jwtUsersBuilder_ == null) { - ensureJwtUsersIsMutable(); - jwtUsers_.add(builderForValue.build()); - onChanged(); - } else { - jwtUsersBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder addJwtUsers( - int index, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder builderForValue) { - if (jwtUsersBuilder_ == null) { - ensureJwtUsersIsMutable(); - jwtUsers_.add(index, builderForValue.build()); - onChanged(); - } else { - jwtUsersBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder addAllJwtUsers( - java.lang.Iterable values) { - if (jwtUsersBuilder_ == null) { - ensureJwtUsersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, jwtUsers_); - onChanged(); - } else { - jwtUsersBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder clearJwtUsers() { - if (jwtUsersBuilder_ == null) { - jwtUsers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - jwtUsersBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public Builder removeJwtUsers(int index) { - if (jwtUsersBuilder_ == null) { - ensureJwtUsersIsMutable(); - jwtUsers_.remove(index); - onChanged(); - } else { - jwtUsersBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder getJwtUsersBuilder( - int index) { - return getJwtUsersFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserOrBuilder getJwtUsersOrBuilder( - int index) { - if (jwtUsersBuilder_ == null) { - return jwtUsers_.get(index); } else { - return jwtUsersBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public java.util.List - getJwtUsersOrBuilderList() { - if (jwtUsersBuilder_ != null) { - return jwtUsersBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(jwtUsers_); - } - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder addJwtUsersBuilder() { - return getJwtUsersFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder addJwtUsersBuilder( - int index) { - return getJwtUsersFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - public java.util.List - getJwtUsersBuilderList() { - return getJwtUsersFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserOrBuilder> - getJwtUsersFieldBuilder() { - if (jwtUsersBuilder_ == null) { - jwtUsersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserOrBuilder>( - jwtUsers_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - jwtUsers_ = null; - } - return jwtUsersBuilder_; - } - @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.JWTIssuer) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.JWTIssuer) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTIssuer getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JWTIssuer parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JWTIssuer(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.JWTIssuer getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuerOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuerOrBuilder.java deleted file mode 100644 index 50e56fa00b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuerOrBuilder.java +++ /dev/null @@ -1,117 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_issuer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface JWTIssuerOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.JWTIssuer) - com.google.protobuf.MessageOrBuilder { - - /** - * bool enabled = 1; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * string issuer = 2; - * @return The issuer. - */ - java.lang.String getIssuer(); - /** - * string issuer = 2; - * @return The bytes for issuer. - */ - com.google.protobuf.ByteString - getIssuerBytes(); - - /** - * string encoding = 3; - * @return The encoding. - */ - java.lang.String getEncoding(); - /** - * string encoding = 3; - * @return The bytes for encoding. - */ - com.google.protobuf.ByteString - getEncodingBytes(); - - /** - * string claim_dialect = 4; - * @return The claimDialect. - */ - java.lang.String getClaimDialect(); - /** - * string claim_dialect = 4; - * @return The bytes for claimDialect. - */ - com.google.protobuf.ByteString - getClaimDialectBytes(); - - /** - * string signing_algorithm = 5; - * @return The signingAlgorithm. - */ - java.lang.String getSigningAlgorithm(); - /** - * string signing_algorithm = 5; - * @return The bytes for signingAlgorithm. - */ - com.google.protobuf.ByteString - getSigningAlgorithmBytes(); - - /** - * string public_certificate_path = 6; - * @return The publicCertificatePath. - */ - java.lang.String getPublicCertificatePath(); - /** - * string public_certificate_path = 6; - * @return The bytes for publicCertificatePath. - */ - com.google.protobuf.ByteString - getPublicCertificatePathBytes(); - - /** - * string private_key_path = 7; - * @return The privateKeyPath. - */ - java.lang.String getPrivateKeyPath(); - /** - * string private_key_path = 7; - * @return The bytes for privateKeyPath. - */ - com.google.protobuf.ByteString - getPrivateKeyPathBytes(); - - /** - * int32 validity_period = 8; - * @return The validityPeriod. - */ - int getValidityPeriod(); - - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - java.util.List - getJwtUsersList(); - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser getJwtUsers(int index); - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - int getJwtUsersCount(); - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - java.util.List - getJwtUsersOrBuilderList(); - /** - * repeated .wso2.discovery.config.enforcer.JWTUser jwt_users = 9; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserOrBuilder getJwtUsersOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuerProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuerProto.java deleted file mode 100644 index 8383d22d35..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTIssuerProto.java +++ /dev/null @@ -1,61 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_issuer.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class JWTIssuerProto { - private JWTIssuerProto() {} - 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_JWTIssuer_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_JWTIssuer_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n/wso2/discovery/config/enforcer/jwt_iss" + - "uer.proto\022\036wso2.discovery.config.enforce" + - "r\032-wso2/discovery/config/enforcer/jwt_us" + - "er.proto\"\200\002\n\tJWTIssuer\022\017\n\007enabled\030\001 \001(\010\022" + - "\016\n\006issuer\030\002 \001(\t\022\020\n\010encoding\030\003 \001(\t\022\025\n\rcla" + - "im_dialect\030\004 \001(\t\022\031\n\021signing_algorithm\030\005 " + - "\001(\t\022\037\n\027public_certificate_path\030\006 \001(\t\022\030\n\020" + - "private_key_path\030\007 \001(\t\022\027\n\017validity_perio" + - "d\030\010 \001(\005\022:\n\tjwt_users\030\t \003(\0132\'.wso2.discov" + - "ery.config.enforcer.JWTUserB\223\001\n/org.wso2" + - ".apk.enforcer.discovery.config.enforcerB" + - "\016JWTIssuerProtoP\001ZNgithub.com/envoyproxy" + - "/go-control-plane/wso2/discovery/config/" + - "enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserProto.getDescriptor(), - }); - internal_static_wso2_discovery_config_enforcer_JWTIssuer_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_JWTIssuer_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_JWTIssuer_descriptor, - new java.lang.String[] { "Enabled", "Issuer", "Encoding", "ClaimDialect", "SigningAlgorithm", "PublicCertificatePath", "PrivateKeyPath", "ValidityPeriod", "JwtUsers", }); - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUser.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUser.java deleted file mode 100644 index edfe9278b9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUser.java +++ /dev/null @@ -1,703 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_user.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * JWT User model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.JWTUser} - */ -public final class JWTUser extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.JWTUser) - JWTUserOrBuilder { -private static final long serialVersionUID = 0L; - // Use JWTUser.newBuilder() to construct. - private JWTUser(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JWTUser() { - username_ = ""; - password_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JWTUser(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JWTUser( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - username_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - password_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserProto.internal_static_wso2_discovery_config_enforcer_JWTUser_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserProto.internal_static_wso2_discovery_config_enforcer_JWTUser_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.class, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder.class); - } - - public static final int USERNAME_FIELD_NUMBER = 1; - private volatile java.lang.Object username_; - /** - * string username = 1; - * @return The username. - */ - @java.lang.Override - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } - } - /** - * string username = 1; - * @return The bytes for username. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PASSWORD_FIELD_NUMBER = 2; - private volatile java.lang.Object password_; - /** - * string password = 2; - * @return The password. - */ - @java.lang.Override - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } - } - /** - * string password = 2; - * @return The bytes for password. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUsernameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); - } - if (!getPasswordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUsernameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); - } - if (!getPasswordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); - } - 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.JWTUser)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser other = (org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser) obj; - - if (!getUsername() - .equals(other.getUsername())) return false; - if (!getPassword() - .equals(other.getPassword())) 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) + USERNAME_FIELD_NUMBER; - hash = (53 * hash) + getUsername().hashCode(); - hash = (37 * hash) + PASSWORD_FIELD_NUMBER; - hash = (53 * hash) + getPassword().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser 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.JWTUser parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser 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.JWTUser parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser 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.JWTUser 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.JWTUser 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.JWTUser 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.JWTUser 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.JWTUser 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.JWTUser 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.JWTUser 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; - } - /** - *
-   * JWT User model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.JWTUser} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.JWTUser) - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserProto.internal_static_wso2_discovery_config_enforcer_JWTUser_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserProto.internal_static_wso2_discovery_config_enforcer_JWTUser_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.class, org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.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(); - username_ = ""; - - password_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTUserProto.internal_static_wso2_discovery_config_enforcer_JWTUser_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser build() { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser result = new org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser(this); - result.username_ = username_; - result.password_ = password_; - 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.JWTUser) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser.getDefaultInstance()) return this; - if (!other.getUsername().isEmpty()) { - username_ = other.username_; - onChanged(); - } - if (!other.getPassword().isEmpty()) { - password_ = other.password_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object username_ = ""; - /** - * string username = 1; - * @return The username. - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string username = 1; - * @return The bytes for username. - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string username = 1; - * @param value The username to set. - * @return This builder for chaining. - */ - public Builder setUsername( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - username_ = value; - onChanged(); - return this; - } - /** - * string username = 1; - * @return This builder for chaining. - */ - public Builder clearUsername() { - - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - /** - * string username = 1; - * @param value The bytes for username to set. - * @return This builder for chaining. - */ - public Builder setUsernameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - username_ = value; - onChanged(); - return this; - } - - private java.lang.Object password_ = ""; - /** - * string password = 2; - * @return The password. - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string password = 2; - * @return The bytes for password. - */ - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string password = 2; - * @param value The password to set. - * @return This builder for chaining. - */ - public Builder setPassword( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - password_ = value; - onChanged(); - return this; - } - /** - * string password = 2; - * @return This builder for chaining. - */ - public Builder clearPassword() { - - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - /** - * string password = 2; - * @param value The bytes for password to set. - * @return This builder for chaining. - */ - public Builder setPasswordBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - password_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.config.enforcer.JWTUser) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.JWTUser) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.JWTUser getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JWTUser parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JWTUser(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.JWTUser getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUserOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUserOrBuilder.java deleted file mode 100644 index f8c3784437..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUserOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_user.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface JWTUserOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.JWTUser) - com.google.protobuf.MessageOrBuilder { - - /** - * string username = 1; - * @return The username. - */ - java.lang.String getUsername(); - /** - * string username = 1; - * @return The bytes for username. - */ - com.google.protobuf.ByteString - getUsernameBytes(); - - /** - * string password = 2; - * @return The password. - */ - java.lang.String getPassword(); - /** - * string password = 2; - * @return The bytes for password. - */ - com.google.protobuf.ByteString - getPasswordBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUserProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUserProto.java deleted file mode 100644 index 86984bfa2d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/JWTUserProto.java +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_user.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class JWTUserProto { - private JWTUserProto() {} - 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_JWTUser_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_JWTUser_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n-wso2/discovery/config/enforcer/jwt_use" + - "r.proto\022\036wso2.discovery.config.enforcer\"" + - "-\n\007JWTUser\022\020\n\010username\030\001 \001(\t\022\020\n\010password" + - "\030\002 \001(\tB\221\001\n/org.wso2.apk.enforcer.discove" + - "ry.config.enforcerB\014JWTUserProtoP\001ZNgith" + - "ub.com/envoyproxy/go-control-plane/wso2/" + - "discovery/config/enforcer;enforcerb\006prot" + - "o3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_JWTUser_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_JWTUser_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_JWTUser_descriptor, - new java.lang.String[] { "Username", "Password", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Keypair.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Keypair.java deleted file mode 100644 index 7b49d81a52..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Keypair.java +++ /dev/null @@ -1,768 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_generator.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * keypair model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Keypair} - */ -public final class Keypair extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Keypair) - KeypairOrBuilder { -private static final long serialVersionUID = 0L; - // Use Keypair.newBuilder() to construct. - private Keypair(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Keypair() { - publicCertificatePath_ = ""; - privateKeyPath_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Keypair(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Keypair( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - publicCertificatePath_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - privateKeyPath_ = s; - break; - } - case 24: { - - useForSigning_ = 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.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_Keypair_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_Keypair_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.class, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder.class); - } - - public static final int PUBLIC_CERTIFICATE_PATH_FIELD_NUMBER = 1; - private volatile java.lang.Object publicCertificatePath_; - /** - * string public_certificate_path = 1; - * @return The publicCertificatePath. - */ - @java.lang.Override - public java.lang.String getPublicCertificatePath() { - java.lang.Object ref = publicCertificatePath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - publicCertificatePath_ = s; - return s; - } - } - /** - * string public_certificate_path = 1; - * @return The bytes for publicCertificatePath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPublicCertificatePathBytes() { - java.lang.Object ref = publicCertificatePath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - publicCertificatePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PRIVATE_KEY_PATH_FIELD_NUMBER = 2; - private volatile java.lang.Object privateKeyPath_; - /** - * string private_key_path = 2; - * @return The privateKeyPath. - */ - @java.lang.Override - public java.lang.String getPrivateKeyPath() { - java.lang.Object ref = privateKeyPath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - privateKeyPath_ = s; - return s; - } - } - /** - * string private_key_path = 2; - * @return The bytes for privateKeyPath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPrivateKeyPathBytes() { - java.lang.Object ref = privateKeyPath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - privateKeyPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int USE_FOR_SIGNING_FIELD_NUMBER = 3; - private boolean useForSigning_; - /** - * bool use_for_signing = 3; - * @return The useForSigning. - */ - @java.lang.Override - public boolean getUseForSigning() { - return useForSigning_; - } - - 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 (!getPublicCertificatePathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, publicCertificatePath_); - } - if (!getPrivateKeyPathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, privateKeyPath_); - } - if (useForSigning_ != false) { - output.writeBool(3, useForSigning_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getPublicCertificatePathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, publicCertificatePath_); - } - if (!getPrivateKeyPathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, privateKeyPath_); - } - if (useForSigning_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, useForSigning_); - } - 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.Keypair)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair other = (org.wso2.apk.enforcer.discovery.config.enforcer.Keypair) obj; - - if (!getPublicCertificatePath() - .equals(other.getPublicCertificatePath())) return false; - if (!getPrivateKeyPath() - .equals(other.getPrivateKeyPath())) return false; - if (getUseForSigning() - != other.getUseForSigning()) 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) + PUBLIC_CERTIFICATE_PATH_FIELD_NUMBER; - hash = (53 * hash) + getPublicCertificatePath().hashCode(); - hash = (37 * hash) + PRIVATE_KEY_PATH_FIELD_NUMBER; - hash = (53 * hash) + getPrivateKeyPath().hashCode(); - hash = (37 * hash) + USE_FOR_SIGNING_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseForSigning()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Keypair parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Keypair 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.Keypair parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Keypair 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.Keypair parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Keypair 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.Keypair 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.Keypair 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.Keypair 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.Keypair 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.Keypair 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.Keypair 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.Keypair 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; - } - /** - *
-   * keypair model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Keypair} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Keypair) - org.wso2.apk.enforcer.discovery.config.enforcer.KeypairOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_Keypair_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_Keypair_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.class, org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.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(); - publicCertificatePath_ = ""; - - privateKeyPath_ = ""; - - useForSigning_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.internal_static_wso2_discovery_config_enforcer_Keypair_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Keypair getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Keypair build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Keypair buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Keypair result = new org.wso2.apk.enforcer.discovery.config.enforcer.Keypair(this); - result.publicCertificatePath_ = publicCertificatePath_; - result.privateKeyPath_ = privateKeyPath_; - result.useForSigning_ = useForSigning_; - 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.Keypair) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Keypair)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Keypair other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Keypair.getDefaultInstance()) return this; - if (!other.getPublicCertificatePath().isEmpty()) { - publicCertificatePath_ = other.publicCertificatePath_; - onChanged(); - } - if (!other.getPrivateKeyPath().isEmpty()) { - privateKeyPath_ = other.privateKeyPath_; - onChanged(); - } - if (other.getUseForSigning() != false) { - setUseForSigning(other.getUseForSigning()); - } - 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.Keypair parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Keypair) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object publicCertificatePath_ = ""; - /** - * string public_certificate_path = 1; - * @return The publicCertificatePath. - */ - public java.lang.String getPublicCertificatePath() { - java.lang.Object ref = publicCertificatePath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - publicCertificatePath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string public_certificate_path = 1; - * @return The bytes for publicCertificatePath. - */ - public com.google.protobuf.ByteString - getPublicCertificatePathBytes() { - java.lang.Object ref = publicCertificatePath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - publicCertificatePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string public_certificate_path = 1; - * @param value The publicCertificatePath to set. - * @return This builder for chaining. - */ - public Builder setPublicCertificatePath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - publicCertificatePath_ = value; - onChanged(); - return this; - } - /** - * string public_certificate_path = 1; - * @return This builder for chaining. - */ - public Builder clearPublicCertificatePath() { - - publicCertificatePath_ = getDefaultInstance().getPublicCertificatePath(); - onChanged(); - return this; - } - /** - * string public_certificate_path = 1; - * @param value The bytes for publicCertificatePath to set. - * @return This builder for chaining. - */ - public Builder setPublicCertificatePathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - publicCertificatePath_ = value; - onChanged(); - return this; - } - - private java.lang.Object privateKeyPath_ = ""; - /** - * string private_key_path = 2; - * @return The privateKeyPath. - */ - public java.lang.String getPrivateKeyPath() { - java.lang.Object ref = privateKeyPath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - privateKeyPath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string private_key_path = 2; - * @return The bytes for privateKeyPath. - */ - public com.google.protobuf.ByteString - getPrivateKeyPathBytes() { - java.lang.Object ref = privateKeyPath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - privateKeyPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string private_key_path = 2; - * @param value The privateKeyPath to set. - * @return This builder for chaining. - */ - public Builder setPrivateKeyPath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - privateKeyPath_ = value; - onChanged(); - return this; - } - /** - * string private_key_path = 2; - * @return This builder for chaining. - */ - public Builder clearPrivateKeyPath() { - - privateKeyPath_ = getDefaultInstance().getPrivateKeyPath(); - onChanged(); - return this; - } - /** - * string private_key_path = 2; - * @param value The bytes for privateKeyPath to set. - * @return This builder for chaining. - */ - public Builder setPrivateKeyPathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - privateKeyPath_ = value; - onChanged(); - return this; - } - - private boolean useForSigning_ ; - /** - * bool use_for_signing = 3; - * @return The useForSigning. - */ - @java.lang.Override - public boolean getUseForSigning() { - return useForSigning_; - } - /** - * bool use_for_signing = 3; - * @param value The useForSigning to set. - * @return This builder for chaining. - */ - public Builder setUseForSigning(boolean value) { - - useForSigning_ = value; - onChanged(); - return this; - } - /** - * bool use_for_signing = 3; - * @return This builder for chaining. - */ - public Builder clearUseForSigning() { - - useForSigning_ = 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.Keypair) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Keypair) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Keypair DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Keypair(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Keypair getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Keypair parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Keypair(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.Keypair getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/KeypairOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/KeypairOrBuilder.java deleted file mode 100644 index a397e89714..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/KeypairOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/jwt_generator.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface KeypairOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Keypair) - com.google.protobuf.MessageOrBuilder { - - /** - * string public_certificate_path = 1; - * @return The publicCertificatePath. - */ - java.lang.String getPublicCertificatePath(); - /** - * string public_certificate_path = 1; - * @return The bytes for publicCertificatePath. - */ - com.google.protobuf.ByteString - getPublicCertificatePathBytes(); - - /** - * string private_key_path = 2; - * @return The privateKeyPath. - */ - java.lang.String getPrivateKeyPath(); - /** - * string private_key_path = 2; - * @return The bytes for privateKeyPath. - */ - com.google.protobuf.ByteString - getPrivateKeyPathBytes(); - - /** - * bool use_for_signing = 3; - * @return The useForSigning. - */ - boolean getUseForSigning(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Management.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Management.java deleted file mode 100644 index 50274140a5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Management.java +++ /dev/null @@ -1,759 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/management.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Model for enforcer management user
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Management} - */ -public final class Management extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Management) - ManagementOrBuilder { -private static final long serialVersionUID = 0L; - // Use Management.newBuilder() to construct. - private Management(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Management() { - username_ = ""; - password_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Management(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Management( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - username_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - password_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ManagementProto.internal_static_wso2_discovery_config_enforcer_Management_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ManagementProto.internal_static_wso2_discovery_config_enforcer_Management_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Management.class, org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder.class); - } - - public static final int USERNAME_FIELD_NUMBER = 1; - private volatile java.lang.Object username_; - /** - *
-   * Admin user name
-   * 
- * - * string username = 1; - * @return The username. - */ - @java.lang.Override - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } - } - /** - *
-   * Admin user name
-   * 
- * - * string username = 1; - * @return The bytes for username. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PASSWORD_FIELD_NUMBER = 2; - private volatile java.lang.Object password_; - /** - *
-   * Admin user password
-   * 
- * - * string password = 2; - * @return The password. - */ - @java.lang.Override - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } - } - /** - *
-   * Admin user password
-   * 
- * - * string password = 2; - * @return The bytes for password. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUsernameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); - } - if (!getPasswordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUsernameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); - } - if (!getPasswordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); - } - 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.Management)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Management other = (org.wso2.apk.enforcer.discovery.config.enforcer.Management) obj; - - if (!getUsername() - .equals(other.getUsername())) return false; - if (!getPassword() - .equals(other.getPassword())) 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) + USERNAME_FIELD_NUMBER; - hash = (53 * hash) + getUsername().hashCode(); - hash = (37 * hash) + PASSWORD_FIELD_NUMBER; - hash = (53 * hash) + getPassword().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Management parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Management 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.Management parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Management 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.Management parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Management 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.Management 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.Management 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.Management 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.Management 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.Management 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.Management 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.Management 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 enforcer management user
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Management} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Management) - org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ManagementProto.internal_static_wso2_discovery_config_enforcer_Management_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ManagementProto.internal_static_wso2_discovery_config_enforcer_Management_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Management.class, org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Management.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(); - username_ = ""; - - password_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ManagementProto.internal_static_wso2_discovery_config_enforcer_Management_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Management getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Management.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Management build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Management result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Management buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Management result = new org.wso2.apk.enforcer.discovery.config.enforcer.Management(this); - result.username_ = username_; - result.password_ = password_; - 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.Management) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Management)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Management other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Management.getDefaultInstance()) return this; - if (!other.getUsername().isEmpty()) { - username_ = other.username_; - onChanged(); - } - if (!other.getPassword().isEmpty()) { - password_ = other.password_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.Management parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Management) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object username_ = ""; - /** - *
-     * Admin user name
-     * 
- * - * string username = 1; - * @return The username. - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Admin user name
-     * 
- * - * string username = 1; - * @return The bytes for username. - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Admin user name
-     * 
- * - * string username = 1; - * @param value The username to set. - * @return This builder for chaining. - */ - public Builder setUsername( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - username_ = value; - onChanged(); - return this; - } - /** - *
-     * Admin user name
-     * 
- * - * string username = 1; - * @return This builder for chaining. - */ - public Builder clearUsername() { - - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - /** - *
-     * Admin user name
-     * 
- * - * string username = 1; - * @param value The bytes for username to set. - * @return This builder for chaining. - */ - public Builder setUsernameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - username_ = value; - onChanged(); - return this; - } - - private java.lang.Object password_ = ""; - /** - *
-     * Admin user password
-     * 
- * - * string password = 2; - * @return The password. - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Admin user password
-     * 
- * - * string password = 2; - * @return The bytes for password. - */ - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Admin user password
-     * 
- * - * string password = 2; - * @param value The password to set. - * @return This builder for chaining. - */ - public Builder setPassword( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - password_ = value; - onChanged(); - return this; - } - /** - *
-     * Admin user password
-     * 
- * - * string password = 2; - * @return This builder for chaining. - */ - public Builder clearPassword() { - - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - /** - *
-     * Admin user password
-     * 
- * - * string password = 2; - * @param value The bytes for password to set. - * @return This builder for chaining. - */ - public Builder setPasswordBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - password_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.config.enforcer.Management) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Management) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Management DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Management(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Management getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Management parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Management(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.Management getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ManagementOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ManagementOrBuilder.java deleted file mode 100644 index c55b358a36..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ManagementOrBuilder.java +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/management.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface ManagementOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Management) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Admin user name
-   * 
- * - * string username = 1; - * @return The username. - */ - java.lang.String getUsername(); - /** - *
-   * Admin user name
-   * 
- * - * string username = 1; - * @return The bytes for username. - */ - com.google.protobuf.ByteString - getUsernameBytes(); - - /** - *
-   * Admin user password
-   * 
- * - * string password = 2; - * @return The password. - */ - java.lang.String getPassword(); - /** - *
-   * Admin user password
-   * 
- * - * string password = 2; - * @return The bytes for password. - */ - com.google.protobuf.ByteString - getPasswordBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ManagementProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ManagementProto.java deleted file mode 100644 index 2710a28804..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ManagementProto.java +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/management.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class ManagementProto { - private ManagementProto() {} - 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_Management_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Management_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n/wso2/discovery/config/enforcer/managem" + - "ent.proto\022\036wso2.discovery.config.enforce" + - "r\"0\n\nManagement\022\020\n\010username\030\001 \001(\t\022\020\n\010pas" + - "sword\030\002 \001(\tB\224\001\n/org.wso2.apk.enforcer.di" + - "scovery.config.enforcerB\017ManagementProto" + - "P\001ZNgithub.com/envoyproxy/go-control-pla" + - "ne/wso2/discovery/config/enforcer;enforc" + - "erb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_Management_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Management_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Management_descriptor, - new java.lang.String[] { "Username", "Password", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Metrics.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Metrics.java deleted file mode 100644 index 7f78cf6781..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Metrics.java +++ /dev/null @@ -1,666 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/metrics.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - * Protobuf type {@code wso2.discovery.config.enforcer.Metrics} - */ -public final class Metrics extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Metrics) - MetricsOrBuilder { -private static final long serialVersionUID = 0L; - // Use Metrics.newBuilder() to construct. - private Metrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Metrics() { - type_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Metrics(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Metrics( - 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: { - - enabled_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.internal_static_wso2_discovery_config_enforcer_Metrics_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.internal_static_wso2_discovery_config_enforcer_Metrics_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.class, org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - *
-   * Enable metrics
-   * 
- * - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object type_; - /** - *
-   * Exporter Type
-   * 
- * - * string type = 2; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - *
-   * Exporter Type
-   * 
- * - * string type = 2; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (enabled_ != false) { - output.writeBool(1, enabled_); - } - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enabled_); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - 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.Metrics)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics other = (org.wso2.apk.enforcer.discovery.config.enforcer.Metrics) obj; - - if (getEnabled() - != other.getEnabled()) return false; - if (!getType() - .equals(other.getType())) 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) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Metrics parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Metrics 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.Metrics parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Metrics 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.Metrics parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Metrics 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.Metrics 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.Metrics 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.Metrics 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.Metrics 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.Metrics 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.Metrics 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.Metrics prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.config.enforcer.Metrics} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Metrics) - org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.internal_static_wso2_discovery_config_enforcer_Metrics_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.internal_static_wso2_discovery_config_enforcer_Metrics_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.class, org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.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(); - enabled_ = false; - - type_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.internal_static_wso2_discovery_config_enforcer_Metrics_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics result = new org.wso2.apk.enforcer.discovery.config.enforcer.Metrics(this); - result.enabled_ = enabled_; - result.type_ = type_; - 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.Metrics) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Metrics)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Metrics other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.Metrics parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Metrics) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enabled_ ; - /** - *
-     * Enable metrics
-     * 
- * - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - *
-     * Enable metrics
-     * 
- * - * bool enabled = 1; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - *
-     * Enable metrics
-     * 
- * - * bool enabled = 1; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private java.lang.Object type_ = ""; - /** - *
-     * Exporter Type
-     * 
- * - * string type = 2; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Exporter Type
-     * 
- * - * string type = 2; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Exporter Type
-     * 
- * - * string type = 2; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - *
-     * Exporter Type
-     * 
- * - * string type = 2; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - *
-     * Exporter Type
-     * 
- * - * string type = 2; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - @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.Metrics) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Metrics) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Metrics DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Metrics(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Metrics getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Metrics parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Metrics(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.Metrics getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MetricsOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MetricsOrBuilder.java deleted file mode 100644 index ced45662e1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MetricsOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/metrics.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface MetricsOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Metrics) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Enable metrics
-   * 
- * - * bool enabled = 1; - * @return The enabled. - */ - boolean getEnabled(); - - /** - *
-   * Exporter Type
-   * 
- * - * string type = 2; - * @return The type. - */ - java.lang.String getType(); - /** - *
-   * Exporter Type
-   * 
- * - * string type = 2; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MetricsProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MetricsProto.java deleted file mode 100644 index 7cfad63438..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MetricsProto.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/metrics.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class MetricsProto { - private MetricsProto() {} - 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_Metrics_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Metrics_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n,wso2/discovery/config/enforcer/metrics" + - ".proto\022\036wso2.discovery.config.enforcer\"(" + - "\n\007Metrics\022\017\n\007enabled\030\001 \001(\010\022\014\n\004type\030\002 \001(\t" + - "B\221\001\n/org.wso2.apk.enforcer.discovery.con" + - "fig.enforcerB\014MetricsProtoP\001ZNgithub.com" + - "/envoyproxy/go-control-plane/wso2/discov" + - "ery/config/enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_Metrics_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Metrics_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Metrics_descriptor, - new java.lang.String[] { "Enabled", "Type", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSL.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSL.java deleted file mode 100644 index b999c7964c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSL.java +++ /dev/null @@ -1,760 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/mutual_ssl.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Client certificate header store model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.MutualSSL} - */ -public final class MutualSSL extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.MutualSSL) - MutualSSLOrBuilder { -private static final long serialVersionUID = 0L; - // Use MutualSSL.newBuilder() to construct. - private MutualSSL(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MutualSSL() { - certificateHeader_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MutualSSL(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MutualSSL( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - certificateHeader_ = s; - break; - } - case 16: { - - enableClientValidation_ = input.readBool(); - break; - } - case 24: { - - clientCertificateEncode_ = input.readBool(); - break; - } - case 32: { - - enableOutboundCertificateHeader_ = 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.MutualSSLProto.internal_static_wso2_discovery_config_enforcer_MutualSSL_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLProto.internal_static_wso2_discovery_config_enforcer_MutualSSL_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.class, org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.Builder.class); - } - - public static final int CERTIFICATEHEADER_FIELD_NUMBER = 1; - private volatile java.lang.Object certificateHeader_; - /** - * string certificateHeader = 1; - * @return The certificateHeader. - */ - @java.lang.Override - public java.lang.String getCertificateHeader() { - java.lang.Object ref = certificateHeader_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificateHeader_ = s; - return s; - } - } - /** - * string certificateHeader = 1; - * @return The bytes for certificateHeader. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCertificateHeaderBytes() { - java.lang.Object ref = certificateHeader_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificateHeader_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENABLECLIENTVALIDATION_FIELD_NUMBER = 2; - private boolean enableClientValidation_; - /** - * bool enableClientValidation = 2; - * @return The enableClientValidation. - */ - @java.lang.Override - public boolean getEnableClientValidation() { - return enableClientValidation_; - } - - public static final int CLIENTCERTIFICATEENCODE_FIELD_NUMBER = 3; - private boolean clientCertificateEncode_; - /** - * bool clientCertificateEncode = 3; - * @return The clientCertificateEncode. - */ - @java.lang.Override - public boolean getClientCertificateEncode() { - return clientCertificateEncode_; - } - - public static final int ENABLEOUTBOUNDCERTIFICATEHEADER_FIELD_NUMBER = 4; - private boolean enableOutboundCertificateHeader_; - /** - * bool enableOutboundCertificateHeader = 4; - * @return The enableOutboundCertificateHeader. - */ - @java.lang.Override - public boolean getEnableOutboundCertificateHeader() { - return enableOutboundCertificateHeader_; - } - - 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 (!getCertificateHeaderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, certificateHeader_); - } - if (enableClientValidation_ != false) { - output.writeBool(2, enableClientValidation_); - } - if (clientCertificateEncode_ != false) { - output.writeBool(3, clientCertificateEncode_); - } - if (enableOutboundCertificateHeader_ != false) { - output.writeBool(4, enableOutboundCertificateHeader_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getCertificateHeaderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, certificateHeader_); - } - if (enableClientValidation_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, enableClientValidation_); - } - if (clientCertificateEncode_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, clientCertificateEncode_); - } - if (enableOutboundCertificateHeader_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, enableOutboundCertificateHeader_); - } - 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.MutualSSL)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL other = (org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL) obj; - - if (!getCertificateHeader() - .equals(other.getCertificateHeader())) return false; - if (getEnableClientValidation() - != other.getEnableClientValidation()) return false; - if (getClientCertificateEncode() - != other.getClientCertificateEncode()) return false; - if (getEnableOutboundCertificateHeader() - != other.getEnableOutboundCertificateHeader()) 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) + CERTIFICATEHEADER_FIELD_NUMBER; - hash = (53 * hash) + getCertificateHeader().hashCode(); - hash = (37 * hash) + ENABLECLIENTVALIDATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableClientValidation()); - hash = (37 * hash) + CLIENTCERTIFICATEENCODE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getClientCertificateEncode()); - hash = (37 * hash) + ENABLEOUTBOUNDCERTIFICATEHEADER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableOutboundCertificateHeader()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL 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.MutualSSL parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL 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.MutualSSL parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL 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.MutualSSL 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.MutualSSL 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.MutualSSL 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.MutualSSL 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.MutualSSL 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.MutualSSL 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.MutualSSL 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; - } - /** - *
-   * Client certificate header store model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.MutualSSL} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.MutualSSL) - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLProto.internal_static_wso2_discovery_config_enforcer_MutualSSL_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLProto.internal_static_wso2_discovery_config_enforcer_MutualSSL_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.class, org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.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(); - certificateHeader_ = ""; - - enableClientValidation_ = false; - - clientCertificateEncode_ = false; - - enableOutboundCertificateHeader_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLProto.internal_static_wso2_discovery_config_enforcer_MutualSSL_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL build() { - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL result = new org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL(this); - result.certificateHeader_ = certificateHeader_; - result.enableClientValidation_ = enableClientValidation_; - result.clientCertificateEncode_ = clientCertificateEncode_; - result.enableOutboundCertificateHeader_ = enableOutboundCertificateHeader_; - 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.MutualSSL) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.getDefaultInstance()) return this; - if (!other.getCertificateHeader().isEmpty()) { - certificateHeader_ = other.certificateHeader_; - onChanged(); - } - if (other.getEnableClientValidation() != false) { - setEnableClientValidation(other.getEnableClientValidation()); - } - if (other.getClientCertificateEncode() != false) { - setClientCertificateEncode(other.getClientCertificateEncode()); - } - if (other.getEnableOutboundCertificateHeader() != false) { - setEnableOutboundCertificateHeader(other.getEnableOutboundCertificateHeader()); - } - 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.MutualSSL parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object certificateHeader_ = ""; - /** - * string certificateHeader = 1; - * @return The certificateHeader. - */ - public java.lang.String getCertificateHeader() { - java.lang.Object ref = certificateHeader_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificateHeader_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string certificateHeader = 1; - * @return The bytes for certificateHeader. - */ - public com.google.protobuf.ByteString - getCertificateHeaderBytes() { - java.lang.Object ref = certificateHeader_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificateHeader_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string certificateHeader = 1; - * @param value The certificateHeader to set. - * @return This builder for chaining. - */ - public Builder setCertificateHeader( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - certificateHeader_ = value; - onChanged(); - return this; - } - /** - * string certificateHeader = 1; - * @return This builder for chaining. - */ - public Builder clearCertificateHeader() { - - certificateHeader_ = getDefaultInstance().getCertificateHeader(); - onChanged(); - return this; - } - /** - * string certificateHeader = 1; - * @param value The bytes for certificateHeader to set. - * @return This builder for chaining. - */ - public Builder setCertificateHeaderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - certificateHeader_ = value; - onChanged(); - return this; - } - - private boolean enableClientValidation_ ; - /** - * bool enableClientValidation = 2; - * @return The enableClientValidation. - */ - @java.lang.Override - public boolean getEnableClientValidation() { - return enableClientValidation_; - } - /** - * bool enableClientValidation = 2; - * @param value The enableClientValidation to set. - * @return This builder for chaining. - */ - public Builder setEnableClientValidation(boolean value) { - - enableClientValidation_ = value; - onChanged(); - return this; - } - /** - * bool enableClientValidation = 2; - * @return This builder for chaining. - */ - public Builder clearEnableClientValidation() { - - enableClientValidation_ = false; - onChanged(); - return this; - } - - private boolean clientCertificateEncode_ ; - /** - * bool clientCertificateEncode = 3; - * @return The clientCertificateEncode. - */ - @java.lang.Override - public boolean getClientCertificateEncode() { - return clientCertificateEncode_; - } - /** - * bool clientCertificateEncode = 3; - * @param value The clientCertificateEncode to set. - * @return This builder for chaining. - */ - public Builder setClientCertificateEncode(boolean value) { - - clientCertificateEncode_ = value; - onChanged(); - return this; - } - /** - * bool clientCertificateEncode = 3; - * @return This builder for chaining. - */ - public Builder clearClientCertificateEncode() { - - clientCertificateEncode_ = false; - onChanged(); - return this; - } - - private boolean enableOutboundCertificateHeader_ ; - /** - * bool enableOutboundCertificateHeader = 4; - * @return The enableOutboundCertificateHeader. - */ - @java.lang.Override - public boolean getEnableOutboundCertificateHeader() { - return enableOutboundCertificateHeader_; - } - /** - * bool enableOutboundCertificateHeader = 4; - * @param value The enableOutboundCertificateHeader to set. - * @return This builder for chaining. - */ - public Builder setEnableOutboundCertificateHeader(boolean value) { - - enableOutboundCertificateHeader_ = value; - onChanged(); - return this; - } - /** - * bool enableOutboundCertificateHeader = 4; - * @return This builder for chaining. - */ - public Builder clearEnableOutboundCertificateHeader() { - - enableOutboundCertificateHeader_ = 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.MutualSSL) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.MutualSSL) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MutualSSL parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MutualSSL(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.MutualSSL getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSLOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSLOrBuilder.java deleted file mode 100644 index f382601aba..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSLOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/mutual_ssl.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface MutualSSLOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.MutualSSL) - com.google.protobuf.MessageOrBuilder { - - /** - * string certificateHeader = 1; - * @return The certificateHeader. - */ - java.lang.String getCertificateHeader(); - /** - * string certificateHeader = 1; - * @return The bytes for certificateHeader. - */ - com.google.protobuf.ByteString - getCertificateHeaderBytes(); - - /** - * bool enableClientValidation = 2; - * @return The enableClientValidation. - */ - boolean getEnableClientValidation(); - - /** - * bool clientCertificateEncode = 3; - * @return The clientCertificateEncode. - */ - boolean getClientCertificateEncode(); - - /** - * bool enableOutboundCertificateHeader = 4; - * @return The enableOutboundCertificateHeader. - */ - boolean getEnableOutboundCertificateHeader(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSLProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSLProto.java deleted file mode 100644 index b9348421e6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/MutualSSLProto.java +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/mutual_ssl.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class MutualSSLProto { - private MutualSSLProto() {} - 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_MutualSSL_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_MutualSSL_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n/wso2/discovery/config/enforcer/mutual_" + - "ssl.proto\022\036wso2.discovery.config.enforce" + - "r\"\220\001\n\tMutualSSL\022\031\n\021certificateHeader\030\001 \001" + - "(\t\022\036\n\026enableClientValidation\030\002 \001(\010\022\037\n\027cl" + - "ientCertificateEncode\030\003 \001(\010\022\'\n\037enableOut" + - "boundCertificateHeader\030\004 \001(\010B\223\001\n/org.wso" + - "2.apk.enforcer.discovery.config.enforcer" + - "B\016MutualSSLProtoP\001ZNgithub.com/envoyprox" + - "y/go-control-plane/wso2/discovery/config" + - "/enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_MutualSSL_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_MutualSSL_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_MutualSSL_descriptor, - new java.lang.String[] { "CertificateHeader", "EnableClientValidation", "ClientCertificateEncode", "EnableOutboundCertificateHeader", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Security.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Security.java deleted file mode 100644 index 280382c840..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Security.java +++ /dev/null @@ -1,991 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/security.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Enforcer config model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Security} - */ -public final class Security extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Security) - SecurityOrBuilder { -private static final long serialVersionUID = 0L; - // Use Security.newBuilder() to construct. - private Security(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Security() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Security(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Security( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder subBuilder = null; - if (apiKey_ != null) { - subBuilder = apiKey_.toBuilder(); - } - apiKey_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(apiKey_); - apiKey_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder subBuilder = null; - if (runtimeToken_ != null) { - subBuilder = runtimeToken_.toBuilder(); - } - runtimeToken_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(runtimeToken_); - runtimeToken_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.Builder subBuilder = null; - if (mutualSSL_ != null) { - subBuilder = mutualSSL_.toBuilder(); - } - mutualSSL_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(mutualSSL_); - mutualSSL_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.SecurityProto.internal_static_wso2_discovery_config_enforcer_Security_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.SecurityProto.internal_static_wso2_discovery_config_enforcer_Security_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Security.class, org.wso2.apk.enforcer.discovery.config.enforcer.Security.Builder.class); - } - - public static final int APIKEY_FIELD_NUMBER = 1; - private org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer apiKey_; - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - * @return Whether the apiKey field is set. - */ - @java.lang.Override - public boolean hasApiKey() { - return apiKey_ != null; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - * @return The apiKey. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer getApiKey() { - return apiKey_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.getDefaultInstance() : apiKey_; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder getApiKeyOrBuilder() { - return getApiKey(); - } - - public static final int RUNTIMETOKEN_FIELD_NUMBER = 2; - private org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer runtimeToken_; - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - * @return Whether the runtimeToken field is set. - */ - @java.lang.Override - public boolean hasRuntimeToken() { - return runtimeToken_ != null; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - * @return The runtimeToken. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer getRuntimeToken() { - return runtimeToken_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.getDefaultInstance() : runtimeToken_; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder getRuntimeTokenOrBuilder() { - return getRuntimeToken(); - } - - public static final int MUTUALSSL_FIELD_NUMBER = 4; - private org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL mutualSSL_; - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - * @return Whether the mutualSSL field is set. - */ - @java.lang.Override - public boolean hasMutualSSL() { - return mutualSSL_ != null; - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - * @return The mutualSSL. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL getMutualSSL() { - return mutualSSL_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.getDefaultInstance() : mutualSSL_; - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLOrBuilder getMutualSSLOrBuilder() { - return getMutualSSL(); - } - - 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 (apiKey_ != null) { - output.writeMessage(1, getApiKey()); - } - if (runtimeToken_ != null) { - output.writeMessage(2, getRuntimeToken()); - } - if (mutualSSL_ != null) { - output.writeMessage(4, getMutualSSL()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (apiKey_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getApiKey()); - } - if (runtimeToken_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getRuntimeToken()); - } - if (mutualSSL_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getMutualSSL()); - } - 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.Security)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Security other = (org.wso2.apk.enforcer.discovery.config.enforcer.Security) obj; - - if (hasApiKey() != other.hasApiKey()) return false; - if (hasApiKey()) { - if (!getApiKey() - .equals(other.getApiKey())) return false; - } - if (hasRuntimeToken() != other.hasRuntimeToken()) return false; - if (hasRuntimeToken()) { - if (!getRuntimeToken() - .equals(other.getRuntimeToken())) return false; - } - if (hasMutualSSL() != other.hasMutualSSL()) return false; - if (hasMutualSSL()) { - if (!getMutualSSL() - .equals(other.getMutualSSL())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasApiKey()) { - hash = (37 * hash) + APIKEY_FIELD_NUMBER; - hash = (53 * hash) + getApiKey().hashCode(); - } - if (hasRuntimeToken()) { - hash = (37 * hash) + RUNTIMETOKEN_FIELD_NUMBER; - hash = (53 * hash) + getRuntimeToken().hashCode(); - } - if (hasMutualSSL()) { - hash = (37 * hash) + MUTUALSSL_FIELD_NUMBER; - hash = (53 * hash) + getMutualSSL().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Security parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Security 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.Security parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Security 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.Security parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Security 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.Security 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.Security 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.Security 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.Security 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.Security 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.Security 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.Security 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; - } - /** - *
-   * Enforcer config model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Security} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Security) - org.wso2.apk.enforcer.discovery.config.enforcer.SecurityOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.SecurityProto.internal_static_wso2_discovery_config_enforcer_Security_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.SecurityProto.internal_static_wso2_discovery_config_enforcer_Security_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Security.class, org.wso2.apk.enforcer.discovery.config.enforcer.Security.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Security.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (apiKeyBuilder_ == null) { - apiKey_ = null; - } else { - apiKey_ = null; - apiKeyBuilder_ = null; - } - if (runtimeTokenBuilder_ == null) { - runtimeToken_ = null; - } else { - runtimeToken_ = null; - runtimeTokenBuilder_ = null; - } - if (mutualSSLBuilder_ == null) { - mutualSSL_ = null; - } else { - mutualSSL_ = null; - mutualSSLBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.SecurityProto.internal_static_wso2_discovery_config_enforcer_Security_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Security getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Security.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Security build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Security result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Security buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Security result = new org.wso2.apk.enforcer.discovery.config.enforcer.Security(this); - if (apiKeyBuilder_ == null) { - result.apiKey_ = apiKey_; - } else { - result.apiKey_ = apiKeyBuilder_.build(); - } - if (runtimeTokenBuilder_ == null) { - result.runtimeToken_ = runtimeToken_; - } else { - result.runtimeToken_ = runtimeTokenBuilder_.build(); - } - if (mutualSSLBuilder_ == null) { - result.mutualSSL_ = mutualSSL_; - } else { - result.mutualSSL_ = mutualSSLBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.config.enforcer.Security) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Security)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Security other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Security.getDefaultInstance()) return this; - if (other.hasApiKey()) { - mergeApiKey(other.getApiKey()); - } - if (other.hasRuntimeToken()) { - mergeRuntimeToken(other.getRuntimeToken()); - } - if (other.hasMutualSSL()) { - mergeMutualSSL(other.getMutualSSL()); - } - 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.Security parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Security) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer apiKey_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder> apiKeyBuilder_; - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - * @return Whether the apiKey field is set. - */ - public boolean hasApiKey() { - return apiKeyBuilder_ != null || apiKey_ != null; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - * @return The apiKey. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer getApiKey() { - if (apiKeyBuilder_ == null) { - return apiKey_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.getDefaultInstance() : apiKey_; - } else { - return apiKeyBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - public Builder setApiKey(org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer value) { - if (apiKeyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - apiKey_ = value; - onChanged(); - } else { - apiKeyBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - public Builder setApiKey( - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder builderForValue) { - if (apiKeyBuilder_ == null) { - apiKey_ = builderForValue.build(); - onChanged(); - } else { - apiKeyBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - public Builder mergeApiKey(org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer value) { - if (apiKeyBuilder_ == null) { - if (apiKey_ != null) { - apiKey_ = - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.newBuilder(apiKey_).mergeFrom(value).buildPartial(); - } else { - apiKey_ = value; - } - onChanged(); - } else { - apiKeyBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - public Builder clearApiKey() { - if (apiKeyBuilder_ == null) { - apiKey_ = null; - onChanged(); - } else { - apiKey_ = null; - apiKeyBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder getApiKeyBuilder() { - - onChanged(); - return getApiKeyFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder getApiKeyOrBuilder() { - if (apiKeyBuilder_ != null) { - return apiKeyBuilder_.getMessageOrBuilder(); - } else { - return apiKey_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.getDefaultInstance() : apiKey_; - } - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder> - getApiKeyFieldBuilder() { - if (apiKeyBuilder_ == null) { - apiKeyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder>( - getApiKey(), - getParentForChildren(), - isClean()); - apiKey_ = null; - } - return apiKeyBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer runtimeToken_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder> runtimeTokenBuilder_; - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - * @return Whether the runtimeToken field is set. - */ - public boolean hasRuntimeToken() { - return runtimeTokenBuilder_ != null || runtimeToken_ != null; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - * @return The runtimeToken. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer getRuntimeToken() { - if (runtimeTokenBuilder_ == null) { - return runtimeToken_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.getDefaultInstance() : runtimeToken_; - } else { - return runtimeTokenBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - public Builder setRuntimeToken(org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer value) { - if (runtimeTokenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - runtimeToken_ = value; - onChanged(); - } else { - runtimeTokenBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - public Builder setRuntimeToken( - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder builderForValue) { - if (runtimeTokenBuilder_ == null) { - runtimeToken_ = builderForValue.build(); - onChanged(); - } else { - runtimeTokenBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - public Builder mergeRuntimeToken(org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer value) { - if (runtimeTokenBuilder_ == null) { - if (runtimeToken_ != null) { - runtimeToken_ = - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.newBuilder(runtimeToken_).mergeFrom(value).buildPartial(); - } else { - runtimeToken_ = value; - } - onChanged(); - } else { - runtimeTokenBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - public Builder clearRuntimeToken() { - if (runtimeTokenBuilder_ == null) { - runtimeToken_ = null; - onChanged(); - } else { - runtimeToken_ = null; - runtimeTokenBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder getRuntimeTokenBuilder() { - - onChanged(); - return getRuntimeTokenFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder getRuntimeTokenOrBuilder() { - if (runtimeTokenBuilder_ != null) { - return runtimeTokenBuilder_.getMessageOrBuilder(); - } else { - return runtimeToken_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.getDefaultInstance() : runtimeToken_; - } - } - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder> - getRuntimeTokenFieldBuilder() { - if (runtimeTokenBuilder_ == null) { - runtimeTokenBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder>( - getRuntimeToken(), - getParentForChildren(), - isClean()); - runtimeToken_ = null; - } - return runtimeTokenBuilder_; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL mutualSSL_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL, org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLOrBuilder> mutualSSLBuilder_; - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - * @return Whether the mutualSSL field is set. - */ - public boolean hasMutualSSL() { - return mutualSSLBuilder_ != null || mutualSSL_ != null; - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - * @return The mutualSSL. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL getMutualSSL() { - if (mutualSSLBuilder_ == null) { - return mutualSSL_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.getDefaultInstance() : mutualSSL_; - } else { - return mutualSSLBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - public Builder setMutualSSL(org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL value) { - if (mutualSSLBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - mutualSSL_ = value; - onChanged(); - } else { - mutualSSLBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - public Builder setMutualSSL( - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.Builder builderForValue) { - if (mutualSSLBuilder_ == null) { - mutualSSL_ = builderForValue.build(); - onChanged(); - } else { - mutualSSLBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - public Builder mergeMutualSSL(org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL value) { - if (mutualSSLBuilder_ == null) { - if (mutualSSL_ != null) { - mutualSSL_ = - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.newBuilder(mutualSSL_).mergeFrom(value).buildPartial(); - } else { - mutualSSL_ = value; - } - onChanged(); - } else { - mutualSSLBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - public Builder clearMutualSSL() { - if (mutualSSLBuilder_ == null) { - mutualSSL_ = null; - onChanged(); - } else { - mutualSSL_ = null; - mutualSSLBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.Builder getMutualSSLBuilder() { - - onChanged(); - return getMutualSSLFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLOrBuilder getMutualSSLOrBuilder() { - if (mutualSSLBuilder_ != null) { - return mutualSSLBuilder_.getMessageOrBuilder(); - } else { - return mutualSSL_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.getDefaultInstance() : mutualSSL_; - } - } - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL, org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLOrBuilder> - getMutualSSLFieldBuilder() { - if (mutualSSLBuilder_ == null) { - mutualSSLBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL, org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLOrBuilder>( - getMutualSSL(), - getParentForChildren(), - isClean()); - mutualSSL_ = null; - } - return mutualSSLBuilder_; - } - @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.Security) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Security) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Security DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Security(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Security getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Security parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Security(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.Security getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SecurityOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SecurityOrBuilder.java deleted file mode 100644 index c467dfa242..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SecurityOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/security.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface SecurityOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Security) - com.google.protobuf.MessageOrBuilder { - - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - * @return Whether the apiKey field is set. - */ - boolean hasApiKey(); - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - * @return The apiKey. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer getApiKey(); - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer apiKey = 1; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder getApiKeyOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - * @return Whether the runtimeToken field is set. - */ - boolean hasRuntimeToken(); - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - * @return The runtimeToken. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcer getRuntimeToken(); - /** - * .wso2.discovery.config.enforcer.APIKeyEnforcer runtimeToken = 2; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerOrBuilder getRuntimeTokenOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - * @return Whether the mutualSSL field is set. - */ - boolean hasMutualSSL(); - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - * @return The mutualSSL. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL getMutualSSL(); - /** - * .wso2.discovery.config.enforcer.MutualSSL mutualSSL = 4; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLOrBuilder getMutualSSLOrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SecurityProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SecurityProto.java deleted file mode 100644 index ff0394274c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SecurityProto.java +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/security.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class SecurityProto { - private SecurityProto() {} - 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_Security_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Security_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n-wso2/discovery/config/enforcer/securit" + - "y.proto\022\036wso2.discovery.config.enforcer\032" + - "/wso2/discovery/config/enforcer/mutual_s" + - "sl.proto\0325wso2/discovery/config/enforcer" + - "/api_key_enforcer.proto\"\316\001\n\010Security\022>\n\006" + - "apiKey\030\001 \001(\0132..wso2.discovery.config.enf" + - "orcer.APIKeyEnforcer\022D\n\014runtimeToken\030\002 \001" + - "(\0132..wso2.discovery.config.enforcer.APIK" + - "eyEnforcer\022<\n\tmutualSSL\030\004 \001(\0132).wso2.dis" + - "covery.config.enforcer.MutualSSLB\222\001\n/org" + - ".wso2.apk.enforcer.discovery.config.enfo" + - "rcerB\rSecurityProtoP\001ZNgithub.com/envoyp" + - "roxy/go-control-plane/wso2/discovery/con" + - "fig/enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerProto.getDescriptor(), - }); - internal_static_wso2_discovery_config_enforcer_Security_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Security_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Security_descriptor, - new java.lang.String[] { "ApiKey", "RuntimeToken", "MutualSSL", }); - org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSLProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.config.enforcer.APIKeyEnforcerProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Service.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Service.java deleted file mode 100644 index 942fb317dc..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Service.java +++ /dev/null @@ -1,887 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/service.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Auth service model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Service} - */ -public final class Service extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Service) - ServiceOrBuilder { -private static final long serialVersionUID = 0L; - // Use Service.newBuilder() to construct. - private Service(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Service() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Service(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Service( - 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: { - - port_ = input.readInt32(); - break; - } - case 16: { - - maxMessageSize_ = input.readInt32(); - break; - } - case 24: { - - maxHeaderLimit_ = input.readInt32(); - break; - } - case 32: { - - keepAliveTime_ = input.readInt32(); - break; - } - case 42: { - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.Builder subBuilder = null; - if (threadPool_ != null) { - subBuilder = threadPool_.toBuilder(); - } - threadPool_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(threadPool_); - threadPool_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ServiceProto.internal_static_wso2_discovery_config_enforcer_Service_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ServiceProto.internal_static_wso2_discovery_config_enforcer_Service_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Service.class, org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder.class); - } - - public static final int PORT_FIELD_NUMBER = 1; - private int port_; - /** - * int32 port = 1; - * @return The port. - */ - @java.lang.Override - public int getPort() { - return port_; - } - - public static final int MAXMESSAGESIZE_FIELD_NUMBER = 2; - private int maxMessageSize_; - /** - * int32 maxMessageSize = 2; - * @return The maxMessageSize. - */ - @java.lang.Override - public int getMaxMessageSize() { - return maxMessageSize_; - } - - public static final int MAXHEADERLIMIT_FIELD_NUMBER = 3; - private int maxHeaderLimit_; - /** - * int32 maxHeaderLimit = 3; - * @return The maxHeaderLimit. - */ - @java.lang.Override - public int getMaxHeaderLimit() { - return maxHeaderLimit_; - } - - public static final int KEEPALIVETIME_FIELD_NUMBER = 4; - private int keepAliveTime_; - /** - *
-   * keep alive time of the external authz connection
-   * 
- * - * int32 keepAliveTime = 4; - * @return The keepAliveTime. - */ - @java.lang.Override - public int getKeepAliveTime() { - return keepAliveTime_; - } - - public static final int THREADPOOL_FIELD_NUMBER = 5; - private org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool threadPool_; - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - * @return Whether the threadPool field is set. - */ - @java.lang.Override - public boolean hasThreadPool() { - return threadPool_ != null; - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - * @return The threadPool. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool getThreadPool() { - return threadPool_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.getDefaultInstance() : threadPool_; - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolOrBuilder getThreadPoolOrBuilder() { - return getThreadPool(); - } - - 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 (port_ != 0) { - output.writeInt32(1, port_); - } - if (maxMessageSize_ != 0) { - output.writeInt32(2, maxMessageSize_); - } - if (maxHeaderLimit_ != 0) { - output.writeInt32(3, maxHeaderLimit_); - } - if (keepAliveTime_ != 0) { - output.writeInt32(4, keepAliveTime_); - } - if (threadPool_ != null) { - output.writeMessage(5, getThreadPool()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (port_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, port_); - } - if (maxMessageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, maxMessageSize_); - } - if (maxHeaderLimit_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, maxHeaderLimit_); - } - if (keepAliveTime_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, keepAliveTime_); - } - if (threadPool_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getThreadPool()); - } - 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.Service)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Service other = (org.wso2.apk.enforcer.discovery.config.enforcer.Service) obj; - - if (getPort() - != other.getPort()) return false; - if (getMaxMessageSize() - != other.getMaxMessageSize()) return false; - if (getMaxHeaderLimit() - != other.getMaxHeaderLimit()) return false; - if (getKeepAliveTime() - != other.getKeepAliveTime()) return false; - if (hasThreadPool() != other.hasThreadPool()) return false; - if (hasThreadPool()) { - if (!getThreadPool() - .equals(other.getThreadPool())) 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) + PORT_FIELD_NUMBER; - hash = (53 * hash) + getPort(); - hash = (37 * hash) + MAXMESSAGESIZE_FIELD_NUMBER; - hash = (53 * hash) + getMaxMessageSize(); - hash = (37 * hash) + MAXHEADERLIMIT_FIELD_NUMBER; - hash = (53 * hash) + getMaxHeaderLimit(); - hash = (37 * hash) + KEEPALIVETIME_FIELD_NUMBER; - hash = (53 * hash) + getKeepAliveTime(); - if (hasThreadPool()) { - hash = (37 * hash) + THREADPOOL_FIELD_NUMBER; - hash = (53 * hash) + getThreadPool().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Service parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Service 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.Service parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Service 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.Service parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Service 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.Service 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.Service 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.Service 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.Service 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.Service 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.Service 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.Service 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; - } - /** - *
-   * Auth service model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.Service} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Service) - org.wso2.apk.enforcer.discovery.config.enforcer.ServiceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ServiceProto.internal_static_wso2_discovery_config_enforcer_Service_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ServiceProto.internal_static_wso2_discovery_config_enforcer_Service_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Service.class, org.wso2.apk.enforcer.discovery.config.enforcer.Service.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Service.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(); - port_ = 0; - - maxMessageSize_ = 0; - - maxHeaderLimit_ = 0; - - keepAliveTime_ = 0; - - if (threadPoolBuilder_ == null) { - threadPool_ = null; - } else { - threadPool_ = null; - threadPoolBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ServiceProto.internal_static_wso2_discovery_config_enforcer_Service_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Service getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Service.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Service build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Service result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Service buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Service result = new org.wso2.apk.enforcer.discovery.config.enforcer.Service(this); - result.port_ = port_; - result.maxMessageSize_ = maxMessageSize_; - result.maxHeaderLimit_ = maxHeaderLimit_; - result.keepAliveTime_ = keepAliveTime_; - if (threadPoolBuilder_ == null) { - result.threadPool_ = threadPool_; - } else { - result.threadPool_ = threadPoolBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.config.enforcer.Service) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Service)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Service other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Service.getDefaultInstance()) return this; - if (other.getPort() != 0) { - setPort(other.getPort()); - } - if (other.getMaxMessageSize() != 0) { - setMaxMessageSize(other.getMaxMessageSize()); - } - if (other.getMaxHeaderLimit() != 0) { - setMaxHeaderLimit(other.getMaxHeaderLimit()); - } - if (other.getKeepAliveTime() != 0) { - setKeepAliveTime(other.getKeepAliveTime()); - } - if (other.hasThreadPool()) { - mergeThreadPool(other.getThreadPool()); - } - 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.Service parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Service) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int port_ ; - /** - * int32 port = 1; - * @return The port. - */ - @java.lang.Override - public int getPort() { - return port_; - } - /** - * int32 port = 1; - * @param value The port to set. - * @return This builder for chaining. - */ - public Builder setPort(int value) { - - port_ = value; - onChanged(); - return this; - } - /** - * int32 port = 1; - * @return This builder for chaining. - */ - public Builder clearPort() { - - port_ = 0; - onChanged(); - return this; - } - - private int maxMessageSize_ ; - /** - * int32 maxMessageSize = 2; - * @return The maxMessageSize. - */ - @java.lang.Override - public int getMaxMessageSize() { - return maxMessageSize_; - } - /** - * int32 maxMessageSize = 2; - * @param value The maxMessageSize to set. - * @return This builder for chaining. - */ - public Builder setMaxMessageSize(int value) { - - maxMessageSize_ = value; - onChanged(); - return this; - } - /** - * int32 maxMessageSize = 2; - * @return This builder for chaining. - */ - public Builder clearMaxMessageSize() { - - maxMessageSize_ = 0; - onChanged(); - return this; - } - - private int maxHeaderLimit_ ; - /** - * int32 maxHeaderLimit = 3; - * @return The maxHeaderLimit. - */ - @java.lang.Override - public int getMaxHeaderLimit() { - return maxHeaderLimit_; - } - /** - * int32 maxHeaderLimit = 3; - * @param value The maxHeaderLimit to set. - * @return This builder for chaining. - */ - public Builder setMaxHeaderLimit(int value) { - - maxHeaderLimit_ = value; - onChanged(); - return this; - } - /** - * int32 maxHeaderLimit = 3; - * @return This builder for chaining. - */ - public Builder clearMaxHeaderLimit() { - - maxHeaderLimit_ = 0; - onChanged(); - return this; - } - - private int keepAliveTime_ ; - /** - *
-     * keep alive time of the external authz connection
-     * 
- * - * int32 keepAliveTime = 4; - * @return The keepAliveTime. - */ - @java.lang.Override - public int getKeepAliveTime() { - return keepAliveTime_; - } - /** - *
-     * keep alive time of the external authz connection
-     * 
- * - * int32 keepAliveTime = 4; - * @param value The keepAliveTime to set. - * @return This builder for chaining. - */ - public Builder setKeepAliveTime(int value) { - - keepAliveTime_ = value; - onChanged(); - return this; - } - /** - *
-     * keep alive time of the external authz connection
-     * 
- * - * int32 keepAliveTime = 4; - * @return This builder for chaining. - */ - public Builder clearKeepAliveTime() { - - keepAliveTime_ = 0; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool threadPool_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool, org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolOrBuilder> threadPoolBuilder_; - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - * @return Whether the threadPool field is set. - */ - public boolean hasThreadPool() { - return threadPoolBuilder_ != null || threadPool_ != null; - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - * @return The threadPool. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool getThreadPool() { - if (threadPoolBuilder_ == null) { - return threadPool_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.getDefaultInstance() : threadPool_; - } else { - return threadPoolBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - public Builder setThreadPool(org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool value) { - if (threadPoolBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - threadPool_ = value; - onChanged(); - } else { - threadPoolBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - public Builder setThreadPool( - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.Builder builderForValue) { - if (threadPoolBuilder_ == null) { - threadPool_ = builderForValue.build(); - onChanged(); - } else { - threadPoolBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - public Builder mergeThreadPool(org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool value) { - if (threadPoolBuilder_ == null) { - if (threadPool_ != null) { - threadPool_ = - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.newBuilder(threadPool_).mergeFrom(value).buildPartial(); - } else { - threadPool_ = value; - } - onChanged(); - } else { - threadPoolBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - public Builder clearThreadPool() { - if (threadPoolBuilder_ == null) { - threadPool_ = null; - onChanged(); - } else { - threadPool_ = null; - threadPoolBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.Builder getThreadPoolBuilder() { - - onChanged(); - return getThreadPoolFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolOrBuilder getThreadPoolOrBuilder() { - if (threadPoolBuilder_ != null) { - return threadPoolBuilder_.getMessageOrBuilder(); - } else { - return threadPool_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.getDefaultInstance() : threadPool_; - } - } - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool, org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolOrBuilder> - getThreadPoolFieldBuilder() { - if (threadPoolBuilder_ == null) { - threadPoolBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool, org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolOrBuilder>( - getThreadPool(), - getParentForChildren(), - isClean()); - threadPool_ = null; - } - return threadPoolBuilder_; - } - @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.Service) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Service) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Service DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Service(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Service getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Service parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Service(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.Service getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ServiceOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ServiceOrBuilder.java deleted file mode 100644 index 9d64827287..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ServiceOrBuilder.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/service.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface ServiceOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Service) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 port = 1; - * @return The port. - */ - int getPort(); - - /** - * int32 maxMessageSize = 2; - * @return The maxMessageSize. - */ - int getMaxMessageSize(); - - /** - * int32 maxHeaderLimit = 3; - * @return The maxHeaderLimit. - */ - int getMaxHeaderLimit(); - - /** - *
-   * keep alive time of the external authz connection
-   * 
- * - * int32 keepAliveTime = 4; - * @return The keepAliveTime. - */ - int getKeepAliveTime(); - - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - * @return Whether the threadPool field is set. - */ - boolean hasThreadPool(); - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - * @return The threadPool. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool getThreadPool(); - /** - * .wso2.discovery.config.enforcer.ThreadPool threadPool = 5; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolOrBuilder getThreadPoolOrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ServiceProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ServiceProto.java deleted file mode 100644 index 3c9bdd4992..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ServiceProto.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/service.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class ServiceProto { - private ServiceProto() {} - 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_Service_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Service_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n,wso2/discovery/config/enforcer/service" + - ".proto\022\036wso2.discovery.config.enforcer\0320" + - "wso2/discovery/config/enforcer/thread_po" + - "ol.proto\"\236\001\n\007Service\022\014\n\004port\030\001 \001(\005\022\026\n\016ma" + - "xMessageSize\030\002 \001(\005\022\026\n\016maxHeaderLimit\030\003 \001" + - "(\005\022\025\n\rkeepAliveTime\030\004 \001(\005\022>\n\nthreadPool\030" + - "\005 \001(\0132*.wso2.discovery.config.enforcer.T" + - "hreadPoolB\221\001\n/org.wso2.apk.enforcer.disc" + - "overy.config.enforcerB\014ServiceProtoP\001ZNg" + - "ithub.com/envoyproxy/go-control-plane/ws" + - "o2/discovery/config/enforcer;enforcerb\006p" + - "roto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolProto.getDescriptor(), - }); - internal_static_wso2_discovery_config_enforcer_Service_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Service_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Service_descriptor, - new java.lang.String[] { "Port", "MaxMessageSize", "MaxHeaderLimit", "KeepAliveTime", "ThreadPool", }); - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Soap.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Soap.java deleted file mode 100644 index d3b6bd68d0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Soap.java +++ /dev/null @@ -1,484 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/soap.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - * Protobuf type {@code wso2.discovery.config.enforcer.Soap} - */ -public final class Soap extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Soap) - SoapOrBuilder { -private static final long serialVersionUID = 0L; - // Use Soap.newBuilder() to construct. - private Soap(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Soap() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Soap(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Soap( - 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: { - - soapErrorInXMLEnabled_ = 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.soapProto.internal_static_wso2_discovery_config_enforcer_Soap_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.soapProto.internal_static_wso2_discovery_config_enforcer_Soap_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Soap.class, org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder.class); - } - - public static final int SOAPERRORINXMLENABLED_FIELD_NUMBER = 1; - private boolean soapErrorInXMLEnabled_; - /** - * bool soapErrorInXMLEnabled = 1; - * @return The soapErrorInXMLEnabled. - */ - @java.lang.Override - public boolean getSoapErrorInXMLEnabled() { - return soapErrorInXMLEnabled_; - } - - 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 (soapErrorInXMLEnabled_ != false) { - output.writeBool(1, soapErrorInXMLEnabled_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (soapErrorInXMLEnabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, soapErrorInXMLEnabled_); - } - 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.Soap)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Soap other = (org.wso2.apk.enforcer.discovery.config.enforcer.Soap) obj; - - if (getSoapErrorInXMLEnabled() - != other.getSoapErrorInXMLEnabled()) 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) + SOAPERRORINXMLENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSoapErrorInXMLEnabled()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Soap parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Soap 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.Soap parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Soap 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.Soap parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Soap 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.Soap 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.Soap 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.Soap 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.Soap 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.Soap 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.Soap 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.Soap prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.config.enforcer.Soap} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Soap) - org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.soapProto.internal_static_wso2_discovery_config_enforcer_Soap_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.soapProto.internal_static_wso2_discovery_config_enforcer_Soap_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Soap.class, org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Soap.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(); - soapErrorInXMLEnabled_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.soapProto.internal_static_wso2_discovery_config_enforcer_Soap_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Soap getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Soap.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Soap build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Soap result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Soap buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Soap result = new org.wso2.apk.enforcer.discovery.config.enforcer.Soap(this); - result.soapErrorInXMLEnabled_ = soapErrorInXMLEnabled_; - 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.Soap) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Soap)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Soap other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Soap.getDefaultInstance()) return this; - if (other.getSoapErrorInXMLEnabled() != false) { - setSoapErrorInXMLEnabled(other.getSoapErrorInXMLEnabled()); - } - 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.Soap parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Soap) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean soapErrorInXMLEnabled_ ; - /** - * bool soapErrorInXMLEnabled = 1; - * @return The soapErrorInXMLEnabled. - */ - @java.lang.Override - public boolean getSoapErrorInXMLEnabled() { - return soapErrorInXMLEnabled_; - } - /** - * bool soapErrorInXMLEnabled = 1; - * @param value The soapErrorInXMLEnabled to set. - * @return This builder for chaining. - */ - public Builder setSoapErrorInXMLEnabled(boolean value) { - - soapErrorInXMLEnabled_ = value; - onChanged(); - return this; - } - /** - * bool soapErrorInXMLEnabled = 1; - * @return This builder for chaining. - */ - public Builder clearSoapErrorInXMLEnabled() { - - soapErrorInXMLEnabled_ = 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.Soap) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Soap) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Soap DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Soap(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Soap getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Soap parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Soap(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.Soap getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SoapOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SoapOrBuilder.java deleted file mode 100644 index 2d5796d0ae..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/SoapOrBuilder.java +++ /dev/null @@ -1,15 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/soap.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface SoapOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Soap) - com.google.protobuf.MessageOrBuilder { - - /** - * bool soapErrorInXMLEnabled = 1; - * @return The soapErrorInXMLEnabled. - */ - boolean getSoapErrorInXMLEnabled(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPool.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPool.java deleted file mode 100644 index d292ef832b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPool.java +++ /dev/null @@ -1,699 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/thread_pool.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * ThreadPool model
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.ThreadPool} - */ -public final class ThreadPool extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.ThreadPool) - ThreadPoolOrBuilder { -private static final long serialVersionUID = 0L; - // Use ThreadPool.newBuilder() to construct. - private ThreadPool(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ThreadPool() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ThreadPool(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ThreadPool( - 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: { - - coreSize_ = input.readInt32(); - break; - } - case 16: { - - maxSize_ = input.readInt32(); - break; - } - case 24: { - - keepAliveTime_ = input.readInt32(); - break; - } - case 32: { - - queueSize_ = input.readInt32(); - 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.ThreadPoolProto.internal_static_wso2_discovery_config_enforcer_ThreadPool_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolProto.internal_static_wso2_discovery_config_enforcer_ThreadPool_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.class, org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.Builder.class); - } - - public static final int CORESIZE_FIELD_NUMBER = 1; - private int coreSize_; - /** - * int32 coreSize = 1; - * @return The coreSize. - */ - @java.lang.Override - public int getCoreSize() { - return coreSize_; - } - - public static final int MAXSIZE_FIELD_NUMBER = 2; - private int maxSize_; - /** - * int32 maxSize = 2; - * @return The maxSize. - */ - @java.lang.Override - public int getMaxSize() { - return maxSize_; - } - - public static final int KEEPALIVETIME_FIELD_NUMBER = 3; - private int keepAliveTime_; - /** - *
-   * keep alive time of threads in seconds
-   * 
- * - * int32 keepAliveTime = 3; - * @return The keepAliveTime. - */ - @java.lang.Override - public int getKeepAliveTime() { - return keepAliveTime_; - } - - public static final int QUEUESIZE_FIELD_NUMBER = 4; - private int queueSize_; - /** - * int32 queueSize = 4; - * @return The queueSize. - */ - @java.lang.Override - public int getQueueSize() { - return queueSize_; - } - - 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 (coreSize_ != 0) { - output.writeInt32(1, coreSize_); - } - if (maxSize_ != 0) { - output.writeInt32(2, maxSize_); - } - if (keepAliveTime_ != 0) { - output.writeInt32(3, keepAliveTime_); - } - if (queueSize_ != 0) { - output.writeInt32(4, queueSize_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (coreSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, coreSize_); - } - if (maxSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, maxSize_); - } - if (keepAliveTime_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, keepAliveTime_); - } - if (queueSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, queueSize_); - } - 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.ThreadPool)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool other = (org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool) obj; - - if (getCoreSize() - != other.getCoreSize()) return false; - if (getMaxSize() - != other.getMaxSize()) return false; - if (getKeepAliveTime() - != other.getKeepAliveTime()) return false; - if (getQueueSize() - != other.getQueueSize()) 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) + CORESIZE_FIELD_NUMBER; - hash = (53 * hash) + getCoreSize(); - hash = (37 * hash) + MAXSIZE_FIELD_NUMBER; - hash = (53 * hash) + getMaxSize(); - hash = (37 * hash) + KEEPALIVETIME_FIELD_NUMBER; - hash = (53 * hash) + getKeepAliveTime(); - hash = (37 * hash) + QUEUESIZE_FIELD_NUMBER; - hash = (53 * hash) + getQueueSize(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool 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.ThreadPool parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool 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.ThreadPool parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool 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.ThreadPool 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.ThreadPool 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.ThreadPool 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.ThreadPool 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.ThreadPool 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.ThreadPool 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.ThreadPool 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; - } - /** - *
-   * ThreadPool model
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.ThreadPool} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.ThreadPool) - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolProto.internal_static_wso2_discovery_config_enforcer_ThreadPool_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolProto.internal_static_wso2_discovery_config_enforcer_ThreadPool_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.class, org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.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(); - coreSize_ = 0; - - maxSize_ = 0; - - keepAliveTime_ = 0; - - queueSize_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPoolProto.internal_static_wso2_discovery_config_enforcer_ThreadPool_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool build() { - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool result = new org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool(this); - result.coreSize_ = coreSize_; - result.maxSize_ = maxSize_; - result.keepAliveTime_ = keepAliveTime_; - result.queueSize_ = queueSize_; - 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.ThreadPool) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool.getDefaultInstance()) return this; - if (other.getCoreSize() != 0) { - setCoreSize(other.getCoreSize()); - } - if (other.getMaxSize() != 0) { - setMaxSize(other.getMaxSize()); - } - if (other.getKeepAliveTime() != 0) { - setKeepAliveTime(other.getKeepAliveTime()); - } - if (other.getQueueSize() != 0) { - setQueueSize(other.getQueueSize()); - } - 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.ThreadPool parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int coreSize_ ; - /** - * int32 coreSize = 1; - * @return The coreSize. - */ - @java.lang.Override - public int getCoreSize() { - return coreSize_; - } - /** - * int32 coreSize = 1; - * @param value The coreSize to set. - * @return This builder for chaining. - */ - public Builder setCoreSize(int value) { - - coreSize_ = value; - onChanged(); - return this; - } - /** - * int32 coreSize = 1; - * @return This builder for chaining. - */ - public Builder clearCoreSize() { - - coreSize_ = 0; - onChanged(); - return this; - } - - private int maxSize_ ; - /** - * int32 maxSize = 2; - * @return The maxSize. - */ - @java.lang.Override - public int getMaxSize() { - return maxSize_; - } - /** - * int32 maxSize = 2; - * @param value The maxSize to set. - * @return This builder for chaining. - */ - public Builder setMaxSize(int value) { - - maxSize_ = value; - onChanged(); - return this; - } - /** - * int32 maxSize = 2; - * @return This builder for chaining. - */ - public Builder clearMaxSize() { - - maxSize_ = 0; - onChanged(); - return this; - } - - private int keepAliveTime_ ; - /** - *
-     * keep alive time of threads in seconds
-     * 
- * - * int32 keepAliveTime = 3; - * @return The keepAliveTime. - */ - @java.lang.Override - public int getKeepAliveTime() { - return keepAliveTime_; - } - /** - *
-     * keep alive time of threads in seconds
-     * 
- * - * int32 keepAliveTime = 3; - * @param value The keepAliveTime to set. - * @return This builder for chaining. - */ - public Builder setKeepAliveTime(int value) { - - keepAliveTime_ = value; - onChanged(); - return this; - } - /** - *
-     * keep alive time of threads in seconds
-     * 
- * - * int32 keepAliveTime = 3; - * @return This builder for chaining. - */ - public Builder clearKeepAliveTime() { - - keepAliveTime_ = 0; - onChanged(); - return this; - } - - private int queueSize_ ; - /** - * int32 queueSize = 4; - * @return The queueSize. - */ - @java.lang.Override - public int getQueueSize() { - return queueSize_; - } - /** - * int32 queueSize = 4; - * @param value The queueSize to set. - * @return This builder for chaining. - */ - public Builder setQueueSize(int value) { - - queueSize_ = value; - onChanged(); - return this; - } - /** - * int32 queueSize = 4; - * @return This builder for chaining. - */ - public Builder clearQueueSize() { - - queueSize_ = 0; - 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.ThreadPool) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.ThreadPool) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.ThreadPool getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ThreadPool parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ThreadPool(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.ThreadPool getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPoolOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPoolOrBuilder.java deleted file mode 100644 index 578ab09fa4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPoolOrBuilder.java +++ /dev/null @@ -1,37 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/thread_pool.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface ThreadPoolOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.ThreadPool) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 coreSize = 1; - * @return The coreSize. - */ - int getCoreSize(); - - /** - * int32 maxSize = 2; - * @return The maxSize. - */ - int getMaxSize(); - - /** - *
-   * keep alive time of threads in seconds
-   * 
- * - * int32 keepAliveTime = 3; - * @return The keepAliveTime. - */ - int getKeepAliveTime(); - - /** - * int32 queueSize = 4; - * @return The queueSize. - */ - int getQueueSize(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPoolProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPoolProto.java deleted file mode 100644 index 51a940b3a3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ThreadPoolProto.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/thread_pool.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class ThreadPoolProto { - private ThreadPoolProto() {} - 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_ThreadPool_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_ThreadPool_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/thread_" + - "pool.proto\022\036wso2.discovery.config.enforc" + - "er\"Y\n\nThreadPool\022\020\n\010coreSize\030\001 \001(\005\022\017\n\007ma" + - "xSize\030\002 \001(\005\022\025\n\rkeepAliveTime\030\003 \001(\005\022\021\n\tqu" + - "eueSize\030\004 \001(\005B\224\001\n/org.wso2.apk.enforcer." + - "discovery.config.enforcerB\017ThreadPoolPro" + - "toP\001ZNgithub.com/envoyproxy/go-control-p" + - "lane/wso2/discovery/config/enforcer;enfo" + - "rcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_ThreadPool_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_ThreadPool_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_ThreadPool_descriptor, - new java.lang.String[] { "CoreSize", "MaxSize", "KeepAliveTime", "QueueSize", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Tracing.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Tracing.java deleted file mode 100644 index 6f630b536c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Tracing.java +++ /dev/null @@ -1,996 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/tracing.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - * Protobuf type {@code wso2.discovery.config.enforcer.Tracing} - */ -public final class Tracing extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.Tracing) - TracingOrBuilder { -private static final long serialVersionUID = 0L; - // Use Tracing.newBuilder() to construct. - private Tracing(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Tracing() { - type_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Tracing(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Tracing( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - enabled_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - configProperties_ = com.google.protobuf.MapField.newMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - configProperties__ = input.readMessage( - ConfigPropertiesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - configProperties_.getMutableMap().put( - configProperties__.getKey(), configProperties__.getValue()); - 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.TracingProto.internal_static_wso2_discovery_config_enforcer_Tracing_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.internal_static_wso2_discovery_config_enforcer_Tracing_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.class, org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder.class); - } - - public static final int ENABLED_FIELD_NUMBER = 1; - private boolean enabled_; - /** - *
-   * Enable tracing
-   * 
- * - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object type_; - /** - *
-   * Type of tracer exporter
-   * 
- * - * string type = 2; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - *
-   * Type of tracer exporter
-   * 
- * - * string type = 2; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIGPROPERTIES_FIELD_NUMBER = 3; - private static final class ConfigPropertiesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.internal_static_wso2_discovery_config_enforcer_Tracing_ConfigPropertiesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> configProperties_; - private com.google.protobuf.MapField - internalGetConfigProperties() { - if (configProperties_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - return configProperties_; - } - - public int getConfigPropertiesCount() { - return internalGetConfigProperties().getMap().size(); - } - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - - @java.lang.Override - public boolean containsConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetConfigProperties().getMap().containsKey(key); - } - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getConfigProperties() { - return getConfigPropertiesMap(); - } - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.util.Map getConfigPropertiesMap() { - return internalGetConfigProperties().getMap(); - } - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - 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 (enabled_ != false) { - output.writeBool(1, enabled_); - } - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetConfigProperties(), - ConfigPropertiesDefaultEntryHolder.defaultEntry, - 3); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enabled_); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - for (java.util.Map.Entry entry - : internalGetConfigProperties().getMap().entrySet()) { - com.google.protobuf.MapEntry - configProperties__ = ConfigPropertiesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, configProperties__); - } - 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.Tracing)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing other = (org.wso2.apk.enforcer.discovery.config.enforcer.Tracing) obj; - - if (getEnabled() - != other.getEnabled()) return false; - if (!getType() - .equals(other.getType())) return false; - if (!internalGetConfigProperties().equals( - other.internalGetConfigProperties())) 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) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - if (!internalGetConfigProperties().getMap().isEmpty()) { - hash = (37 * hash) + CONFIGPROPERTIES_FIELD_NUMBER; - hash = (53 * hash) + internalGetConfigProperties().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Tracing parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Tracing 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.Tracing parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Tracing 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.Tracing parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.Tracing 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.Tracing 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.Tracing 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.Tracing 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.Tracing 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.Tracing 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.Tracing 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.Tracing prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.config.enforcer.Tracing} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.Tracing) - org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.internal_static_wso2_discovery_config_enforcer_Tracing_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 3: - return internalGetMutableConfigProperties(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.internal_static_wso2_discovery_config_enforcer_Tracing_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.class, org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.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(); - enabled_ = false; - - type_ = ""; - - internalGetMutableConfigProperties().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.internal_static_wso2_discovery_config_enforcer_Tracing_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing build() { - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.Tracing result = new org.wso2.apk.enforcer.discovery.config.enforcer.Tracing(this); - int from_bitField0_ = bitField0_; - result.enabled_ = enabled_; - result.type_ = type_; - result.configProperties_ = internalGetConfigProperties(); - result.configProperties_.makeImmutable(); - 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.Tracing) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.Tracing)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Tracing other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.getDefaultInstance()) return this; - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - internalGetMutableConfigProperties().mergeFrom( - other.internalGetConfigProperties()); - 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.Tracing parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.Tracing) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private boolean enabled_ ; - /** - *
-     * Enable tracing
-     * 
- * - * bool enabled = 1; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - *
-     * Enable tracing
-     * 
- * - * bool enabled = 1; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - *
-     * Enable tracing
-     * 
- * - * bool enabled = 1; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private java.lang.Object type_ = ""; - /** - *
-     * Type of tracer exporter
-     * 
- * - * string type = 2; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Type of tracer exporter
-     * 
- * - * string type = 2; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Type of tracer exporter
-     * 
- * - * string type = 2; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - *
-     * Type of tracer exporter
-     * 
- * - * string type = 2; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - *
-     * Type of tracer exporter
-     * 
- * - * string type = 2; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> configProperties_; - private com.google.protobuf.MapField - internalGetConfigProperties() { - if (configProperties_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - return configProperties_; - } - private com.google.protobuf.MapField - internalGetMutableConfigProperties() { - onChanged();; - if (configProperties_ == null) { - configProperties_ = com.google.protobuf.MapField.newMapField( - ConfigPropertiesDefaultEntryHolder.defaultEntry); - } - if (!configProperties_.isMutable()) { - configProperties_ = configProperties_.copy(); - } - return configProperties_; - } - - public int getConfigPropertiesCount() { - return internalGetConfigProperties().getMap().size(); - } - /** - *
-     * Tracer Configurations
-     * 
- * - * map<string, string> configProperties = 3; - */ - - @java.lang.Override - public boolean containsConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetConfigProperties().getMap().containsKey(key); - } - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getConfigProperties() { - return getConfigPropertiesMap(); - } - /** - *
-     * Tracer Configurations
-     * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.util.Map getConfigPropertiesMap() { - return internalGetConfigProperties().getMap(); - } - /** - *
-     * Tracer Configurations
-     * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * Tracer Configurations
-     * 
- * - * map<string, string> configProperties = 3; - */ - @java.lang.Override - - public java.lang.String getConfigPropertiesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConfigProperties().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearConfigProperties() { - internalGetMutableConfigProperties().getMutableMap() - .clear(); - return this; - } - /** - *
-     * Tracer Configurations
-     * 
- * - * map<string, string> configProperties = 3; - */ - - public Builder removeConfigProperties( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableConfigProperties().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableConfigProperties() { - return internalGetMutableConfigProperties().getMutableMap(); - } - /** - *
-     * Tracer Configurations
-     * 
- * - * map<string, string> configProperties = 3; - */ - public Builder putConfigProperties( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableConfigProperties().getMutableMap() - .put(key, value); - return this; - } - /** - *
-     * Tracer Configurations
-     * 
- * - * map<string, string> configProperties = 3; - */ - - public Builder putAllConfigProperties( - java.util.Map values) { - internalGetMutableConfigProperties().getMutableMap() - .putAll(values); - 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.Tracing) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.Tracing) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.Tracing DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.Tracing(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.Tracing getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Tracing parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Tracing(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.Tracing getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/TracingOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/TracingOrBuilder.java deleted file mode 100644 index b39a63ce72..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/TracingOrBuilder.java +++ /dev/null @@ -1,93 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/tracing.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface TracingOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.Tracing) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Enable tracing
-   * 
- * - * bool enabled = 1; - * @return The enabled. - */ - boolean getEnabled(); - - /** - *
-   * Type of tracer exporter
-   * 
- * - * string type = 2; - * @return The type. - */ - java.lang.String getType(); - /** - *
-   * Type of tracer exporter
-   * 
- * - * string type = 2; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - int getConfigPropertiesCount(); - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - boolean containsConfigProperties( - java.lang.String key); - /** - * Use {@link #getConfigPropertiesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getConfigProperties(); - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - java.util.Map - getConfigPropertiesMap(); - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - - java.lang.String getConfigPropertiesOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - *
-   * Tracer Configurations
-   * 
- * - * map<string, string> configProperties = 3; - */ - - java.lang.String getConfigPropertiesOrThrow( - java.lang.String key); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/TracingProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/TracingProto.java deleted file mode 100644 index eccaf0d602..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/TracingProto.java +++ /dev/null @@ -1,67 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/tracing.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class TracingProto { - private TracingProto() {} - 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_Tracing_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Tracing_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_config_enforcer_Tracing_ConfigPropertiesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Tracing_ConfigPropertiesEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n,wso2/discovery/config/enforcer/tracing" + - ".proto\022\036wso2.discovery.config.enforcer\"\272" + - "\001\n\007Tracing\022\017\n\007enabled\030\001 \001(\010\022\014\n\004type\030\002 \001(" + - "\t\022W\n\020configProperties\030\003 \003(\0132=.wso2.disco" + - "very.config.enforcer.Tracing.ConfigPrope" + - "rtiesEntry\0327\n\025ConfigPropertiesEntry\022\013\n\003k" + - "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\221\001\n/org.wso2" + - ".apk.enforcer.discovery.config.enforcerB" + - "\014TracingProtoP\001ZNgithub.com/envoyproxy/g" + - "o-control-plane/wso2/discovery/config/en" + - "forcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_Tracing_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Tracing_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Tracing_descriptor, - new java.lang.String[] { "Enabled", "Type", "ConfigProperties", }); - internal_static_wso2_discovery_config_enforcer_Tracing_ConfigPropertiesEntry_descriptor = - internal_static_wso2_discovery_config_enforcer_Tracing_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Tracing_ConfigPropertiesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Tracing_ConfigPropertiesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/soapProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/soapProto.java deleted file mode 100644 index 2dfd6a05ab..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/soapProto.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/soap.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class soapProto { - private soapProto() {} - 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_Soap_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_Soap_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n)wso2/discovery/config/enforcer/soap.pr" + - "oto\022\036wso2.discovery.config.enforcer\"%\n\004S" + - "oap\022\035\n\025soapErrorInXMLEnabled\030\001 \001(\010B\216\001\n/o" + - "rg.wso2.apk.enforcer.discovery.config.en" + - "forcerB\tsoapProtoP\001ZNgithub.com/envoypro" + - "xy/go-control-plane/wso2/discovery/confi" + - "g/enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_Soap_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_Soap_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_Soap_descriptor, - new java.lang.String[] { "SoapErrorInXMLEnabled", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfig.java deleted file mode 100644 index fb80397f7d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfig.java +++ /dev/null @@ -1,1044 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/keymgt/key_manager_config.proto - -package org.wso2.apk.enforcer.discovery.keymgt; - -/** - *
- * KeyManagerConfig model
- * 
- * - * Protobuf type {@code wso2.discovery.keymgt.KeyManagerConfig} - */ -public final class KeyManagerConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.keymgt.KeyManagerConfig) - KeyManagerConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use KeyManagerConfig.newBuilder() to construct. - private KeyManagerConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private KeyManagerConfig() { - name_ = ""; - type_ = ""; - tenantDomain_ = ""; - configuration_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new KeyManagerConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private KeyManagerConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 24: { - - enabled_ = input.readBool(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - tenantDomain_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - configuration_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfigProto.internal_static_wso2_discovery_keymgt_KeyManagerConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfigProto.internal_static_wso2_discovery_keymgt_KeyManagerConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig.class, org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object type_; - /** - * string type = 2; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - * string type = 2; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENABLED_FIELD_NUMBER = 3; - private boolean enabled_; - /** - * bool enabled = 3; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - - public static final int TENANTDOMAIN_FIELD_NUMBER = 4; - private volatile java.lang.Object tenantDomain_; - /** - * string tenantDomain = 4; - * @return The tenantDomain. - */ - @java.lang.Override - public java.lang.String getTenantDomain() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tenantDomain_ = s; - return s; - } - } - /** - * string tenantDomain = 4; - * @return The bytes for tenantDomain. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTenantDomainBytes() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tenantDomain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIGURATION_FIELD_NUMBER = 5; - private volatile java.lang.Object configuration_; - /** - * string configuration = 5; - * @return The configuration. - */ - @java.lang.Override - public java.lang.String getConfiguration() { - java.lang.Object ref = configuration_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - configuration_ = s; - return s; - } - } - /** - * string configuration = 5; - * @return The bytes for configuration. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getConfigurationBytes() { - java.lang.Object ref = configuration_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - configuration_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - if (enabled_ != false) { - output.writeBool(3, enabled_); - } - if (!getTenantDomainBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, tenantDomain_); - } - if (!getConfigurationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, configuration_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - if (enabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, enabled_); - } - if (!getTenantDomainBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, tenantDomain_); - } - if (!getConfigurationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, configuration_); - } - 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.keymgt.KeyManagerConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig other = (org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getType() - .equals(other.getType())) return false; - if (getEnabled() - != other.getEnabled()) return false; - if (!getTenantDomain() - .equals(other.getTenantDomain())) return false; - if (!getConfiguration() - .equals(other.getConfiguration())) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnabled()); - hash = (37 * hash) + TENANTDOMAIN_FIELD_NUMBER; - hash = (53 * hash) + getTenantDomain().hashCode(); - hash = (37 * hash) + CONFIGURATION_FIELD_NUMBER; - hash = (53 * hash) + getConfiguration().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig 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.keymgt.KeyManagerConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig 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.keymgt.KeyManagerConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig 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.keymgt.KeyManagerConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig 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.keymgt.KeyManagerConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig 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.keymgt.KeyManagerConfig 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.keymgt.KeyManagerConfig 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.keymgt.KeyManagerConfig 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; - } - /** - *
-   * KeyManagerConfig model
-   * 
- * - * Protobuf type {@code wso2.discovery.keymgt.KeyManagerConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.keymgt.KeyManagerConfig) - org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfigProto.internal_static_wso2_discovery_keymgt_KeyManagerConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfigProto.internal_static_wso2_discovery_keymgt_KeyManagerConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig.class, org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig.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(); - name_ = ""; - - type_ = ""; - - enabled_ = false; - - tenantDomain_ = ""; - - configuration_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfigProto.internal_static_wso2_discovery_keymgt_KeyManagerConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig build() { - org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig buildPartial() { - org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig result = new org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig(this); - result.name_ = name_; - result.type_ = type_; - result.enabled_ = enabled_; - result.tenantDomain_ = tenantDomain_; - result.configuration_ = configuration_; - 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.keymgt.KeyManagerConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig other) { - if (other == org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (other.getEnabled() != false) { - setEnabled(other.getEnabled()); - } - if (!other.getTenantDomain().isEmpty()) { - tenantDomain_ = other.tenantDomain_; - onChanged(); - } - if (!other.getConfiguration().isEmpty()) { - configuration_ = other.configuration_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object type_ = ""; - /** - * string type = 2; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string type = 2; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string type = 2; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - * string type = 2; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - * string type = 2; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private boolean enabled_ ; - /** - * bool enabled = 3; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 3; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - - enabled_ = value; - onChanged(); - return this; - } - /** - * bool enabled = 3; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - - enabled_ = false; - onChanged(); - return this; - } - - private java.lang.Object tenantDomain_ = ""; - /** - * string tenantDomain = 4; - * @return The tenantDomain. - */ - public java.lang.String getTenantDomain() { - java.lang.Object ref = tenantDomain_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tenantDomain_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string tenantDomain = 4; - * @return The bytes for tenantDomain. - */ - public com.google.protobuf.ByteString - getTenantDomainBytes() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tenantDomain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string tenantDomain = 4; - * @param value The tenantDomain to set. - * @return This builder for chaining. - */ - public Builder setTenantDomain( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tenantDomain_ = value; - onChanged(); - return this; - } - /** - * string tenantDomain = 4; - * @return This builder for chaining. - */ - public Builder clearTenantDomain() { - - tenantDomain_ = getDefaultInstance().getTenantDomain(); - onChanged(); - return this; - } - /** - * string tenantDomain = 4; - * @param value The bytes for tenantDomain to set. - * @return This builder for chaining. - */ - public Builder setTenantDomainBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tenantDomain_ = value; - onChanged(); - return this; - } - - private java.lang.Object configuration_ = ""; - /** - * string configuration = 5; - * @return The configuration. - */ - public java.lang.String getConfiguration() { - java.lang.Object ref = configuration_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - configuration_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string configuration = 5; - * @return The bytes for configuration. - */ - public com.google.protobuf.ByteString - getConfigurationBytes() { - java.lang.Object ref = configuration_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - configuration_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string configuration = 5; - * @param value The configuration to set. - * @return This builder for chaining. - */ - public Builder setConfiguration( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - configuration_ = value; - onChanged(); - return this; - } - /** - * string configuration = 5; - * @return This builder for chaining. - */ - public Builder clearConfiguration() { - - configuration_ = getDefaultInstance().getConfiguration(); - onChanged(); - return this; - } - /** - * string configuration = 5; - * @param value The bytes for configuration to set. - * @return This builder for chaining. - */ - public Builder setConfigurationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - configuration_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.keymgt.KeyManagerConfig) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.keymgt.KeyManagerConfig) - private static final org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig(); - } - - public static org.wso2.apk.enforcer.discovery.keymgt.KeyManagerConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public KeyManagerConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new KeyManagerConfig(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.keymgt.KeyManagerConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfigOrBuilder.java deleted file mode 100644 index 4c008ea95e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfigOrBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/keymgt/key_manager_config.proto - -package org.wso2.apk.enforcer.discovery.keymgt; - -public interface KeyManagerConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.keymgt.KeyManagerConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string type = 2; - * @return The type. - */ - java.lang.String getType(); - /** - * string type = 2; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - * bool enabled = 3; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * string tenantDomain = 4; - * @return The tenantDomain. - */ - java.lang.String getTenantDomain(); - /** - * string tenantDomain = 4; - * @return The bytes for tenantDomain. - */ - com.google.protobuf.ByteString - getTenantDomainBytes(); - - /** - * string configuration = 5; - * @return The configuration. - */ - java.lang.String getConfiguration(); - /** - * string configuration = 5; - * @return The bytes for configuration. - */ - com.google.protobuf.ByteString - getConfigurationBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfigProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfigProto.java deleted file mode 100644 index 1077e5f9d1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/KeyManagerConfigProto.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/keymgt/key_manager_config.proto - -package org.wso2.apk.enforcer.discovery.keymgt; - -public final class KeyManagerConfigProto { - private KeyManagerConfigProto() {} - 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_keymgt_KeyManagerConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_keymgt_KeyManagerConfig_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n.wso2/discovery/keymgt/key_manager_conf" + - "ig.proto\022\025wso2.discovery.keymgt\"l\n\020KeyMa" + - "nagerConfig\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022" + - "\017\n\007enabled\030\003 \001(\010\022\024\n\014tenantDomain\030\004 \001(\t\022\025" + - "\n\rconfiguration\030\005 \001(\tB\206\001\n&org.wso2.apk.e" + - "nforcer.discovery.keymgtB\025KeyManagerConf" + - "igProtoP\001ZCgithub.com/envoyproxy/go-cont" + - "rol-plane/wso2/discovery/keymgt;keymgtb\006" + - "proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_keymgt_KeyManagerConfig_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_keymgt_KeyManagerConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_keymgt_KeyManagerConfig_descriptor, - new java.lang.String[] { "Name", "Type", "Enabled", "TenantDomain", "Configuration", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedToken.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedToken.java deleted file mode 100644 index a5166b5ef7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedToken.java +++ /dev/null @@ -1,630 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/keymgt/revoked_tokens.proto - -package org.wso2.apk.enforcer.discovery.keymgt; - -/** - *
- * Enforcer config model
- * 
- * - * Protobuf type {@code wso2.discovery.keymgt.RevokedToken} - */ -public final class RevokedToken extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.keymgt.RevokedToken) - RevokedTokenOrBuilder { -private static final long serialVersionUID = 0L; - // Use RevokedToken.newBuilder() to construct. - private RevokedToken(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RevokedToken() { - jti_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RevokedToken(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RevokedToken( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - jti_ = s; - break; - } - case 16: { - - expirytime_ = input.readInt64(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.keymgt.RevokedTokensProto.internal_static_wso2_discovery_keymgt_RevokedToken_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.keymgt.RevokedTokensProto.internal_static_wso2_discovery_keymgt_RevokedToken_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.keymgt.RevokedToken.class, org.wso2.apk.enforcer.discovery.keymgt.RevokedToken.Builder.class); - } - - public static final int JTI_FIELD_NUMBER = 1; - private volatile java.lang.Object jti_; - /** - * string jti = 1; - * @return The jti. - */ - @java.lang.Override - public java.lang.String getJti() { - java.lang.Object ref = jti_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - jti_ = s; - return s; - } - } - /** - * string jti = 1; - * @return The bytes for jti. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getJtiBytes() { - java.lang.Object ref = jti_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - jti_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXPIRYTIME_FIELD_NUMBER = 2; - private long expirytime_; - /** - * int64 expirytime = 2; - * @return The expirytime. - */ - @java.lang.Override - public long getExpirytime() { - return expirytime_; - } - - 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 (!getJtiBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, jti_); - } - if (expirytime_ != 0L) { - output.writeInt64(2, expirytime_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getJtiBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, jti_); - } - if (expirytime_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, expirytime_); - } - 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.keymgt.RevokedToken)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.keymgt.RevokedToken other = (org.wso2.apk.enforcer.discovery.keymgt.RevokedToken) obj; - - if (!getJti() - .equals(other.getJti())) return false; - if (getExpirytime() - != other.getExpirytime()) 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) + JTI_FIELD_NUMBER; - hash = (53 * hash) + getJti().hashCode(); - hash = (37 * hash) + EXPIRYTIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getExpirytime()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.keymgt.RevokedToken parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.keymgt.RevokedToken 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.keymgt.RevokedToken parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.keymgt.RevokedToken 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.keymgt.RevokedToken parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.keymgt.RevokedToken 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.keymgt.RevokedToken parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.keymgt.RevokedToken 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.keymgt.RevokedToken parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.keymgt.RevokedToken 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.keymgt.RevokedToken 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.keymgt.RevokedToken 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.keymgt.RevokedToken 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; - } - /** - *
-   * Enforcer config model
-   * 
- * - * Protobuf type {@code wso2.discovery.keymgt.RevokedToken} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.keymgt.RevokedToken) - org.wso2.apk.enforcer.discovery.keymgt.RevokedTokenOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.keymgt.RevokedTokensProto.internal_static_wso2_discovery_keymgt_RevokedToken_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.keymgt.RevokedTokensProto.internal_static_wso2_discovery_keymgt_RevokedToken_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.keymgt.RevokedToken.class, org.wso2.apk.enforcer.discovery.keymgt.RevokedToken.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.keymgt.RevokedToken.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(); - jti_ = ""; - - expirytime_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.keymgt.RevokedTokensProto.internal_static_wso2_discovery_keymgt_RevokedToken_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.keymgt.RevokedToken getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.keymgt.RevokedToken.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.keymgt.RevokedToken build() { - org.wso2.apk.enforcer.discovery.keymgt.RevokedToken result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.keymgt.RevokedToken buildPartial() { - org.wso2.apk.enforcer.discovery.keymgt.RevokedToken result = new org.wso2.apk.enforcer.discovery.keymgt.RevokedToken(this); - result.jti_ = jti_; - result.expirytime_ = expirytime_; - 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.keymgt.RevokedToken) { - return mergeFrom((org.wso2.apk.enforcer.discovery.keymgt.RevokedToken)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.keymgt.RevokedToken other) { - if (other == org.wso2.apk.enforcer.discovery.keymgt.RevokedToken.getDefaultInstance()) return this; - if (!other.getJti().isEmpty()) { - jti_ = other.jti_; - onChanged(); - } - if (other.getExpirytime() != 0L) { - setExpirytime(other.getExpirytime()); - } - 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.keymgt.RevokedToken parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.keymgt.RevokedToken) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object jti_ = ""; - /** - * string jti = 1; - * @return The jti. - */ - public java.lang.String getJti() { - java.lang.Object ref = jti_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - jti_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string jti = 1; - * @return The bytes for jti. - */ - public com.google.protobuf.ByteString - getJtiBytes() { - java.lang.Object ref = jti_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - jti_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string jti = 1; - * @param value The jti to set. - * @return This builder for chaining. - */ - public Builder setJti( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - jti_ = value; - onChanged(); - return this; - } - /** - * string jti = 1; - * @return This builder for chaining. - */ - public Builder clearJti() { - - jti_ = getDefaultInstance().getJti(); - onChanged(); - return this; - } - /** - * string jti = 1; - * @param value The bytes for jti to set. - * @return This builder for chaining. - */ - public Builder setJtiBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - jti_ = value; - onChanged(); - return this; - } - - private long expirytime_ ; - /** - * int64 expirytime = 2; - * @return The expirytime. - */ - @java.lang.Override - public long getExpirytime() { - return expirytime_; - } - /** - * int64 expirytime = 2; - * @param value The expirytime to set. - * @return This builder for chaining. - */ - public Builder setExpirytime(long value) { - - expirytime_ = value; - onChanged(); - return this; - } - /** - * int64 expirytime = 2; - * @return This builder for chaining. - */ - public Builder clearExpirytime() { - - expirytime_ = 0L; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.keymgt.RevokedToken) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.keymgt.RevokedToken) - private static final org.wso2.apk.enforcer.discovery.keymgt.RevokedToken DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.keymgt.RevokedToken(); - } - - public static org.wso2.apk.enforcer.discovery.keymgt.RevokedToken getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RevokedToken parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RevokedToken(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.keymgt.RevokedToken getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedTokenOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedTokenOrBuilder.java deleted file mode 100644 index 32c3c48b26..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedTokenOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/keymgt/revoked_tokens.proto - -package org.wso2.apk.enforcer.discovery.keymgt; - -public interface RevokedTokenOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.keymgt.RevokedToken) - com.google.protobuf.MessageOrBuilder { - - /** - * string jti = 1; - * @return The jti. - */ - java.lang.String getJti(); - /** - * string jti = 1; - * @return The bytes for jti. - */ - com.google.protobuf.ByteString - getJtiBytes(); - - /** - * int64 expirytime = 2; - * @return The expirytime. - */ - long getExpirytime(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedTokensProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedTokensProto.java deleted file mode 100644 index 43a80f0a78..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/keymgt/RevokedTokensProto.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/keymgt/revoked_tokens.proto - -package org.wso2.apk.enforcer.discovery.keymgt; - -public final class RevokedTokensProto { - private RevokedTokensProto() {} - 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_keymgt_RevokedToken_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_keymgt_RevokedToken_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n*wso2/discovery/keymgt/revoked_tokens.p" + - "roto\022\025wso2.discovery.keymgt\"/\n\014RevokedTo" + - "ken\022\013\n\003jti\030\001 \001(\t\022\022\n\nexpirytime\030\002 \001(\003B\203\001\n" + - "&org.wso2.apk.enforcer.discovery.keymgtB" + - "\022RevokedTokensProtoP\001ZCgithub.com/envoyp" + - "roxy/go-control-plane/wso2/discovery/key" + - "mgt;keymgtb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_keymgt_RevokedToken_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_keymgt_RevokedToken_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_keymgt_RevokedToken_descriptor, - new java.lang.String[] { "Jti", "Expirytime", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java deleted file mode 100644 index 3ed73dccee..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.discovery.scheduler; - -import org.wso2.apk.enforcer.config.EnvVarConfig; -import org.wso2.apk.enforcer.discovery.ApiDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ConfigDiscoveryClient; -import org.wso2.apk.enforcer.discovery.JWTIssuerDiscoveryClient; -import org.wso2.apk.enforcer.subscription.EventingGrpcClient; - -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - -/** - * Manages all the scheduling tasks that runs for retrying discovery requests. - */ -public class XdsSchedulerManager { - - private static int retryPeriod; - private static volatile XdsSchedulerManager instance; - private static ScheduledExecutorService discoveryClientScheduler; - private static ScheduledExecutorService eventingScheduler; - private ScheduledFuture apiDiscoveryScheduledFuture; - private ScheduledFuture jwtIssuerDiscoveryScheduledFuture; - - private ScheduledFuture eventingScheduledFuture; - private ScheduledFuture configDiscoveryScheduledFuture; - - public static XdsSchedulerManager getInstance() { - - if (instance == null) { - synchronized (XdsSchedulerManager.class) { - if (instance == null) { - instance = new XdsSchedulerManager(); - discoveryClientScheduler = Executors.newSingleThreadScheduledExecutor(); - eventingScheduler = Executors.newSingleThreadScheduledExecutor(); - retryPeriod = Integer.parseInt(EnvVarConfig.getInstance().getXdsRetryPeriod()); - } - } - } - return instance; - } - - public synchronized void startAPIDiscoveryScheduling() { - - if (apiDiscoveryScheduledFuture == null || apiDiscoveryScheduledFuture.isDone()) { - apiDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(ApiDiscoveryClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); - } - } - - public synchronized void stopAPIDiscoveryScheduling() { - - if (apiDiscoveryScheduledFuture != null && !apiDiscoveryScheduledFuture.isDone()) { - apiDiscoveryScheduledFuture.cancel(false); - } - } - - public synchronized void startJWTIssuerDiscoveryScheduling() { - - if (jwtIssuerDiscoveryScheduledFuture == null || jwtIssuerDiscoveryScheduledFuture.isDone()) { - jwtIssuerDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(JWTIssuerDiscoveryClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); - } - } - - public synchronized void startEventScheduling() { - - if (eventingScheduledFuture == null || eventingScheduledFuture.isDone()) { - eventingScheduledFuture = eventingScheduler - .scheduleWithFixedDelay(EventingGrpcClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); - } - } - - public synchronized void stopJWTIssuerDiscoveryScheduling() { - - if (jwtIssuerDiscoveryScheduledFuture != null && !jwtIssuerDiscoveryScheduledFuture.isDone()) { - jwtIssuerDiscoveryScheduledFuture.cancel(false); - } - } - - public synchronized void stopEventStreamScheduling() { - - if (eventingScheduledFuture != null && !eventingScheduledFuture.isDone()) { - eventingScheduledFuture.cancel(false); - } - } - - public synchronized void startConfigDiscoveryScheduling() { - - if (configDiscoveryScheduledFuture == null || configDiscoveryScheduledFuture.isDone()) { - configDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(ConfigDiscoveryClient.getInstance(), 1, retryPeriod, - TimeUnit.SECONDS); - } - } - - public synchronized void stopConfigDiscoveryScheduling() { - - if (configDiscoveryScheduledFuture != null && !configDiscoveryScheduledFuture.isDone()) { - configDiscoveryScheduledFuture.cancel(false); - } - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/APIDsProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/APIDsProto.java deleted file mode 100644 index a1e47579f4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/APIDsProto.java +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/api/apids.proto - -package org.wso2.apk.enforcer.discovery.service.api; - -public final class APIDsProto { - private APIDsProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n&wso2/discovery/service/api/apids.proto" + - "\022\025discovery.service.api\032*envoy/service/d" + - "iscovery/v3/discovery.proto2\362\001\n\023ApiDisco" + - "veryService\022o\n\nStreamApis\022,.envoy.servic" + - "e.discovery.v3.DiscoveryRequest\032-.envoy." + - "service.discovery.v3.DiscoveryResponse\"\000" + - "(\0010\001\022j\n\tFetchApis\022,.envoy.service.discov" + - "ery.v3.DiscoveryRequest\032-.envoy.service." + - "discovery.v3.DiscoveryResponse\"\000B\201\001\n+org" + - ".wso2.apk.enforcer.discovery.service.api" + - "B\nAPIDsProtoP\001ZAgithub.com/envoyproxy/go" + - "-control-plane/wso2/discovery/service/ap" + - "i\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(), - }); - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/ApiDiscoveryService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/ApiDiscoveryService.java deleted file mode 100644 index 22d6235425..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/ApiDiscoveryService.java +++ /dev/null @@ -1,312 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/api/apids.proto - -package org.wso2.apk.enforcer.discovery.service.api; - -/** - *
- * [#protodoc-title: APIDS]
- * 
- * - * Protobuf service {@code discovery.service.api.ApiDiscoveryService} - */ -public abstract class ApiDiscoveryService - implements com.google.protobuf.Service { - protected ApiDiscoveryService() {} - - public interface Interface { - /** - * rpc StreamApis(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc FetchApis(.envoy.service.discovery.v3.DiscoveryRequest) returns (.envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void fetchApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new ApiDiscoveryService() { - @java.lang.Override - public void streamApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.streamApis(controller, request, done); - } - - @java.lang.Override - public void fetchApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.fetchApis(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.streamApis(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - case 1: - return impl.fetchApis(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc StreamApis(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc FetchApis(.envoy.service.discovery.v3.DiscoveryRequest) returns (.envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void fetchApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.api.APIDsProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.streamApis(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - case 1: - this.fetchApis(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.api.ApiDiscoveryService implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void streamApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - - public void fetchApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(1), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchApis( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(1), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:discovery.service.api.ApiDiscoveryService) -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/ApiDiscoveryServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/ApiDiscoveryServiceGrpc.java deleted file mode 100644 index 9bcde960a2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/api/ApiDiscoveryServiceGrpc.java +++ /dev/null @@ -1,361 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.api; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: APIDS]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/api/apids.proto") -public final class ApiDiscoveryServiceGrpc { - - private ApiDiscoveryServiceGrpc() {} - - public static final String SERVICE_NAME = "discovery.service.api.ApiDiscoveryService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getStreamApisMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamApis", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamApisMethod() { - io.grpc.MethodDescriptor getStreamApisMethod; - if ((getStreamApisMethod = ApiDiscoveryServiceGrpc.getStreamApisMethod) == null) { - synchronized (ApiDiscoveryServiceGrpc.class) { - if ((getStreamApisMethod = ApiDiscoveryServiceGrpc.getStreamApisMethod) == null) { - ApiDiscoveryServiceGrpc.getStreamApisMethod = getStreamApisMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamApis")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new ApiDiscoveryServiceMethodDescriptorSupplier("StreamApis")) - .build(); - } - } - } - return getStreamApisMethod; - } - - private static volatile io.grpc.MethodDescriptor getFetchApisMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "FetchApis", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getFetchApisMethod() { - io.grpc.MethodDescriptor getFetchApisMethod; - if ((getFetchApisMethod = ApiDiscoveryServiceGrpc.getFetchApisMethod) == null) { - synchronized (ApiDiscoveryServiceGrpc.class) { - if ((getFetchApisMethod = ApiDiscoveryServiceGrpc.getFetchApisMethod) == null) { - ApiDiscoveryServiceGrpc.getFetchApisMethod = getFetchApisMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchApis")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new ApiDiscoveryServiceMethodDescriptorSupplier("FetchApis")) - .build(); - } - } - } - return getFetchApisMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static ApiDiscoveryServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ApiDiscoveryServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ApiDiscoveryServiceStub(channel, callOptions); - } - }; - return ApiDiscoveryServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static ApiDiscoveryServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ApiDiscoveryServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ApiDiscoveryServiceBlockingStub(channel, callOptions); - } - }; - return ApiDiscoveryServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static ApiDiscoveryServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ApiDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ApiDiscoveryServiceFutureStub(channel, callOptions); - } - }; - return ApiDiscoveryServiceFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: APIDS]
-   * 
- */ - public static abstract class ApiDiscoveryServiceImplBase implements io.grpc.BindableService { - - /** - */ - public io.grpc.stub.StreamObserver streamApis( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(getStreamApisMethod(), responseObserver); - } - - /** - */ - public void fetchApis(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getFetchApisMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamApisMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_STREAM_APIS))) - .addMethod( - getFetchApisMethod(), - asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_FETCH_APIS))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: APIDS]
-   * 
- */ - public static final class ApiDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { - private ApiDiscoveryServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ApiDiscoveryServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ApiDiscoveryServiceStub(channel, callOptions); - } - - /** - */ - public io.grpc.stub.StreamObserver streamApis( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamApisMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public void fetchApis(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getFetchApisMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * [#protodoc-title: APIDS]
-   * 
- */ - public static final class ApiDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private ApiDiscoveryServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ApiDiscoveryServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ApiDiscoveryServiceBlockingStub(channel, callOptions); - } - - /** - */ - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchApis(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) { - return blockingUnaryCall( - getChannel(), getFetchApisMethod(), getCallOptions(), request); - } - } - - /** - *
-   * [#protodoc-title: APIDS]
-   * 
- */ - public static final class ApiDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private ApiDiscoveryServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ApiDiscoveryServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ApiDiscoveryServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture fetchApis( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) { - return futureUnaryCall( - getChannel().newCall(getFetchApisMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_FETCH_APIS = 0; - private static final int METHODID_STREAM_APIS = 1; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ApiDiscoveryServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(ApiDiscoveryServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_FETCH_APIS: - serviceImpl.fetchApis((io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAM_APIS: - return (io.grpc.stub.StreamObserver) serviceImpl.streamApis( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class ApiDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - ApiDiscoveryServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.api.APIDsProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("ApiDiscoveryService"); - } - } - - private static final class ApiDiscoveryServiceFileDescriptorSupplier - extends ApiDiscoveryServiceBaseDescriptorSupplier { - ApiDiscoveryServiceFileDescriptorSupplier() {} - } - - private static final class ApiDiscoveryServiceMethodDescriptorSupplier - extends ApiDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - ApiDiscoveryServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (ApiDiscoveryServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new ApiDiscoveryServiceFileDescriptorSupplier()) - .addMethod(getStreamApisMethod()) - .addMethod(getFetchApisMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/APIServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/APIServiceGrpc.java deleted file mode 100644 index 3205b36581..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/APIServiceGrpc.java +++ /dev/null @@ -1,436 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/apkmgt/apids.proto") -public final class APIServiceGrpc { - - private APIServiceGrpc() {} - - public static final String SERVICE_NAME = "discovery.service.apkmgt.APIService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCreateAPIMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "createAPI", - requestType = org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.class, - responseType = org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateAPIMethod() { - io.grpc.MethodDescriptor getCreateAPIMethod; - if ((getCreateAPIMethod = APIServiceGrpc.getCreateAPIMethod) == null) { - synchronized (APIServiceGrpc.class) { - if ((getCreateAPIMethod = APIServiceGrpc.getCreateAPIMethod) == null) { - APIServiceGrpc.getCreateAPIMethod = getCreateAPIMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "createAPI")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance())) - .setSchemaDescriptor(new APIServiceMethodDescriptorSupplier("createAPI")) - .build(); - } - } - } - return getCreateAPIMethod; - } - - private static volatile io.grpc.MethodDescriptor getUpdateAPIMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "updateAPI", - requestType = org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.class, - responseType = org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdateAPIMethod() { - io.grpc.MethodDescriptor getUpdateAPIMethod; - if ((getUpdateAPIMethod = APIServiceGrpc.getUpdateAPIMethod) == null) { - synchronized (APIServiceGrpc.class) { - if ((getUpdateAPIMethod = APIServiceGrpc.getUpdateAPIMethod) == null) { - APIServiceGrpc.getUpdateAPIMethod = getUpdateAPIMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "updateAPI")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance())) - .setSchemaDescriptor(new APIServiceMethodDescriptorSupplier("updateAPI")) - .build(); - } - } - } - return getUpdateAPIMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeleteAPIMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "deleteAPI", - requestType = org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.class, - responseType = org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteAPIMethod() { - io.grpc.MethodDescriptor getDeleteAPIMethod; - if ((getDeleteAPIMethod = APIServiceGrpc.getDeleteAPIMethod) == null) { - synchronized (APIServiceGrpc.class) { - if ((getDeleteAPIMethod = APIServiceGrpc.getDeleteAPIMethod) == null) { - APIServiceGrpc.getDeleteAPIMethod = getDeleteAPIMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "deleteAPI")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance())) - .setSchemaDescriptor(new APIServiceMethodDescriptorSupplier("deleteAPI")) - .build(); - } - } - } - return getDeleteAPIMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static APIServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public APIServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APIServiceStub(channel, callOptions); - } - }; - return APIServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static APIServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public APIServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APIServiceBlockingStub(channel, callOptions); - } - }; - return APIServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static APIServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public APIServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APIServiceFutureStub(channel, callOptions); - } - }; - return APIServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class APIServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void createAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCreateAPIMethod(), responseObserver); - } - - /** - */ - public void updateAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getUpdateAPIMethod(), responseObserver); - } - - /** - */ - public void deleteAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getDeleteAPIMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateAPIMethod(), - asyncUnaryCall( - new MethodHandlers< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response>( - this, METHODID_CREATE_API))) - .addMethod( - getUpdateAPIMethod(), - asyncUnaryCall( - new MethodHandlers< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response>( - this, METHODID_UPDATE_API))) - .addMethod( - getDeleteAPIMethod(), - asyncUnaryCall( - new MethodHandlers< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response>( - this, METHODID_DELETE_API))) - .build(); - } - } - - /** - */ - public static final class APIServiceStub extends io.grpc.stub.AbstractAsyncStub { - private APIServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected APIServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APIServiceStub(channel, callOptions); - } - - /** - */ - public void createAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getCreateAPIMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void updateAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getUpdateAPIMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void deleteAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getDeleteAPIMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class APIServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private APIServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected APIServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APIServiceBlockingStub(channel, callOptions); - } - - /** - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response createAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) { - return blockingUnaryCall( - getChannel(), getCreateAPIMethod(), getCallOptions(), request); - } - - /** - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response updateAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) { - return blockingUnaryCall( - getChannel(), getUpdateAPIMethod(), getCallOptions(), request); - } - - /** - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response deleteAPI(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) { - return blockingUnaryCall( - getChannel(), getDeleteAPIMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class APIServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private APIServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected APIServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APIServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture createAPI( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) { - return futureUnaryCall( - getChannel().newCall(getCreateAPIMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture updateAPI( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) { - return futureUnaryCall( - getChannel().newCall(getUpdateAPIMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture deleteAPI( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) { - return futureUnaryCall( - getChannel().newCall(getDeleteAPIMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_API = 0; - private static final int METHODID_UPDATE_API = 1; - private static final int METHODID_DELETE_API = 2; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final APIServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(APIServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_CREATE_API: - serviceImpl.createAPI((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_API: - serviceImpl.updateAPI((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_API: - serviceImpl.deleteAPI((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class APIServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - APIServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("APIService"); - } - } - - private static final class APIServiceFileDescriptorSupplier - extends APIServiceBaseDescriptorSupplier { - APIServiceFileDescriptorSupplier() {} - } - - private static final class APIServiceMethodDescriptorSupplier - extends APIServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - APIServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (APIServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new APIServiceFileDescriptorSupplier()) - .addMethod(getCreateAPIMethod()) - .addMethod(getUpdateAPIMethod()) - .addMethod(getDeleteAPIMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/APKMgtDiscoveryServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/APKMgtDiscoveryServiceGrpc.java deleted file mode 100644 index 9eab4967bd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/APKMgtDiscoveryServiceGrpc.java +++ /dev/null @@ -1,287 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: ApplicationDS]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/apkmgt/applicationds.proto") -public final class APKMgtDiscoveryServiceGrpc { - - private APKMgtDiscoveryServiceGrpc() {} - - public static final String SERVICE_NAME = "discovery.service.apkmgt.APKMgtDiscoveryService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getStreamAPKMgtApplicationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamAPKMgtApplications", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamAPKMgtApplicationsMethod() { - io.grpc.MethodDescriptor getStreamAPKMgtApplicationsMethod; - if ((getStreamAPKMgtApplicationsMethod = APKMgtDiscoveryServiceGrpc.getStreamAPKMgtApplicationsMethod) == null) { - synchronized (APKMgtDiscoveryServiceGrpc.class) { - if ((getStreamAPKMgtApplicationsMethod = APKMgtDiscoveryServiceGrpc.getStreamAPKMgtApplicationsMethod) == null) { - APKMgtDiscoveryServiceGrpc.getStreamAPKMgtApplicationsMethod = getStreamAPKMgtApplicationsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamAPKMgtApplications")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new APKMgtDiscoveryServiceMethodDescriptorSupplier("StreamAPKMgtApplications")) - .build(); - } - } - } - return getStreamAPKMgtApplicationsMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static APKMgtDiscoveryServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public APKMgtDiscoveryServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APKMgtDiscoveryServiceStub(channel, callOptions); - } - }; - return APKMgtDiscoveryServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static APKMgtDiscoveryServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public APKMgtDiscoveryServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APKMgtDiscoveryServiceBlockingStub(channel, callOptions); - } - }; - return APKMgtDiscoveryServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static APKMgtDiscoveryServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public APKMgtDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APKMgtDiscoveryServiceFutureStub(channel, callOptions); - } - }; - return APKMgtDiscoveryServiceFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: ApplicationDS]
-   * 
- */ - public static abstract class APKMgtDiscoveryServiceImplBase implements io.grpc.BindableService { - - /** - */ - public io.grpc.stub.StreamObserver streamAPKMgtApplications( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(getStreamAPKMgtApplicationsMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamAPKMgtApplicationsMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_STREAM_APKMGT_APPLICATIONS))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: ApplicationDS]
-   * 
- */ - public static final class APKMgtDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { - private APKMgtDiscoveryServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected APKMgtDiscoveryServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APKMgtDiscoveryServiceStub(channel, callOptions); - } - - /** - */ - public io.grpc.stub.StreamObserver streamAPKMgtApplications( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamAPKMgtApplicationsMethod(), getCallOptions()), responseObserver); - } - } - - /** - *
-   * [#protodoc-title: ApplicationDS]
-   * 
- */ - public static final class APKMgtDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private APKMgtDiscoveryServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected APKMgtDiscoveryServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APKMgtDiscoveryServiceBlockingStub(channel, callOptions); - } - } - - /** - *
-   * [#protodoc-title: ApplicationDS]
-   * 
- */ - public static final class APKMgtDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private APKMgtDiscoveryServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected APKMgtDiscoveryServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new APKMgtDiscoveryServiceFutureStub(channel, callOptions); - } - } - - private static final int METHODID_STREAM_APKMGT_APPLICATIONS = 0; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final APKMgtDiscoveryServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(APKMgtDiscoveryServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAM_APKMGT_APPLICATIONS: - return (io.grpc.stub.StreamObserver) serviceImpl.streamAPKMgtApplications( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class APKMgtDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - APKMgtDiscoveryServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApplicationDsProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("APKMgtDiscoveryService"); - } - } - - private static final class APKMgtDiscoveryServiceFileDescriptorSupplier - extends APKMgtDiscoveryServiceBaseDescriptorSupplier { - APKMgtDiscoveryServiceFileDescriptorSupplier() {} - } - - private static final class APKMgtDiscoveryServiceMethodDescriptorSupplier - extends APKMgtDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - APKMgtDiscoveryServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (APKMgtDiscoveryServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new APKMgtDiscoveryServiceFileDescriptorSupplier()) - .addMethod(getStreamAPKMgtApplicationsMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/ApiDsProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/ApiDsProto.java deleted file mode 100644 index 63beea8022..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/ApiDsProto.java +++ /dev/null @@ -1,11857 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/apkmgt/apids.proto - -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -public final class ApiDsProto { - private ApiDsProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - public interface APIOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.API) - com.google.protobuf.MessageOrBuilder { - - /** - * string uuid = 1; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * string provider = 2; - * @return The provider. - */ - java.lang.String getProvider(); - /** - * string provider = 2; - * @return The bytes for provider. - */ - com.google.protobuf.ByteString - getProviderBytes(); - - /** - * string version = 3; - * @return The version. - */ - java.lang.String getVersion(); - /** - * string version = 3; - * @return The bytes for version. - */ - com.google.protobuf.ByteString - getVersionBytes(); - - /** - * string name = 4; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 4; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string basePath = 5; - * @return The basePath. - */ - java.lang.String getBasePath(); - /** - * string basePath = 5; - * @return The bytes for basePath. - */ - com.google.protobuf.ByteString - getBasePathBytes(); - - /** - * string type = 6; - * @return The type. - */ - java.lang.String getType(); - /** - * string type = 6; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - * string organizationId = 7; - * @return The organizationId. - */ - java.lang.String getOrganizationId(); - /** - * string organizationId = 7; - * @return The bytes for organizationId. - */ - com.google.protobuf.ByteString - getOrganizationIdBytes(); - - /** - * string createdBy = 8; - * @return The createdBy. - */ - java.lang.String getCreatedBy(); - /** - * string createdBy = 8; - * @return The bytes for createdBy. - */ - com.google.protobuf.ByteString - getCreatedByBytes(); - - /** - * string createdTime = 9; - * @return The createdTime. - */ - java.lang.String getCreatedTime(); - /** - * string createdTime = 9; - * @return The bytes for createdTime. - */ - com.google.protobuf.ByteString - getCreatedTimeBytes(); - - /** - * string updatedBy = 10; - * @return The updatedBy. - */ - java.lang.String getUpdatedBy(); - /** - * string updatedBy = 10; - * @return The bytes for updatedBy. - */ - com.google.protobuf.ByteString - getUpdatedByBytes(); - - /** - * string updatedTime = 11; - * @return The updatedTime. - */ - java.lang.String getUpdatedTime(); - /** - * string updatedTime = 11; - * @return The bytes for updatedTime. - */ - com.google.protobuf.ByteString - getUpdatedTimeBytes(); - - /** - * string definition = 12; - * @return The definition. - */ - java.lang.String getDefinition(); - /** - * string definition = 12; - * @return The bytes for definition. - */ - com.google.protobuf.ByteString - getDefinitionBytes(); - - /** - * repeated string transports = 13; - * @return A list containing the transports. - */ - java.util.List - getTransportsList(); - /** - * repeated string transports = 13; - * @return The count of transports. - */ - int getTransportsCount(); - /** - * repeated string transports = 13; - * @param index The index of the element to return. - * @return The transports at the given index. - */ - java.lang.String getTransports(int index); - /** - * repeated string transports = 13; - * @param index The index of the value to return. - * @return The bytes of the transports at the given index. - */ - com.google.protobuf.ByteString - getTransportsBytes(int index); - - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - java.util.List - getResourcesList(); - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource getResources(int index); - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - int getResourcesCount(); - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - java.util.List - getResourcesOrBuilderList(); - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ResourceOrBuilder getResourcesOrBuilder( - int index); - - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - * @return Whether the corsConfig field is set. - */ - boolean hasCorsConfig(); - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - * @return The corsConfig. - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig getCorsConfig(); - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfigOrBuilder getCorsConfigOrBuilder(); - } - /** - * Protobuf type {@code discovery.service.apkmgt.API} - */ - public static final class API extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.API) - APIOrBuilder { - private static final long serialVersionUID = 0L; - // Use API.newBuilder() to construct. - private API(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private API() { - uuid_ = ""; - provider_ = ""; - version_ = ""; - name_ = ""; - basePath_ = ""; - type_ = ""; - organizationId_ = ""; - createdBy_ = ""; - createdTime_ = ""; - updatedBy_ = ""; - updatedTime_ = ""; - definition_ = ""; - transports_ = com.google.protobuf.LazyStringArrayList.EMPTY; - resources_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new API(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private API( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - provider_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - version_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - basePath_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - organizationId_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - createdBy_ = s; - break; - } - case 74: { - java.lang.String s = input.readStringRequireUtf8(); - - createdTime_ = s; - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - - updatedBy_ = s; - break; - } - case 90: { - java.lang.String s = input.readStringRequireUtf8(); - - updatedTime_ = s; - break; - } - case 98: { - java.lang.String s = input.readStringRequireUtf8(); - - definition_ = s; - break; - } - case 106: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - transports_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - transports_.add(s); - break; - } - case 130: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - resources_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - resources_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.parser(), extensionRegistry)); - break; - } - case 138: { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.Builder subBuilder = null; - if (corsConfig_ != null) { - subBuilder = corsConfig_.toBuilder(); - } - corsConfig_ = input.readMessage(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(corsConfig_); - corsConfig_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - transports_ = transports_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - resources_ = java.util.Collections.unmodifiableList(resources_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_API_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_API_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.Builder.class); - } - - public static final int UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object uuid_; - /** - * string uuid = 1; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROVIDER_FIELD_NUMBER = 2; - private volatile java.lang.Object provider_; - /** - * string provider = 2; - * @return The provider. - */ - @java.lang.Override - public java.lang.String getProvider() { - java.lang.Object ref = provider_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - provider_ = s; - return s; - } - } - /** - * string provider = 2; - * @return The bytes for provider. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getProviderBytes() { - java.lang.Object ref = provider_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - provider_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VERSION_FIELD_NUMBER = 3; - private volatile java.lang.Object version_; - /** - * string version = 3; - * @return The version. - */ - @java.lang.Override - public java.lang.String getVersion() { - java.lang.Object ref = version_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - version_ = s; - return s; - } - } - /** - * string version = 3; - * @return The bytes for version. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getVersionBytes() { - java.lang.Object ref = version_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - version_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object name_; - /** - * string name = 4; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 4; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BASEPATH_FIELD_NUMBER = 5; - private volatile java.lang.Object basePath_; - /** - * string basePath = 5; - * @return The basePath. - */ - @java.lang.Override - public java.lang.String getBasePath() { - java.lang.Object ref = basePath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - basePath_ = s; - return s; - } - } - /** - * string basePath = 5; - * @return The bytes for basePath. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getBasePathBytes() { - java.lang.Object ref = basePath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - basePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 6; - private volatile java.lang.Object type_; - /** - * string type = 6; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - * string type = 6; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATIONID_FIELD_NUMBER = 7; - private volatile java.lang.Object organizationId_; - /** - * string organizationId = 7; - * @return The organizationId. - */ - @java.lang.Override - public java.lang.String getOrganizationId() { - java.lang.Object ref = organizationId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organizationId_ = s; - return s; - } - } - /** - * string organizationId = 7; - * @return The bytes for organizationId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationIdBytes() { - java.lang.Object ref = organizationId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organizationId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREATEDBY_FIELD_NUMBER = 8; - private volatile java.lang.Object createdBy_; - /** - * string createdBy = 8; - * @return The createdBy. - */ - @java.lang.Override - public java.lang.String getCreatedBy() { - java.lang.Object ref = createdBy_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - createdBy_ = s; - return s; - } - } - /** - * string createdBy = 8; - * @return The bytes for createdBy. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCreatedByBytes() { - java.lang.Object ref = createdBy_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - createdBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREATEDTIME_FIELD_NUMBER = 9; - private volatile java.lang.Object createdTime_; - /** - * string createdTime = 9; - * @return The createdTime. - */ - @java.lang.Override - public java.lang.String getCreatedTime() { - java.lang.Object ref = createdTime_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - createdTime_ = s; - return s; - } - } - /** - * string createdTime = 9; - * @return The bytes for createdTime. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCreatedTimeBytes() { - java.lang.Object ref = createdTime_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - createdTime_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UPDATEDBY_FIELD_NUMBER = 10; - private volatile java.lang.Object updatedBy_; - /** - * string updatedBy = 10; - * @return The updatedBy. - */ - @java.lang.Override - public java.lang.String getUpdatedBy() { - java.lang.Object ref = updatedBy_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - updatedBy_ = s; - return s; - } - } - /** - * string updatedBy = 10; - * @return The bytes for updatedBy. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUpdatedByBytes() { - java.lang.Object ref = updatedBy_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - updatedBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UPDATEDTIME_FIELD_NUMBER = 11; - private volatile java.lang.Object updatedTime_; - /** - * string updatedTime = 11; - * @return The updatedTime. - */ - @java.lang.Override - public java.lang.String getUpdatedTime() { - java.lang.Object ref = updatedTime_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - updatedTime_ = s; - return s; - } - } - /** - * string updatedTime = 11; - * @return The bytes for updatedTime. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUpdatedTimeBytes() { - java.lang.Object ref = updatedTime_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - updatedTime_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEFINITION_FIELD_NUMBER = 12; - private volatile java.lang.Object definition_; - /** - * string definition = 12; - * @return The definition. - */ - @java.lang.Override - public java.lang.String getDefinition() { - java.lang.Object ref = definition_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - definition_ = s; - return s; - } - } - /** - * string definition = 12; - * @return The bytes for definition. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDefinitionBytes() { - java.lang.Object ref = definition_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - definition_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TRANSPORTS_FIELD_NUMBER = 13; - private com.google.protobuf.LazyStringList transports_; - /** - * repeated string transports = 13; - * @return A list containing the transports. - */ - public com.google.protobuf.ProtocolStringList - getTransportsList() { - return transports_; - } - /** - * repeated string transports = 13; - * @return The count of transports. - */ - public int getTransportsCount() { - return transports_.size(); - } - /** - * repeated string transports = 13; - * @param index The index of the element to return. - * @return The transports at the given index. - */ - public java.lang.String getTransports(int index) { - return transports_.get(index); - } - /** - * repeated string transports = 13; - * @param index The index of the value to return. - * @return The bytes of the transports at the given index. - */ - public com.google.protobuf.ByteString - getTransportsBytes(int index) { - return transports_.getByteString(index); - } - - public static final int RESOURCES_FIELD_NUMBER = 16; - private java.util.List resources_; - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - @java.lang.Override - public java.util.List getResourcesList() { - return resources_; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - @java.lang.Override - public java.util.List - getResourcesOrBuilderList() { - return resources_; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - @java.lang.Override - public int getResourcesCount() { - return resources_.size(); - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource getResources(int index) { - return resources_.get(index); - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ResourceOrBuilder getResourcesOrBuilder( - int index) { - return resources_.get(index); - } - - public static final int CORSCONFIG_FIELD_NUMBER = 17; - private org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig corsConfig_; - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - * @return Whether the corsConfig field is set. - */ - @java.lang.Override - public boolean hasCorsConfig() { - return corsConfig_ != null; - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - * @return The corsConfig. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig getCorsConfig() { - return corsConfig_ == null ? org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.getDefaultInstance() : corsConfig_; - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfigOrBuilder getCorsConfigOrBuilder() { - return getCorsConfig(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); - } - if (!getProviderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, provider_); - } - if (!getVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, version_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, name_); - } - if (!getBasePathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, basePath_); - } - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, type_); - } - if (!getOrganizationIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, organizationId_); - } - if (!getCreatedByBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, createdBy_); - } - if (!getCreatedTimeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, createdTime_); - } - if (!getUpdatedByBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, updatedBy_); - } - if (!getUpdatedTimeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, updatedTime_); - } - if (!getDefinitionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, definition_); - } - for (int i = 0; i < transports_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, transports_.getRaw(i)); - } - for (int i = 0; i < resources_.size(); i++) { - output.writeMessage(16, resources_.get(i)); - } - if (corsConfig_ != null) { - output.writeMessage(17, getCorsConfig()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); - } - if (!getProviderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, provider_); - } - if (!getVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, version_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, name_); - } - if (!getBasePathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, basePath_); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, type_); - } - if (!getOrganizationIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, organizationId_); - } - if (!getCreatedByBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, createdBy_); - } - if (!getCreatedTimeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, createdTime_); - } - if (!getUpdatedByBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, updatedBy_); - } - if (!getUpdatedTimeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, updatedTime_); - } - if (!getDefinitionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, definition_); - } - { - int dataSize = 0; - for (int i = 0; i < transports_.size(); i++) { - dataSize += computeStringSizeNoTag(transports_.getRaw(i)); - } - size += dataSize; - size += 1 * getTransportsList().size(); - } - for (int i = 0; i < resources_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(16, resources_.get(i)); - } - if (corsConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(17, getCorsConfig()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API) obj; - - if (!getUuid() - .equals(other.getUuid())) return false; - if (!getProvider() - .equals(other.getProvider())) return false; - if (!getVersion() - .equals(other.getVersion())) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getBasePath() - .equals(other.getBasePath())) return false; - if (!getType() - .equals(other.getType())) return false; - if (!getOrganizationId() - .equals(other.getOrganizationId())) return false; - if (!getCreatedBy() - .equals(other.getCreatedBy())) return false; - if (!getCreatedTime() - .equals(other.getCreatedTime())) return false; - if (!getUpdatedBy() - .equals(other.getUpdatedBy())) return false; - if (!getUpdatedTime() - .equals(other.getUpdatedTime())) return false; - if (!getDefinition() - .equals(other.getDefinition())) return false; - if (!getTransportsList() - .equals(other.getTransportsList())) return false; - if (!getResourcesList() - .equals(other.getResourcesList())) return false; - if (hasCorsConfig() != other.hasCorsConfig()) return false; - if (hasCorsConfig()) { - if (!getCorsConfig() - .equals(other.getCorsConfig())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + PROVIDER_FIELD_NUMBER; - hash = (53 * hash) + getProvider().hashCode(); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + BASEPATH_FIELD_NUMBER; - hash = (53 * hash) + getBasePath().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + ORGANIZATIONID_FIELD_NUMBER; - hash = (53 * hash) + getOrganizationId().hashCode(); - hash = (37 * hash) + CREATEDBY_FIELD_NUMBER; - hash = (53 * hash) + getCreatedBy().hashCode(); - hash = (37 * hash) + CREATEDTIME_FIELD_NUMBER; - hash = (53 * hash) + getCreatedTime().hashCode(); - hash = (37 * hash) + UPDATEDBY_FIELD_NUMBER; - hash = (53 * hash) + getUpdatedBy().hashCode(); - hash = (37 * hash) + UPDATEDTIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdatedTime().hashCode(); - hash = (37 * hash) + DEFINITION_FIELD_NUMBER; - hash = (53 * hash) + getDefinition().hashCode(); - if (getTransportsCount() > 0) { - hash = (37 * hash) + TRANSPORTS_FIELD_NUMBER; - hash = (53 * hash) + getTransportsList().hashCode(); - } - if (getResourcesCount() > 0) { - hash = (37 * hash) + RESOURCES_FIELD_NUMBER; - hash = (53 * hash) + getResourcesList().hashCode(); - } - if (hasCorsConfig()) { - hash = (37 * hash) + CORSCONFIG_FIELD_NUMBER; - hash = (53 * hash) + getCorsConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.API} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.API) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.APIOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_API_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_API_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResourcesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - uuid_ = ""; - - provider_ = ""; - - version_ = ""; - - name_ = ""; - - basePath_ = ""; - - type_ = ""; - - organizationId_ = ""; - - createdBy_ = ""; - - createdTime_ = ""; - - updatedBy_ = ""; - - updatedTime_ = ""; - - definition_ = ""; - - transports_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - if (resourcesBuilder_ == null) { - resources_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - resourcesBuilder_.clear(); - } - if (corsConfigBuilder_ == null) { - corsConfig_ = null; - } else { - corsConfig_ = null; - corsConfigBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_API_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API(this); - int from_bitField0_ = bitField0_; - result.uuid_ = uuid_; - result.provider_ = provider_; - result.version_ = version_; - result.name_ = name_; - result.basePath_ = basePath_; - result.type_ = type_; - result.organizationId_ = organizationId_; - result.createdBy_ = createdBy_; - result.createdTime_ = createdTime_; - result.updatedBy_ = updatedBy_; - result.updatedTime_ = updatedTime_; - result.definition_ = definition_; - if (((bitField0_ & 0x00000001) != 0)) { - transports_ = transports_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.transports_ = transports_; - if (resourcesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - resources_ = java.util.Collections.unmodifiableList(resources_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.resources_ = resources_; - } else { - result.resources_ = resourcesBuilder_.build(); - } - if (corsConfigBuilder_ == null) { - result.corsConfig_ = corsConfig_; - } else { - result.corsConfig_ = corsConfigBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance()) return this; - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (!other.getProvider().isEmpty()) { - provider_ = other.provider_; - onChanged(); - } - if (!other.getVersion().isEmpty()) { - version_ = other.version_; - onChanged(); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getBasePath().isEmpty()) { - basePath_ = other.basePath_; - onChanged(); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (!other.getOrganizationId().isEmpty()) { - organizationId_ = other.organizationId_; - onChanged(); - } - if (!other.getCreatedBy().isEmpty()) { - createdBy_ = other.createdBy_; - onChanged(); - } - if (!other.getCreatedTime().isEmpty()) { - createdTime_ = other.createdTime_; - onChanged(); - } - if (!other.getUpdatedBy().isEmpty()) { - updatedBy_ = other.updatedBy_; - onChanged(); - } - if (!other.getUpdatedTime().isEmpty()) { - updatedTime_ = other.updatedTime_; - onChanged(); - } - if (!other.getDefinition().isEmpty()) { - definition_ = other.definition_; - onChanged(); - } - if (!other.transports_.isEmpty()) { - if (transports_.isEmpty()) { - transports_ = other.transports_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTransportsIsMutable(); - transports_.addAll(other.transports_); - } - onChanged(); - } - if (resourcesBuilder_ == null) { - if (!other.resources_.isEmpty()) { - if (resources_.isEmpty()) { - resources_ = other.resources_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureResourcesIsMutable(); - resources_.addAll(other.resources_); - } - onChanged(); - } - } else { - if (!other.resources_.isEmpty()) { - if (resourcesBuilder_.isEmpty()) { - resourcesBuilder_.dispose(); - resourcesBuilder_ = null; - resources_ = other.resources_; - bitField0_ = (bitField0_ & ~0x00000002); - resourcesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResourcesFieldBuilder() : null; - } else { - resourcesBuilder_.addAllMessages(other.resources_); - } - } - } - if (other.hasCorsConfig()) { - mergeCorsConfig(other.getCorsConfig()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 1; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 1; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 1; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 1; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private java.lang.Object provider_ = ""; - /** - * string provider = 2; - * @return The provider. - */ - public java.lang.String getProvider() { - java.lang.Object ref = provider_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - provider_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string provider = 2; - * @return The bytes for provider. - */ - public com.google.protobuf.ByteString - getProviderBytes() { - java.lang.Object ref = provider_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - provider_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string provider = 2; - * @param value The provider to set. - * @return This builder for chaining. - */ - public Builder setProvider( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - provider_ = value; - onChanged(); - return this; - } - /** - * string provider = 2; - * @return This builder for chaining. - */ - public Builder clearProvider() { - - provider_ = getDefaultInstance().getProvider(); - onChanged(); - return this; - } - /** - * string provider = 2; - * @param value The bytes for provider to set. - * @return This builder for chaining. - */ - public Builder setProviderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - provider_ = value; - onChanged(); - return this; - } - - private java.lang.Object version_ = ""; - /** - * string version = 3; - * @return The version. - */ - public java.lang.String getVersion() { - java.lang.Object ref = version_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - version_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string version = 3; - * @return The bytes for version. - */ - public com.google.protobuf.ByteString - getVersionBytes() { - java.lang.Object ref = version_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - version_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string version = 3; - * @param value The version to set. - * @return This builder for chaining. - */ - public Builder setVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - version_ = value; - onChanged(); - return this; - } - /** - * string version = 3; - * @return This builder for chaining. - */ - public Builder clearVersion() { - - version_ = getDefaultInstance().getVersion(); - onChanged(); - return this; - } - /** - * string version = 3; - * @param value The bytes for version to set. - * @return This builder for chaining. - */ - public Builder setVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - version_ = value; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 4; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 4; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 4; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 4; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 4; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object basePath_ = ""; - /** - * string basePath = 5; - * @return The basePath. - */ - public java.lang.String getBasePath() { - java.lang.Object ref = basePath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - basePath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string basePath = 5; - * @return The bytes for basePath. - */ - public com.google.protobuf.ByteString - getBasePathBytes() { - java.lang.Object ref = basePath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - basePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string basePath = 5; - * @param value The basePath to set. - * @return This builder for chaining. - */ - public Builder setBasePath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - basePath_ = value; - onChanged(); - return this; - } - /** - * string basePath = 5; - * @return This builder for chaining. - */ - public Builder clearBasePath() { - - basePath_ = getDefaultInstance().getBasePath(); - onChanged(); - return this; - } - /** - * string basePath = 5; - * @param value The bytes for basePath to set. - * @return This builder for chaining. - */ - public Builder setBasePathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - basePath_ = value; - onChanged(); - return this; - } - - private java.lang.Object type_ = ""; - /** - * string type = 6; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string type = 6; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string type = 6; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - * string type = 6; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - * string type = 6; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private java.lang.Object organizationId_ = ""; - /** - * string organizationId = 7; - * @return The organizationId. - */ - public java.lang.String getOrganizationId() { - java.lang.Object ref = organizationId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organizationId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organizationId = 7; - * @return The bytes for organizationId. - */ - public com.google.protobuf.ByteString - getOrganizationIdBytes() { - java.lang.Object ref = organizationId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organizationId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organizationId = 7; - * @param value The organizationId to set. - * @return This builder for chaining. - */ - public Builder setOrganizationId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organizationId_ = value; - onChanged(); - return this; - } - /** - * string organizationId = 7; - * @return This builder for chaining. - */ - public Builder clearOrganizationId() { - - organizationId_ = getDefaultInstance().getOrganizationId(); - onChanged(); - return this; - } - /** - * string organizationId = 7; - * @param value The bytes for organizationId to set. - * @return This builder for chaining. - */ - public Builder setOrganizationIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organizationId_ = value; - onChanged(); - return this; - } - - private java.lang.Object createdBy_ = ""; - /** - * string createdBy = 8; - * @return The createdBy. - */ - public java.lang.String getCreatedBy() { - java.lang.Object ref = createdBy_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - createdBy_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string createdBy = 8; - * @return The bytes for createdBy. - */ - public com.google.protobuf.ByteString - getCreatedByBytes() { - java.lang.Object ref = createdBy_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - createdBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string createdBy = 8; - * @param value The createdBy to set. - * @return This builder for chaining. - */ - public Builder setCreatedBy( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - createdBy_ = value; - onChanged(); - return this; - } - /** - * string createdBy = 8; - * @return This builder for chaining. - */ - public Builder clearCreatedBy() { - - createdBy_ = getDefaultInstance().getCreatedBy(); - onChanged(); - return this; - } - /** - * string createdBy = 8; - * @param value The bytes for createdBy to set. - * @return This builder for chaining. - */ - public Builder setCreatedByBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - createdBy_ = value; - onChanged(); - return this; - } - - private java.lang.Object createdTime_ = ""; - /** - * string createdTime = 9; - * @return The createdTime. - */ - public java.lang.String getCreatedTime() { - java.lang.Object ref = createdTime_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - createdTime_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string createdTime = 9; - * @return The bytes for createdTime. - */ - public com.google.protobuf.ByteString - getCreatedTimeBytes() { - java.lang.Object ref = createdTime_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - createdTime_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string createdTime = 9; - * @param value The createdTime to set. - * @return This builder for chaining. - */ - public Builder setCreatedTime( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - createdTime_ = value; - onChanged(); - return this; - } - /** - * string createdTime = 9; - * @return This builder for chaining. - */ - public Builder clearCreatedTime() { - - createdTime_ = getDefaultInstance().getCreatedTime(); - onChanged(); - return this; - } - /** - * string createdTime = 9; - * @param value The bytes for createdTime to set. - * @return This builder for chaining. - */ - public Builder setCreatedTimeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - createdTime_ = value; - onChanged(); - return this; - } - - private java.lang.Object updatedBy_ = ""; - /** - * string updatedBy = 10; - * @return The updatedBy. - */ - public java.lang.String getUpdatedBy() { - java.lang.Object ref = updatedBy_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - updatedBy_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string updatedBy = 10; - * @return The bytes for updatedBy. - */ - public com.google.protobuf.ByteString - getUpdatedByBytes() { - java.lang.Object ref = updatedBy_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - updatedBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string updatedBy = 10; - * @param value The updatedBy to set. - * @return This builder for chaining. - */ - public Builder setUpdatedBy( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - updatedBy_ = value; - onChanged(); - return this; - } - /** - * string updatedBy = 10; - * @return This builder for chaining. - */ - public Builder clearUpdatedBy() { - - updatedBy_ = getDefaultInstance().getUpdatedBy(); - onChanged(); - return this; - } - /** - * string updatedBy = 10; - * @param value The bytes for updatedBy to set. - * @return This builder for chaining. - */ - public Builder setUpdatedByBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - updatedBy_ = value; - onChanged(); - return this; - } - - private java.lang.Object updatedTime_ = ""; - /** - * string updatedTime = 11; - * @return The updatedTime. - */ - public java.lang.String getUpdatedTime() { - java.lang.Object ref = updatedTime_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - updatedTime_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string updatedTime = 11; - * @return The bytes for updatedTime. - */ - public com.google.protobuf.ByteString - getUpdatedTimeBytes() { - java.lang.Object ref = updatedTime_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - updatedTime_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string updatedTime = 11; - * @param value The updatedTime to set. - * @return This builder for chaining. - */ - public Builder setUpdatedTime( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - updatedTime_ = value; - onChanged(); - return this; - } - /** - * string updatedTime = 11; - * @return This builder for chaining. - */ - public Builder clearUpdatedTime() { - - updatedTime_ = getDefaultInstance().getUpdatedTime(); - onChanged(); - return this; - } - /** - * string updatedTime = 11; - * @param value The bytes for updatedTime to set. - * @return This builder for chaining. - */ - public Builder setUpdatedTimeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - updatedTime_ = value; - onChanged(); - return this; - } - - private java.lang.Object definition_ = ""; - /** - * string definition = 12; - * @return The definition. - */ - public java.lang.String getDefinition() { - java.lang.Object ref = definition_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - definition_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string definition = 12; - * @return The bytes for definition. - */ - public com.google.protobuf.ByteString - getDefinitionBytes() { - java.lang.Object ref = definition_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - definition_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string definition = 12; - * @param value The definition to set. - * @return This builder for chaining. - */ - public Builder setDefinition( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - definition_ = value; - onChanged(); - return this; - } - /** - * string definition = 12; - * @return This builder for chaining. - */ - public Builder clearDefinition() { - - definition_ = getDefaultInstance().getDefinition(); - onChanged(); - return this; - } - /** - * string definition = 12; - * @param value The bytes for definition to set. - * @return This builder for chaining. - */ - public Builder setDefinitionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - definition_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList transports_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureTransportsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - transports_ = new com.google.protobuf.LazyStringArrayList(transports_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string transports = 13; - * @return A list containing the transports. - */ - public com.google.protobuf.ProtocolStringList - getTransportsList() { - return transports_.getUnmodifiableView(); - } - /** - * repeated string transports = 13; - * @return The count of transports. - */ - public int getTransportsCount() { - return transports_.size(); - } - /** - * repeated string transports = 13; - * @param index The index of the element to return. - * @return The transports at the given index. - */ - public java.lang.String getTransports(int index) { - return transports_.get(index); - } - /** - * repeated string transports = 13; - * @param index The index of the value to return. - * @return The bytes of the transports at the given index. - */ - public com.google.protobuf.ByteString - getTransportsBytes(int index) { - return transports_.getByteString(index); - } - /** - * repeated string transports = 13; - * @param index The index to set the value at. - * @param value The transports to set. - * @return This builder for chaining. - */ - public Builder setTransports( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTransportsIsMutable(); - transports_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string transports = 13; - * @param value The transports to add. - * @return This builder for chaining. - */ - public Builder addTransports( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTransportsIsMutable(); - transports_.add(value); - onChanged(); - return this; - } - /** - * repeated string transports = 13; - * @param values The transports to add. - * @return This builder for chaining. - */ - public Builder addAllTransports( - java.lang.Iterable values) { - ensureTransportsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, transports_); - onChanged(); - return this; - } - /** - * repeated string transports = 13; - * @return This builder for chaining. - */ - public Builder clearTransports() { - transports_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string transports = 13; - * @param value The bytes of the transports to add. - * @return This builder for chaining. - */ - public Builder addTransportsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureTransportsIsMutable(); - transports_.add(value); - onChanged(); - return this; - } - - private java.util.List resources_ = - java.util.Collections.emptyList(); - private void ensureResourcesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - resources_ = new java.util.ArrayList(resources_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ResourceOrBuilder> resourcesBuilder_; - - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public java.util.List getResourcesList() { - if (resourcesBuilder_ == null) { - return java.util.Collections.unmodifiableList(resources_); - } else { - return resourcesBuilder_.getMessageList(); - } - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public int getResourcesCount() { - if (resourcesBuilder_ == null) { - return resources_.size(); - } else { - return resourcesBuilder_.getCount(); - } - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource getResources(int index) { - if (resourcesBuilder_ == null) { - return resources_.get(index); - } else { - return resourcesBuilder_.getMessage(index); - } - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder setResources( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource value) { - if (resourcesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.set(index, value); - onChanged(); - } else { - resourcesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder setResources( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder builderForValue) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - resources_.set(index, builderForValue.build()); - onChanged(); - } else { - resourcesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder addResources(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource value) { - if (resourcesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.add(value); - onChanged(); - } else { - resourcesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder addResources( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource value) { - if (resourcesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourcesIsMutable(); - resources_.add(index, value); - onChanged(); - } else { - resourcesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder addResources( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder builderForValue) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - resources_.add(builderForValue.build()); - onChanged(); - } else { - resourcesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder addResources( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder builderForValue) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - resources_.add(index, builderForValue.build()); - onChanged(); - } else { - resourcesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder addAllResources( - java.lang.Iterable values) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, resources_); - onChanged(); - } else { - resourcesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder clearResources() { - if (resourcesBuilder_ == null) { - resources_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - resourcesBuilder_.clear(); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public Builder removeResources(int index) { - if (resourcesBuilder_ == null) { - ensureResourcesIsMutable(); - resources_.remove(index); - onChanged(); - } else { - resourcesBuilder_.remove(index); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder getResourcesBuilder( - int index) { - return getResourcesFieldBuilder().getBuilder(index); - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ResourceOrBuilder getResourcesOrBuilder( - int index) { - if (resourcesBuilder_ == null) { - return resources_.get(index); } else { - return resourcesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public java.util.List - getResourcesOrBuilderList() { - if (resourcesBuilder_ != null) { - return resourcesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(resources_); - } - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder addResourcesBuilder() { - return getResourcesFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder addResourcesBuilder( - int index) { - return getResourcesFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.Resource resources = 16; - */ - public java.util.List - getResourcesBuilderList() { - return getResourcesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ResourceOrBuilder> - getResourcesFieldBuilder() { - if (resourcesBuilder_ == null) { - resourcesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ResourceOrBuilder>( - resources_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - resources_ = null; - } - return resourcesBuilder_; - } - - private org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig corsConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfigOrBuilder> corsConfigBuilder_; - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - * @return Whether the corsConfig field is set. - */ - public boolean hasCorsConfig() { - return corsConfigBuilder_ != null || corsConfig_ != null; - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - * @return The corsConfig. - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig getCorsConfig() { - if (corsConfigBuilder_ == null) { - return corsConfig_ == null ? org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.getDefaultInstance() : corsConfig_; - } else { - return corsConfigBuilder_.getMessage(); - } - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - public Builder setCorsConfig(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig value) { - if (corsConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - corsConfig_ = value; - onChanged(); - } else { - corsConfigBuilder_.setMessage(value); - } - - return this; - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - public Builder setCorsConfig( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.Builder builderForValue) { - if (corsConfigBuilder_ == null) { - corsConfig_ = builderForValue.build(); - onChanged(); - } else { - corsConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - public Builder mergeCorsConfig(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig value) { - if (corsConfigBuilder_ == null) { - if (corsConfig_ != null) { - corsConfig_ = - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.newBuilder(corsConfig_).mergeFrom(value).buildPartial(); - } else { - corsConfig_ = value; - } - onChanged(); - } else { - corsConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - public Builder clearCorsConfig() { - if (corsConfigBuilder_ == null) { - corsConfig_ = null; - onChanged(); - } else { - corsConfig_ = null; - corsConfigBuilder_ = null; - } - - return this; - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.Builder getCorsConfigBuilder() { - - onChanged(); - return getCorsConfigFieldBuilder().getBuilder(); - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfigOrBuilder getCorsConfigOrBuilder() { - if (corsConfigBuilder_ != null) { - return corsConfigBuilder_.getMessageOrBuilder(); - } else { - return corsConfig_ == null ? - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.getDefaultInstance() : corsConfig_; - } - } - /** - * .discovery.service.apkmgt.CorsConfig corsConfig = 17; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfigOrBuilder> - getCorsConfigFieldBuilder() { - if (corsConfigBuilder_ == null) { - corsConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfigOrBuilder>( - getCorsConfig(), - getParentForChildren(), - isClean()); - corsConfig_ = null; - } - return corsConfigBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.API) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.API) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public API parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new API(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface CorsConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.CorsConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * bool corsConfigurationEnabled = 1; - * @return The corsConfigurationEnabled. - */ - boolean getCorsConfigurationEnabled(); - - /** - * repeated string accessControlAllowOrigins = 2; - * @return A list containing the accessControlAllowOrigins. - */ - java.util.List - getAccessControlAllowOriginsList(); - /** - * repeated string accessControlAllowOrigins = 2; - * @return The count of accessControlAllowOrigins. - */ - int getAccessControlAllowOriginsCount(); - /** - * repeated string accessControlAllowOrigins = 2; - * @param index The index of the element to return. - * @return The accessControlAllowOrigins at the given index. - */ - java.lang.String getAccessControlAllowOrigins(int index); - /** - * repeated string accessControlAllowOrigins = 2; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowOrigins at the given index. - */ - com.google.protobuf.ByteString - getAccessControlAllowOriginsBytes(int index); - - /** - * bool accessControlAllowCredentials = 3; - * @return The accessControlAllowCredentials. - */ - boolean getAccessControlAllowCredentials(); - - /** - * repeated string accessControlAllowHeaders = 4; - * @return A list containing the accessControlAllowHeaders. - */ - java.util.List - getAccessControlAllowHeadersList(); - /** - * repeated string accessControlAllowHeaders = 4; - * @return The count of accessControlAllowHeaders. - */ - int getAccessControlAllowHeadersCount(); - /** - * repeated string accessControlAllowHeaders = 4; - * @param index The index of the element to return. - * @return The accessControlAllowHeaders at the given index. - */ - java.lang.String getAccessControlAllowHeaders(int index); - /** - * repeated string accessControlAllowHeaders = 4; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowHeaders at the given index. - */ - com.google.protobuf.ByteString - getAccessControlAllowHeadersBytes(int index); - - /** - * repeated string accessControlAllowMethods = 5; - * @return A list containing the accessControlAllowMethods. - */ - java.util.List - getAccessControlAllowMethodsList(); - /** - * repeated string accessControlAllowMethods = 5; - * @return The count of accessControlAllowMethods. - */ - int getAccessControlAllowMethodsCount(); - /** - * repeated string accessControlAllowMethods = 5; - * @param index The index of the element to return. - * @return The accessControlAllowMethods at the given index. - */ - java.lang.String getAccessControlAllowMethods(int index); - /** - * repeated string accessControlAllowMethods = 5; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowMethods at the given index. - */ - com.google.protobuf.ByteString - getAccessControlAllowMethodsBytes(int index); - } - /** - * Protobuf type {@code discovery.service.apkmgt.CorsConfig} - */ - public static final class CorsConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.CorsConfig) - CorsConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use CorsConfig.newBuilder() to construct. - private CorsConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CorsConfig() { - accessControlAllowOrigins_ = com.google.protobuf.LazyStringArrayList.EMPTY; - accessControlAllowHeaders_ = com.google.protobuf.LazyStringArrayList.EMPTY; - accessControlAllowMethods_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CorsConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CorsConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - corsConfigurationEnabled_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - accessControlAllowOrigins_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - accessControlAllowOrigins_.add(s); - break; - } - case 24: { - - accessControlAllowCredentials_ = input.readBool(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - accessControlAllowHeaders_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - accessControlAllowHeaders_.add(s); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - accessControlAllowMethods_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - accessControlAllowMethods_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - accessControlAllowOrigins_ = accessControlAllowOrigins_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - accessControlAllowHeaders_ = accessControlAllowHeaders_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - accessControlAllowMethods_ = accessControlAllowMethods_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_CorsConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_CorsConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.Builder.class); - } - - public static final int CORSCONFIGURATIONENABLED_FIELD_NUMBER = 1; - private boolean corsConfigurationEnabled_; - /** - * bool corsConfigurationEnabled = 1; - * @return The corsConfigurationEnabled. - */ - @java.lang.Override - public boolean getCorsConfigurationEnabled() { - return corsConfigurationEnabled_; - } - - public static final int ACCESSCONTROLALLOWORIGINS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList accessControlAllowOrigins_; - /** - * repeated string accessControlAllowOrigins = 2; - * @return A list containing the accessControlAllowOrigins. - */ - public com.google.protobuf.ProtocolStringList - getAccessControlAllowOriginsList() { - return accessControlAllowOrigins_; - } - /** - * repeated string accessControlAllowOrigins = 2; - * @return The count of accessControlAllowOrigins. - */ - public int getAccessControlAllowOriginsCount() { - return accessControlAllowOrigins_.size(); - } - /** - * repeated string accessControlAllowOrigins = 2; - * @param index The index of the element to return. - * @return The accessControlAllowOrigins at the given index. - */ - public java.lang.String getAccessControlAllowOrigins(int index) { - return accessControlAllowOrigins_.get(index); - } - /** - * repeated string accessControlAllowOrigins = 2; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowOrigins at the given index. - */ - public com.google.protobuf.ByteString - getAccessControlAllowOriginsBytes(int index) { - return accessControlAllowOrigins_.getByteString(index); - } - - public static final int ACCESSCONTROLALLOWCREDENTIALS_FIELD_NUMBER = 3; - private boolean accessControlAllowCredentials_; - /** - * bool accessControlAllowCredentials = 3; - * @return The accessControlAllowCredentials. - */ - @java.lang.Override - public boolean getAccessControlAllowCredentials() { - return accessControlAllowCredentials_; - } - - public static final int ACCESSCONTROLALLOWHEADERS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList accessControlAllowHeaders_; - /** - * repeated string accessControlAllowHeaders = 4; - * @return A list containing the accessControlAllowHeaders. - */ - public com.google.protobuf.ProtocolStringList - getAccessControlAllowHeadersList() { - return accessControlAllowHeaders_; - } - /** - * repeated string accessControlAllowHeaders = 4; - * @return The count of accessControlAllowHeaders. - */ - public int getAccessControlAllowHeadersCount() { - return accessControlAllowHeaders_.size(); - } - /** - * repeated string accessControlAllowHeaders = 4; - * @param index The index of the element to return. - * @return The accessControlAllowHeaders at the given index. - */ - public java.lang.String getAccessControlAllowHeaders(int index) { - return accessControlAllowHeaders_.get(index); - } - /** - * repeated string accessControlAllowHeaders = 4; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowHeaders at the given index. - */ - public com.google.protobuf.ByteString - getAccessControlAllowHeadersBytes(int index) { - return accessControlAllowHeaders_.getByteString(index); - } - - public static final int ACCESSCONTROLALLOWMETHODS_FIELD_NUMBER = 5; - private com.google.protobuf.LazyStringList accessControlAllowMethods_; - /** - * repeated string accessControlAllowMethods = 5; - * @return A list containing the accessControlAllowMethods. - */ - public com.google.protobuf.ProtocolStringList - getAccessControlAllowMethodsList() { - return accessControlAllowMethods_; - } - /** - * repeated string accessControlAllowMethods = 5; - * @return The count of accessControlAllowMethods. - */ - public int getAccessControlAllowMethodsCount() { - return accessControlAllowMethods_.size(); - } - /** - * repeated string accessControlAllowMethods = 5; - * @param index The index of the element to return. - * @return The accessControlAllowMethods at the given index. - */ - public java.lang.String getAccessControlAllowMethods(int index) { - return accessControlAllowMethods_.get(index); - } - /** - * repeated string accessControlAllowMethods = 5; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowMethods at the given index. - */ - public com.google.protobuf.ByteString - getAccessControlAllowMethodsBytes(int index) { - return accessControlAllowMethods_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (corsConfigurationEnabled_ != false) { - output.writeBool(1, corsConfigurationEnabled_); - } - for (int i = 0; i < accessControlAllowOrigins_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, accessControlAllowOrigins_.getRaw(i)); - } - if (accessControlAllowCredentials_ != false) { - output.writeBool(3, accessControlAllowCredentials_); - } - for (int i = 0; i < accessControlAllowHeaders_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, accessControlAllowHeaders_.getRaw(i)); - } - for (int i = 0; i < accessControlAllowMethods_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, accessControlAllowMethods_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (corsConfigurationEnabled_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, corsConfigurationEnabled_); - } - { - int dataSize = 0; - for (int i = 0; i < accessControlAllowOrigins_.size(); i++) { - dataSize += computeStringSizeNoTag(accessControlAllowOrigins_.getRaw(i)); - } - size += dataSize; - size += 1 * getAccessControlAllowOriginsList().size(); - } - if (accessControlAllowCredentials_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, accessControlAllowCredentials_); - } - { - int dataSize = 0; - for (int i = 0; i < accessControlAllowHeaders_.size(); i++) { - dataSize += computeStringSizeNoTag(accessControlAllowHeaders_.getRaw(i)); - } - size += dataSize; - size += 1 * getAccessControlAllowHeadersList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < accessControlAllowMethods_.size(); i++) { - dataSize += computeStringSizeNoTag(accessControlAllowMethods_.getRaw(i)); - } - size += dataSize; - size += 1 * getAccessControlAllowMethodsList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig) obj; - - if (getCorsConfigurationEnabled() - != other.getCorsConfigurationEnabled()) return false; - if (!getAccessControlAllowOriginsList() - .equals(other.getAccessControlAllowOriginsList())) return false; - if (getAccessControlAllowCredentials() - != other.getAccessControlAllowCredentials()) return false; - if (!getAccessControlAllowHeadersList() - .equals(other.getAccessControlAllowHeadersList())) return false; - if (!getAccessControlAllowMethodsList() - .equals(other.getAccessControlAllowMethodsList())) 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) + CORSCONFIGURATIONENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCorsConfigurationEnabled()); - if (getAccessControlAllowOriginsCount() > 0) { - hash = (37 * hash) + ACCESSCONTROLALLOWORIGINS_FIELD_NUMBER; - hash = (53 * hash) + getAccessControlAllowOriginsList().hashCode(); - } - hash = (37 * hash) + ACCESSCONTROLALLOWCREDENTIALS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAccessControlAllowCredentials()); - if (getAccessControlAllowHeadersCount() > 0) { - hash = (37 * hash) + ACCESSCONTROLALLOWHEADERS_FIELD_NUMBER; - hash = (53 * hash) + getAccessControlAllowHeadersList().hashCode(); - } - if (getAccessControlAllowMethodsCount() > 0) { - hash = (37 * hash) + ACCESSCONTROLALLOWMETHODS_FIELD_NUMBER; - hash = (53 * hash) + getAccessControlAllowMethodsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.CorsConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.CorsConfig) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_CorsConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_CorsConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.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(); - corsConfigurationEnabled_ = false; - - accessControlAllowOrigins_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - accessControlAllowCredentials_ = false; - - accessControlAllowHeaders_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - accessControlAllowMethods_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_CorsConfig_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig(this); - int from_bitField0_ = bitField0_; - result.corsConfigurationEnabled_ = corsConfigurationEnabled_; - if (((bitField0_ & 0x00000001) != 0)) { - accessControlAllowOrigins_ = accessControlAllowOrigins_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.accessControlAllowOrigins_ = accessControlAllowOrigins_; - result.accessControlAllowCredentials_ = accessControlAllowCredentials_; - if (((bitField0_ & 0x00000002) != 0)) { - accessControlAllowHeaders_ = accessControlAllowHeaders_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.accessControlAllowHeaders_ = accessControlAllowHeaders_; - if (((bitField0_ & 0x00000004) != 0)) { - accessControlAllowMethods_ = accessControlAllowMethods_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.accessControlAllowMethods_ = accessControlAllowMethods_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig.getDefaultInstance()) return this; - if (other.getCorsConfigurationEnabled() != false) { - setCorsConfigurationEnabled(other.getCorsConfigurationEnabled()); - } - if (!other.accessControlAllowOrigins_.isEmpty()) { - if (accessControlAllowOrigins_.isEmpty()) { - accessControlAllowOrigins_ = other.accessControlAllowOrigins_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAccessControlAllowOriginsIsMutable(); - accessControlAllowOrigins_.addAll(other.accessControlAllowOrigins_); - } - onChanged(); - } - if (other.getAccessControlAllowCredentials() != false) { - setAccessControlAllowCredentials(other.getAccessControlAllowCredentials()); - } - if (!other.accessControlAllowHeaders_.isEmpty()) { - if (accessControlAllowHeaders_.isEmpty()) { - accessControlAllowHeaders_ = other.accessControlAllowHeaders_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureAccessControlAllowHeadersIsMutable(); - accessControlAllowHeaders_.addAll(other.accessControlAllowHeaders_); - } - onChanged(); - } - if (!other.accessControlAllowMethods_.isEmpty()) { - if (accessControlAllowMethods_.isEmpty()) { - accessControlAllowMethods_ = other.accessControlAllowMethods_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureAccessControlAllowMethodsIsMutable(); - accessControlAllowMethods_.addAll(other.accessControlAllowMethods_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private boolean corsConfigurationEnabled_ ; - /** - * bool corsConfigurationEnabled = 1; - * @return The corsConfigurationEnabled. - */ - @java.lang.Override - public boolean getCorsConfigurationEnabled() { - return corsConfigurationEnabled_; - } - /** - * bool corsConfigurationEnabled = 1; - * @param value The corsConfigurationEnabled to set. - * @return This builder for chaining. - */ - public Builder setCorsConfigurationEnabled(boolean value) { - - corsConfigurationEnabled_ = value; - onChanged(); - return this; - } - /** - * bool corsConfigurationEnabled = 1; - * @return This builder for chaining. - */ - public Builder clearCorsConfigurationEnabled() { - - corsConfigurationEnabled_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList accessControlAllowOrigins_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureAccessControlAllowOriginsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - accessControlAllowOrigins_ = new com.google.protobuf.LazyStringArrayList(accessControlAllowOrigins_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string accessControlAllowOrigins = 2; - * @return A list containing the accessControlAllowOrigins. - */ - public com.google.protobuf.ProtocolStringList - getAccessControlAllowOriginsList() { - return accessControlAllowOrigins_.getUnmodifiableView(); - } - /** - * repeated string accessControlAllowOrigins = 2; - * @return The count of accessControlAllowOrigins. - */ - public int getAccessControlAllowOriginsCount() { - return accessControlAllowOrigins_.size(); - } - /** - * repeated string accessControlAllowOrigins = 2; - * @param index The index of the element to return. - * @return The accessControlAllowOrigins at the given index. - */ - public java.lang.String getAccessControlAllowOrigins(int index) { - return accessControlAllowOrigins_.get(index); - } - /** - * repeated string accessControlAllowOrigins = 2; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowOrigins at the given index. - */ - public com.google.protobuf.ByteString - getAccessControlAllowOriginsBytes(int index) { - return accessControlAllowOrigins_.getByteString(index); - } - /** - * repeated string accessControlAllowOrigins = 2; - * @param index The index to set the value at. - * @param value The accessControlAllowOrigins to set. - * @return This builder for chaining. - */ - public Builder setAccessControlAllowOrigins( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAccessControlAllowOriginsIsMutable(); - accessControlAllowOrigins_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowOrigins = 2; - * @param value The accessControlAllowOrigins to add. - * @return This builder for chaining. - */ - public Builder addAccessControlAllowOrigins( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAccessControlAllowOriginsIsMutable(); - accessControlAllowOrigins_.add(value); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowOrigins = 2; - * @param values The accessControlAllowOrigins to add. - * @return This builder for chaining. - */ - public Builder addAllAccessControlAllowOrigins( - java.lang.Iterable values) { - ensureAccessControlAllowOriginsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, accessControlAllowOrigins_); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowOrigins = 2; - * @return This builder for chaining. - */ - public Builder clearAccessControlAllowOrigins() { - accessControlAllowOrigins_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowOrigins = 2; - * @param value The bytes of the accessControlAllowOrigins to add. - * @return This builder for chaining. - */ - public Builder addAccessControlAllowOriginsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAccessControlAllowOriginsIsMutable(); - accessControlAllowOrigins_.add(value); - onChanged(); - return this; - } - - private boolean accessControlAllowCredentials_ ; - /** - * bool accessControlAllowCredentials = 3; - * @return The accessControlAllowCredentials. - */ - @java.lang.Override - public boolean getAccessControlAllowCredentials() { - return accessControlAllowCredentials_; - } - /** - * bool accessControlAllowCredentials = 3; - * @param value The accessControlAllowCredentials to set. - * @return This builder for chaining. - */ - public Builder setAccessControlAllowCredentials(boolean value) { - - accessControlAllowCredentials_ = value; - onChanged(); - return this; - } - /** - * bool accessControlAllowCredentials = 3; - * @return This builder for chaining. - */ - public Builder clearAccessControlAllowCredentials() { - - accessControlAllowCredentials_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList accessControlAllowHeaders_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureAccessControlAllowHeadersIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - accessControlAllowHeaders_ = new com.google.protobuf.LazyStringArrayList(accessControlAllowHeaders_); - bitField0_ |= 0x00000002; - } - } - /** - * repeated string accessControlAllowHeaders = 4; - * @return A list containing the accessControlAllowHeaders. - */ - public com.google.protobuf.ProtocolStringList - getAccessControlAllowHeadersList() { - return accessControlAllowHeaders_.getUnmodifiableView(); - } - /** - * repeated string accessControlAllowHeaders = 4; - * @return The count of accessControlAllowHeaders. - */ - public int getAccessControlAllowHeadersCount() { - return accessControlAllowHeaders_.size(); - } - /** - * repeated string accessControlAllowHeaders = 4; - * @param index The index of the element to return. - * @return The accessControlAllowHeaders at the given index. - */ - public java.lang.String getAccessControlAllowHeaders(int index) { - return accessControlAllowHeaders_.get(index); - } - /** - * repeated string accessControlAllowHeaders = 4; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowHeaders at the given index. - */ - public com.google.protobuf.ByteString - getAccessControlAllowHeadersBytes(int index) { - return accessControlAllowHeaders_.getByteString(index); - } - /** - * repeated string accessControlAllowHeaders = 4; - * @param index The index to set the value at. - * @param value The accessControlAllowHeaders to set. - * @return This builder for chaining. - */ - public Builder setAccessControlAllowHeaders( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAccessControlAllowHeadersIsMutable(); - accessControlAllowHeaders_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowHeaders = 4; - * @param value The accessControlAllowHeaders to add. - * @return This builder for chaining. - */ - public Builder addAccessControlAllowHeaders( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAccessControlAllowHeadersIsMutable(); - accessControlAllowHeaders_.add(value); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowHeaders = 4; - * @param values The accessControlAllowHeaders to add. - * @return This builder for chaining. - */ - public Builder addAllAccessControlAllowHeaders( - java.lang.Iterable values) { - ensureAccessControlAllowHeadersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, accessControlAllowHeaders_); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowHeaders = 4; - * @return This builder for chaining. - */ - public Builder clearAccessControlAllowHeaders() { - accessControlAllowHeaders_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowHeaders = 4; - * @param value The bytes of the accessControlAllowHeaders to add. - * @return This builder for chaining. - */ - public Builder addAccessControlAllowHeadersBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAccessControlAllowHeadersIsMutable(); - accessControlAllowHeaders_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList accessControlAllowMethods_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureAccessControlAllowMethodsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - accessControlAllowMethods_ = new com.google.protobuf.LazyStringArrayList(accessControlAllowMethods_); - bitField0_ |= 0x00000004; - } - } - /** - * repeated string accessControlAllowMethods = 5; - * @return A list containing the accessControlAllowMethods. - */ - public com.google.protobuf.ProtocolStringList - getAccessControlAllowMethodsList() { - return accessControlAllowMethods_.getUnmodifiableView(); - } - /** - * repeated string accessControlAllowMethods = 5; - * @return The count of accessControlAllowMethods. - */ - public int getAccessControlAllowMethodsCount() { - return accessControlAllowMethods_.size(); - } - /** - * repeated string accessControlAllowMethods = 5; - * @param index The index of the element to return. - * @return The accessControlAllowMethods at the given index. - */ - public java.lang.String getAccessControlAllowMethods(int index) { - return accessControlAllowMethods_.get(index); - } - /** - * repeated string accessControlAllowMethods = 5; - * @param index The index of the value to return. - * @return The bytes of the accessControlAllowMethods at the given index. - */ - public com.google.protobuf.ByteString - getAccessControlAllowMethodsBytes(int index) { - return accessControlAllowMethods_.getByteString(index); - } - /** - * repeated string accessControlAllowMethods = 5; - * @param index The index to set the value at. - * @param value The accessControlAllowMethods to set. - * @return This builder for chaining. - */ - public Builder setAccessControlAllowMethods( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAccessControlAllowMethodsIsMutable(); - accessControlAllowMethods_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowMethods = 5; - * @param value The accessControlAllowMethods to add. - * @return This builder for chaining. - */ - public Builder addAccessControlAllowMethods( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAccessControlAllowMethodsIsMutable(); - accessControlAllowMethods_.add(value); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowMethods = 5; - * @param values The accessControlAllowMethods to add. - * @return This builder for chaining. - */ - public Builder addAllAccessControlAllowMethods( - java.lang.Iterable values) { - ensureAccessControlAllowMethodsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, accessControlAllowMethods_); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowMethods = 5; - * @return This builder for chaining. - */ - public Builder clearAccessControlAllowMethods() { - accessControlAllowMethods_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * repeated string accessControlAllowMethods = 5; - * @param value The bytes of the accessControlAllowMethods to add. - * @return This builder for chaining. - */ - public Builder addAccessControlAllowMethodsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAccessControlAllowMethodsIsMutable(); - accessControlAllowMethods_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.CorsConfig) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.CorsConfig) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CorsConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CorsConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CorsConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ResourceOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.Resource) - com.google.protobuf.MessageOrBuilder { - - /** - * string path = 1; - * @return The path. - */ - java.lang.String getPath(); - /** - * string path = 1; - * @return The bytes for path. - */ - com.google.protobuf.ByteString - getPathBytes(); - - /** - * string verb = 2; - * @return The verb. - */ - java.lang.String getVerb(); - /** - * string verb = 2; - * @return The bytes for verb. - */ - com.google.protobuf.ByteString - getVerbBytes(); - - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - java.util.List - getAuthenticationsList(); - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication getAuthentications(int index); - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - int getAuthenticationsCount(); - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - java.util.List - getAuthenticationsOrBuilderList(); - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.AuthenticationOrBuilder getAuthenticationsOrBuilder( - int index); - - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - java.util.List - getScopesList(); - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope getScopes(int index); - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - int getScopesCount(); - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - java.util.List - getScopesOrBuilderList(); - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ScopeOrBuilder getScopesOrBuilder( - int index); - - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - * @return Whether the operationPolicies field is set. - */ - boolean hasOperationPolicies(); - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - * @return The operationPolicies. - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies getOperationPolicies(); - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPoliciesOrBuilder getOperationPoliciesOrBuilder(); - - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - java.util.List - getQueryParamsList(); - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam getQueryParams(int index); - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - int getQueryParamsCount(); - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - java.util.List - getQueryParamsOrBuilderList(); - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParamOrBuilder getQueryParamsOrBuilder( - int index); - - /** - * repeated string hostname = 8; - * @return A list containing the hostname. - */ - java.util.List - getHostnameList(); - /** - * repeated string hostname = 8; - * @return The count of hostname. - */ - int getHostnameCount(); - /** - * repeated string hostname = 8; - * @param index The index of the element to return. - * @return The hostname at the given index. - */ - java.lang.String getHostname(int index); - /** - * repeated string hostname = 8; - * @param index The index of the value to return. - * @return The bytes of the hostname at the given index. - */ - com.google.protobuf.ByteString - getHostnameBytes(int index); - } - /** - * Protobuf type {@code discovery.service.apkmgt.Resource} - */ - public static final class Resource extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.Resource) - ResourceOrBuilder { - private static final long serialVersionUID = 0L; - // Use Resource.newBuilder() to construct. - private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Resource() { - path_ = ""; - verb_ = ""; - authentications_ = java.util.Collections.emptyList(); - scopes_ = java.util.Collections.emptyList(); - queryParams_ = java.util.Collections.emptyList(); - hostname_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Resource(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Resource( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - path_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - verb_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - authentications_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - authentications_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - scopes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - scopes_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.parser(), extensionRegistry)); - break; - } - case 50: { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.Builder subBuilder = null; - if (operationPolicies_ != null) { - subBuilder = operationPolicies_.toBuilder(); - } - operationPolicies_ = input.readMessage(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(operationPolicies_); - operationPolicies_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - queryParams_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - queryParams_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.parser(), extensionRegistry)); - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - hostname_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000008; - } - hostname_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - authentications_ = java.util.Collections.unmodifiableList(authentications_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - scopes_ = java.util.Collections.unmodifiableList(scopes_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - queryParams_ = java.util.Collections.unmodifiableList(queryParams_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - hostname_ = hostname_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Resource_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Resource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder.class); - } - - public static final int PATH_FIELD_NUMBER = 1; - private volatile java.lang.Object path_; - /** - * string path = 1; - * @return The path. - */ - @java.lang.Override - public java.lang.String getPath() { - java.lang.Object ref = path_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - path_ = s; - return s; - } - } - /** - * string path = 1; - * @return The bytes for path. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPathBytes() { - java.lang.Object ref = path_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - path_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VERB_FIELD_NUMBER = 2; - private volatile java.lang.Object verb_; - /** - * string verb = 2; - * @return The verb. - */ - @java.lang.Override - public java.lang.String getVerb() { - java.lang.Object ref = verb_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - verb_ = s; - return s; - } - } - /** - * string verb = 2; - * @return The bytes for verb. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getVerbBytes() { - java.lang.Object ref = verb_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - verb_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int AUTHENTICATIONS_FIELD_NUMBER = 3; - private java.util.List authentications_; - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - @java.lang.Override - public java.util.List getAuthenticationsList() { - return authentications_; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - @java.lang.Override - public java.util.List - getAuthenticationsOrBuilderList() { - return authentications_; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - @java.lang.Override - public int getAuthenticationsCount() { - return authentications_.size(); - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication getAuthentications(int index) { - return authentications_.get(index); - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.AuthenticationOrBuilder getAuthenticationsOrBuilder( - int index) { - return authentications_.get(index); - } - - public static final int SCOPES_FIELD_NUMBER = 4; - private java.util.List scopes_; - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - @java.lang.Override - public java.util.List getScopesList() { - return scopes_; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - @java.lang.Override - public java.util.List - getScopesOrBuilderList() { - return scopes_; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - @java.lang.Override - public int getScopesCount() { - return scopes_.size(); - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope getScopes(int index) { - return scopes_.get(index); - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ScopeOrBuilder getScopesOrBuilder( - int index) { - return scopes_.get(index); - } - - public static final int OPERATIONPOLICIES_FIELD_NUMBER = 6; - private org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies operationPolicies_; - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - * @return Whether the operationPolicies field is set. - */ - @java.lang.Override - public boolean hasOperationPolicies() { - return operationPolicies_ != null; - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - * @return The operationPolicies. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies getOperationPolicies() { - return operationPolicies_ == null ? org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.getDefaultInstance() : operationPolicies_; - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPoliciesOrBuilder getOperationPoliciesOrBuilder() { - return getOperationPolicies(); - } - - public static final int QUERYPARAMS_FIELD_NUMBER = 7; - private java.util.List queryParams_; - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - @java.lang.Override - public java.util.List getQueryParamsList() { - return queryParams_; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - @java.lang.Override - public java.util.List - getQueryParamsOrBuilderList() { - return queryParams_; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - @java.lang.Override - public int getQueryParamsCount() { - return queryParams_.size(); - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam getQueryParams(int index) { - return queryParams_.get(index); - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParamOrBuilder getQueryParamsOrBuilder( - int index) { - return queryParams_.get(index); - } - - public static final int HOSTNAME_FIELD_NUMBER = 8; - private com.google.protobuf.LazyStringList hostname_; - /** - * repeated string hostname = 8; - * @return A list containing the hostname. - */ - public com.google.protobuf.ProtocolStringList - getHostnameList() { - return hostname_; - } - /** - * repeated string hostname = 8; - * @return The count of hostname. - */ - public int getHostnameCount() { - return hostname_.size(); - } - /** - * repeated string hostname = 8; - * @param index The index of the element to return. - * @return The hostname at the given index. - */ - public java.lang.String getHostname(int index) { - return hostname_.get(index); - } - /** - * repeated string hostname = 8; - * @param index The index of the value to return. - * @return The bytes of the hostname at the given index. - */ - public com.google.protobuf.ByteString - getHostnameBytes(int index) { - return hostname_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getPathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, path_); - } - if (!getVerbBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, verb_); - } - for (int i = 0; i < authentications_.size(); i++) { - output.writeMessage(3, authentications_.get(i)); - } - for (int i = 0; i < scopes_.size(); i++) { - output.writeMessage(4, scopes_.get(i)); - } - if (operationPolicies_ != null) { - output.writeMessage(6, getOperationPolicies()); - } - for (int i = 0; i < queryParams_.size(); i++) { - output.writeMessage(7, queryParams_.get(i)); - } - for (int i = 0; i < hostname_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, hostname_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getPathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, path_); - } - if (!getVerbBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, verb_); - } - for (int i = 0; i < authentications_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, authentications_.get(i)); - } - for (int i = 0; i < scopes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, scopes_.get(i)); - } - if (operationPolicies_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getOperationPolicies()); - } - for (int i = 0; i < queryParams_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, queryParams_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < hostname_.size(); i++) { - dataSize += computeStringSizeNoTag(hostname_.getRaw(i)); - } - size += dataSize; - size += 1 * getHostnameList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource) obj; - - if (!getPath() - .equals(other.getPath())) return false; - if (!getVerb() - .equals(other.getVerb())) return false; - if (!getAuthenticationsList() - .equals(other.getAuthenticationsList())) return false; - if (!getScopesList() - .equals(other.getScopesList())) return false; - if (hasOperationPolicies() != other.hasOperationPolicies()) return false; - if (hasOperationPolicies()) { - if (!getOperationPolicies() - .equals(other.getOperationPolicies())) return false; - } - if (!getQueryParamsList() - .equals(other.getQueryParamsList())) return false; - if (!getHostnameList() - .equals(other.getHostnameList())) 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) + PATH_FIELD_NUMBER; - hash = (53 * hash) + getPath().hashCode(); - hash = (37 * hash) + VERB_FIELD_NUMBER; - hash = (53 * hash) + getVerb().hashCode(); - if (getAuthenticationsCount() > 0) { - hash = (37 * hash) + AUTHENTICATIONS_FIELD_NUMBER; - hash = (53 * hash) + getAuthenticationsList().hashCode(); - } - if (getScopesCount() > 0) { - hash = (37 * hash) + SCOPES_FIELD_NUMBER; - hash = (53 * hash) + getScopesList().hashCode(); - } - if (hasOperationPolicies()) { - hash = (37 * hash) + OPERATIONPOLICIES_FIELD_NUMBER; - hash = (53 * hash) + getOperationPolicies().hashCode(); - } - if (getQueryParamsCount() > 0) { - hash = (37 * hash) + QUERYPARAMS_FIELD_NUMBER; - hash = (53 * hash) + getQueryParamsList().hashCode(); - } - if (getHostnameCount() > 0) { - hash = (37 * hash) + HOSTNAME_FIELD_NUMBER; - hash = (53 * hash) + getHostnameList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.Resource} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.Resource) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ResourceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Resource_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Resource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAuthenticationsFieldBuilder(); - getScopesFieldBuilder(); - getQueryParamsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - path_ = ""; - - verb_ = ""; - - if (authenticationsBuilder_ == null) { - authentications_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - authenticationsBuilder_.clear(); - } - if (scopesBuilder_ == null) { - scopes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - scopesBuilder_.clear(); - } - if (operationPoliciesBuilder_ == null) { - operationPolicies_ = null; - } else { - operationPolicies_ = null; - operationPoliciesBuilder_ = null; - } - if (queryParamsBuilder_ == null) { - queryParams_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - queryParamsBuilder_.clear(); - } - hostname_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Resource_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource(this); - int from_bitField0_ = bitField0_; - result.path_ = path_; - result.verb_ = verb_; - if (authenticationsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - authentications_ = java.util.Collections.unmodifiableList(authentications_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.authentications_ = authentications_; - } else { - result.authentications_ = authenticationsBuilder_.build(); - } - if (scopesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - scopes_ = java.util.Collections.unmodifiableList(scopes_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.scopes_ = scopes_; - } else { - result.scopes_ = scopesBuilder_.build(); - } - if (operationPoliciesBuilder_ == null) { - result.operationPolicies_ = operationPolicies_; - } else { - result.operationPolicies_ = operationPoliciesBuilder_.build(); - } - if (queryParamsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - queryParams_ = java.util.Collections.unmodifiableList(queryParams_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.queryParams_ = queryParams_; - } else { - result.queryParams_ = queryParamsBuilder_.build(); - } - if (((bitField0_ & 0x00000008) != 0)) { - hostname_ = hostname_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.hostname_ = hostname_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource.getDefaultInstance()) return this; - if (!other.getPath().isEmpty()) { - path_ = other.path_; - onChanged(); - } - if (!other.getVerb().isEmpty()) { - verb_ = other.verb_; - onChanged(); - } - if (authenticationsBuilder_ == null) { - if (!other.authentications_.isEmpty()) { - if (authentications_.isEmpty()) { - authentications_ = other.authentications_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAuthenticationsIsMutable(); - authentications_.addAll(other.authentications_); - } - onChanged(); - } - } else { - if (!other.authentications_.isEmpty()) { - if (authenticationsBuilder_.isEmpty()) { - authenticationsBuilder_.dispose(); - authenticationsBuilder_ = null; - authentications_ = other.authentications_; - bitField0_ = (bitField0_ & ~0x00000001); - authenticationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAuthenticationsFieldBuilder() : null; - } else { - authenticationsBuilder_.addAllMessages(other.authentications_); - } - } - } - if (scopesBuilder_ == null) { - if (!other.scopes_.isEmpty()) { - if (scopes_.isEmpty()) { - scopes_ = other.scopes_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureScopesIsMutable(); - scopes_.addAll(other.scopes_); - } - onChanged(); - } - } else { - if (!other.scopes_.isEmpty()) { - if (scopesBuilder_.isEmpty()) { - scopesBuilder_.dispose(); - scopesBuilder_ = null; - scopes_ = other.scopes_; - bitField0_ = (bitField0_ & ~0x00000002); - scopesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getScopesFieldBuilder() : null; - } else { - scopesBuilder_.addAllMessages(other.scopes_); - } - } - } - if (other.hasOperationPolicies()) { - mergeOperationPolicies(other.getOperationPolicies()); - } - if (queryParamsBuilder_ == null) { - if (!other.queryParams_.isEmpty()) { - if (queryParams_.isEmpty()) { - queryParams_ = other.queryParams_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureQueryParamsIsMutable(); - queryParams_.addAll(other.queryParams_); - } - onChanged(); - } - } else { - if (!other.queryParams_.isEmpty()) { - if (queryParamsBuilder_.isEmpty()) { - queryParamsBuilder_.dispose(); - queryParamsBuilder_ = null; - queryParams_ = other.queryParams_; - bitField0_ = (bitField0_ & ~0x00000004); - queryParamsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getQueryParamsFieldBuilder() : null; - } else { - queryParamsBuilder_.addAllMessages(other.queryParams_); - } - } - } - if (!other.hostname_.isEmpty()) { - if (hostname_.isEmpty()) { - hostname_ = other.hostname_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureHostnameIsMutable(); - hostname_.addAll(other.hostname_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object path_ = ""; - /** - * string path = 1; - * @return The path. - */ - public java.lang.String getPath() { - java.lang.Object ref = path_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - path_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string path = 1; - * @return The bytes for path. - */ - public com.google.protobuf.ByteString - getPathBytes() { - java.lang.Object ref = path_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - path_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string path = 1; - * @param value The path to set. - * @return This builder for chaining. - */ - public Builder setPath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - path_ = value; - onChanged(); - return this; - } - /** - * string path = 1; - * @return This builder for chaining. - */ - public Builder clearPath() { - - path_ = getDefaultInstance().getPath(); - onChanged(); - return this; - } - /** - * string path = 1; - * @param value The bytes for path to set. - * @return This builder for chaining. - */ - public Builder setPathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - path_ = value; - onChanged(); - return this; - } - - private java.lang.Object verb_ = ""; - /** - * string verb = 2; - * @return The verb. - */ - public java.lang.String getVerb() { - java.lang.Object ref = verb_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - verb_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string verb = 2; - * @return The bytes for verb. - */ - public com.google.protobuf.ByteString - getVerbBytes() { - java.lang.Object ref = verb_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - verb_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string verb = 2; - * @param value The verb to set. - * @return This builder for chaining. - */ - public Builder setVerb( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - verb_ = value; - onChanged(); - return this; - } - /** - * string verb = 2; - * @return This builder for chaining. - */ - public Builder clearVerb() { - - verb_ = getDefaultInstance().getVerb(); - onChanged(); - return this; - } - /** - * string verb = 2; - * @param value The bytes for verb to set. - * @return This builder for chaining. - */ - public Builder setVerbBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - verb_ = value; - onChanged(); - return this; - } - - private java.util.List authentications_ = - java.util.Collections.emptyList(); - private void ensureAuthenticationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - authentications_ = new java.util.ArrayList(authentications_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.AuthenticationOrBuilder> authenticationsBuilder_; - - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public java.util.List getAuthenticationsList() { - if (authenticationsBuilder_ == null) { - return java.util.Collections.unmodifiableList(authentications_); - } else { - return authenticationsBuilder_.getMessageList(); - } - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public int getAuthenticationsCount() { - if (authenticationsBuilder_ == null) { - return authentications_.size(); - } else { - return authenticationsBuilder_.getCount(); - } - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication getAuthentications(int index) { - if (authenticationsBuilder_ == null) { - return authentications_.get(index); - } else { - return authenticationsBuilder_.getMessage(index); - } - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder setAuthentications( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication value) { - if (authenticationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAuthenticationsIsMutable(); - authentications_.set(index, value); - onChanged(); - } else { - authenticationsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder setAuthentications( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder builderForValue) { - if (authenticationsBuilder_ == null) { - ensureAuthenticationsIsMutable(); - authentications_.set(index, builderForValue.build()); - onChanged(); - } else { - authenticationsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder addAuthentications(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication value) { - if (authenticationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAuthenticationsIsMutable(); - authentications_.add(value); - onChanged(); - } else { - authenticationsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder addAuthentications( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication value) { - if (authenticationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAuthenticationsIsMutable(); - authentications_.add(index, value); - onChanged(); - } else { - authenticationsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder addAuthentications( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder builderForValue) { - if (authenticationsBuilder_ == null) { - ensureAuthenticationsIsMutable(); - authentications_.add(builderForValue.build()); - onChanged(); - } else { - authenticationsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder addAuthentications( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder builderForValue) { - if (authenticationsBuilder_ == null) { - ensureAuthenticationsIsMutable(); - authentications_.add(index, builderForValue.build()); - onChanged(); - } else { - authenticationsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder addAllAuthentications( - java.lang.Iterable values) { - if (authenticationsBuilder_ == null) { - ensureAuthenticationsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, authentications_); - onChanged(); - } else { - authenticationsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder clearAuthentications() { - if (authenticationsBuilder_ == null) { - authentications_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - authenticationsBuilder_.clear(); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public Builder removeAuthentications(int index) { - if (authenticationsBuilder_ == null) { - ensureAuthenticationsIsMutable(); - authentications_.remove(index); - onChanged(); - } else { - authenticationsBuilder_.remove(index); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder getAuthenticationsBuilder( - int index) { - return getAuthenticationsFieldBuilder().getBuilder(index); - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.AuthenticationOrBuilder getAuthenticationsOrBuilder( - int index) { - if (authenticationsBuilder_ == null) { - return authentications_.get(index); } else { - return authenticationsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public java.util.List - getAuthenticationsOrBuilderList() { - if (authenticationsBuilder_ != null) { - return authenticationsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(authentications_); - } - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder addAuthenticationsBuilder() { - return getAuthenticationsFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder addAuthenticationsBuilder( - int index) { - return getAuthenticationsFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.Authentication authentications = 3; - */ - public java.util.List - getAuthenticationsBuilderList() { - return getAuthenticationsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.AuthenticationOrBuilder> - getAuthenticationsFieldBuilder() { - if (authenticationsBuilder_ == null) { - authenticationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.AuthenticationOrBuilder>( - authentications_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - authentications_ = null; - } - return authenticationsBuilder_; - } - - private java.util.List scopes_ = - java.util.Collections.emptyList(); - private void ensureScopesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - scopes_ = new java.util.ArrayList(scopes_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ScopeOrBuilder> scopesBuilder_; - - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public java.util.List getScopesList() { - if (scopesBuilder_ == null) { - return java.util.Collections.unmodifiableList(scopes_); - } else { - return scopesBuilder_.getMessageList(); - } - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public int getScopesCount() { - if (scopesBuilder_ == null) { - return scopes_.size(); - } else { - return scopesBuilder_.getCount(); - } - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope getScopes(int index) { - if (scopesBuilder_ == null) { - return scopes_.get(index); - } else { - return scopesBuilder_.getMessage(index); - } - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder setScopes( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope value) { - if (scopesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureScopesIsMutable(); - scopes_.set(index, value); - onChanged(); - } else { - scopesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder setScopes( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder builderForValue) { - if (scopesBuilder_ == null) { - ensureScopesIsMutable(); - scopes_.set(index, builderForValue.build()); - onChanged(); - } else { - scopesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder addScopes(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope value) { - if (scopesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureScopesIsMutable(); - scopes_.add(value); - onChanged(); - } else { - scopesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder addScopes( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope value) { - if (scopesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureScopesIsMutable(); - scopes_.add(index, value); - onChanged(); - } else { - scopesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder addScopes( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder builderForValue) { - if (scopesBuilder_ == null) { - ensureScopesIsMutable(); - scopes_.add(builderForValue.build()); - onChanged(); - } else { - scopesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder addScopes( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder builderForValue) { - if (scopesBuilder_ == null) { - ensureScopesIsMutable(); - scopes_.add(index, builderForValue.build()); - onChanged(); - } else { - scopesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder addAllScopes( - java.lang.Iterable values) { - if (scopesBuilder_ == null) { - ensureScopesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, scopes_); - onChanged(); - } else { - scopesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder clearScopes() { - if (scopesBuilder_ == null) { - scopes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - scopesBuilder_.clear(); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public Builder removeScopes(int index) { - if (scopesBuilder_ == null) { - ensureScopesIsMutable(); - scopes_.remove(index); - onChanged(); - } else { - scopesBuilder_.remove(index); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder getScopesBuilder( - int index) { - return getScopesFieldBuilder().getBuilder(index); - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ScopeOrBuilder getScopesOrBuilder( - int index) { - if (scopesBuilder_ == null) { - return scopes_.get(index); } else { - return scopesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public java.util.List - getScopesOrBuilderList() { - if (scopesBuilder_ != null) { - return scopesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(scopes_); - } - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder addScopesBuilder() { - return getScopesFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder addScopesBuilder( - int index) { - return getScopesFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.Scope scopes = 4; - */ - public java.util.List - getScopesBuilderList() { - return getScopesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ScopeOrBuilder> - getScopesFieldBuilder() { - if (scopesBuilder_ == null) { - scopesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ScopeOrBuilder>( - scopes_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - scopes_ = null; - } - return scopesBuilder_; - } - - private org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies operationPolicies_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPoliciesOrBuilder> operationPoliciesBuilder_; - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - * @return Whether the operationPolicies field is set. - */ - public boolean hasOperationPolicies() { - return operationPoliciesBuilder_ != null || operationPolicies_ != null; - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - * @return The operationPolicies. - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies getOperationPolicies() { - if (operationPoliciesBuilder_ == null) { - return operationPolicies_ == null ? org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.getDefaultInstance() : operationPolicies_; - } else { - return operationPoliciesBuilder_.getMessage(); - } - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - public Builder setOperationPolicies(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies value) { - if (operationPoliciesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - operationPolicies_ = value; - onChanged(); - } else { - operationPoliciesBuilder_.setMessage(value); - } - - return this; - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - public Builder setOperationPolicies( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.Builder builderForValue) { - if (operationPoliciesBuilder_ == null) { - operationPolicies_ = builderForValue.build(); - onChanged(); - } else { - operationPoliciesBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - public Builder mergeOperationPolicies(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies value) { - if (operationPoliciesBuilder_ == null) { - if (operationPolicies_ != null) { - operationPolicies_ = - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.newBuilder(operationPolicies_).mergeFrom(value).buildPartial(); - } else { - operationPolicies_ = value; - } - onChanged(); - } else { - operationPoliciesBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - public Builder clearOperationPolicies() { - if (operationPoliciesBuilder_ == null) { - operationPolicies_ = null; - onChanged(); - } else { - operationPolicies_ = null; - operationPoliciesBuilder_ = null; - } - - return this; - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.Builder getOperationPoliciesBuilder() { - - onChanged(); - return getOperationPoliciesFieldBuilder().getBuilder(); - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPoliciesOrBuilder getOperationPoliciesOrBuilder() { - if (operationPoliciesBuilder_ != null) { - return operationPoliciesBuilder_.getMessageOrBuilder(); - } else { - return operationPolicies_ == null ? - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.getDefaultInstance() : operationPolicies_; - } - } - /** - * .discovery.service.apkmgt.OperationPolicies operationPolicies = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPoliciesOrBuilder> - getOperationPoliciesFieldBuilder() { - if (operationPoliciesBuilder_ == null) { - operationPoliciesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPoliciesOrBuilder>( - getOperationPolicies(), - getParentForChildren(), - isClean()); - operationPolicies_ = null; - } - return operationPoliciesBuilder_; - } - - private java.util.List queryParams_ = - java.util.Collections.emptyList(); - private void ensureQueryParamsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - queryParams_ = new java.util.ArrayList(queryParams_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParamOrBuilder> queryParamsBuilder_; - - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public java.util.List getQueryParamsList() { - if (queryParamsBuilder_ == null) { - return java.util.Collections.unmodifiableList(queryParams_); - } else { - return queryParamsBuilder_.getMessageList(); - } - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public int getQueryParamsCount() { - if (queryParamsBuilder_ == null) { - return queryParams_.size(); - } else { - return queryParamsBuilder_.getCount(); - } - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam getQueryParams(int index) { - if (queryParamsBuilder_ == null) { - return queryParams_.get(index); - } else { - return queryParamsBuilder_.getMessage(index); - } - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder setQueryParams( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam value) { - if (queryParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureQueryParamsIsMutable(); - queryParams_.set(index, value); - onChanged(); - } else { - queryParamsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder setQueryParams( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder builderForValue) { - if (queryParamsBuilder_ == null) { - ensureQueryParamsIsMutable(); - queryParams_.set(index, builderForValue.build()); - onChanged(); - } else { - queryParamsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder addQueryParams(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam value) { - if (queryParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureQueryParamsIsMutable(); - queryParams_.add(value); - onChanged(); - } else { - queryParamsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder addQueryParams( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam value) { - if (queryParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureQueryParamsIsMutable(); - queryParams_.add(index, value); - onChanged(); - } else { - queryParamsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder addQueryParams( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder builderForValue) { - if (queryParamsBuilder_ == null) { - ensureQueryParamsIsMutable(); - queryParams_.add(builderForValue.build()); - onChanged(); - } else { - queryParamsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder addQueryParams( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder builderForValue) { - if (queryParamsBuilder_ == null) { - ensureQueryParamsIsMutable(); - queryParams_.add(index, builderForValue.build()); - onChanged(); - } else { - queryParamsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder addAllQueryParams( - java.lang.Iterable values) { - if (queryParamsBuilder_ == null) { - ensureQueryParamsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, queryParams_); - onChanged(); - } else { - queryParamsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder clearQueryParams() { - if (queryParamsBuilder_ == null) { - queryParams_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - queryParamsBuilder_.clear(); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public Builder removeQueryParams(int index) { - if (queryParamsBuilder_ == null) { - ensureQueryParamsIsMutable(); - queryParams_.remove(index); - onChanged(); - } else { - queryParamsBuilder_.remove(index); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder getQueryParamsBuilder( - int index) { - return getQueryParamsFieldBuilder().getBuilder(index); - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParamOrBuilder getQueryParamsOrBuilder( - int index) { - if (queryParamsBuilder_ == null) { - return queryParams_.get(index); } else { - return queryParamsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public java.util.List - getQueryParamsOrBuilderList() { - if (queryParamsBuilder_ != null) { - return queryParamsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(queryParams_); - } - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder addQueryParamsBuilder() { - return getQueryParamsFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder addQueryParamsBuilder( - int index) { - return getQueryParamsFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.QueryParam queryParams = 7; - */ - public java.util.List - getQueryParamsBuilderList() { - return getQueryParamsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParamOrBuilder> - getQueryParamsFieldBuilder() { - if (queryParamsBuilder_ == null) { - queryParamsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParamOrBuilder>( - queryParams_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - queryParams_ = null; - } - return queryParamsBuilder_; - } - - private com.google.protobuf.LazyStringList hostname_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureHostnameIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - hostname_ = new com.google.protobuf.LazyStringArrayList(hostname_); - bitField0_ |= 0x00000008; - } - } - /** - * repeated string hostname = 8; - * @return A list containing the hostname. - */ - public com.google.protobuf.ProtocolStringList - getHostnameList() { - return hostname_.getUnmodifiableView(); - } - /** - * repeated string hostname = 8; - * @return The count of hostname. - */ - public int getHostnameCount() { - return hostname_.size(); - } - /** - * repeated string hostname = 8; - * @param index The index of the element to return. - * @return The hostname at the given index. - */ - public java.lang.String getHostname(int index) { - return hostname_.get(index); - } - /** - * repeated string hostname = 8; - * @param index The index of the value to return. - * @return The bytes of the hostname at the given index. - */ - public com.google.protobuf.ByteString - getHostnameBytes(int index) { - return hostname_.getByteString(index); - } - /** - * repeated string hostname = 8; - * @param index The index to set the value at. - * @param value The hostname to set. - * @return This builder for chaining. - */ - public Builder setHostname( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureHostnameIsMutable(); - hostname_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string hostname = 8; - * @param value The hostname to add. - * @return This builder for chaining. - */ - public Builder addHostname( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureHostnameIsMutable(); - hostname_.add(value); - onChanged(); - return this; - } - /** - * repeated string hostname = 8; - * @param values The hostname to add. - * @return This builder for chaining. - */ - public Builder addAllHostname( - java.lang.Iterable values) { - ensureHostnameIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, hostname_); - onChanged(); - return this; - } - /** - * repeated string hostname = 8; - * @return This builder for chaining. - */ - public Builder clearHostname() { - hostname_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * repeated string hostname = 8; - * @param value The bytes of the hostname to add. - * @return This builder for chaining. - */ - public Builder addHostnameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureHostnameIsMutable(); - hostname_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.Resource) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.Resource) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Resource parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Resource(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Resource getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface OperationPoliciesOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.OperationPolicies) - com.google.protobuf.MessageOrBuilder { - } - /** - * Protobuf type {@code discovery.service.apkmgt.OperationPolicies} - */ - public static final class OperationPolicies extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.OperationPolicies) - OperationPoliciesOrBuilder { - private static final long serialVersionUID = 0L; - // Use OperationPolicies.newBuilder() to construct. - private OperationPolicies(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OperationPolicies() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OperationPolicies(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OperationPolicies( - 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; - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_OperationPolicies_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_OperationPolicies_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.Builder.class); - } - - 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 { - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies) obj; - - 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 = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.OperationPolicies} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.OperationPolicies) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPoliciesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_OperationPolicies_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_OperationPolicies_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.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(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_OperationPolicies_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies(this); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.OperationPolicies) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.OperationPolicies) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OperationPolicies parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OperationPolicies(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.OperationPolicies getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface QueryParamOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.QueryParam) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string value = 2; - * @return The value. - */ - java.lang.String getValue(); - /** - * string value = 2; - * @return The bytes for value. - */ - com.google.protobuf.ByteString - getValueBytes(); - } - /** - * Protobuf type {@code discovery.service.apkmgt.QueryParam} - */ - public static final class QueryParam extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.QueryParam) - QueryParamOrBuilder { - private static final long serialVersionUID = 0L; - // Use QueryParam.newBuilder() to construct. - private QueryParam(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private QueryParam() { - name_ = ""; - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new QueryParam(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private QueryParam( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_QueryParam_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_QueryParam_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALUE_FIELD_NUMBER = 2; - private volatile java.lang.Object value_; - /** - * string value = 2; - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } - } - /** - * string value = 2; - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getValue() - .equals(other.getValue())) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.QueryParam} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.QueryParam) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParamOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_QueryParam_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_QueryParam_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.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(); - name_ = ""; - - value_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_QueryParam_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam(this); - result.name_ = name_; - result.value_ = value_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object value_ = ""; - /** - * string value = 2; - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string value = 2; - * @return The bytes for value. - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string value = 2; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * string value = 2; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - * string value = 2; - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.QueryParam) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.QueryParam) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public QueryParam parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new QueryParam(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.QueryParam getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ScopeOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.Scope) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string displayName = 2; - * @return The displayName. - */ - java.lang.String getDisplayName(); - /** - * string displayName = 2; - * @return The bytes for displayName. - */ - com.google.protobuf.ByteString - getDisplayNameBytes(); - - /** - * string description = 3; - * @return The description. - */ - java.lang.String getDescription(); - /** - * string description = 3; - * @return The bytes for description. - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - * repeated string bindings = 4; - * @return A list containing the bindings. - */ - java.util.List - getBindingsList(); - /** - * repeated string bindings = 4; - * @return The count of bindings. - */ - int getBindingsCount(); - /** - * repeated string bindings = 4; - * @param index The index of the element to return. - * @return The bindings at the given index. - */ - java.lang.String getBindings(int index); - /** - * repeated string bindings = 4; - * @param index The index of the value to return. - * @return The bytes of the bindings at the given index. - */ - com.google.protobuf.ByteString - getBindingsBytes(int index); - } - /** - * Protobuf type {@code discovery.service.apkmgt.Scope} - */ - public static final class Scope extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.Scope) - ScopeOrBuilder { - private static final long serialVersionUID = 0L; - // Use Scope.newBuilder() to construct. - private Scope(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Scope() { - name_ = ""; - displayName_ = ""; - description_ = ""; - bindings_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Scope(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Scope( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - bindings_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - bindings_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - bindings_ = bindings_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Scope_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Scope_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DISPLAYNAME_FIELD_NUMBER = 2; - private volatile java.lang.Object displayName_; - /** - * string displayName = 2; - * @return The displayName. - */ - @java.lang.Override - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; - } - } - /** - * string displayName = 2; - * @return The bytes for displayName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - * string description = 3; - * @return The description. - */ - @java.lang.Override - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - /** - * string description = 3; - * @return The bytes for description. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BINDINGS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList bindings_; - /** - * repeated string bindings = 4; - * @return A list containing the bindings. - */ - public com.google.protobuf.ProtocolStringList - getBindingsList() { - return bindings_; - } - /** - * repeated string bindings = 4; - * @return The count of bindings. - */ - public int getBindingsCount() { - return bindings_.size(); - } - /** - * repeated string bindings = 4; - * @param index The index of the element to return. - * @return The bindings at the given index. - */ - public java.lang.String getBindings(int index) { - return bindings_.get(index); - } - /** - * repeated string bindings = 4; - * @param index The index of the value to return. - * @return The bytes of the bindings at the given index. - */ - public com.google.protobuf.ByteString - getBindingsBytes(int index) { - return bindings_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getDisplayNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - for (int i = 0; i < bindings_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, bindings_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getDisplayNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - { - int dataSize = 0; - for (int i = 0; i < bindings_.size(); i++) { - dataSize += computeStringSizeNoTag(bindings_.getRaw(i)); - } - size += dataSize; - size += 1 * getBindingsList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getDisplayName() - .equals(other.getDisplayName())) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (!getBindingsList() - .equals(other.getBindingsList())) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DISPLAYNAME_FIELD_NUMBER; - hash = (53 * hash) + getDisplayName().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - if (getBindingsCount() > 0) { - hash = (37 * hash) + BINDINGS_FIELD_NUMBER; - hash = (53 * hash) + getBindingsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.Scope} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.Scope) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ScopeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Scope_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Scope_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.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(); - name_ = ""; - - displayName_ = ""; - - description_ = ""; - - bindings_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Scope_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.displayName_ = displayName_; - result.description_ = description_; - if (((bitField0_ & 0x00000001) != 0)) { - bindings_ = bindings_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.bindings_ = bindings_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (!other.bindings_.isEmpty()) { - if (bindings_.isEmpty()) { - bindings_ = other.bindings_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBindingsIsMutable(); - bindings_.addAll(other.bindings_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object displayName_ = ""; - /** - * string displayName = 2; - * @return The displayName. - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string displayName = 2; - * @return The bytes for displayName. - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string displayName = 2; - * @param value The displayName to set. - * @return This builder for chaining. - */ - public Builder setDisplayName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - displayName_ = value; - onChanged(); - return this; - } - /** - * string displayName = 2; - * @return This builder for chaining. - */ - public Builder clearDisplayName() { - - displayName_ = getDefaultInstance().getDisplayName(); - onChanged(); - return this; - } - /** - * string displayName = 2; - * @param value The bytes for displayName to set. - * @return This builder for chaining. - */ - public Builder setDisplayNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - displayName_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - * string description = 3; - * @return The description. - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string description = 3; - * @return The bytes for description. - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string description = 3; - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - * string description = 3; - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - * string description = 3; - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList bindings_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureBindingsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - bindings_ = new com.google.protobuf.LazyStringArrayList(bindings_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string bindings = 4; - * @return A list containing the bindings. - */ - public com.google.protobuf.ProtocolStringList - getBindingsList() { - return bindings_.getUnmodifiableView(); - } - /** - * repeated string bindings = 4; - * @return The count of bindings. - */ - public int getBindingsCount() { - return bindings_.size(); - } - /** - * repeated string bindings = 4; - * @param index The index of the element to return. - * @return The bindings at the given index. - */ - public java.lang.String getBindings(int index) { - return bindings_.get(index); - } - /** - * repeated string bindings = 4; - * @param index The index of the value to return. - * @return The bytes of the bindings at the given index. - */ - public com.google.protobuf.ByteString - getBindingsBytes(int index) { - return bindings_.getByteString(index); - } - /** - * repeated string bindings = 4; - * @param index The index to set the value at. - * @param value The bindings to set. - * @return This builder for chaining. - */ - public Builder setBindings( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureBindingsIsMutable(); - bindings_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string bindings = 4; - * @param value The bindings to add. - * @return This builder for chaining. - */ - public Builder addBindings( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureBindingsIsMutable(); - bindings_.add(value); - onChanged(); - return this; - } - /** - * repeated string bindings = 4; - * @param values The bindings to add. - * @return This builder for chaining. - */ - public Builder addAllBindings( - java.lang.Iterable values) { - ensureBindingsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, bindings_); - onChanged(); - return this; - } - /** - * repeated string bindings = 4; - * @return This builder for chaining. - */ - public Builder clearBindings() { - bindings_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string bindings = 4; - * @param value The bytes of the bindings to add. - * @return This builder for chaining. - */ - public Builder addBindingsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureBindingsIsMutable(); - bindings_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.Scope) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.Scope) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Scope parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Scope(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Scope getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface AuthenticationOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.Authentication) - com.google.protobuf.MessageOrBuilder { - - /** - * string type = 1; - * @return The type. - */ - java.lang.String getType(); - /** - * string type = 1; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - * string iss = 2; - * @return The iss. - */ - java.lang.String getIss(); - /** - * string iss = 2; - * @return The bytes for iss. - */ - com.google.protobuf.ByteString - getIssBytes(); - - /** - * string aud = 3; - * @return The aud. - */ - java.lang.String getAud(); - /** - * string aud = 3; - * @return The bytes for aud. - */ - com.google.protobuf.ByteString - getAudBytes(); - - /** - * string jwksUri = 4; - * @return The jwksUri. - */ - java.lang.String getJwksUri(); - /** - * string jwksUri = 4; - * @return The bytes for jwksUri. - */ - com.google.protobuf.ByteString - getJwksUriBytes(); - - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - java.util.List - getCredentialListList(); - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential getCredentialList(int index); - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - int getCredentialListCount(); - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - java.util.List - getCredentialListOrBuilderList(); - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CredentialOrBuilder getCredentialListOrBuilder( - int index); - } - /** - * Protobuf type {@code discovery.service.apkmgt.Authentication} - */ - public static final class Authentication extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.Authentication) - AuthenticationOrBuilder { - private static final long serialVersionUID = 0L; - // Use Authentication.newBuilder() to construct. - private Authentication(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Authentication() { - type_ = ""; - iss_ = ""; - aud_ = ""; - jwksUri_ = ""; - credentialList_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Authentication(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Authentication( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - iss_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - aud_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - jwksUri_ = s; - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - credentialList_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - credentialList_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - credentialList_ = java.util.Collections.unmodifiableList(credentialList_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Authentication_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Authentication_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder.class); - } - - public static final int TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object type_; - /** - * string type = 1; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - * string type = 1; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ISS_FIELD_NUMBER = 2; - private volatile java.lang.Object iss_; - /** - * string iss = 2; - * @return The iss. - */ - @java.lang.Override - public java.lang.String getIss() { - java.lang.Object ref = iss_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - iss_ = s; - return s; - } - } - /** - * string iss = 2; - * @return The bytes for iss. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIssBytes() { - java.lang.Object ref = iss_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - iss_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int AUD_FIELD_NUMBER = 3; - private volatile java.lang.Object aud_; - /** - * string aud = 3; - * @return The aud. - */ - @java.lang.Override - public java.lang.String getAud() { - java.lang.Object ref = aud_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - aud_ = s; - return s; - } - } - /** - * string aud = 3; - * @return The bytes for aud. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAudBytes() { - java.lang.Object ref = aud_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - aud_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int JWKSURI_FIELD_NUMBER = 4; - private volatile java.lang.Object jwksUri_; - /** - * string jwksUri = 4; - * @return The jwksUri. - */ - @java.lang.Override - public java.lang.String getJwksUri() { - java.lang.Object ref = jwksUri_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - jwksUri_ = s; - return s; - } - } - /** - * string jwksUri = 4; - * @return The bytes for jwksUri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getJwksUriBytes() { - java.lang.Object ref = jwksUri_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - jwksUri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREDENTIALLIST_FIELD_NUMBER = 5; - private java.util.List credentialList_; - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - @java.lang.Override - public java.util.List getCredentialListList() { - return credentialList_; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - @java.lang.Override - public java.util.List - getCredentialListOrBuilderList() { - return credentialList_; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - @java.lang.Override - public int getCredentialListCount() { - return credentialList_.size(); - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential getCredentialList(int index) { - return credentialList_.get(index); - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CredentialOrBuilder getCredentialListOrBuilder( - int index) { - return credentialList_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); - } - if (!getIssBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, iss_); - } - if (!getAudBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, aud_); - } - if (!getJwksUriBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, jwksUri_); - } - for (int i = 0; i < credentialList_.size(); i++) { - output.writeMessage(5, credentialList_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); - } - if (!getIssBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, iss_); - } - if (!getAudBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, aud_); - } - if (!getJwksUriBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, jwksUri_); - } - for (int i = 0; i < credentialList_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, credentialList_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication) obj; - - if (!getType() - .equals(other.getType())) return false; - if (!getIss() - .equals(other.getIss())) return false; - if (!getAud() - .equals(other.getAud())) return false; - if (!getJwksUri() - .equals(other.getJwksUri())) return false; - if (!getCredentialListList() - .equals(other.getCredentialListList())) 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) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + ISS_FIELD_NUMBER; - hash = (53 * hash) + getIss().hashCode(); - hash = (37 * hash) + AUD_FIELD_NUMBER; - hash = (53 * hash) + getAud().hashCode(); - hash = (37 * hash) + JWKSURI_FIELD_NUMBER; - hash = (53 * hash) + getJwksUri().hashCode(); - if (getCredentialListCount() > 0) { - hash = (37 * hash) + CREDENTIALLIST_FIELD_NUMBER; - hash = (53 * hash) + getCredentialListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.Authentication} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.Authentication) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.AuthenticationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Authentication_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Authentication_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getCredentialListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - type_ = ""; - - iss_ = ""; - - aud_ = ""; - - jwksUri_ = ""; - - if (credentialListBuilder_ == null) { - credentialList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - credentialListBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Authentication_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication(this); - int from_bitField0_ = bitField0_; - result.type_ = type_; - result.iss_ = iss_; - result.aud_ = aud_; - result.jwksUri_ = jwksUri_; - if (credentialListBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - credentialList_ = java.util.Collections.unmodifiableList(credentialList_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.credentialList_ = credentialList_; - } else { - result.credentialList_ = credentialListBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication.getDefaultInstance()) return this; - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (!other.getIss().isEmpty()) { - iss_ = other.iss_; - onChanged(); - } - if (!other.getAud().isEmpty()) { - aud_ = other.aud_; - onChanged(); - } - if (!other.getJwksUri().isEmpty()) { - jwksUri_ = other.jwksUri_; - onChanged(); - } - if (credentialListBuilder_ == null) { - if (!other.credentialList_.isEmpty()) { - if (credentialList_.isEmpty()) { - credentialList_ = other.credentialList_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCredentialListIsMutable(); - credentialList_.addAll(other.credentialList_); - } - onChanged(); - } - } else { - if (!other.credentialList_.isEmpty()) { - if (credentialListBuilder_.isEmpty()) { - credentialListBuilder_.dispose(); - credentialListBuilder_ = null; - credentialList_ = other.credentialList_; - bitField0_ = (bitField0_ & ~0x00000001); - credentialListBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getCredentialListFieldBuilder() : null; - } else { - credentialListBuilder_.addAllMessages(other.credentialList_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object type_ = ""; - /** - * string type = 1; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string type = 1; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string type = 1; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - * string type = 1; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - * string type = 1; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private java.lang.Object iss_ = ""; - /** - * string iss = 2; - * @return The iss. - */ - public java.lang.String getIss() { - java.lang.Object ref = iss_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - iss_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string iss = 2; - * @return The bytes for iss. - */ - public com.google.protobuf.ByteString - getIssBytes() { - java.lang.Object ref = iss_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - iss_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string iss = 2; - * @param value The iss to set. - * @return This builder for chaining. - */ - public Builder setIss( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - iss_ = value; - onChanged(); - return this; - } - /** - * string iss = 2; - * @return This builder for chaining. - */ - public Builder clearIss() { - - iss_ = getDefaultInstance().getIss(); - onChanged(); - return this; - } - /** - * string iss = 2; - * @param value The bytes for iss to set. - * @return This builder for chaining. - */ - public Builder setIssBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - iss_ = value; - onChanged(); - return this; - } - - private java.lang.Object aud_ = ""; - /** - * string aud = 3; - * @return The aud. - */ - public java.lang.String getAud() { - java.lang.Object ref = aud_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - aud_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string aud = 3; - * @return The bytes for aud. - */ - public com.google.protobuf.ByteString - getAudBytes() { - java.lang.Object ref = aud_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - aud_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string aud = 3; - * @param value The aud to set. - * @return This builder for chaining. - */ - public Builder setAud( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - aud_ = value; - onChanged(); - return this; - } - /** - * string aud = 3; - * @return This builder for chaining. - */ - public Builder clearAud() { - - aud_ = getDefaultInstance().getAud(); - onChanged(); - return this; - } - /** - * string aud = 3; - * @param value The bytes for aud to set. - * @return This builder for chaining. - */ - public Builder setAudBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - aud_ = value; - onChanged(); - return this; - } - - private java.lang.Object jwksUri_ = ""; - /** - * string jwksUri = 4; - * @return The jwksUri. - */ - public java.lang.String getJwksUri() { - java.lang.Object ref = jwksUri_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - jwksUri_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string jwksUri = 4; - * @return The bytes for jwksUri. - */ - public com.google.protobuf.ByteString - getJwksUriBytes() { - java.lang.Object ref = jwksUri_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - jwksUri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string jwksUri = 4; - * @param value The jwksUri to set. - * @return This builder for chaining. - */ - public Builder setJwksUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - jwksUri_ = value; - onChanged(); - return this; - } - /** - * string jwksUri = 4; - * @return This builder for chaining. - */ - public Builder clearJwksUri() { - - jwksUri_ = getDefaultInstance().getJwksUri(); - onChanged(); - return this; - } - /** - * string jwksUri = 4; - * @param value The bytes for jwksUri to set. - * @return This builder for chaining. - */ - public Builder setJwksUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - jwksUri_ = value; - onChanged(); - return this; - } - - private java.util.List credentialList_ = - java.util.Collections.emptyList(); - private void ensureCredentialListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - credentialList_ = new java.util.ArrayList(credentialList_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CredentialOrBuilder> credentialListBuilder_; - - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public java.util.List getCredentialListList() { - if (credentialListBuilder_ == null) { - return java.util.Collections.unmodifiableList(credentialList_); - } else { - return credentialListBuilder_.getMessageList(); - } - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public int getCredentialListCount() { - if (credentialListBuilder_ == null) { - return credentialList_.size(); - } else { - return credentialListBuilder_.getCount(); - } - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential getCredentialList(int index) { - if (credentialListBuilder_ == null) { - return credentialList_.get(index); - } else { - return credentialListBuilder_.getMessage(index); - } - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder setCredentialList( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential value) { - if (credentialListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCredentialListIsMutable(); - credentialList_.set(index, value); - onChanged(); - } else { - credentialListBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder setCredentialList( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder builderForValue) { - if (credentialListBuilder_ == null) { - ensureCredentialListIsMutable(); - credentialList_.set(index, builderForValue.build()); - onChanged(); - } else { - credentialListBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder addCredentialList(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential value) { - if (credentialListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCredentialListIsMutable(); - credentialList_.add(value); - onChanged(); - } else { - credentialListBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder addCredentialList( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential value) { - if (credentialListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCredentialListIsMutable(); - credentialList_.add(index, value); - onChanged(); - } else { - credentialListBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder addCredentialList( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder builderForValue) { - if (credentialListBuilder_ == null) { - ensureCredentialListIsMutable(); - credentialList_.add(builderForValue.build()); - onChanged(); - } else { - credentialListBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder addCredentialList( - int index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder builderForValue) { - if (credentialListBuilder_ == null) { - ensureCredentialListIsMutable(); - credentialList_.add(index, builderForValue.build()); - onChanged(); - } else { - credentialListBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder addAllCredentialList( - java.lang.Iterable values) { - if (credentialListBuilder_ == null) { - ensureCredentialListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, credentialList_); - onChanged(); - } else { - credentialListBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder clearCredentialList() { - if (credentialListBuilder_ == null) { - credentialList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - credentialListBuilder_.clear(); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public Builder removeCredentialList(int index) { - if (credentialListBuilder_ == null) { - ensureCredentialListIsMutable(); - credentialList_.remove(index); - onChanged(); - } else { - credentialListBuilder_.remove(index); - } - return this; - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder getCredentialListBuilder( - int index) { - return getCredentialListFieldBuilder().getBuilder(index); - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CredentialOrBuilder getCredentialListOrBuilder( - int index) { - if (credentialListBuilder_ == null) { - return credentialList_.get(index); } else { - return credentialListBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public java.util.List - getCredentialListOrBuilderList() { - if (credentialListBuilder_ != null) { - return credentialListBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(credentialList_); - } - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder addCredentialListBuilder() { - return getCredentialListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder addCredentialListBuilder( - int index) { - return getCredentialListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.getDefaultInstance()); - } - /** - * repeated .discovery.service.apkmgt.Credential credentialList = 5; - */ - public java.util.List - getCredentialListBuilderList() { - return getCredentialListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CredentialOrBuilder> - getCredentialListFieldBuilder() { - if (credentialListBuilder_ == null) { - credentialListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CredentialOrBuilder>( - credentialList_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - credentialList_ = null; - } - return credentialListBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.Authentication) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.Authentication) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Authentication parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Authentication(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Authentication getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface CredentialOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.Credential) - com.google.protobuf.MessageOrBuilder { - - /** - * string username = 1; - * @return The username. - */ - java.lang.String getUsername(); - /** - * string username = 1; - * @return The bytes for username. - */ - com.google.protobuf.ByteString - getUsernameBytes(); - - /** - * string password = 2; - * @return The password. - */ - java.lang.String getPassword(); - /** - * string password = 2; - * @return The bytes for password. - */ - com.google.protobuf.ByteString - getPasswordBytes(); - } - /** - * Protobuf type {@code discovery.service.apkmgt.Credential} - */ - public static final class Credential extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.Credential) - CredentialOrBuilder { - private static final long serialVersionUID = 0L; - // Use Credential.newBuilder() to construct. - private Credential(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Credential() { - username_ = ""; - password_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Credential(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Credential( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - username_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - password_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Credential_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Credential_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder.class); - } - - public static final int USERNAME_FIELD_NUMBER = 1; - private volatile java.lang.Object username_; - /** - * string username = 1; - * @return The username. - */ - @java.lang.Override - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } - } - /** - * string username = 1; - * @return The bytes for username. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PASSWORD_FIELD_NUMBER = 2; - private volatile java.lang.Object password_; - /** - * string password = 2; - * @return The password. - */ - @java.lang.Override - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } - } - /** - * string password = 2; - * @return The bytes for password. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUsernameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); - } - if (!getPasswordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUsernameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); - } - if (!getPasswordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential) obj; - - if (!getUsername() - .equals(other.getUsername())) return false; - if (!getPassword() - .equals(other.getPassword())) 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) + USERNAME_FIELD_NUMBER; - hash = (53 * hash) + getUsername().hashCode(); - hash = (37 * hash) + PASSWORD_FIELD_NUMBER; - hash = (53 * hash) + getPassword().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.Credential} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.Credential) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.CredentialOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Credential_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Credential_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.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(); - username_ = ""; - - password_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Credential_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential(this); - result.username_ = username_; - result.password_ = password_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential.getDefaultInstance()) return this; - if (!other.getUsername().isEmpty()) { - username_ = other.username_; - onChanged(); - } - if (!other.getPassword().isEmpty()) { - password_ = other.password_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object username_ = ""; - /** - * string username = 1; - * @return The username. - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string username = 1; - * @return The bytes for username. - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string username = 1; - * @param value The username to set. - * @return This builder for chaining. - */ - public Builder setUsername( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - username_ = value; - onChanged(); - return this; - } - /** - * string username = 1; - * @return This builder for chaining. - */ - public Builder clearUsername() { - - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - /** - * string username = 1; - * @param value The bytes for username to set. - * @return This builder for chaining. - */ - public Builder setUsernameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - username_ = value; - onChanged(); - return this; - } - - private java.lang.Object password_ = ""; - /** - * string password = 2; - * @return The password. - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string password = 2; - * @return The bytes for password. - */ - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string password = 2; - * @param value The password to set. - * @return This builder for chaining. - */ - public Builder setPassword( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - password_ = value; - onChanged(); - return this; - } - /** - * string password = 2; - * @return This builder for chaining. - */ - public Builder clearPassword() { - - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - /** - * string password = 2; - * @param value The bytes for password to set. - * @return This builder for chaining. - */ - public Builder setPasswordBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - password_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.Credential) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.Credential) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Credential parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Credential(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Credential getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.Response) - com.google.protobuf.MessageOrBuilder { - - /** - * bool result = 1; - * @return The result. - */ - boolean getResult(); - } - /** - * Protobuf type {@code discovery.service.apkmgt.Response} - */ - public static final class Response extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.Response) - ResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use Response.newBuilder() to construct. - private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Response() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Response(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Response( - 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: { - - result_ = 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.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Response_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Response_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.Builder.class); - } - - public static final int RESULT_FIELD_NUMBER = 1; - private boolean result_; - /** - * bool result = 1; - * @return The result. - */ - @java.lang.Override - public boolean getResult() { - return result_; - } - - 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 (result_ != false) { - output.writeBool(1, result_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (result_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, result_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response other = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response) obj; - - if (getResult() - != other.getResult()) 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) + RESULT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getResult()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.Response} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.Response) - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.ResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Response_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Response_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.class, org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.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(); - result_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.internal_static_discovery_service_apkmgt_Response_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response result = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response(this); - result.result_ = result_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance()) return this; - if (other.getResult() != false) { - setResult(other.getResult()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean result_ ; - /** - * bool result = 1; - * @return The result. - */ - @java.lang.Override - public boolean getResult() { - return result_; - } - /** - * bool result = 1; - * @param value The result to set. - * @return This builder for chaining. - */ - public Builder setResult(boolean value) { - - result_ = value; - onChanged(); - return this; - } - /** - * bool result = 1; - * @return This builder for chaining. - */ - public Builder clearResult() { - - result_ = 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:discovery.service.apkmgt.Response) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.Response) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Response parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Response(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - /** - * Protobuf service {@code discovery.service.apkmgt.APIService} - */ - public static abstract class APIService - implements com.google.protobuf.Service { - protected APIService() {} - - public interface Interface { - /** - * rpc createAPI(.discovery.service.apkmgt.API) returns (.discovery.service.apkmgt.Response); - */ - public abstract void createAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done); - - /** - * rpc updateAPI(.discovery.service.apkmgt.API) returns (.discovery.service.apkmgt.Response); - */ - public abstract void updateAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done); - - /** - * rpc deleteAPI(.discovery.service.apkmgt.API) returns (.discovery.service.apkmgt.Response); - */ - public abstract void deleteAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new APIService() { - @java.lang.Override - public void createAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done) { - impl.createAPI(controller, request, done); - } - - @java.lang.Override - public void updateAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done) { - impl.updateAPI(controller, request, done); - } - - @java.lang.Override - public void deleteAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done) { - impl.deleteAPI(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.createAPI(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API)request); - case 1: - return impl.updateAPI(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API)request); - case 2: - return impl.deleteAPI(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance(); - case 1: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance(); - case 2: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(); - case 1: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(); - case 2: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc createAPI(.discovery.service.apkmgt.API) returns (.discovery.service.apkmgt.Response); - */ - public abstract void createAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done); - - /** - * rpc updateAPI(.discovery.service.apkmgt.API) returns (.discovery.service.apkmgt.Response); - */ - public abstract void updateAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done); - - /** - * rpc deleteAPI(.discovery.service.apkmgt.API) returns (.discovery.service.apkmgt.Response); - */ - public abstract void deleteAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.createAPI(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - case 1: - this.updateAPI(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - case 2: - this.deleteAPI(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance(); - case 1: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance(); - case 2: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(); - case 1: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(); - case 2: - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.APIService implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void createAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.class, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance())); - } - - public void updateAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(1), - controller, - request, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.class, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance())); - } - - public void deleteAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(2), - controller, - request, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.class, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response createAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) - throws com.google.protobuf.ServiceException; - - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response updateAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) - throws com.google.protobuf.ServiceException; - - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response deleteAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response createAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) - throws com.google.protobuf.ServiceException { - return (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance()); - } - - - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response updateAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) - throws com.google.protobuf.ServiceException { - return (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response) channel.callBlockingMethod( - getDescriptor().getMethods().get(1), - controller, - request, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance()); - } - - - public org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response deleteAPI( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.API request) - throws com.google.protobuf.ServiceException { - return (org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response) channel.callBlockingMethod( - getDescriptor().getMethods().get(2), - controller, - request, - org.wso2.apk.enforcer.discovery.service.apkmgt.ApiDsProto.Response.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.APIService) - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_API_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_API_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_CorsConfig_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_CorsConfig_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_Resource_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_Resource_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_OperationPolicies_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_OperationPolicies_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_QueryParam_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_QueryParam_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_Scope_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_Scope_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_Authentication_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_Authentication_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_Credential_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_Credential_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_Response_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_Response_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n)wso2/discovery/service/apkmgt/apids.pr" + - "oto\022\030discovery.service.apkmgt\"\345\002\n\003API\022\014\n" + - "\004uuid\030\001 \001(\t\022\020\n\010provider\030\002 \001(\t\022\017\n\007version" + - "\030\003 \001(\t\022\014\n\004name\030\004 \001(\t\022\020\n\010basePath\030\005 \001(\t\022\014" + - "\n\004type\030\006 \001(\t\022\026\n\016organizationId\030\007 \001(\t\022\021\n\t" + - "createdBy\030\010 \001(\t\022\023\n\013createdTime\030\t \001(\t\022\021\n\t" + - "updatedBy\030\n \001(\t\022\023\n\013updatedTime\030\013 \001(\t\022\022\n\n" + - "definition\030\014 \001(\t\022\022\n\ntransports\030\r \003(\t\0225\n\t" + - "resources\030\020 \003(\0132\".discovery.service.apkm" + - "gt.Resource\0228\n\ncorsConfig\030\021 \001(\0132$.discov" + - "ery.service.apkmgt.CorsConfig\"\276\001\n\nCorsCo" + - "nfig\022 \n\030corsConfigurationEnabled\030\001 \001(\010\022!" + - "\n\031accessControlAllowOrigins\030\002 \003(\t\022%\n\035acc" + - "essControlAllowCredentials\030\003 \001(\010\022!\n\031acce" + - "ssControlAllowHeaders\030\004 \003(\t\022!\n\031accessCon" + - "trolAllowMethods\030\005 \003(\t\"\257\002\n\010Resource\022\014\n\004p" + - "ath\030\001 \001(\t\022\014\n\004verb\030\002 \001(\t\022A\n\017authenticatio" + - "ns\030\003 \003(\0132(.discovery.service.apkmgt.Auth" + - "entication\022/\n\006scopes\030\004 \003(\0132\037.discovery.s" + - "ervice.apkmgt.Scope\022F\n\021operationPolicies" + - "\030\006 \001(\0132+.discovery.service.apkmgt.Operat" + - "ionPolicies\0229\n\013queryParams\030\007 \003(\0132$.disco" + - "very.service.apkmgt.QueryParam\022\020\n\010hostna" + - "me\030\010 \003(\t\"\023\n\021OperationPolicies\")\n\nQueryPa" + - "ram\022\014\n\004name\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"Q\n\005Scop" + - "e\022\014\n\004name\030\001 \001(\t\022\023\n\013displayName\030\002 \001(\t\022\023\n\013" + - "description\030\003 \001(\t\022\020\n\010bindings\030\004 \003(\t\"\207\001\n\016" + - "Authentication\022\014\n\004type\030\001 \001(\t\022\013\n\003iss\030\002 \001(" + - "\t\022\013\n\003aud\030\003 \001(\t\022\017\n\007jwksUri\030\004 \001(\t\022<\n\016crede" + - "ntialList\030\005 \003(\0132$.discovery.service.apkm" + - "gt.Credential\"0\n\nCredential\022\020\n\010username\030" + - "\001 \001(\t\022\020\n\010password\030\002 \001(\t\"\032\n\010Response\022\016\n\006r" + - "esult\030\001 \001(\0102\374\001\n\nAPIService\022N\n\tcreateAPI\022" + - "\035.discovery.service.apkmgt.API\032\".discove" + - "ry.service.apkmgt.Response\022N\n\tupdateAPI\022" + - "\035.discovery.service.apkmgt.API\032\".discove" + - "ry.service.apkmgt.Response\022N\n\tdeleteAPI\022" + - "\035.discovery.service.apkmgt.API\032\".discove" + - "ry.service.apkmgt.ResponseBw\n.org.wso2.a" + - "pk.enforcer.discovery.service.apkmgtB\nAp" + - "iDsProtoP\000Z4github.com/wso2/apk/adapter/" + - "discovery/service/apkmgt\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_discovery_service_apkmgt_API_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_discovery_service_apkmgt_API_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_API_descriptor, - new java.lang.String[] { "Uuid", "Provider", "Version", "Name", "BasePath", "Type", "OrganizationId", "CreatedBy", "CreatedTime", "UpdatedBy", "UpdatedTime", "Definition", "Transports", "Resources", "CorsConfig", }); - internal_static_discovery_service_apkmgt_CorsConfig_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_discovery_service_apkmgt_CorsConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_CorsConfig_descriptor, - new java.lang.String[] { "CorsConfigurationEnabled", "AccessControlAllowOrigins", "AccessControlAllowCredentials", "AccessControlAllowHeaders", "AccessControlAllowMethods", }); - internal_static_discovery_service_apkmgt_Resource_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_discovery_service_apkmgt_Resource_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_Resource_descriptor, - new java.lang.String[] { "Path", "Verb", "Authentications", "Scopes", "OperationPolicies", "QueryParams", "Hostname", }); - internal_static_discovery_service_apkmgt_OperationPolicies_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_discovery_service_apkmgt_OperationPolicies_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_OperationPolicies_descriptor, - new java.lang.String[] { }); - internal_static_discovery_service_apkmgt_QueryParam_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_discovery_service_apkmgt_QueryParam_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_QueryParam_descriptor, - new java.lang.String[] { "Name", "Value", }); - internal_static_discovery_service_apkmgt_Scope_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_discovery_service_apkmgt_Scope_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_Scope_descriptor, - new java.lang.String[] { "Name", "DisplayName", "Description", "Bindings", }); - internal_static_discovery_service_apkmgt_Authentication_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_discovery_service_apkmgt_Authentication_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_Authentication_descriptor, - new java.lang.String[] { "Type", "Iss", "Aud", "JwksUri", "CredentialList", }); - internal_static_discovery_service_apkmgt_Credential_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_discovery_service_apkmgt_Credential_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_Credential_descriptor, - new java.lang.String[] { "Username", "Password", }); - internal_static_discovery_service_apkmgt_Response_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_discovery_service_apkmgt_Response_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_Response_descriptor, - new java.lang.String[] { "Result", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/ApplicationDsProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/ApplicationDsProto.java deleted file mode 100644 index 5af07ba159..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/ApplicationDsProto.java +++ /dev/null @@ -1,283 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/apkmgt/applicationds.proto - -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -public final class ApplicationDsProto { - private ApplicationDsProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - /** - *
-   * [#protodoc-title: ApplicationDS]
-   * 
- * - * Protobuf service {@code discovery.service.apkmgt.APKMgtDiscoveryService} - */ - public static abstract class APKMgtDiscoveryService - implements com.google.protobuf.Service { - protected APKMgtDiscoveryService() {} - - public interface Interface { - /** - * rpc StreamAPKMgtApplications(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamAPKMgtApplications( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new APKMgtDiscoveryService() { - @java.lang.Override - public void streamAPKMgtApplications( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.streamAPKMgtApplications(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.streamAPKMgtApplications(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc StreamAPKMgtApplications(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamAPKMgtApplications( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.ApplicationDsProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.streamAPKMgtApplications(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.apkmgt.ApplicationDsProto.APKMgtDiscoveryService implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void streamAPKMgtApplications( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamAPKMgtApplications( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamAPKMgtApplications( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.APKMgtDiscoveryService) - } - - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n1wso2/discovery/service/apkmgt/applicat" + - "ionds.proto\022\030discovery.service.apkmgt\032*e" + - "nvoy/service/discovery/v3/discovery.prot" + - "o2\227\001\n\026APKMgtDiscoveryService\022}\n\030StreamAP" + - "KMgtApplications\022,.envoy.service.discove" + - "ry.v3.DiscoveryRequest\032-.envoy.service.d" + - "iscovery.v3.DiscoveryResponse\"\000(\0010\001B\217\001\n." + - "org.wso2.apk.enforcer.discovery.service." + - "apkmgtB\022ApplicationDsProtoP\000ZDgithub.com" + - "/envoyproxy/go-control-plane/wso2/discov" + - "ery/service/apkmgt\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(), - }); - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventServiceProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventServiceProto.java deleted file mode 100644 index 8125f757ac..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventServiceProto.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/apkmgt/eventds.proto - -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -public final class EventServiceProto { - private EventServiceProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_discovery_service_apkmgt_Request_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_discovery_service_apkmgt_Request_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n+wso2/discovery/service/apkmgt/eventds." + - "proto\022\030discovery.service.apkmgt\032\'wso2/di" + - "scovery/subscription/event.proto\"\030\n\007Requ" + - "est\022\r\n\005event\030\001 \001(\t2o\n\022EventStreamService" + - "\022Y\n\014StreamEvents\022!.discovery.service.apk" + - "mgt.Request\032\".wso2.discovery.subscriptio" + - "n.Event\"\0000\001B\234\001\n.org.wso2.apk.enforcer.di" + - "scovery.service.apkmgtB\021EventServiceProt" + - "oP\001ZRgithub.com/wso2/apk/common-go-libs/" + - "pkg/discovery/api/wso2/discovery/service" + - "/apkmgt\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.EventProto.getDescriptor(), - }); - internal_static_discovery_service_apkmgt_Request_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_discovery_service_apkmgt_Request_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_discovery_service_apkmgt_Request_descriptor, - new java.lang.String[] { "Event", }); - org.wso2.apk.enforcer.discovery.subscription.EventProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamService.java deleted file mode 100644 index 6e57e5bcad..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamService.java +++ /dev/null @@ -1,241 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/apkmgt/eventds.proto - -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -/** - *
- * [#protodoc-title: EventStreamDS]
- * 
- * - * Protobuf service {@code discovery.service.apkmgt.EventStreamService} - */ -public abstract class EventStreamService - implements com.google.protobuf.Service { - protected EventStreamService() {} - - public interface Interface { - /** - * rpc StreamEvents(.discovery.service.apkmgt.Request) returns (stream .wso2.discovery.subscription.Event); - */ - public abstract void streamEvents( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new EventStreamService() { - @java.lang.Override - public void streamEvents( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, - com.google.protobuf.RpcCallback done) { - impl.streamEvents(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.streamEvents(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.Request)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc StreamEvents(.discovery.service.apkmgt.Request) returns (stream .wso2.discovery.subscription.Event); - */ - public abstract void streamEvents( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.streamEvents(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.Request)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.apkmgt.EventStreamService implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void streamEvents( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - org.wso2.apk.enforcer.discovery.subscription.Event.class, - org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public org.wso2.apk.enforcer.discovery.subscription.Event streamEvents( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.Request request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public org.wso2.apk.enforcer.discovery.subscription.Event streamEvents( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.apkmgt.Request request) - throws com.google.protobuf.ServiceException { - return (org.wso2.apk.enforcer.discovery.subscription.Event) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.EventStreamService) -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamServiceGrpc.java deleted file mode 100644 index dffec9ee47..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamServiceGrpc.java +++ /dev/null @@ -1,296 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: EventStreamDS]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/apkmgt/eventds.proto") -public final class EventStreamServiceGrpc { - - private EventStreamServiceGrpc() {} - - public static final String SERVICE_NAME = "discovery.service.apkmgt.EventStreamService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getStreamEventsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamEvents", - requestType = org.wso2.apk.enforcer.discovery.service.apkmgt.Request.class, - responseType = org.wso2.apk.enforcer.discovery.subscription.Event.class, - methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - public static io.grpc.MethodDescriptor getStreamEventsMethod() { - io.grpc.MethodDescriptor getStreamEventsMethod; - if ((getStreamEventsMethod = EventStreamServiceGrpc.getStreamEventsMethod) == null) { - synchronized (EventStreamServiceGrpc.class) { - if ((getStreamEventsMethod = EventStreamServiceGrpc.getStreamEventsMethod) == null) { - EventStreamServiceGrpc.getStreamEventsMethod = getStreamEventsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamEvents")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance())) - .setSchemaDescriptor(new EventStreamServiceMethodDescriptorSupplier("StreamEvents")) - .build(); - } - } - } - return getStreamEventsMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static EventStreamServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public EventStreamServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EventStreamServiceStub(channel, callOptions); - } - }; - return EventStreamServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static EventStreamServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public EventStreamServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EventStreamServiceBlockingStub(channel, callOptions); - } - }; - return EventStreamServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static EventStreamServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public EventStreamServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EventStreamServiceFutureStub(channel, callOptions); - } - }; - return EventStreamServiceFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: EventStreamDS]
-   * 
- */ - public static abstract class EventStreamServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void streamEvents(org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getStreamEventsMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamEventsMethod(), - asyncServerStreamingCall( - new MethodHandlers< - org.wso2.apk.enforcer.discovery.service.apkmgt.Request, - org.wso2.apk.enforcer.discovery.subscription.Event>( - this, METHODID_STREAM_EVENTS))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: EventStreamDS]
-   * 
- */ - public static final class EventStreamServiceStub extends io.grpc.stub.AbstractAsyncStub { - private EventStreamServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected EventStreamServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EventStreamServiceStub(channel, callOptions); - } - - /** - */ - public void streamEvents(org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, - io.grpc.stub.StreamObserver responseObserver) { - asyncServerStreamingCall( - getChannel().newCall(getStreamEventsMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * [#protodoc-title: EventStreamDS]
-   * 
- */ - public static final class EventStreamServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private EventStreamServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected EventStreamServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EventStreamServiceBlockingStub(channel, callOptions); - } - - /** - */ - public java.util.Iterator streamEvents( - org.wso2.apk.enforcer.discovery.service.apkmgt.Request request) { - return blockingServerStreamingCall( - getChannel(), getStreamEventsMethod(), getCallOptions(), request); - } - } - - /** - *
-   * [#protodoc-title: EventStreamDS]
-   * 
- */ - public static final class EventStreamServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private EventStreamServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected EventStreamServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EventStreamServiceFutureStub(channel, callOptions); - } - } - - private static final int METHODID_STREAM_EVENTS = 0; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final EventStreamServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(EventStreamServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAM_EVENTS: - serviceImpl.streamEvents((org.wso2.apk.enforcer.discovery.service.apkmgt.Request) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class EventStreamServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - EventStreamServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("EventStreamService"); - } - } - - private static final class EventStreamServiceFileDescriptorSupplier - extends EventStreamServiceBaseDescriptorSupplier { - EventStreamServiceFileDescriptorSupplier() {} - } - - private static final class EventStreamServiceMethodDescriptorSupplier - extends EventStreamServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - EventStreamServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (EventStreamServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new EventStreamServiceFileDescriptorSupplier()) - .addMethod(getStreamEventsMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/Request.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/Request.java deleted file mode 100644 index bd03bb0361..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/Request.java +++ /dev/null @@ -1,557 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/apkmgt/eventds.proto - -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -/** - * Protobuf type {@code discovery.service.apkmgt.Request} - */ -public final class Request extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.Request) - RequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use Request.newBuilder() to construct. - private Request(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Request() { - event_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Request(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Request( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - event_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.Request.class, org.wso2.apk.enforcer.discovery.service.apkmgt.Request.Builder.class); - } - - public static final int EVENT_FIELD_NUMBER = 1; - private volatile java.lang.Object event_; - /** - * string event = 1; - * @return The event. - */ - @java.lang.Override - public java.lang.String getEvent() { - java.lang.Object ref = event_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - event_ = s; - return s; - } - } - /** - * string event = 1; - * @return The bytes for event. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEventBytes() { - java.lang.Object ref = event_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - event_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getEventBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, event_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getEventBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, event_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.Request)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.apkmgt.Request other = (org.wso2.apk.enforcer.discovery.service.apkmgt.Request) obj; - - if (!getEvent() - .equals(other.getEvent())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.Request prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code discovery.service.apkmgt.Request} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.Request) - org.wso2.apk.enforcer.discovery.service.apkmgt.RequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.apkmgt.Request.class, org.wso2.apk.enforcer.discovery.service.apkmgt.Request.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.Request.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - event_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.Request getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.Request build() { - org.wso2.apk.enforcer.discovery.service.apkmgt.Request result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.Request buildPartial() { - org.wso2.apk.enforcer.discovery.service.apkmgt.Request result = new org.wso2.apk.enforcer.discovery.service.apkmgt.Request(this); - result.event_ = event_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.Request) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.Request)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.Request other) { - if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance()) return this; - if (!other.getEvent().isEmpty()) { - event_ = other.event_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.apkmgt.Request parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.Request) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object event_ = ""; - /** - * string event = 1; - * @return The event. - */ - public java.lang.String getEvent() { - java.lang.Object ref = event_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - event_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string event = 1; - * @return The bytes for event. - */ - public com.google.protobuf.ByteString - getEventBytes() { - java.lang.Object ref = event_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - event_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string event = 1; - * @param value The event to set. - * @return This builder for chaining. - */ - public Builder setEvent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - event_ = value; - onChanged(); - return this; - } - /** - * string event = 1; - * @return This builder for chaining. - */ - public Builder clearEvent() { - - event_ = getDefaultInstance().getEvent(); - onChanged(); - return this; - } - /** - * string event = 1; - * @param value The bytes for event to set. - * @return This builder for chaining. - */ - public Builder setEventBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - event_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.Request) - } - - // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.Request) - private static final org.wso2.apk.enforcer.discovery.service.apkmgt.Request DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.Request(); - } - - public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Request parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Request(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.apkmgt.Request getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/RequestOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/RequestOrBuilder.java deleted file mode 100644 index e7e08f0e40..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/RequestOrBuilder.java +++ /dev/null @@ -1,21 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/apkmgt/eventds.proto - -package org.wso2.apk.enforcer.discovery.service.apkmgt; - -public interface RequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.Request) - com.google.protobuf.MessageOrBuilder { - - /** - * string event = 1; - * @return The event. - */ - java.lang.String getEvent(); - /** - * string event = 1; - * @return The bytes for event. - */ - com.google.protobuf.ByteString - getEventBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/CdsProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/CdsProto.java deleted file mode 100644 index 2cfb2ef376..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/CdsProto.java +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/config/cds.proto - -package org.wso2.apk.enforcer.discovery.service.config; - -public final class CdsProto { - private CdsProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\'wso2/discovery/service/config/cds.prot" + - "o\022\030discovery.service.config\032*envoy/servi" + - "ce/discovery/v3/discovery.proto2\373\001\n\026Conf" + - "igDiscoveryService\022r\n\rStreamConfigs\022,.en" + - "voy.service.discovery.v3.DiscoveryReques" + - "t\032-.envoy.service.discovery.v3.Discovery" + - "Response\"\000(\0010\001\022m\n\014FetchConfigs\022,.envoy.s" + - "ervice.discovery.v3.DiscoveryRequest\032-.e" + - "nvoy.service.discovery.v3.DiscoveryRespo" + - "nse\"\000B\205\001\n.org.wso2.apk.enforcer.discover" + - "y.service.configB\010CdsProtoP\001ZDgithub.com" + - "/envoyproxy/go-control-plane/wso2/discov" + - "ery/service/config\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(), - }); - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/ConfigDiscoveryService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/ConfigDiscoveryService.java deleted file mode 100644 index 2f3e7f6d24..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/ConfigDiscoveryService.java +++ /dev/null @@ -1,312 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/config/cds.proto - -package org.wso2.apk.enforcer.discovery.service.config; - -/** - *
- * [#protodoc-title: CDS]
- * 
- * - * Protobuf service {@code discovery.service.config.ConfigDiscoveryService} - */ -public abstract class ConfigDiscoveryService - implements com.google.protobuf.Service { - protected ConfigDiscoveryService() {} - - public interface Interface { - /** - * rpc StreamConfigs(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc FetchConfigs(.envoy.service.discovery.v3.DiscoveryRequest) returns (.envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void fetchConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new ConfigDiscoveryService() { - @java.lang.Override - public void streamConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.streamConfigs(controller, request, done); - } - - @java.lang.Override - public void fetchConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.fetchConfigs(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.streamConfigs(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - case 1: - return impl.fetchConfigs(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc StreamConfigs(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc FetchConfigs(.envoy.service.discovery.v3.DiscoveryRequest) returns (.envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void fetchConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.config.CdsProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.streamConfigs(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - case 1: - this.fetchConfigs(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.config.ConfigDiscoveryService implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void streamConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - - public void fetchConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(1), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchConfigs( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(1), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:discovery.service.config.ConfigDiscoveryService) -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/ConfigDiscoveryServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/ConfigDiscoveryServiceGrpc.java deleted file mode 100644 index 4799f3fbbd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/config/ConfigDiscoveryServiceGrpc.java +++ /dev/null @@ -1,361 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.config; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: CDS]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/config/cds.proto") -public final class ConfigDiscoveryServiceGrpc { - - private ConfigDiscoveryServiceGrpc() {} - - public static final String SERVICE_NAME = "discovery.service.config.ConfigDiscoveryService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getStreamConfigsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamConfigs", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamConfigsMethod() { - io.grpc.MethodDescriptor getStreamConfigsMethod; - if ((getStreamConfigsMethod = ConfigDiscoveryServiceGrpc.getStreamConfigsMethod) == null) { - synchronized (ConfigDiscoveryServiceGrpc.class) { - if ((getStreamConfigsMethod = ConfigDiscoveryServiceGrpc.getStreamConfigsMethod) == null) { - ConfigDiscoveryServiceGrpc.getStreamConfigsMethod = getStreamConfigsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamConfigs")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new ConfigDiscoveryServiceMethodDescriptorSupplier("StreamConfigs")) - .build(); - } - } - } - return getStreamConfigsMethod; - } - - private static volatile io.grpc.MethodDescriptor getFetchConfigsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "FetchConfigs", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getFetchConfigsMethod() { - io.grpc.MethodDescriptor getFetchConfigsMethod; - if ((getFetchConfigsMethod = ConfigDiscoveryServiceGrpc.getFetchConfigsMethod) == null) { - synchronized (ConfigDiscoveryServiceGrpc.class) { - if ((getFetchConfigsMethod = ConfigDiscoveryServiceGrpc.getFetchConfigsMethod) == null) { - ConfigDiscoveryServiceGrpc.getFetchConfigsMethod = getFetchConfigsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchConfigs")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new ConfigDiscoveryServiceMethodDescriptorSupplier("FetchConfigs")) - .build(); - } - } - } - return getFetchConfigsMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static ConfigDiscoveryServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ConfigDiscoveryServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ConfigDiscoveryServiceStub(channel, callOptions); - } - }; - return ConfigDiscoveryServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static ConfigDiscoveryServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ConfigDiscoveryServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ConfigDiscoveryServiceBlockingStub(channel, callOptions); - } - }; - return ConfigDiscoveryServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static ConfigDiscoveryServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ConfigDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ConfigDiscoveryServiceFutureStub(channel, callOptions); - } - }; - return ConfigDiscoveryServiceFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: CDS]
-   * 
- */ - public static abstract class ConfigDiscoveryServiceImplBase implements io.grpc.BindableService { - - /** - */ - public io.grpc.stub.StreamObserver streamConfigs( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(getStreamConfigsMethod(), responseObserver); - } - - /** - */ - public void fetchConfigs(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getFetchConfigsMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamConfigsMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_STREAM_CONFIGS))) - .addMethod( - getFetchConfigsMethod(), - asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_FETCH_CONFIGS))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: CDS]
-   * 
- */ - public static final class ConfigDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { - private ConfigDiscoveryServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ConfigDiscoveryServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ConfigDiscoveryServiceStub(channel, callOptions); - } - - /** - */ - public io.grpc.stub.StreamObserver streamConfigs( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamConfigsMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public void fetchConfigs(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getFetchConfigsMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * [#protodoc-title: CDS]
-   * 
- */ - public static final class ConfigDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private ConfigDiscoveryServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ConfigDiscoveryServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ConfigDiscoveryServiceBlockingStub(channel, callOptions); - } - - /** - */ - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchConfigs(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) { - return blockingUnaryCall( - getChannel(), getFetchConfigsMethod(), getCallOptions(), request); - } - } - - /** - *
-   * [#protodoc-title: CDS]
-   * 
- */ - public static final class ConfigDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private ConfigDiscoveryServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ConfigDiscoveryServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ConfigDiscoveryServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture fetchConfigs( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) { - return futureUnaryCall( - getChannel().newCall(getFetchConfigsMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_FETCH_CONFIGS = 0; - private static final int METHODID_STREAM_CONFIGS = 1; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final ConfigDiscoveryServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(ConfigDiscoveryServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_FETCH_CONFIGS: - serviceImpl.fetchConfigs((io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAM_CONFIGS: - return (io.grpc.stub.StreamObserver) serviceImpl.streamConfigs( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class ConfigDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - ConfigDiscoveryServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.config.CdsProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("ConfigDiscoveryService"); - } - } - - private static final class ConfigDiscoveryServiceFileDescriptorSupplier - extends ConfigDiscoveryServiceBaseDescriptorSupplier { - ConfigDiscoveryServiceFileDescriptorSupplier() {} - } - - private static final class ConfigDiscoveryServiceMethodDescriptorSupplier - extends ConfigDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - ConfigDiscoveryServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (ConfigDiscoveryServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new ConfigDiscoveryServiceFileDescriptorSupplier()) - .addMethod(getStreamConfigsMethod()) - .addMethod(getFetchConfigsMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/Health.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/Health.java deleted file mode 100644 index 87b91bd434..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/Health.java +++ /dev/null @@ -1,312 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/health/service/health.proto - -package org.wso2.apk.enforcer.discovery.service.health; - -/** - *
- * [#protodoc-title: Health]
- * 
- * - * Protobuf service {@code grpc.health.v1.Health} - */ -public abstract class Health - implements com.google.protobuf.Service { - protected Health() {} - - public interface Interface { - /** - * rpc Check(.grpc.health.v1.HealthCheckRequest) returns (.grpc.health.v1.HealthCheckResponse); - */ - public abstract void check( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc Watch(.grpc.health.v1.HealthCheckRequest) returns (stream .grpc.health.v1.HealthCheckResponse); - */ - public abstract void watch( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new Health() { - @java.lang.Override - public void check( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - com.google.protobuf.RpcCallback done) { - impl.check(controller, request, done); - } - - @java.lang.Override - public void watch( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - com.google.protobuf.RpcCallback done) { - impl.watch(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.check(controller, (org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest)request); - case 1: - return impl.watch(controller, (org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.getDefaultInstance(); - case 1: - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance(); - case 1: - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc Check(.grpc.health.v1.HealthCheckRequest) returns (.grpc.health.v1.HealthCheckResponse); - */ - public abstract void check( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc Watch(.grpc.health.v1.HealthCheckRequest) returns (stream .grpc.health.v1.HealthCheckResponse); - */ - public abstract void watch( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.check(controller, (org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - case 1: - this.watch(controller, (org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.getDefaultInstance(); - case 1: - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance(); - case 1: - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.health.Health implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void check( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.class, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance())); - } - - public void watch( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(1), - controller, - request, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.class, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse check( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request) - throws com.google.protobuf.ServiceException; - - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse watch( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse check( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request) - throws com.google.protobuf.ServiceException { - return (org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance()); - } - - - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse watch( - com.google.protobuf.RpcController controller, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request) - throws com.google.protobuf.ServiceException { - return (org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(1), - controller, - request, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:grpc.health.v1.Health) -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckRequest.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckRequest.java deleted file mode 100644 index 92c337826a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckRequest.java +++ /dev/null @@ -1,557 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/health/service/health.proto - -package org.wso2.apk.enforcer.discovery.service.health; - -/** - * Protobuf type {@code grpc.health.v1.HealthCheckRequest} - */ -public final class HealthCheckRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.health.v1.HealthCheckRequest) - HealthCheckRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use HealthCheckRequest.newBuilder() to construct. - private HealthCheckRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private HealthCheckRequest() { - service_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new HealthCheckRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private HealthCheckRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - service_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.class, org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.Builder.class); - } - - public static final int SERVICE_FIELD_NUMBER = 1; - private volatile java.lang.Object service_; - /** - * string service = 1; - * @return The service. - */ - @java.lang.Override - public java.lang.String getService() { - java.lang.Object ref = service_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - service_ = s; - return s; - } - } - /** - * string service = 1; - * @return The bytes for service. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getServiceBytes() { - java.lang.Object ref = service_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - service_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getServiceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getServiceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest other = (org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest) obj; - - if (!getService() - .equals(other.getService())) 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) + SERVICE_FIELD_NUMBER; - hash = (53 * hash) + getService().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code grpc.health.v1.HealthCheckRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.health.v1.HealthCheckRequest) - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.class, org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.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(); - service_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckRequest_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest build() { - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest buildPartial() { - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest result = new org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest(this); - result.service_ = service_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest other) { - if (other == org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.getDefaultInstance()) return this; - if (!other.getService().isEmpty()) { - service_ = other.service_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object service_ = ""; - /** - * string service = 1; - * @return The service. - */ - public java.lang.String getService() { - java.lang.Object ref = service_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - service_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string service = 1; - * @return The bytes for service. - */ - public com.google.protobuf.ByteString - getServiceBytes() { - java.lang.Object ref = service_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - service_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string service = 1; - * @param value The service to set. - * @return This builder for chaining. - */ - public Builder setService( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - service_ = value; - onChanged(); - return this; - } - /** - * string service = 1; - * @return This builder for chaining. - */ - public Builder clearService() { - - service_ = getDefaultInstance().getService(); - onChanged(); - return this; - } - /** - * string service = 1; - * @param value The bytes for service to set. - * @return This builder for chaining. - */ - public Builder setServiceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - service_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:grpc.health.v1.HealthCheckRequest) - } - - // @@protoc_insertion_point(class_scope:grpc.health.v1.HealthCheckRequest) - private static final org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest(); - } - - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public HealthCheckRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HealthCheckRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckRequestOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckRequestOrBuilder.java deleted file mode 100644 index 26586b1ed4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckRequestOrBuilder.java +++ /dev/null @@ -1,21 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/health/service/health.proto - -package org.wso2.apk.enforcer.discovery.service.health; - -public interface HealthCheckRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.health.v1.HealthCheckRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * string service = 1; - * @return The service. - */ - java.lang.String getService(); - /** - * string service = 1; - * @return The bytes for service. - */ - com.google.protobuf.ByteString - getServiceBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckResponse.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckResponse.java deleted file mode 100644 index 5501903f04..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckResponse.java +++ /dev/null @@ -1,649 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/health/service/health.proto - -package org.wso2.apk.enforcer.discovery.service.health; - -/** - * Protobuf type {@code grpc.health.v1.HealthCheckResponse} - */ -public final class HealthCheckResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:grpc.health.v1.HealthCheckResponse) - HealthCheckResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use HealthCheckResponse.newBuilder() to construct. - private HealthCheckResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private HealthCheckResponse() { - status_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new HealthCheckResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private HealthCheckResponse( - 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: { - int rawValue = input.readEnum(); - - status_ = rawValue; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.class, org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.Builder.class); - } - - /** - * Protobuf enum {@code grpc.health.v1.HealthCheckResponse.ServingStatus} - */ - public enum ServingStatus - implements com.google.protobuf.ProtocolMessageEnum { - /** - * UNKNOWN = 0; - */ - UNKNOWN(0), - /** - * SERVING = 1; - */ - SERVING(1), - /** - * NOT_SERVING = 2; - */ - NOT_SERVING(2), - /** - *
-     * Used only by the Watch method.
-     * 
- * - * SERVICE_UNKNOWN = 3; - */ - SERVICE_UNKNOWN(3), - UNRECOGNIZED(-1), - ; - - /** - * UNKNOWN = 0; - */ - public static final int UNKNOWN_VALUE = 0; - /** - * SERVING = 1; - */ - public static final int SERVING_VALUE = 1; - /** - * NOT_SERVING = 2; - */ - public static final int NOT_SERVING_VALUE = 2; - /** - *
-     * Used only by the Watch method.
-     * 
- * - * SERVICE_UNKNOWN = 3; - */ - public static final int SERVICE_UNKNOWN_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ServingStatus valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static ServingStatus forNumber(int value) { - switch (value) { - case 0: return UNKNOWN; - case 1: return SERVING; - case 2: return NOT_SERVING; - case 3: return SERVICE_UNKNOWN; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - ServingStatus> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ServingStatus findValueByNumber(int number) { - return ServingStatus.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDescriptor().getEnumTypes().get(0); - } - - private static final ServingStatus[] VALUES = values(); - - public static ServingStatus valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private ServingStatus(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:grpc.health.v1.HealthCheckResponse.ServingStatus) - } - - public static final int STATUS_FIELD_NUMBER = 1; - private int status_; - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @return The enum numeric value on the wire for status. - */ - @java.lang.Override public int getStatusValue() { - return status_; - } - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @return The status. - */ - @java.lang.Override public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus getStatus() { - @SuppressWarnings("deprecation") - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus result = org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus.valueOf(status_); - return result == null ? org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus.UNRECOGNIZED : result; - } - - 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 (status_ != org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus.UNKNOWN.getNumber()) { - output.writeEnum(1, status_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (status_ != org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus.UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, status_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse other = (org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse) obj; - - if (status_ != other.status_) 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) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + status_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code grpc.health.v1.HealthCheckResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:grpc.health.v1.HealthCheckResponse) - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.class, org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.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(); - status_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.internal_static_grpc_health_v1_HealthCheckResponse_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse build() { - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse buildPartial() { - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse result = new org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse(this); - result.status_ = status_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse other) { - if (other == org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance()) return this; - if (other.status_ != 0) { - setStatusValue(other.getStatusValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int status_ = 0; - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @return The enum numeric value on the wire for status. - */ - @java.lang.Override public int getStatusValue() { - return status_; - } - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @param value The enum numeric value on the wire for status to set. - * @return This builder for chaining. - */ - public Builder setStatusValue(int value) { - - status_ = value; - onChanged(); - return this; - } - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @return The status. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus getStatus() { - @SuppressWarnings("deprecation") - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus result = org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus.valueOf(status_); - return result == null ? org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus.UNRECOGNIZED : result; - } - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @param value The status to set. - * @return This builder for chaining. - */ - public Builder setStatus(org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus value) { - if (value == null) { - throw new NullPointerException(); - } - - status_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @return This builder for chaining. - */ - public Builder clearStatus() { - - status_ = 0; - 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:grpc.health.v1.HealthCheckResponse) - } - - // @@protoc_insertion_point(class_scope:grpc.health.v1.HealthCheckResponse) - private static final org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse(); - } - - public static org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public HealthCheckResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HealthCheckResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckResponseOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckResponseOrBuilder.java deleted file mode 100644 index 78dbdd7b40..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthCheckResponseOrBuilder.java +++ /dev/null @@ -1,20 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/health/service/health.proto - -package org.wso2.apk.enforcer.discovery.service.health; - -public interface HealthCheckResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:grpc.health.v1.HealthCheckResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @return The enum numeric value on the wire for status. - */ - int getStatusValue(); - /** - * .grpc.health.v1.HealthCheckResponse.ServingStatus status = 1; - * @return The status. - */ - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.ServingStatus getStatus(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthGrpc.java deleted file mode 100644 index 4608e5bedb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthGrpc.java +++ /dev/null @@ -1,370 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.health; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: Health]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/health/service/health.proto") -public final class HealthGrpc { - - private HealthGrpc() {} - - public static final String SERVICE_NAME = "grpc.health.v1.Health"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCheckMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Check", - requestType = org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.class, - responseType = org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCheckMethod() { - io.grpc.MethodDescriptor getCheckMethod; - if ((getCheckMethod = HealthGrpc.getCheckMethod) == null) { - synchronized (HealthGrpc.class) { - if ((getCheckMethod = HealthGrpc.getCheckMethod) == null) { - HealthGrpc.getCheckMethod = getCheckMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Check")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance())) - .setSchemaDescriptor(new HealthMethodDescriptorSupplier("Check")) - .build(); - } - } - } - return getCheckMethod; - } - - private static volatile io.grpc.MethodDescriptor getWatchMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Watch", - requestType = org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.class, - responseType = org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - public static io.grpc.MethodDescriptor getWatchMethod() { - io.grpc.MethodDescriptor getWatchMethod; - if ((getWatchMethod = HealthGrpc.getWatchMethod) == null) { - synchronized (HealthGrpc.class) { - if ((getWatchMethod = HealthGrpc.getWatchMethod) == null) { - HealthGrpc.getWatchMethod = getWatchMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Watch")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse.getDefaultInstance())) - .setSchemaDescriptor(new HealthMethodDescriptorSupplier("Watch")) - .build(); - } - } - } - return getWatchMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static HealthStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public HealthStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new HealthStub(channel, callOptions); - } - }; - return HealthStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static HealthBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public HealthBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new HealthBlockingStub(channel, callOptions); - } - }; - return HealthBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static HealthFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public HealthFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new HealthFutureStub(channel, callOptions); - } - }; - return HealthFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: Health]
-   * 
- */ - public static abstract class HealthImplBase implements io.grpc.BindableService { - - /** - */ - public void check(org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCheckMethod(), responseObserver); - } - - /** - */ - public void watch(org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getWatchMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCheckMethod(), - asyncUnaryCall( - new MethodHandlers< - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse>( - this, METHODID_CHECK))) - .addMethod( - getWatchMethod(), - asyncServerStreamingCall( - new MethodHandlers< - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest, - org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse>( - this, METHODID_WATCH))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: Health]
-   * 
- */ - public static final class HealthStub extends io.grpc.stub.AbstractAsyncStub { - private HealthStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected HealthStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new HealthStub(channel, callOptions); - } - - /** - */ - public void check(org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getCheckMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void watch(org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncServerStreamingCall( - getChannel().newCall(getWatchMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * [#protodoc-title: Health]
-   * 
- */ - public static final class HealthBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private HealthBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected HealthBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new HealthBlockingStub(channel, callOptions); - } - - /** - */ - public org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse check(org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request) { - return blockingUnaryCall( - getChannel(), getCheckMethod(), getCallOptions(), request); - } - - /** - */ - public java.util.Iterator watch( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request) { - return blockingServerStreamingCall( - getChannel(), getWatchMethod(), getCallOptions(), request); - } - } - - /** - *
-   * [#protodoc-title: Health]
-   * 
- */ - public static final class HealthFutureStub extends io.grpc.stub.AbstractFutureStub { - private HealthFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected HealthFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new HealthFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture check( - org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest request) { - return futureUnaryCall( - getChannel().newCall(getCheckMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CHECK = 0; - private static final int METHODID_WATCH = 1; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final HealthImplBase serviceImpl; - private final int methodId; - - MethodHandlers(HealthImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_CHECK: - serviceImpl.check((org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_WATCH: - serviceImpl.watch((org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class HealthBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - HealthBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.health.HealthProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Health"); - } - } - - private static final class HealthFileDescriptorSupplier - extends HealthBaseDescriptorSupplier { - HealthFileDescriptorSupplier() {} - } - - private static final class HealthMethodDescriptorSupplier - extends HealthBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - HealthMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (HealthGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new HealthFileDescriptorSupplier()) - .addMethod(getCheckMethod()) - .addMethod(getWatchMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthProto.java deleted file mode 100644 index 20cdafcbed..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/health/HealthProto.java +++ /dev/null @@ -1,71 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/health/service/health.proto - -package org.wso2.apk.enforcer.discovery.service.health; - -public final class HealthProto { - private HealthProto() {} - 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_grpc_health_v1_HealthCheckRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_health_v1_HealthCheckRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_grpc_health_v1_HealthCheckResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_grpc_health_v1_HealthCheckResponse_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n wso2/health/service/health.proto\022\016grpc" + - ".health.v1\"%\n\022HealthCheckRequest\022\017\n\007serv" + - "ice\030\001 \001(\t\"\251\001\n\023HealthCheckResponse\022A\n\006sta" + - "tus\030\001 \001(\01621.grpc.health.v1.HealthCheckRe" + - "sponse.ServingStatus\"O\n\rServingStatus\022\013\n" + - "\007UNKNOWN\020\000\022\013\n\007SERVING\020\001\022\017\n\013NOT_SERVING\020\002" + - "\022\023\n\017SERVICE_UNKNOWN\020\0032\256\001\n\006Health\022P\n\005Chec" + - "k\022\".grpc.health.v1.HealthCheckRequest\032#." + - "grpc.health.v1.HealthCheckResponse\022R\n\005Wa" + - "tch\022\".grpc.health.v1.HealthCheckRequest\032" + - "#.grpc.health.v1.HealthCheckResponse0\001B~" + - "\n.org.wso2.apk.enforcer.discovery.servic" + - "e.healthB\013HealthProtoP\001Z:github.com/envo" + - "yproxy/go-control-plane/wso2/health/serv" + - "ice\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_grpc_health_v1_HealthCheckRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_grpc_health_v1_HealthCheckRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_health_v1_HealthCheckRequest_descriptor, - new java.lang.String[] { "Service", }); - internal_static_grpc_health_v1_HealthCheckResponse_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_grpc_health_v1_HealthCheckResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_grpc_health_v1_HealthCheckResponse_descriptor, - new java.lang.String[] { "Status", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KMDiscoveryService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KMDiscoveryService.java deleted file mode 100644 index 8f81f9fd2c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KMDiscoveryService.java +++ /dev/null @@ -1,312 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/keymgt/kmds.proto - -package org.wso2.apk.enforcer.discovery.service.keymgt; - -/** - *
- * [#protodoc-title: KMDS]
- * 
- * - * Protobuf service {@code wso2.discovery.service.keymgt.KMDiscoveryService} - */ -public abstract class KMDiscoveryService - implements com.google.protobuf.Service { - protected KMDiscoveryService() {} - - public interface Interface { - /** - * rpc StreamKeyManagers(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc FetchKeyManagers(.envoy.service.discovery.v3.DiscoveryRequest) returns (.envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void fetchKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new KMDiscoveryService() { - @java.lang.Override - public void streamKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.streamKeyManagers(controller, request, done); - } - - @java.lang.Override - public void fetchKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.fetchKeyManagers(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.streamKeyManagers(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - case 1: - return impl.fetchKeyManagers(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc StreamKeyManagers(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc FetchKeyManagers(.envoy.service.discovery.v3.DiscoveryRequest) returns (.envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void fetchKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.keymgt.KmdsProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.streamKeyManagers(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - case 1: - this.fetchKeyManagers(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.keymgt.KMDiscoveryService implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void streamKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - - public void fetchKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(1), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchKeyManagers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(1), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.service.keymgt.KMDiscoveryService) -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KMDiscoveryServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KMDiscoveryServiceGrpc.java deleted file mode 100644 index d48ba08be6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KMDiscoveryServiceGrpc.java +++ /dev/null @@ -1,361 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.keymgt; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: KMDS]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/keymgt/kmds.proto") -public final class KMDiscoveryServiceGrpc { - - private KMDiscoveryServiceGrpc() {} - - public static final String SERVICE_NAME = "wso2.discovery.service.keymgt.KMDiscoveryService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getStreamKeyManagersMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamKeyManagers", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamKeyManagersMethod() { - io.grpc.MethodDescriptor getStreamKeyManagersMethod; - if ((getStreamKeyManagersMethod = KMDiscoveryServiceGrpc.getStreamKeyManagersMethod) == null) { - synchronized (KMDiscoveryServiceGrpc.class) { - if ((getStreamKeyManagersMethod = KMDiscoveryServiceGrpc.getStreamKeyManagersMethod) == null) { - KMDiscoveryServiceGrpc.getStreamKeyManagersMethod = getStreamKeyManagersMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamKeyManagers")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new KMDiscoveryServiceMethodDescriptorSupplier("StreamKeyManagers")) - .build(); - } - } - } - return getStreamKeyManagersMethod; - } - - private static volatile io.grpc.MethodDescriptor getFetchKeyManagersMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "FetchKeyManagers", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getFetchKeyManagersMethod() { - io.grpc.MethodDescriptor getFetchKeyManagersMethod; - if ((getFetchKeyManagersMethod = KMDiscoveryServiceGrpc.getFetchKeyManagersMethod) == null) { - synchronized (KMDiscoveryServiceGrpc.class) { - if ((getFetchKeyManagersMethod = KMDiscoveryServiceGrpc.getFetchKeyManagersMethod) == null) { - KMDiscoveryServiceGrpc.getFetchKeyManagersMethod = getFetchKeyManagersMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchKeyManagers")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new KMDiscoveryServiceMethodDescriptorSupplier("FetchKeyManagers")) - .build(); - } - } - } - return getFetchKeyManagersMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static KMDiscoveryServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public KMDiscoveryServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new KMDiscoveryServiceStub(channel, callOptions); - } - }; - return KMDiscoveryServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static KMDiscoveryServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public KMDiscoveryServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new KMDiscoveryServiceBlockingStub(channel, callOptions); - } - }; - return KMDiscoveryServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static KMDiscoveryServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public KMDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new KMDiscoveryServiceFutureStub(channel, callOptions); - } - }; - return KMDiscoveryServiceFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: KMDS]
-   * 
- */ - public static abstract class KMDiscoveryServiceImplBase implements io.grpc.BindableService { - - /** - */ - public io.grpc.stub.StreamObserver streamKeyManagers( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(getStreamKeyManagersMethod(), responseObserver); - } - - /** - */ - public void fetchKeyManagers(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getFetchKeyManagersMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamKeyManagersMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_STREAM_KEY_MANAGERS))) - .addMethod( - getFetchKeyManagersMethod(), - asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_FETCH_KEY_MANAGERS))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: KMDS]
-   * 
- */ - public static final class KMDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { - private KMDiscoveryServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected KMDiscoveryServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new KMDiscoveryServiceStub(channel, callOptions); - } - - /** - */ - public io.grpc.stub.StreamObserver streamKeyManagers( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamKeyManagersMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public void fetchKeyManagers(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getFetchKeyManagersMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * [#protodoc-title: KMDS]
-   * 
- */ - public static final class KMDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private KMDiscoveryServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected KMDiscoveryServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new KMDiscoveryServiceBlockingStub(channel, callOptions); - } - - /** - */ - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchKeyManagers(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) { - return blockingUnaryCall( - getChannel(), getFetchKeyManagersMethod(), getCallOptions(), request); - } - } - - /** - *
-   * [#protodoc-title: KMDS]
-   * 
- */ - public static final class KMDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private KMDiscoveryServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected KMDiscoveryServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new KMDiscoveryServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture fetchKeyManagers( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) { - return futureUnaryCall( - getChannel().newCall(getFetchKeyManagersMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_FETCH_KEY_MANAGERS = 0; - private static final int METHODID_STREAM_KEY_MANAGERS = 1; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final KMDiscoveryServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(KMDiscoveryServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_FETCH_KEY_MANAGERS: - serviceImpl.fetchKeyManagers((io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAM_KEY_MANAGERS: - return (io.grpc.stub.StreamObserver) serviceImpl.streamKeyManagers( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class KMDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - KMDiscoveryServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.keymgt.KmdsProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("KMDiscoveryService"); - } - } - - private static final class KMDiscoveryServiceFileDescriptorSupplier - extends KMDiscoveryServiceBaseDescriptorSupplier { - KMDiscoveryServiceFileDescriptorSupplier() {} - } - - private static final class KMDiscoveryServiceMethodDescriptorSupplier - extends KMDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - KMDiscoveryServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (KMDiscoveryServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new KMDiscoveryServiceFileDescriptorSupplier()) - .addMethod(getStreamKeyManagersMethod()) - .addMethod(getFetchKeyManagersMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KmdsProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KmdsProto.java deleted file mode 100644 index 2074158ba1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/KmdsProto.java +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/keymgt/kmds.proto - -package org.wso2.apk.enforcer.discovery.service.keymgt; - -public final class KmdsProto { - private KmdsProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n(wso2/discovery/service/keymgt/kmds.pro" + - "to\022\035wso2.discovery.service.keymgt\032*envoy" + - "/service/discovery/v3/discovery.proto2\377\001" + - "\n\022KMDiscoveryService\022v\n\021StreamKeyManager" + - "s\022,.envoy.service.discovery.v3.Discovery" + - "Request\032-.envoy.service.discovery.v3.Dis" + - "coveryResponse\"\000(\0010\001\022q\n\020FetchKeyManagers" + - "\022,.envoy.service.discovery.v3.DiscoveryR" + - "equest\032-.envoy.service.discovery.v3.Disc" + - "overyResponse\"\000B\206\001\n.org.wso2.apk.enforce" + - "r.discovery.service.keymgtB\tKmdsProtoP\001Z" + - "Dgithub.com/envoyproxy/go-control-plane/" + - "wso2/discovery/service/keymgt\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(), - }); - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RevokedTokenDiscoveryService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RevokedTokenDiscoveryService.java deleted file mode 100644 index e275eeda77..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RevokedTokenDiscoveryService.java +++ /dev/null @@ -1,312 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/keymgt/rtds.proto - -package org.wso2.apk.enforcer.discovery.service.keymgt; - -/** - *
- * [#protodoc-title: RTDS]
- * 
- * - * Protobuf service {@code wso2.discovery.service.keymgt.RevokedTokenDiscoveryService} - */ -public abstract class RevokedTokenDiscoveryService - implements com.google.protobuf.Service { - protected RevokedTokenDiscoveryService() {} - - public interface Interface { - /** - * rpc StreamTokens(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc FetchTokens(.envoy.service.discovery.v3.DiscoveryRequest) returns (.envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void fetchTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new RevokedTokenDiscoveryService() { - @java.lang.Override - public void streamTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.streamTokens(controller, request, done); - } - - @java.lang.Override - public void fetchTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.fetchTokens(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.streamTokens(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - case 1: - return impl.fetchTokens(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc StreamTokens(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - /** - * rpc FetchTokens(.envoy.service.discovery.v3.DiscoveryRequest) returns (.envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void fetchTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.keymgt.RtdsProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.streamTokens(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - case 1: - this.fetchTokens(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - case 1: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.keymgt.RevokedTokenDiscoveryService implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void streamTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - - public void fetchTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(1), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchTokens( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(1), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.service.keymgt.RevokedTokenDiscoveryService) -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RevokedTokenDiscoveryServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RevokedTokenDiscoveryServiceGrpc.java deleted file mode 100644 index 725e0acdac..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RevokedTokenDiscoveryServiceGrpc.java +++ /dev/null @@ -1,361 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.keymgt; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: RTDS]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/keymgt/rtds.proto") -public final class RevokedTokenDiscoveryServiceGrpc { - - private RevokedTokenDiscoveryServiceGrpc() {} - - public static final String SERVICE_NAME = "wso2.discovery.service.keymgt.RevokedTokenDiscoveryService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getStreamTokensMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamTokens", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamTokensMethod() { - io.grpc.MethodDescriptor getStreamTokensMethod; - if ((getStreamTokensMethod = RevokedTokenDiscoveryServiceGrpc.getStreamTokensMethod) == null) { - synchronized (RevokedTokenDiscoveryServiceGrpc.class) { - if ((getStreamTokensMethod = RevokedTokenDiscoveryServiceGrpc.getStreamTokensMethod) == null) { - RevokedTokenDiscoveryServiceGrpc.getStreamTokensMethod = getStreamTokensMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamTokens")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new RevokedTokenDiscoveryServiceMethodDescriptorSupplier("StreamTokens")) - .build(); - } - } - } - return getStreamTokensMethod; - } - - private static volatile io.grpc.MethodDescriptor getFetchTokensMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "FetchTokens", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getFetchTokensMethod() { - io.grpc.MethodDescriptor getFetchTokensMethod; - if ((getFetchTokensMethod = RevokedTokenDiscoveryServiceGrpc.getFetchTokensMethod) == null) { - synchronized (RevokedTokenDiscoveryServiceGrpc.class) { - if ((getFetchTokensMethod = RevokedTokenDiscoveryServiceGrpc.getFetchTokensMethod) == null) { - RevokedTokenDiscoveryServiceGrpc.getFetchTokensMethod = getFetchTokensMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchTokens")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new RevokedTokenDiscoveryServiceMethodDescriptorSupplier("FetchTokens")) - .build(); - } - } - } - return getFetchTokensMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static RevokedTokenDiscoveryServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public RevokedTokenDiscoveryServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new RevokedTokenDiscoveryServiceStub(channel, callOptions); - } - }; - return RevokedTokenDiscoveryServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static RevokedTokenDiscoveryServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public RevokedTokenDiscoveryServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new RevokedTokenDiscoveryServiceBlockingStub(channel, callOptions); - } - }; - return RevokedTokenDiscoveryServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static RevokedTokenDiscoveryServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public RevokedTokenDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new RevokedTokenDiscoveryServiceFutureStub(channel, callOptions); - } - }; - return RevokedTokenDiscoveryServiceFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: RTDS]
-   * 
- */ - public static abstract class RevokedTokenDiscoveryServiceImplBase implements io.grpc.BindableService { - - /** - */ - public io.grpc.stub.StreamObserver streamTokens( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(getStreamTokensMethod(), responseObserver); - } - - /** - */ - public void fetchTokens(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getFetchTokensMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamTokensMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_STREAM_TOKENS))) - .addMethod( - getFetchTokensMethod(), - asyncUnaryCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_FETCH_TOKENS))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: RTDS]
-   * 
- */ - public static final class RevokedTokenDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { - private RevokedTokenDiscoveryServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected RevokedTokenDiscoveryServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new RevokedTokenDiscoveryServiceStub(channel, callOptions); - } - - /** - */ - public io.grpc.stub.StreamObserver streamTokens( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamTokensMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public void fetchTokens(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getFetchTokensMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * [#protodoc-title: RTDS]
-   * 
- */ - public static final class RevokedTokenDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private RevokedTokenDiscoveryServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected RevokedTokenDiscoveryServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new RevokedTokenDiscoveryServiceBlockingStub(channel, callOptions); - } - - /** - */ - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse fetchTokens(io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) { - return blockingUnaryCall( - getChannel(), getFetchTokensMethod(), getCallOptions(), request); - } - } - - /** - *
-   * [#protodoc-title: RTDS]
-   * 
- */ - public static final class RevokedTokenDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private RevokedTokenDiscoveryServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected RevokedTokenDiscoveryServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new RevokedTokenDiscoveryServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture fetchTokens( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) { - return futureUnaryCall( - getChannel().newCall(getFetchTokensMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_FETCH_TOKENS = 0; - private static final int METHODID_STREAM_TOKENS = 1; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final RevokedTokenDiscoveryServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(RevokedTokenDiscoveryServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_FETCH_TOKENS: - serviceImpl.fetchTokens((io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAM_TOKENS: - return (io.grpc.stub.StreamObserver) serviceImpl.streamTokens( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class RevokedTokenDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - RevokedTokenDiscoveryServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.keymgt.RtdsProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("RevokedTokenDiscoveryService"); - } - } - - private static final class RevokedTokenDiscoveryServiceFileDescriptorSupplier - extends RevokedTokenDiscoveryServiceBaseDescriptorSupplier { - RevokedTokenDiscoveryServiceFileDescriptorSupplier() {} - } - - private static final class RevokedTokenDiscoveryServiceMethodDescriptorSupplier - extends RevokedTokenDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - RevokedTokenDiscoveryServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (RevokedTokenDiscoveryServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new RevokedTokenDiscoveryServiceFileDescriptorSupplier()) - .addMethod(getStreamTokensMethod()) - .addMethod(getFetchTokensMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RtdsProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RtdsProto.java deleted file mode 100644 index cb798bc64b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/keymgt/RtdsProto.java +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/keymgt/rtds.proto - -package org.wso2.apk.enforcer.discovery.service.keymgt; - -public final class RtdsProto { - private RtdsProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n(wso2/discovery/service/keymgt/rtds.pro" + - "to\022\035wso2.discovery.service.keymgt\032*envoy" + - "/service/discovery/v3/discovery.proto2\377\001" + - "\n\034RevokedTokenDiscoveryService\022q\n\014Stream" + - "Tokens\022,.envoy.service.discovery.v3.Disc" + - "overyRequest\032-.envoy.service.discovery.v" + - "3.DiscoveryResponse\"\000(\0010\001\022l\n\013FetchTokens" + - "\022,.envoy.service.discovery.v3.DiscoveryR" + - "equest\032-.envoy.service.discovery.v3.Disc" + - "overyResponse\"\000B\206\001\n.org.wso2.apk.enforce" + - "r.discovery.service.keymgtB\tRtdsProtoP\001Z" + - "Dgithub.com/envoyproxy/go-control-plane/" + - "wso2/discovery/service/keymgt\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(), - }); - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDSProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDSProto.java deleted file mode 100644 index 57b0a7a30c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDSProto.java +++ /dev/null @@ -1,47 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/subscription/jwtds.proto - -package org.wso2.apk.enforcer.discovery.service.subscription; - -public final class JWTIssuerDSProto { - private JWTIssuerDSProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n/wso2/discovery/service/subscription/jw" + - "tds.proto\022\036discovery.service.subscriptio" + - "n\032*envoy/service/discovery/v3/discovery." + - "proto2\222\001\n\031JWTIssuerDiscoveryService\022u\n\020S" + - "treamJWTIssuers\022,.envoy.service.discover" + - "y.v3.DiscoveryRequest\032-.envoy.service.di" + - "scovery.v3.DiscoveryResponse\"\000(\0010\001B\231\001\n4o" + - "rg.wso2.apk.enforcer.discovery.service.s" + - "ubscriptionB\020JWTIssuerDSProtoP\001ZJgithub." + - "com/envoyproxy/go-control-plane/wso2/dis" + - "covery/service/subscription\210\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(), - }); - io.envoyproxy.envoy.service.discovery.v3.DiscoveryProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDiscoveryService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDiscoveryService.java deleted file mode 100644 index 8b227bbc0d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDiscoveryService.java +++ /dev/null @@ -1,241 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/subscription/jwtds.proto - -package org.wso2.apk.enforcer.discovery.service.subscription; - -/** - *
- * [#protodoc-title: JWTIssuerDS]
- * 
- * - * Protobuf service {@code discovery.service.subscription.JWTIssuerDiscoveryService} - */ -public abstract class JWTIssuerDiscoveryService - implements com.google.protobuf.Service { - protected JWTIssuerDiscoveryService() {} - - public interface Interface { - /** - * rpc StreamJWTIssuers(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamJWTIssuers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - } - - public static com.google.protobuf.Service newReflectiveService( - final Interface impl) { - return new JWTIssuerDiscoveryService() { - @java.lang.Override - public void streamJWTIssuers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - impl.streamJWTIssuers(controller, request, done); - } - - }; - } - - public static com.google.protobuf.BlockingService - newReflectiveBlockingService(final BlockingInterface impl) { - return new com.google.protobuf.BlockingService() { - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final com.google.protobuf.Message callBlockingMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request) - throws com.google.protobuf.ServiceException { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callBlockingMethod() given method descriptor for " + - "wrong service type."); - } - switch(method.getIndex()) { - case 0: - return impl.streamJWTIssuers(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - }; - } - - /** - * rpc StreamJWTIssuers(stream .envoy.service.discovery.v3.DiscoveryRequest) returns (stream .envoy.service.discovery.v3.DiscoveryResponse); - */ - public abstract void streamJWTIssuers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done); - - public static final - com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.subscription.JWTIssuerDSProto.getDescriptor().getServices().get(0); - } - public final com.google.protobuf.Descriptors.ServiceDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - public final void callMethod( - com.google.protobuf.Descriptors.MethodDescriptor method, - com.google.protobuf.RpcController controller, - com.google.protobuf.Message request, - com.google.protobuf.RpcCallback< - com.google.protobuf.Message> done) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.callMethod() given method descriptor for wrong " + - "service type."); - } - switch(method.getIndex()) { - case 0: - this.streamJWTIssuers(controller, (io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest)request, - com.google.protobuf.RpcUtil.specializeCallback( - done)); - return; - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getRequestPrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getRequestPrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public final com.google.protobuf.Message - getResponsePrototype( - com.google.protobuf.Descriptors.MethodDescriptor method) { - if (method.getService() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "Service.getResponsePrototype() given method " + - "descriptor for wrong service type."); - } - switch(method.getIndex()) { - case 0: - return io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(); - default: - throw new java.lang.AssertionError("Can't get here."); - } - } - - public static Stub newStub( - com.google.protobuf.RpcChannel channel) { - return new Stub(channel); - } - - public static final class Stub extends org.wso2.apk.enforcer.discovery.service.subscription.JWTIssuerDiscoveryService implements Interface { - private Stub(com.google.protobuf.RpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.RpcChannel channel; - - public com.google.protobuf.RpcChannel getChannel() { - return channel; - } - - public void streamJWTIssuers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request, - com.google.protobuf.RpcCallback done) { - channel.callMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance(), - com.google.protobuf.RpcUtil.generalizeCallback( - done, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())); - } - } - - public static BlockingInterface newBlockingStub( - com.google.protobuf.BlockingRpcChannel channel) { - return new BlockingStub(channel); - } - - public interface BlockingInterface { - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamJWTIssuers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException; - } - - private static final class BlockingStub implements BlockingInterface { - private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { - this.channel = channel; - } - - private final com.google.protobuf.BlockingRpcChannel channel; - - public io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse streamJWTIssuers( - com.google.protobuf.RpcController controller, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest request) - throws com.google.protobuf.ServiceException { - return (io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse) channel.callBlockingMethod( - getDescriptor().getMethods().get(0), - controller, - request, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance()); - } - - } - - // @@protoc_insertion_point(class_scope:discovery.service.subscription.JWTIssuerDiscoveryService) -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDiscoveryServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDiscoveryServiceGrpc.java deleted file mode 100644 index 06355a9d14..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/JWTIssuerDiscoveryServiceGrpc.java +++ /dev/null @@ -1,287 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.subscription; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: JWTIssuerDS]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/subscription/jwtds.proto") -public final class JWTIssuerDiscoveryServiceGrpc { - - private JWTIssuerDiscoveryServiceGrpc() {} - - public static final String SERVICE_NAME = "discovery.service.subscription.JWTIssuerDiscoveryService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getStreamJWTIssuersMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamJWTIssuers", - requestType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.class, - responseType = io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamJWTIssuersMethod() { - io.grpc.MethodDescriptor getStreamJWTIssuersMethod; - if ((getStreamJWTIssuersMethod = JWTIssuerDiscoveryServiceGrpc.getStreamJWTIssuersMethod) == null) { - synchronized (JWTIssuerDiscoveryServiceGrpc.class) { - if ((getStreamJWTIssuersMethod = JWTIssuerDiscoveryServiceGrpc.getStreamJWTIssuersMethod) == null) { - JWTIssuerDiscoveryServiceGrpc.getStreamJWTIssuersMethod = getStreamJWTIssuersMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamJWTIssuers")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse.getDefaultInstance())) - .setSchemaDescriptor(new JWTIssuerDiscoveryServiceMethodDescriptorSupplier("StreamJWTIssuers")) - .build(); - } - } - } - return getStreamJWTIssuersMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static JWTIssuerDiscoveryServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public JWTIssuerDiscoveryServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new JWTIssuerDiscoveryServiceStub(channel, callOptions); - } - }; - return JWTIssuerDiscoveryServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static JWTIssuerDiscoveryServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public JWTIssuerDiscoveryServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new JWTIssuerDiscoveryServiceBlockingStub(channel, callOptions); - } - }; - return JWTIssuerDiscoveryServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static JWTIssuerDiscoveryServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public JWTIssuerDiscoveryServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new JWTIssuerDiscoveryServiceFutureStub(channel, callOptions); - } - }; - return JWTIssuerDiscoveryServiceFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: JWTIssuerDS]
-   * 
- */ - public static abstract class JWTIssuerDiscoveryServiceImplBase implements io.grpc.BindableService { - - /** - */ - public io.grpc.stub.StreamObserver streamJWTIssuers( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(getStreamJWTIssuersMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getStreamJWTIssuersMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest, - io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse>( - this, METHODID_STREAM_JWTISSUERS))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: JWTIssuerDS]
-   * 
- */ - public static final class JWTIssuerDiscoveryServiceStub extends io.grpc.stub.AbstractAsyncStub { - private JWTIssuerDiscoveryServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected JWTIssuerDiscoveryServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new JWTIssuerDiscoveryServiceStub(channel, callOptions); - } - - /** - */ - public io.grpc.stub.StreamObserver streamJWTIssuers( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getStreamJWTIssuersMethod(), getCallOptions()), responseObserver); - } - } - - /** - *
-   * [#protodoc-title: JWTIssuerDS]
-   * 
- */ - public static final class JWTIssuerDiscoveryServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private JWTIssuerDiscoveryServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected JWTIssuerDiscoveryServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new JWTIssuerDiscoveryServiceBlockingStub(channel, callOptions); - } - } - - /** - *
-   * [#protodoc-title: JWTIssuerDS]
-   * 
- */ - public static final class JWTIssuerDiscoveryServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private JWTIssuerDiscoveryServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected JWTIssuerDiscoveryServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new JWTIssuerDiscoveryServiceFutureStub(channel, callOptions); - } - } - - private static final int METHODID_STREAM_JWTISSUERS = 0; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final JWTIssuerDiscoveryServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(JWTIssuerDiscoveryServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAM_JWTISSUERS: - return (io.grpc.stub.StreamObserver) serviceImpl.streamJWTIssuers( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class JWTIssuerDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - JWTIssuerDiscoveryServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.subscription.JWTIssuerDSProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("JWTIssuerDiscoveryService"); - } - } - - private static final class JWTIssuerDiscoveryServiceFileDescriptorSupplier - extends JWTIssuerDiscoveryServiceBaseDescriptorSupplier { - JWTIssuerDiscoveryServiceFileDescriptorSupplier() {} - } - - private static final class JWTIssuerDiscoveryServiceMethodDescriptorSupplier - extends JWTIssuerDiscoveryServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - JWTIssuerDiscoveryServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (JWTIssuerDiscoveryServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new JWTIssuerDiscoveryServiceFileDescriptorSupplier()) - .addMethod(getStreamJWTIssuersMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/Metadata.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/Metadata.java deleted file mode 100644 index 96e6da47b3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/Metadata.java +++ /dev/null @@ -1,705 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/websocket/frame_service.proto - -package org.wso2.apk.enforcer.discovery.service.websocket; - -/** - * Protobuf type {@code envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata} - */ -public final class Metadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata) - MetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use Metadata.newBuilder() to construct. - private Metadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Metadata() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Metadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Metadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - extAuthzMetadata_ = com.google.protobuf.MapField.newMapField( - ExtAuthzMetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - extAuthzMetadata__ = input.readMessage( - ExtAuthzMetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - extAuthzMetadata_.getMutableMap().put( - extAuthzMetadata__.getKey(), extAuthzMetadata__.getValue()); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetExtAuthzMetadata(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.websocket.Metadata.class, org.wso2.apk.enforcer.discovery.service.websocket.Metadata.Builder.class); - } - - public static final int EXT_AUTHZ_METADATA_FIELD_NUMBER = 1; - private static final class ExtAuthzMetadataDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_ExtAuthzMetadataEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> extAuthzMetadata_; - private com.google.protobuf.MapField - internalGetExtAuthzMetadata() { - if (extAuthzMetadata_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ExtAuthzMetadataDefaultEntryHolder.defaultEntry); - } - return extAuthzMetadata_; - } - - public int getExtAuthzMetadataCount() { - return internalGetExtAuthzMetadata().getMap().size(); - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - - @java.lang.Override - public boolean containsExtAuthzMetadata( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetExtAuthzMetadata().getMap().containsKey(key); - } - /** - * Use {@link #getExtAuthzMetadataMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getExtAuthzMetadata() { - return getExtAuthzMetadataMap(); - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - @java.lang.Override - - public java.util.Map getExtAuthzMetadataMap() { - return internalGetExtAuthzMetadata().getMap(); - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - @java.lang.Override - - public java.lang.String getExtAuthzMetadataOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExtAuthzMetadata().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - @java.lang.Override - - public java.lang.String getExtAuthzMetadataOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExtAuthzMetadata().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - 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 { - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetExtAuthzMetadata(), - ExtAuthzMetadataDefaultEntryHolder.defaultEntry, - 1); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (java.util.Map.Entry entry - : internalGetExtAuthzMetadata().getMap().entrySet()) { - com.google.protobuf.MapEntry - extAuthzMetadata__ = ExtAuthzMetadataDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, extAuthzMetadata__); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.websocket.Metadata)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.websocket.Metadata other = (org.wso2.apk.enforcer.discovery.service.websocket.Metadata) obj; - - if (!internalGetExtAuthzMetadata().equals( - other.internalGetExtAuthzMetadata())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (!internalGetExtAuthzMetadata().getMap().isEmpty()) { - hash = (37 * hash) + EXT_AUTHZ_METADATA_FIELD_NUMBER; - hash = (53 * hash) + internalGetExtAuthzMetadata().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.websocket.Metadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata) - org.wso2.apk.enforcer.discovery.service.websocket.MetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetExtAuthzMetadata(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableExtAuthzMetadata(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.websocket.Metadata.class, org.wso2.apk.enforcer.discovery.service.websocket.Metadata.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.websocket.Metadata.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(); - internalGetMutableExtAuthzMetadata().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.Metadata getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.websocket.Metadata.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.Metadata build() { - org.wso2.apk.enforcer.discovery.service.websocket.Metadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.Metadata buildPartial() { - org.wso2.apk.enforcer.discovery.service.websocket.Metadata result = new org.wso2.apk.enforcer.discovery.service.websocket.Metadata(this); - int from_bitField0_ = bitField0_; - result.extAuthzMetadata_ = internalGetExtAuthzMetadata(); - result.extAuthzMetadata_.makeImmutable(); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.websocket.Metadata) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.websocket.Metadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.websocket.Metadata other) { - if (other == org.wso2.apk.enforcer.discovery.service.websocket.Metadata.getDefaultInstance()) return this; - internalGetMutableExtAuthzMetadata().mergeFrom( - other.internalGetExtAuthzMetadata()); - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.websocket.Metadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.websocket.Metadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> extAuthzMetadata_; - private com.google.protobuf.MapField - internalGetExtAuthzMetadata() { - if (extAuthzMetadata_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ExtAuthzMetadataDefaultEntryHolder.defaultEntry); - } - return extAuthzMetadata_; - } - private com.google.protobuf.MapField - internalGetMutableExtAuthzMetadata() { - onChanged();; - if (extAuthzMetadata_ == null) { - extAuthzMetadata_ = com.google.protobuf.MapField.newMapField( - ExtAuthzMetadataDefaultEntryHolder.defaultEntry); - } - if (!extAuthzMetadata_.isMutable()) { - extAuthzMetadata_ = extAuthzMetadata_.copy(); - } - return extAuthzMetadata_; - } - - public int getExtAuthzMetadataCount() { - return internalGetExtAuthzMetadata().getMap().size(); - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - - @java.lang.Override - public boolean containsExtAuthzMetadata( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetExtAuthzMetadata().getMap().containsKey(key); - } - /** - * Use {@link #getExtAuthzMetadataMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getExtAuthzMetadata() { - return getExtAuthzMetadataMap(); - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - @java.lang.Override - - public java.util.Map getExtAuthzMetadataMap() { - return internalGetExtAuthzMetadata().getMap(); - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - @java.lang.Override - - public java.lang.String getExtAuthzMetadataOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExtAuthzMetadata().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - @java.lang.Override - - public java.lang.String getExtAuthzMetadataOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExtAuthzMetadata().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearExtAuthzMetadata() { - internalGetMutableExtAuthzMetadata().getMutableMap() - .clear(); - return this; - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - - public Builder removeExtAuthzMetadata( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableExtAuthzMetadata().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableExtAuthzMetadata() { - return internalGetMutableExtAuthzMetadata().getMutableMap(); - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - public Builder putExtAuthzMetadata( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableExtAuthzMetadata().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, string> ext_authz_metadata = 1; - */ - - public Builder putAllExtAuthzMetadata( - java.util.Map values) { - internalGetMutableExtAuthzMetadata().getMutableMap() - .putAll(values); - 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:envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata) - } - - // @@protoc_insertion_point(class_scope:envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata) - private static final org.wso2.apk.enforcer.discovery.service.websocket.Metadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.websocket.Metadata(); - } - - public static org.wso2.apk.enforcer.discovery.service.websocket.Metadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Metadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Metadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.Metadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/MetadataOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/MetadataOrBuilder.java deleted file mode 100644 index 33a6c45004..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/MetadataOrBuilder.java +++ /dev/null @@ -1,43 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/websocket/frame_service.proto - -package org.wso2.apk.enforcer.discovery.service.websocket; - -public interface MetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata) - com.google.protobuf.MessageOrBuilder { - - /** - * map<string, string> ext_authz_metadata = 1; - */ - int getExtAuthzMetadataCount(); - /** - * map<string, string> ext_authz_metadata = 1; - */ - boolean containsExtAuthzMetadata( - java.lang.String key); - /** - * Use {@link #getExtAuthzMetadataMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getExtAuthzMetadata(); - /** - * map<string, string> ext_authz_metadata = 1; - */ - java.util.Map - getExtAuthzMetadataMap(); - /** - * map<string, string> ext_authz_metadata = 1; - */ - - java.lang.String getExtAuthzMetadataOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - * map<string, string> ext_authz_metadata = 1; - */ - - java.lang.String getExtAuthzMetadataOrThrow( - java.lang.String key); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/MgwWebSocketProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/MgwWebSocketProto.java deleted file mode 100644 index 34ed4f0be3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/MgwWebSocketProto.java +++ /dev/null @@ -1,108 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/websocket/frame_service.proto - -package org.wso2.apk.enforcer.discovery.service.websocket; - -public final class MgwWebSocketProto { - private MgwWebSocketProto() {} - 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_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_ExtAuthzMetadataEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_ExtAuthzMetadataEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n4wso2/discovery/service/websocket/frame" + - "_service.proto\0223envoy.extensions.filters" + - ".http.mgw_wasm_websocket.v3\"\373\002\n\025WebSocke" + - "tFrameRequest\022\017\n\007node_id\030\001 \001(\t\022O\n\010metada" + - "ta\030\002 \001(\0132=.envoy.extensions.filters.http" + - ".mgw_wasm_websocket.v3.Metadata\022\024\n\014frame" + - "_length\030\003 \001(\005\022\021\n\tremote_ip\030\004 \001(\t\022\017\n\007payl" + - "oad\030\005 \001(\014\022n\n\tdirection\030\006 \001(\0162[.envoy.ext" + - "ensions.filters.http.mgw_wasm_websocket." + - "v3.WebSocketFrameRequest.MessageDirectio" + - "n\022\027\n\017apim_error_code\030\007 \001(\005\"=\n\020MessageDir" + - "ection\022\013\n\007PUBLISH\020\000\022\r\n\tSUBSCRIBE\020\001\022\r\n\tHA" + - "NDSHAKE\020\002\"\341\001\n\026WebSocketFrameResponse\022h\n\016" + - "throttle_state\030\001 \001(\0162P.envoy.extensions." + - "filters.http.mgw_wasm_websocket.v3.WebSo" + - "cketFrameResponse.Code\022\027\n\017throttle_perio" + - "d\030\002 \001(\003\022\027\n\017apim_error_code\030\003 \001(\005\"+\n\004Code" + - "\022\013\n\007UNKNOWN\020\000\022\006\n\002OK\020\001\022\016\n\nOVER_LIMIT\020\002\"\264\001" + - "\n\010Metadata\022o\n\022ext_authz_metadata\030\001 \003(\0132S" + - ".envoy.extensions.filters.http.mgw_wasm_" + - "websocket.v3.Metadata.ExtAuthzMetadataEn" + - "try\0327\n\025ExtAuthzMetadataEntry\022\013\n\003key\030\001 \001(" + - "\t\022\r\n\005value\030\002 \001(\t:\0028\0012\313\001\n\025WebSocketFrameS" + - "ervice\022\261\001\n\020PublishFrameData\022J.envoy.exte" + - "nsions.filters.http.mgw_wasm_websocket.v" + - "3.WebSocketFrameRequest\032K.envoy.extensio" + - "ns.filters.http.mgw_wasm_websocket.v3.We" + - "bSocketFrameResponse\"\000(\0010\001BH\n1org.wso2.a" + - "pk.enforcer.discovery.service.websocketB" + - "\021MgwWebSocketProtoP\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_descriptor, - new java.lang.String[] { "NodeId", "Metadata", "FrameLength", "RemoteIp", "Payload", "Direction", "ApimErrorCode", }); - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_descriptor, - new java.lang.String[] { "ThrottleState", "ThrottlePeriod", "ApimErrorCode", }); - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_descriptor, - new java.lang.String[] { "ExtAuthzMetadata", }); - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_ExtAuthzMetadataEntry_descriptor = - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_descriptor.getNestedTypes().get(0); - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_ExtAuthzMetadataEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_Metadata_ExtAuthzMetadataEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameRequest.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameRequest.java deleted file mode 100644 index ad682a5ba5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameRequest.java +++ /dev/null @@ -1,1416 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/websocket/frame_service.proto - -package org.wso2.apk.enforcer.discovery.service.websocket; - -/** - * Protobuf type {@code envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest} - */ -public final class WebSocketFrameRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest) - WebSocketFrameRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use WebSocketFrameRequest.newBuilder() to construct. - private WebSocketFrameRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WebSocketFrameRequest() { - nodeId_ = ""; - remoteIp_ = ""; - payload_ = com.google.protobuf.ByteString.EMPTY; - direction_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WebSocketFrameRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WebSocketFrameRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - nodeId_ = s; - break; - } - case 18: { - org.wso2.apk.enforcer.discovery.service.websocket.Metadata.Builder subBuilder = null; - if (metadata_ != null) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = input.readMessage(org.wso2.apk.enforcer.discovery.service.websocket.Metadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - - frameLength_ = input.readInt32(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - remoteIp_ = s; - break; - } - case 42: { - - payload_ = input.readBytes(); - break; - } - case 48: { - int rawValue = input.readEnum(); - - direction_ = rawValue; - break; - } - case 56: { - - apimErrorCode_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.class, org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.Builder.class); - } - - /** - *
-   * direction of the message
-   * 
- * - * Protobuf enum {@code envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection} - */ - public enum MessageDirection - implements com.google.protobuf.ProtocolMessageEnum { - /** - * PUBLISH = 0; - */ - PUBLISH(0), - /** - * SUBSCRIBE = 1; - */ - SUBSCRIBE(1), - /** - * HANDSHAKE = 2; - */ - HANDSHAKE(2), - UNRECOGNIZED(-1), - ; - - /** - * PUBLISH = 0; - */ - public static final int PUBLISH_VALUE = 0; - /** - * SUBSCRIBE = 1; - */ - public static final int SUBSCRIBE_VALUE = 1; - /** - * HANDSHAKE = 2; - */ - public static final int HANDSHAKE_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static MessageDirection valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static MessageDirection forNumber(int value) { - switch (value) { - case 0: return PUBLISH; - case 1: return SUBSCRIBE; - case 2: return HANDSHAKE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - MessageDirection> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public MessageDirection findValueByNumber(int number) { - return MessageDirection.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.getDescriptor().getEnumTypes().get(0); - } - - private static final MessageDirection[] VALUES = values(); - - public static MessageDirection valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private MessageDirection(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection) - } - - public static final int NODE_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object nodeId_; - /** - *
-   * Unique Id / label of the router
-   * 
- * - * string node_id = 1; - * @return The nodeId. - */ - @java.lang.Override - public java.lang.String getNodeId() { - java.lang.Object ref = nodeId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nodeId_ = s; - return s; - } - } - /** - *
-   * Unique Id / label of the router
-   * 
- * - * string node_id = 1; - * @return The bytes for nodeId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNodeIdBytes() { - java.lang.Object ref = nodeId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nodeId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METADATA_FIELD_NUMBER = 2; - private org.wso2.apk.enforcer.discovery.service.websocket.Metadata metadata_; - /** - *
-   * Ext_authz metadata
-   * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return metadata_ != null; - } - /** - *
-   * Ext_authz metadata
-   * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - * @return The metadata. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.Metadata getMetadata() { - return metadata_ == null ? org.wso2.apk.enforcer.discovery.service.websocket.Metadata.getDefaultInstance() : metadata_; - } - /** - *
-   * Ext_authz metadata
-   * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.MetadataOrBuilder getMetadataOrBuilder() { - return getMetadata(); - } - - public static final int FRAME_LENGTH_FIELD_NUMBER = 3; - private int frameLength_; - /** - *
-   * Web socket frame length
-   * 
- * - * int32 frame_length = 3; - * @return The frameLength. - */ - @java.lang.Override - public int getFrameLength() { - return frameLength_; - } - - public static final int REMOTE_IP_FIELD_NUMBER = 4; - private volatile java.lang.Object remoteIp_; - /** - *
-   * IP address of upstream service
-   * 
- * - * string remote_ip = 4; - * @return The remoteIp. - */ - @java.lang.Override - public java.lang.String getRemoteIp() { - java.lang.Object ref = remoteIp_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - remoteIp_ = s; - return s; - } - } - /** - *
-   * IP address of upstream service
-   * 
- * - * string remote_ip = 4; - * @return The bytes for remoteIp. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRemoteIpBytes() { - java.lang.Object ref = remoteIp_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - remoteIp_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAYLOAD_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString payload_; - /** - * bytes payload = 5; - * @return The payload. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPayload() { - return payload_; - } - - public static final int DIRECTION_FIELD_NUMBER = 6; - private int direction_; - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @return The enum numeric value on the wire for direction. - */ - @java.lang.Override public int getDirectionValue() { - return direction_; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @return The direction. - */ - @java.lang.Override public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection getDirection() { - @SuppressWarnings("deprecation") - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection result = org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection.valueOf(direction_); - return result == null ? org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection.UNRECOGNIZED : result; - } - - public static final int APIM_ERROR_CODE_FIELD_NUMBER = 7; - private int apimErrorCode_; - /** - * int32 apim_error_code = 7; - * @return The apimErrorCode. - */ - @java.lang.Override - public int getApimErrorCode() { - return apimErrorCode_; - } - - 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 (!getNodeIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, nodeId_); - } - if (metadata_ != null) { - output.writeMessage(2, getMetadata()); - } - if (frameLength_ != 0) { - output.writeInt32(3, frameLength_); - } - if (!getRemoteIpBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, remoteIp_); - } - if (!payload_.isEmpty()) { - output.writeBytes(5, payload_); - } - if (direction_ != org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection.PUBLISH.getNumber()) { - output.writeEnum(6, direction_); - } - if (apimErrorCode_ != 0) { - output.writeInt32(7, apimErrorCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNodeIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, nodeId_); - } - if (metadata_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getMetadata()); - } - if (frameLength_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, frameLength_); - } - if (!getRemoteIpBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, remoteIp_); - } - if (!payload_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, payload_); - } - if (direction_ != org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection.PUBLISH.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, direction_); - } - if (apimErrorCode_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, apimErrorCode_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest other = (org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest) obj; - - if (!getNodeId() - .equals(other.getNodeId())) return false; - if (hasMetadata() != other.hasMetadata()) return false; - if (hasMetadata()) { - if (!getMetadata() - .equals(other.getMetadata())) return false; - } - if (getFrameLength() - != other.getFrameLength()) return false; - if (!getRemoteIp() - .equals(other.getRemoteIp())) return false; - if (!getPayload() - .equals(other.getPayload())) return false; - if (direction_ != other.direction_) return false; - if (getApimErrorCode() - != other.getApimErrorCode()) 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) + NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getNodeId().hashCode(); - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - hash = (37 * hash) + FRAME_LENGTH_FIELD_NUMBER; - hash = (53 * hash) + getFrameLength(); - hash = (37 * hash) + REMOTE_IP_FIELD_NUMBER; - hash = (53 * hash) + getRemoteIp().hashCode(); - hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; - hash = (53 * hash) + getPayload().hashCode(); - hash = (37 * hash) + DIRECTION_FIELD_NUMBER; - hash = (53 * hash) + direction_; - hash = (37 * hash) + APIM_ERROR_CODE_FIELD_NUMBER; - hash = (53 * hash) + getApimErrorCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest) - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.class, org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.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(); - nodeId_ = ""; - - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; - metadataBuilder_ = null; - } - frameLength_ = 0; - - remoteIp_ = ""; - - payload_ = com.google.protobuf.ByteString.EMPTY; - - direction_ = 0; - - apimErrorCode_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameRequest_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest build() { - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest buildPartial() { - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest result = new org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest(this); - result.nodeId_ = nodeId_; - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - result.frameLength_ = frameLength_; - result.remoteIp_ = remoteIp_; - result.payload_ = payload_; - result.direction_ = direction_; - result.apimErrorCode_ = apimErrorCode_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest other) { - if (other == org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.getDefaultInstance()) return this; - if (!other.getNodeId().isEmpty()) { - nodeId_ = other.nodeId_; - onChanged(); - } - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (other.getFrameLength() != 0) { - setFrameLength(other.getFrameLength()); - } - if (!other.getRemoteIp().isEmpty()) { - remoteIp_ = other.remoteIp_; - onChanged(); - } - if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { - setPayload(other.getPayload()); - } - if (other.direction_ != 0) { - setDirectionValue(other.getDirectionValue()); - } - if (other.getApimErrorCode() != 0) { - setApimErrorCode(other.getApimErrorCode()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object nodeId_ = ""; - /** - *
-     * Unique Id / label of the router
-     * 
- * - * string node_id = 1; - * @return The nodeId. - */ - public java.lang.String getNodeId() { - java.lang.Object ref = nodeId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nodeId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Unique Id / label of the router
-     * 
- * - * string node_id = 1; - * @return The bytes for nodeId. - */ - public com.google.protobuf.ByteString - getNodeIdBytes() { - java.lang.Object ref = nodeId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nodeId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Unique Id / label of the router
-     * 
- * - * string node_id = 1; - * @param value The nodeId to set. - * @return This builder for chaining. - */ - public Builder setNodeId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nodeId_ = value; - onChanged(); - return this; - } - /** - *
-     * Unique Id / label of the router
-     * 
- * - * string node_id = 1; - * @return This builder for chaining. - */ - public Builder clearNodeId() { - - nodeId_ = getDefaultInstance().getNodeId(); - onChanged(); - return this; - } - /** - *
-     * Unique Id / label of the router
-     * 
- * - * string node_id = 1; - * @param value The bytes for nodeId to set. - * @return This builder for chaining. - */ - public Builder setNodeIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nodeId_ = value; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.service.websocket.Metadata metadata_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.websocket.Metadata, org.wso2.apk.enforcer.discovery.service.websocket.Metadata.Builder, org.wso2.apk.enforcer.discovery.service.websocket.MetadataOrBuilder> metadataBuilder_; - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - * @return Whether the metadata field is set. - */ - public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; - } - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - * @return The metadata. - */ - public org.wso2.apk.enforcer.discovery.service.websocket.Metadata getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null ? org.wso2.apk.enforcer.discovery.service.websocket.Metadata.getDefaultInstance() : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - public Builder setMetadata(org.wso2.apk.enforcer.discovery.service.websocket.Metadata value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - public Builder setMetadata( - org.wso2.apk.enforcer.discovery.service.websocket.Metadata.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - public Builder mergeMetadata(org.wso2.apk.enforcer.discovery.service.websocket.Metadata value) { - if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - org.wso2.apk.enforcer.discovery.service.websocket.Metadata.newBuilder(metadata_).mergeFrom(value).buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; - metadataBuilder_ = null; - } - - return this; - } - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - public org.wso2.apk.enforcer.discovery.service.websocket.Metadata.Builder getMetadataBuilder() { - - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - public org.wso2.apk.enforcer.discovery.service.websocket.MetadataOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null ? - org.wso2.apk.enforcer.discovery.service.websocket.Metadata.getDefaultInstance() : metadata_; - } - } - /** - *
-     * Ext_authz metadata
-     * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.websocket.Metadata, org.wso2.apk.enforcer.discovery.service.websocket.Metadata.Builder, org.wso2.apk.enforcer.discovery.service.websocket.MetadataOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.service.websocket.Metadata, org.wso2.apk.enforcer.discovery.service.websocket.Metadata.Builder, org.wso2.apk.enforcer.discovery.service.websocket.MetadataOrBuilder>( - getMetadata(), - getParentForChildren(), - isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private int frameLength_ ; - /** - *
-     * Web socket frame length
-     * 
- * - * int32 frame_length = 3; - * @return The frameLength. - */ - @java.lang.Override - public int getFrameLength() { - return frameLength_; - } - /** - *
-     * Web socket frame length
-     * 
- * - * int32 frame_length = 3; - * @param value The frameLength to set. - * @return This builder for chaining. - */ - public Builder setFrameLength(int value) { - - frameLength_ = value; - onChanged(); - return this; - } - /** - *
-     * Web socket frame length
-     * 
- * - * int32 frame_length = 3; - * @return This builder for chaining. - */ - public Builder clearFrameLength() { - - frameLength_ = 0; - onChanged(); - return this; - } - - private java.lang.Object remoteIp_ = ""; - /** - *
-     * IP address of upstream service
-     * 
- * - * string remote_ip = 4; - * @return The remoteIp. - */ - public java.lang.String getRemoteIp() { - java.lang.Object ref = remoteIp_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - remoteIp_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * IP address of upstream service
-     * 
- * - * string remote_ip = 4; - * @return The bytes for remoteIp. - */ - public com.google.protobuf.ByteString - getRemoteIpBytes() { - java.lang.Object ref = remoteIp_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - remoteIp_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * IP address of upstream service
-     * 
- * - * string remote_ip = 4; - * @param value The remoteIp to set. - * @return This builder for chaining. - */ - public Builder setRemoteIp( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - remoteIp_ = value; - onChanged(); - return this; - } - /** - *
-     * IP address of upstream service
-     * 
- * - * string remote_ip = 4; - * @return This builder for chaining. - */ - public Builder clearRemoteIp() { - - remoteIp_ = getDefaultInstance().getRemoteIp(); - onChanged(); - return this; - } - /** - *
-     * IP address of upstream service
-     * 
- * - * string remote_ip = 4; - * @param value The bytes for remoteIp to set. - * @return This builder for chaining. - */ - public Builder setRemoteIpBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - remoteIp_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes payload = 5; - * @return The payload. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPayload() { - return payload_; - } - /** - * bytes payload = 5; - * @param value The payload to set. - * @return This builder for chaining. - */ - public Builder setPayload(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - payload_ = value; - onChanged(); - return this; - } - /** - * bytes payload = 5; - * @return This builder for chaining. - */ - public Builder clearPayload() { - - payload_ = getDefaultInstance().getPayload(); - onChanged(); - return this; - } - - private int direction_ = 0; - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @return The enum numeric value on the wire for direction. - */ - @java.lang.Override public int getDirectionValue() { - return direction_; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @param value The enum numeric value on the wire for direction to set. - * @return This builder for chaining. - */ - public Builder setDirectionValue(int value) { - - direction_ = value; - onChanged(); - return this; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @return The direction. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection getDirection() { - @SuppressWarnings("deprecation") - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection result = org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection.valueOf(direction_); - return result == null ? org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection.UNRECOGNIZED : result; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @param value The direction to set. - * @return This builder for chaining. - */ - public Builder setDirection(org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection value) { - if (value == null) { - throw new NullPointerException(); - } - - direction_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @return This builder for chaining. - */ - public Builder clearDirection() { - - direction_ = 0; - onChanged(); - return this; - } - - private int apimErrorCode_ ; - /** - * int32 apim_error_code = 7; - * @return The apimErrorCode. - */ - @java.lang.Override - public int getApimErrorCode() { - return apimErrorCode_; - } - /** - * int32 apim_error_code = 7; - * @param value The apimErrorCode to set. - * @return This builder for chaining. - */ - public Builder setApimErrorCode(int value) { - - apimErrorCode_ = value; - onChanged(); - return this; - } - /** - * int32 apim_error_code = 7; - * @return This builder for chaining. - */ - public Builder clearApimErrorCode() { - - apimErrorCode_ = 0; - 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:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest) - } - - // @@protoc_insertion_point(class_scope:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest) - private static final org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest(); - } - - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WebSocketFrameRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WebSocketFrameRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameRequestOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameRequestOrBuilder.java deleted file mode 100644 index 534efad024..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameRequestOrBuilder.java +++ /dev/null @@ -1,109 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/websocket/frame_service.proto - -package org.wso2.apk.enforcer.discovery.service.websocket; - -public interface WebSocketFrameRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Unique Id / label of the router
-   * 
- * - * string node_id = 1; - * @return The nodeId. - */ - java.lang.String getNodeId(); - /** - *
-   * Unique Id / label of the router
-   * 
- * - * string node_id = 1; - * @return The bytes for nodeId. - */ - com.google.protobuf.ByteString - getNodeIdBytes(); - - /** - *
-   * Ext_authz metadata
-   * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - * @return Whether the metadata field is set. - */ - boolean hasMetadata(); - /** - *
-   * Ext_authz metadata
-   * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - * @return The metadata. - */ - org.wso2.apk.enforcer.discovery.service.websocket.Metadata getMetadata(); - /** - *
-   * Ext_authz metadata
-   * 
- * - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.Metadata metadata = 2; - */ - org.wso2.apk.enforcer.discovery.service.websocket.MetadataOrBuilder getMetadataOrBuilder(); - - /** - *
-   * Web socket frame length
-   * 
- * - * int32 frame_length = 3; - * @return The frameLength. - */ - int getFrameLength(); - - /** - *
-   * IP address of upstream service
-   * 
- * - * string remote_ip = 4; - * @return The remoteIp. - */ - java.lang.String getRemoteIp(); - /** - *
-   * IP address of upstream service
-   * 
- * - * string remote_ip = 4; - * @return The bytes for remoteIp. - */ - com.google.protobuf.ByteString - getRemoteIpBytes(); - - /** - * bytes payload = 5; - * @return The payload. - */ - com.google.protobuf.ByteString getPayload(); - - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @return The enum numeric value on the wire for direction. - */ - int getDirectionValue(); - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameRequest.MessageDirection direction = 6; - * @return The direction. - */ - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.MessageDirection getDirection(); - - /** - * int32 apim_error_code = 7; - * @return The apimErrorCode. - */ - int getApimErrorCode(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameResponse.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameResponse.java deleted file mode 100644 index e332c693b8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameResponse.java +++ /dev/null @@ -1,785 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/websocket/frame_service.proto - -package org.wso2.apk.enforcer.discovery.service.websocket; - -/** - * Protobuf type {@code envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse} - */ -public final class WebSocketFrameResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse) - WebSocketFrameResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use WebSocketFrameResponse.newBuilder() to construct. - private WebSocketFrameResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WebSocketFrameResponse() { - throttleState_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WebSocketFrameResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WebSocketFrameResponse( - 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: { - int rawValue = input.readEnum(); - - throttleState_ = rawValue; - break; - } - case 16: { - - throttlePeriod_ = input.readInt64(); - break; - } - case 24: { - - apimErrorCode_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.class, org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Builder.class); - } - - /** - * Protobuf enum {@code envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code} - */ - public enum Code - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * The response code is not known.
-     * 
- * - * UNKNOWN = 0; - */ - UNKNOWN(0), - /** - *
-     * The response code to notify that the number of requests are under limit.
-     * 
- * - * OK = 1; - */ - OK(1), - /** - *
-     * The response code to notify that the number of requests are over limit.
-     * 
- * - * OVER_LIMIT = 2; - */ - OVER_LIMIT(2), - UNRECOGNIZED(-1), - ; - - /** - *
-     * The response code is not known.
-     * 
- * - * UNKNOWN = 0; - */ - public static final int UNKNOWN_VALUE = 0; - /** - *
-     * The response code to notify that the number of requests are under limit.
-     * 
- * - * OK = 1; - */ - public static final int OK_VALUE = 1; - /** - *
-     * The response code to notify that the number of requests are over limit.
-     * 
- * - * OVER_LIMIT = 2; - */ - public static final int OVER_LIMIT_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Code valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static Code forNumber(int value) { - switch (value) { - case 0: return UNKNOWN; - case 1: return OK; - case 2: return OVER_LIMIT; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Code> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Code findValueByNumber(int number) { - return Code.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.getDescriptor().getEnumTypes().get(0); - } - - private static final Code[] VALUES = values(); - - public static Code valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private Code(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code) - } - - public static final int THROTTLE_STATE_FIELD_NUMBER = 1; - private int throttleState_; - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @return The enum numeric value on the wire for throttleState. - */ - @java.lang.Override public int getThrottleStateValue() { - return throttleState_; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @return The throttleState. - */ - @java.lang.Override public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code getThrottleState() { - @SuppressWarnings("deprecation") - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code result = org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code.valueOf(throttleState_); - return result == null ? org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code.UNRECOGNIZED : result; - } - - public static final int THROTTLE_PERIOD_FIELD_NUMBER = 2; - private long throttlePeriod_; - /** - * int64 throttle_period = 2; - * @return The throttlePeriod. - */ - @java.lang.Override - public long getThrottlePeriod() { - return throttlePeriod_; - } - - public static final int APIM_ERROR_CODE_FIELD_NUMBER = 3; - private int apimErrorCode_; - /** - * int32 apim_error_code = 3; - * @return The apimErrorCode. - */ - @java.lang.Override - public int getApimErrorCode() { - return apimErrorCode_; - } - - 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 (throttleState_ != org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code.UNKNOWN.getNumber()) { - output.writeEnum(1, throttleState_); - } - if (throttlePeriod_ != 0L) { - output.writeInt64(2, throttlePeriod_); - } - if (apimErrorCode_ != 0) { - output.writeInt32(3, apimErrorCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (throttleState_ != org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code.UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, throttleState_); - } - if (throttlePeriod_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, throttlePeriod_); - } - if (apimErrorCode_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, apimErrorCode_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse other = (org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse) obj; - - if (throttleState_ != other.throttleState_) return false; - if (getThrottlePeriod() - != other.getThrottlePeriod()) return false; - if (getApimErrorCode() - != other.getApimErrorCode()) 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) + THROTTLE_STATE_FIELD_NUMBER; - hash = (53 * hash) + throttleState_; - hash = (37 * hash) + THROTTLE_PERIOD_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getThrottlePeriod()); - hash = (37 * hash) + APIM_ERROR_CODE_FIELD_NUMBER; - hash = (53 * hash) + getApimErrorCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse) - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.class, org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.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(); - throttleState_ = 0; - - throttlePeriod_ = 0L; - - apimErrorCode_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.internal_static_envoy_extensions_filters_http_mgw_wasm_websocket_v3_WebSocketFrameResponse_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse build() { - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse buildPartial() { - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse result = new org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse(this); - result.throttleState_ = throttleState_; - result.throttlePeriod_ = throttlePeriod_; - result.apimErrorCode_ = apimErrorCode_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse) { - return mergeFrom((org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse other) { - if (other == org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.getDefaultInstance()) return this; - if (other.throttleState_ != 0) { - setThrottleStateValue(other.getThrottleStateValue()); - } - if (other.getThrottlePeriod() != 0L) { - setThrottlePeriod(other.getThrottlePeriod()); - } - if (other.getApimErrorCode() != 0) { - setApimErrorCode(other.getApimErrorCode()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int throttleState_ = 0; - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @return The enum numeric value on the wire for throttleState. - */ - @java.lang.Override public int getThrottleStateValue() { - return throttleState_; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @param value The enum numeric value on the wire for throttleState to set. - * @return This builder for chaining. - */ - public Builder setThrottleStateValue(int value) { - - throttleState_ = value; - onChanged(); - return this; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @return The throttleState. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code getThrottleState() { - @SuppressWarnings("deprecation") - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code result = org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code.valueOf(throttleState_); - return result == null ? org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code.UNRECOGNIZED : result; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @param value The throttleState to set. - * @return This builder for chaining. - */ - public Builder setThrottleState(org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code value) { - if (value == null) { - throw new NullPointerException(); - } - - throttleState_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @return This builder for chaining. - */ - public Builder clearThrottleState() { - - throttleState_ = 0; - onChanged(); - return this; - } - - private long throttlePeriod_ ; - /** - * int64 throttle_period = 2; - * @return The throttlePeriod. - */ - @java.lang.Override - public long getThrottlePeriod() { - return throttlePeriod_; - } - /** - * int64 throttle_period = 2; - * @param value The throttlePeriod to set. - * @return This builder for chaining. - */ - public Builder setThrottlePeriod(long value) { - - throttlePeriod_ = value; - onChanged(); - return this; - } - /** - * int64 throttle_period = 2; - * @return This builder for chaining. - */ - public Builder clearThrottlePeriod() { - - throttlePeriod_ = 0L; - onChanged(); - return this; - } - - private int apimErrorCode_ ; - /** - * int32 apim_error_code = 3; - * @return The apimErrorCode. - */ - @java.lang.Override - public int getApimErrorCode() { - return apimErrorCode_; - } - /** - * int32 apim_error_code = 3; - * @param value The apimErrorCode to set. - * @return This builder for chaining. - */ - public Builder setApimErrorCode(int value) { - - apimErrorCode_ = value; - onChanged(); - return this; - } - /** - * int32 apim_error_code = 3; - * @return This builder for chaining. - */ - public Builder clearApimErrorCode() { - - apimErrorCode_ = 0; - 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:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse) - } - - // @@protoc_insertion_point(class_scope:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse) - private static final org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse(); - } - - public static org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WebSocketFrameResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WebSocketFrameResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameResponseOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameResponseOrBuilder.java deleted file mode 100644 index 5670b12816..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameResponseOrBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/service/websocket/frame_service.proto - -package org.wso2.apk.enforcer.discovery.service.websocket; - -public interface WebSocketFrameResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @return The enum numeric value on the wire for throttleState. - */ - int getThrottleStateValue(); - /** - * .envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameResponse.Code throttle_state = 1; - * @return The throttleState. - */ - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.Code getThrottleState(); - - /** - * int64 throttle_period = 2; - * @return The throttlePeriod. - */ - long getThrottlePeriod(); - - /** - * int32 apim_error_code = 3; - * @return The apimErrorCode. - */ - int getApimErrorCode(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameServiceGrpc.java deleted file mode 100644 index c7695433f0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/websocket/WebSocketFrameServiceGrpc.java +++ /dev/null @@ -1,287 +0,0 @@ -package org.wso2.apk.enforcer.discovery.service.websocket; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - *
- * [#protodoc-title: WebSocketFrameService]
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: wso2/discovery/service/websocket/frame_service.proto") -public final class WebSocketFrameServiceGrpc { - - private WebSocketFrameServiceGrpc() {} - - public static final String SERVICE_NAME = "envoy.extensions.filters.http.mgw_wasm_websocket.v3.WebSocketFrameService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getPublishFrameDataMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PublishFrameData", - requestType = org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.class, - responseType = org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getPublishFrameDataMethod() { - io.grpc.MethodDescriptor getPublishFrameDataMethod; - if ((getPublishFrameDataMethod = WebSocketFrameServiceGrpc.getPublishFrameDataMethod) == null) { - synchronized (WebSocketFrameServiceGrpc.class) { - if ((getPublishFrameDataMethod = WebSocketFrameServiceGrpc.getPublishFrameDataMethod) == null) { - WebSocketFrameServiceGrpc.getPublishFrameDataMethod = getPublishFrameDataMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PublishFrameData")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse.getDefaultInstance())) - .setSchemaDescriptor(new WebSocketFrameServiceMethodDescriptorSupplier("PublishFrameData")) - .build(); - } - } - } - return getPublishFrameDataMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static WebSocketFrameServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public WebSocketFrameServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new WebSocketFrameServiceStub(channel, callOptions); - } - }; - return WebSocketFrameServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static WebSocketFrameServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public WebSocketFrameServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new WebSocketFrameServiceBlockingStub(channel, callOptions); - } - }; - return WebSocketFrameServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static WebSocketFrameServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public WebSocketFrameServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new WebSocketFrameServiceFutureStub(channel, callOptions); - } - }; - return WebSocketFrameServiceFutureStub.newStub(factory, channel); - } - - /** - *
-   * [#protodoc-title: WebSocketFrameService]
-   * 
- */ - public static abstract class WebSocketFrameServiceImplBase implements io.grpc.BindableService { - - /** - */ - public io.grpc.stub.StreamObserver publishFrameData( - io.grpc.stub.StreamObserver responseObserver) { - return asyncUnimplementedStreamingCall(getPublishFrameDataMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getPublishFrameDataMethod(), - asyncBidiStreamingCall( - new MethodHandlers< - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest, - org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse>( - this, METHODID_PUBLISH_FRAME_DATA))) - .build(); - } - } - - /** - *
-   * [#protodoc-title: WebSocketFrameService]
-   * 
- */ - public static final class WebSocketFrameServiceStub extends io.grpc.stub.AbstractAsyncStub { - private WebSocketFrameServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected WebSocketFrameServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new WebSocketFrameServiceStub(channel, callOptions); - } - - /** - */ - public io.grpc.stub.StreamObserver publishFrameData( - io.grpc.stub.StreamObserver responseObserver) { - return asyncBidiStreamingCall( - getChannel().newCall(getPublishFrameDataMethod(), getCallOptions()), responseObserver); - } - } - - /** - *
-   * [#protodoc-title: WebSocketFrameService]
-   * 
- */ - public static final class WebSocketFrameServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private WebSocketFrameServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected WebSocketFrameServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new WebSocketFrameServiceBlockingStub(channel, callOptions); - } - } - - /** - *
-   * [#protodoc-title: WebSocketFrameService]
-   * 
- */ - public static final class WebSocketFrameServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private WebSocketFrameServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected WebSocketFrameServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new WebSocketFrameServiceFutureStub(channel, callOptions); - } - } - - private static final int METHODID_PUBLISH_FRAME_DATA = 0; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final WebSocketFrameServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(WebSocketFrameServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_PUBLISH_FRAME_DATA: - return (io.grpc.stub.StreamObserver) serviceImpl.publishFrameData( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class WebSocketFrameServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - WebSocketFrameServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return org.wso2.apk.enforcer.discovery.service.websocket.MgwWebSocketProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("WebSocketFrameService"); - } - } - - private static final class WebSocketFrameServiceFileDescriptorSupplier - extends WebSocketFrameServiceBaseDescriptorSupplier { - WebSocketFrameServiceFileDescriptorSupplier() {} - } - - private static final class WebSocketFrameServiceMethodDescriptorSupplier - extends WebSocketFrameServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - WebSocketFrameServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (WebSocketFrameServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new WebSocketFrameServiceFileDescriptorSupplier()) - .addMethod(getPublishFrameDataMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Application.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Application.java deleted file mode 100644 index 48b681eaa4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Application.java +++ /dev/null @@ -1,1265 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * Application data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.Application} - */ -public final class Application extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.Application) - ApplicationOrBuilder { -private static final long serialVersionUID = 0L; - // Use Application.newBuilder() to construct. - private Application(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Application() { - uuid_ = ""; - name_ = ""; - owner_ = ""; - organization_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Application(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Application( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - owner_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - organization_ = s; - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - attributes_ = com.google.protobuf.MapField.newMapField( - AttributesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - attributes__ = input.readMessage( - AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attributes_.getMutableMap().put( - attributes__.getKey(), attributes__.getValue()); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Application_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 5: - return internalGetAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Application_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Application.class, org.wso2.apk.enforcer.discovery.subscription.Application.Builder.class); - } - - public static final int UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object uuid_; - /** - * string uuid = 1; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - * string name = 2; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 2; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OWNER_FIELD_NUMBER = 3; - private volatile java.lang.Object owner_; - /** - * string owner = 3; - * @return The owner. - */ - @java.lang.Override - public java.lang.String getOwner() { - java.lang.Object ref = owner_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - owner_ = s; - return s; - } - } - /** - * string owner = 3; - * @return The bytes for owner. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOwnerBytes() { - java.lang.Object ref = owner_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - owner_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATION_FIELD_NUMBER = 4; - private volatile java.lang.Object organization_; - /** - * string organization = 4; - * @return The organization. - */ - @java.lang.Override - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } - } - /** - * string organization = 4; - * @return The bytes for organization. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ATTRIBUTES_FIELD_NUMBER = 5; - private static final class AttributesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Application_AttributesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> attributes_; - private com.google.protobuf.MapField - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * map<string, string> attributes = 5; - */ - - @java.lang.Override - public boolean containsAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttributes().getMap().containsKey(key); - } - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * map<string, string> attributes = 5; - */ - @java.lang.Override - - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * map<string, string> attributes = 5; - */ - @java.lang.Override - - public java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> attributes = 5; - */ - @java.lang.Override - - public java.lang.String getAttributesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (!getOwnerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, owner_); - } - if (!getOrganizationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, organization_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttributes(), - AttributesDefaultEntryHolder.defaultEntry, - 5); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (!getOwnerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, owner_); - } - if (!getOrganizationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, organization_); - } - for (java.util.Map.Entry entry - : internalGetAttributes().getMap().entrySet()) { - com.google.protobuf.MapEntry - attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, attributes__); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.Application)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.Application other = (org.wso2.apk.enforcer.discovery.subscription.Application) obj; - - if (!getUuid() - .equals(other.getUuid())) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getOwner() - .equals(other.getOwner())) return false; - if (!getOrganization() - .equals(other.getOrganization())) return false; - if (!internalGetAttributes().equals( - other.internalGetAttributes())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + OWNER_FIELD_NUMBER; - hash = (53 * hash) + getOwner().hashCode(); - hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; - hash = (53 * hash) + getOrganization().hashCode(); - if (!internalGetAttributes().getMap().isEmpty()) { - hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttributes().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Application parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.Application 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; - } - /** - *
-   * Application data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.Application} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.Application) - org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Application_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 5: - return internalGetAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 5: - return internalGetMutableAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Application_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Application.class, org.wso2.apk.enforcer.discovery.subscription.Application.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.Application.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - uuid_ = ""; - - name_ = ""; - - owner_ = ""; - - organization_ = ""; - - internalGetMutableAttributes().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Application_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Application getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Application build() { - org.wso2.apk.enforcer.discovery.subscription.Application result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Application buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.Application result = new org.wso2.apk.enforcer.discovery.subscription.Application(this); - int from_bitField0_ = bitField0_; - result.uuid_ = uuid_; - result.name_ = name_; - result.owner_ = owner_; - result.organization_ = organization_; - result.attributes_ = internalGetAttributes(); - result.attributes_.makeImmutable(); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.Application) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.Application)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.Application other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance()) return this; - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getOwner().isEmpty()) { - owner_ = other.owner_; - onChanged(); - } - if (!other.getOrganization().isEmpty()) { - organization_ = other.organization_; - onChanged(); - } - internalGetMutableAttributes().mergeFrom( - other.internalGetAttributes()); - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.Application parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.Application) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 1; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 1; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 1; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 1; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 2; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 2; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 2; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 2; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 2; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object owner_ = ""; - /** - * string owner = 3; - * @return The owner. - */ - public java.lang.String getOwner() { - java.lang.Object ref = owner_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - owner_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string owner = 3; - * @return The bytes for owner. - */ - public com.google.protobuf.ByteString - getOwnerBytes() { - java.lang.Object ref = owner_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - owner_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string owner = 3; - * @param value The owner to set. - * @return This builder for chaining. - */ - public Builder setOwner( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - owner_ = value; - onChanged(); - return this; - } - /** - * string owner = 3; - * @return This builder for chaining. - */ - public Builder clearOwner() { - - owner_ = getDefaultInstance().getOwner(); - onChanged(); - return this; - } - /** - * string owner = 3; - * @param value The bytes for owner to set. - * @return This builder for chaining. - */ - public Builder setOwnerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - owner_ = value; - onChanged(); - return this; - } - - private java.lang.Object organization_ = ""; - /** - * string organization = 4; - * @return The organization. - */ - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organization = 4; - * @return The bytes for organization. - */ - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organization = 4; - * @param value The organization to set. - * @return This builder for chaining. - */ - public Builder setOrganization( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organization_ = value; - onChanged(); - return this; - } - /** - * string organization = 4; - * @return This builder for chaining. - */ - public Builder clearOrganization() { - - organization_ = getDefaultInstance().getOrganization(); - onChanged(); - return this; - } - /** - * string organization = 4; - * @param value The bytes for organization to set. - * @return This builder for chaining. - */ - public Builder setOrganizationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organization_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> attributes_; - private com.google.protobuf.MapField - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - private com.google.protobuf.MapField - internalGetMutableAttributes() { - onChanged();; - if (attributes_ == null) { - attributes_ = com.google.protobuf.MapField.newMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - if (!attributes_.isMutable()) { - attributes_ = attributes_.copy(); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * map<string, string> attributes = 5; - */ - - @java.lang.Override - public boolean containsAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttributes().getMap().containsKey(key); - } - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * map<string, string> attributes = 5; - */ - @java.lang.Override - - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * map<string, string> attributes = 5; - */ - @java.lang.Override - - public java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> attributes = 5; - */ - @java.lang.Override - - public java.lang.String getAttributesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttributes() { - internalGetMutableAttributes().getMutableMap() - .clear(); - return this; - } - /** - * map<string, string> attributes = 5; - */ - - public Builder removeAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttributes().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAttributes() { - return internalGetMutableAttributes().getMutableMap(); - } - /** - * map<string, string> attributes = 5; - */ - public Builder putAttributes( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttributes().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, string> attributes = 5; - */ - - public Builder putAllAttributes( - java.util.Map values) { - internalGetMutableAttributes().getMutableMap() - .putAll(values); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.Application) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.Application) - private static final org.wso2.apk.enforcer.discovery.subscription.Application DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.Application(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.Application getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Application parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Application(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Application getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMapping.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMapping.java deleted file mode 100644 index ef351e1d1a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMapping.java +++ /dev/null @@ -1,1320 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationKeyMapping data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationKeyMapping} - */ -public final class ApplicationKeyMapping extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationKeyMapping) - ApplicationKeyMappingOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationKeyMapping.newBuilder() to construct. - private ApplicationKeyMapping(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationKeyMapping() { - applicationUUID_ = ""; - securityScheme_ = ""; - applicationIdentifier_ = ""; - keyType_ = ""; - envID_ = ""; - organization_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationKeyMapping(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationKeyMapping( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - applicationUUID_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - securityScheme_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - applicationIdentifier_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - keyType_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - envID_ = s; - break; - } - case 48: { - - timestamp_ = input.readInt64(); - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - organization_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.internal_static_wso2_discovery_subscription_ApplicationKeyMapping_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.internal_static_wso2_discovery_subscription_ApplicationKeyMapping_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder.class); - } - - public static final int APPLICATIONUUID_FIELD_NUMBER = 1; - private volatile java.lang.Object applicationUUID_; - /** - * string applicationUUID = 1; - * @return The applicationUUID. - */ - @java.lang.Override - public java.lang.String getApplicationUUID() { - java.lang.Object ref = applicationUUID_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationUUID_ = s; - return s; - } - } - /** - * string applicationUUID = 1; - * @return The bytes for applicationUUID. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationUUIDBytes() { - java.lang.Object ref = applicationUUID_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationUUID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SECURITYSCHEME_FIELD_NUMBER = 2; - private volatile java.lang.Object securityScheme_; - /** - * string securityScheme = 2; - * @return The securityScheme. - */ - @java.lang.Override - public java.lang.String getSecurityScheme() { - java.lang.Object ref = securityScheme_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - securityScheme_ = s; - return s; - } - } - /** - * string securityScheme = 2; - * @return The bytes for securityScheme. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSecuritySchemeBytes() { - java.lang.Object ref = securityScheme_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - securityScheme_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APPLICATIONIDENTIFIER_FIELD_NUMBER = 3; - private volatile java.lang.Object applicationIdentifier_; - /** - * string applicationIdentifier = 3; - * @return The applicationIdentifier. - */ - @java.lang.Override - public java.lang.String getApplicationIdentifier() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationIdentifier_ = s; - return s; - } - } - /** - * string applicationIdentifier = 3; - * @return The bytes for applicationIdentifier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationIdentifierBytes() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEYTYPE_FIELD_NUMBER = 4; - private volatile java.lang.Object keyType_; - /** - * string keyType = 4; - * @return The keyType. - */ - @java.lang.Override - public java.lang.String getKeyType() { - java.lang.Object ref = keyType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyType_ = s; - return s; - } - } - /** - * string keyType = 4; - * @return The bytes for keyType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyTypeBytes() { - java.lang.Object ref = keyType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - keyType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENVID_FIELD_NUMBER = 5; - private volatile java.lang.Object envID_; - /** - * string envID = 5; - * @return The envID. - */ - @java.lang.Override - public java.lang.String getEnvID() { - java.lang.Object ref = envID_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - envID_ = s; - return s; - } - } - /** - * string envID = 5; - * @return The bytes for envID. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEnvIDBytes() { - java.lang.Object ref = envID_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - envID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 6; - private long timestamp_; - /** - * int64 timestamp = 6; - * @return The timestamp. - */ - @java.lang.Override - public long getTimestamp() { - return timestamp_; - } - - public static final int ORGANIZATION_FIELD_NUMBER = 7; - private volatile java.lang.Object organization_; - /** - * string organization = 7; - * @return The organization. - */ - @java.lang.Override - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } - } - /** - * string organization = 7; - * @return The bytes for organization. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getApplicationUUIDBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, applicationUUID_); - } - if (!getSecuritySchemeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, securityScheme_); - } - if (!getApplicationIdentifierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, applicationIdentifier_); - } - if (!getKeyTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, keyType_); - } - if (!getEnvIDBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, envID_); - } - if (timestamp_ != 0L) { - output.writeInt64(6, timestamp_); - } - if (!getOrganizationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, organization_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getApplicationUUIDBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, applicationUUID_); - } - if (!getSecuritySchemeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, securityScheme_); - } - if (!getApplicationIdentifierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, applicationIdentifier_); - } - if (!getKeyTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, keyType_); - } - if (!getEnvIDBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, envID_); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, timestamp_); - } - if (!getOrganizationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, organization_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping) obj; - - if (!getApplicationUUID() - .equals(other.getApplicationUUID())) return false; - if (!getSecurityScheme() - .equals(other.getSecurityScheme())) return false; - if (!getApplicationIdentifier() - .equals(other.getApplicationIdentifier())) return false; - if (!getKeyType() - .equals(other.getKeyType())) return false; - if (!getEnvID() - .equals(other.getEnvID())) return false; - if (getTimestamp() - != other.getTimestamp()) return false; - if (!getOrganization() - .equals(other.getOrganization())) 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) + APPLICATIONUUID_FIELD_NUMBER; - hash = (53 * hash) + getApplicationUUID().hashCode(); - hash = (37 * hash) + SECURITYSCHEME_FIELD_NUMBER; - hash = (53 * hash) + getSecurityScheme().hashCode(); - hash = (37 * hash) + APPLICATIONIDENTIFIER_FIELD_NUMBER; - hash = (53 * hash) + getApplicationIdentifier().hashCode(); - hash = (37 * hash) + KEYTYPE_FIELD_NUMBER; - hash = (53 * hash) + getKeyType().hashCode(); - hash = (37 * hash) + ENVID_FIELD_NUMBER; - hash = (53 * hash) + getEnvID().hashCode(); - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimestamp()); - hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; - hash = (53 * hash) + getOrganization().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping 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; - } - /** - *
-   * ApplicationKeyMapping data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationKeyMapping} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationKeyMapping) - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.internal_static_wso2_discovery_subscription_ApplicationKeyMapping_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.internal_static_wso2_discovery_subscription_ApplicationKeyMapping_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.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(); - applicationUUID_ = ""; - - securityScheme_ = ""; - - applicationIdentifier_ = ""; - - keyType_ = ""; - - envID_ = ""; - - timestamp_ = 0L; - - organization_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.internal_static_wso2_discovery_subscription_ApplicationKeyMapping_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping(this); - result.applicationUUID_ = applicationUUID_; - result.securityScheme_ = securityScheme_; - result.applicationIdentifier_ = applicationIdentifier_; - result.keyType_ = keyType_; - result.envID_ = envID_; - result.timestamp_ = timestamp_; - result.organization_ = organization_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance()) return this; - if (!other.getApplicationUUID().isEmpty()) { - applicationUUID_ = other.applicationUUID_; - onChanged(); - } - if (!other.getSecurityScheme().isEmpty()) { - securityScheme_ = other.securityScheme_; - onChanged(); - } - if (!other.getApplicationIdentifier().isEmpty()) { - applicationIdentifier_ = other.applicationIdentifier_; - onChanged(); - } - if (!other.getKeyType().isEmpty()) { - keyType_ = other.keyType_; - onChanged(); - } - if (!other.getEnvID().isEmpty()) { - envID_ = other.envID_; - onChanged(); - } - if (other.getTimestamp() != 0L) { - setTimestamp(other.getTimestamp()); - } - if (!other.getOrganization().isEmpty()) { - organization_ = other.organization_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object applicationUUID_ = ""; - /** - * string applicationUUID = 1; - * @return The applicationUUID. - */ - public java.lang.String getApplicationUUID() { - java.lang.Object ref = applicationUUID_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationUUID_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string applicationUUID = 1; - * @return The bytes for applicationUUID. - */ - public com.google.protobuf.ByteString - getApplicationUUIDBytes() { - java.lang.Object ref = applicationUUID_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationUUID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string applicationUUID = 1; - * @param value The applicationUUID to set. - * @return This builder for chaining. - */ - public Builder setApplicationUUID( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - applicationUUID_ = value; - onChanged(); - return this; - } - /** - * string applicationUUID = 1; - * @return This builder for chaining. - */ - public Builder clearApplicationUUID() { - - applicationUUID_ = getDefaultInstance().getApplicationUUID(); - onChanged(); - return this; - } - /** - * string applicationUUID = 1; - * @param value The bytes for applicationUUID to set. - * @return This builder for chaining. - */ - public Builder setApplicationUUIDBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - applicationUUID_ = value; - onChanged(); - return this; - } - - private java.lang.Object securityScheme_ = ""; - /** - * string securityScheme = 2; - * @return The securityScheme. - */ - public java.lang.String getSecurityScheme() { - java.lang.Object ref = securityScheme_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - securityScheme_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string securityScheme = 2; - * @return The bytes for securityScheme. - */ - public com.google.protobuf.ByteString - getSecuritySchemeBytes() { - java.lang.Object ref = securityScheme_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - securityScheme_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string securityScheme = 2; - * @param value The securityScheme to set. - * @return This builder for chaining. - */ - public Builder setSecurityScheme( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - securityScheme_ = value; - onChanged(); - return this; - } - /** - * string securityScheme = 2; - * @return This builder for chaining. - */ - public Builder clearSecurityScheme() { - - securityScheme_ = getDefaultInstance().getSecurityScheme(); - onChanged(); - return this; - } - /** - * string securityScheme = 2; - * @param value The bytes for securityScheme to set. - * @return This builder for chaining. - */ - public Builder setSecuritySchemeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - securityScheme_ = value; - onChanged(); - return this; - } - - private java.lang.Object applicationIdentifier_ = ""; - /** - * string applicationIdentifier = 3; - * @return The applicationIdentifier. - */ - public java.lang.String getApplicationIdentifier() { - java.lang.Object ref = applicationIdentifier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationIdentifier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string applicationIdentifier = 3; - * @return The bytes for applicationIdentifier. - */ - public com.google.protobuf.ByteString - getApplicationIdentifierBytes() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string applicationIdentifier = 3; - * @param value The applicationIdentifier to set. - * @return This builder for chaining. - */ - public Builder setApplicationIdentifier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - applicationIdentifier_ = value; - onChanged(); - return this; - } - /** - * string applicationIdentifier = 3; - * @return This builder for chaining. - */ - public Builder clearApplicationIdentifier() { - - applicationIdentifier_ = getDefaultInstance().getApplicationIdentifier(); - onChanged(); - return this; - } - /** - * string applicationIdentifier = 3; - * @param value The bytes for applicationIdentifier to set. - * @return This builder for chaining. - */ - public Builder setApplicationIdentifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - applicationIdentifier_ = value; - onChanged(); - return this; - } - - private java.lang.Object keyType_ = ""; - /** - * string keyType = 4; - * @return The keyType. - */ - public java.lang.String getKeyType() { - java.lang.Object ref = keyType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string keyType = 4; - * @return The bytes for keyType. - */ - public com.google.protobuf.ByteString - getKeyTypeBytes() { - java.lang.Object ref = keyType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - keyType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string keyType = 4; - * @param value The keyType to set. - * @return This builder for chaining. - */ - public Builder setKeyType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - keyType_ = value; - onChanged(); - return this; - } - /** - * string keyType = 4; - * @return This builder for chaining. - */ - public Builder clearKeyType() { - - keyType_ = getDefaultInstance().getKeyType(); - onChanged(); - return this; - } - /** - * string keyType = 4; - * @param value The bytes for keyType to set. - * @return This builder for chaining. - */ - public Builder setKeyTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - keyType_ = value; - onChanged(); - return this; - } - - private java.lang.Object envID_ = ""; - /** - * string envID = 5; - * @return The envID. - */ - public java.lang.String getEnvID() { - java.lang.Object ref = envID_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - envID_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string envID = 5; - * @return The bytes for envID. - */ - public com.google.protobuf.ByteString - getEnvIDBytes() { - java.lang.Object ref = envID_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - envID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string envID = 5; - * @param value The envID to set. - * @return This builder for chaining. - */ - public Builder setEnvID( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - envID_ = value; - onChanged(); - return this; - } - /** - * string envID = 5; - * @return This builder for chaining. - */ - public Builder clearEnvID() { - - envID_ = getDefaultInstance().getEnvID(); - onChanged(); - return this; - } - /** - * string envID = 5; - * @param value The bytes for envID to set. - * @return This builder for chaining. - */ - public Builder setEnvIDBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - envID_ = value; - onChanged(); - return this; - } - - private long timestamp_ ; - /** - * int64 timestamp = 6; - * @return The timestamp. - */ - @java.lang.Override - public long getTimestamp() { - return timestamp_; - } - /** - * int64 timestamp = 6; - * @param value The timestamp to set. - * @return This builder for chaining. - */ - public Builder setTimestamp(long value) { - - timestamp_ = value; - onChanged(); - return this; - } - /** - * int64 timestamp = 6; - * @return This builder for chaining. - */ - public Builder clearTimestamp() { - - timestamp_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object organization_ = ""; - /** - * string organization = 7; - * @return The organization. - */ - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organization = 7; - * @return The bytes for organization. - */ - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organization = 7; - * @param value The organization to set. - * @return This builder for chaining. - */ - public Builder setOrganization( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organization_ = value; - onChanged(); - return this; - } - /** - * string organization = 7; - * @return This builder for chaining. - */ - public Builder clearOrganization() { - - organization_ = getDefaultInstance().getOrganization(); - onChanged(); - return this; - } - /** - * string organization = 7; - * @param value The bytes for organization to set. - * @return This builder for chaining. - */ - public Builder setOrganizationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organization_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationKeyMapping) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationKeyMapping) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationKeyMapping parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationKeyMapping(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingOrBuilder.java deleted file mode 100644 index 86bb940b77..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingOrBuilder.java +++ /dev/null @@ -1,87 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationKeyMappingOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationKeyMapping) - com.google.protobuf.MessageOrBuilder { - - /** - * string applicationUUID = 1; - * @return The applicationUUID. - */ - java.lang.String getApplicationUUID(); - /** - * string applicationUUID = 1; - * @return The bytes for applicationUUID. - */ - com.google.protobuf.ByteString - getApplicationUUIDBytes(); - - /** - * string securityScheme = 2; - * @return The securityScheme. - */ - java.lang.String getSecurityScheme(); - /** - * string securityScheme = 2; - * @return The bytes for securityScheme. - */ - com.google.protobuf.ByteString - getSecuritySchemeBytes(); - - /** - * string applicationIdentifier = 3; - * @return The applicationIdentifier. - */ - java.lang.String getApplicationIdentifier(); - /** - * string applicationIdentifier = 3; - * @return The bytes for applicationIdentifier. - */ - com.google.protobuf.ByteString - getApplicationIdentifierBytes(); - - /** - * string keyType = 4; - * @return The keyType. - */ - java.lang.String getKeyType(); - /** - * string keyType = 4; - * @return The bytes for keyType. - */ - com.google.protobuf.ByteString - getKeyTypeBytes(); - - /** - * string envID = 5; - * @return The envID. - */ - java.lang.String getEnvID(); - /** - * string envID = 5; - * @return The bytes for envID. - */ - com.google.protobuf.ByteString - getEnvIDBytes(); - - /** - * int64 timestamp = 6; - * @return The timestamp. - */ - long getTimestamp(); - - /** - * string organization = 7; - * @return The organization. - */ - java.lang.String getOrganization(); - /** - * string organization = 7; - * @return The bytes for organization. - */ - com.google.protobuf.ByteString - getOrganizationBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingProto.java deleted file mode 100644 index 3091c2736f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingProto.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationKeyMappingProto { - private ApplicationKeyMappingProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationKeyMapping_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationKeyMapping_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n9wso2/discovery/subscription/applicatio" + - "n_key_mapping.proto\022\033wso2.discovery.subs" + - "cription\"\260\001\n\025ApplicationKeyMapping\022\027\n\017ap" + - "plicationUUID\030\001 \001(\t\022\026\n\016securityScheme\030\002 " + - "\001(\t\022\035\n\025applicationIdentifier\030\003 \001(\t\022\017\n\007ke" + - "yType\030\004 \001(\t\022\r\n\005envID\030\005 \001(\t\022\021\n\ttimestamp\030" + - "\006 \001(\003\022\024\n\014organization\030\007 \001(\tB\236\001\n,org.wso2" + - ".apk.enforcer.discovery.subscriptionB\032Ap" + - "plicationKeyMappingProtoP\001ZPgithub.com/w" + - "so2/apk/common-go-libs/pkg/discovery/api" + - "/wso2/discovery/subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_ApplicationKeyMapping_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationKeyMapping_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationKeyMapping_descriptor, - new java.lang.String[] { "ApplicationUUID", "SecurityScheme", "ApplicationIdentifier", "KeyType", "EnvID", "Timestamp", "Organization", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMapping.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMapping.java deleted file mode 100644 index 7d32e21c7e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMapping.java +++ /dev/null @@ -1,979 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationMapping data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationMapping} - */ -public final class ApplicationMapping extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationMapping) - ApplicationMappingOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationMapping.newBuilder() to construct. - private ApplicationMapping(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationMapping() { - uuid_ = ""; - applicationRef_ = ""; - subscriptionRef_ = ""; - organization_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationMapping(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationMapping( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - applicationRef_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - subscriptionRef_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - organization_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.internal_static_wso2_discovery_subscription_ApplicationMapping_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.internal_static_wso2_discovery_subscription_ApplicationMapping_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder.class); - } - - public static final int UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object uuid_; - /** - * string uuid = 1; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APPLICATIONREF_FIELD_NUMBER = 2; - private volatile java.lang.Object applicationRef_; - /** - * string applicationRef = 2; - * @return The applicationRef. - */ - @java.lang.Override - public java.lang.String getApplicationRef() { - java.lang.Object ref = applicationRef_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationRef_ = s; - return s; - } - } - /** - * string applicationRef = 2; - * @return The bytes for applicationRef. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationRefBytes() { - java.lang.Object ref = applicationRef_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationRef_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SUBSCRIPTIONREF_FIELD_NUMBER = 3; - private volatile java.lang.Object subscriptionRef_; - /** - * string subscriptionRef = 3; - * @return The subscriptionRef. - */ - @java.lang.Override - public java.lang.String getSubscriptionRef() { - java.lang.Object ref = subscriptionRef_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscriptionRef_ = s; - return s; - } - } - /** - * string subscriptionRef = 3; - * @return The bytes for subscriptionRef. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSubscriptionRefBytes() { - java.lang.Object ref = subscriptionRef_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subscriptionRef_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATION_FIELD_NUMBER = 4; - private volatile java.lang.Object organization_; - /** - * string organization = 4; - * @return The organization. - */ - @java.lang.Override - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } - } - /** - * string organization = 4; - * @return The bytes for organization. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); - } - if (!getApplicationRefBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, applicationRef_); - } - if (!getSubscriptionRefBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, subscriptionRef_); - } - if (!getOrganizationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, organization_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); - } - if (!getApplicationRefBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, applicationRef_); - } - if (!getSubscriptionRefBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, subscriptionRef_); - } - if (!getOrganizationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, organization_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping) obj; - - if (!getUuid() - .equals(other.getUuid())) return false; - if (!getApplicationRef() - .equals(other.getApplicationRef())) return false; - if (!getSubscriptionRef() - .equals(other.getSubscriptionRef())) return false; - if (!getOrganization() - .equals(other.getOrganization())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + APPLICATIONREF_FIELD_NUMBER; - hash = (53 * hash) + getApplicationRef().hashCode(); - hash = (37 * hash) + SUBSCRIPTIONREF_FIELD_NUMBER; - hash = (53 * hash) + getSubscriptionRef().hashCode(); - hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; - hash = (53 * hash) + getOrganization().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping 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; - } - /** - *
-   * ApplicationMapping data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationMapping} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationMapping) - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.internal_static_wso2_discovery_subscription_ApplicationMapping_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.internal_static_wso2_discovery_subscription_ApplicationMapping_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - uuid_ = ""; - - applicationRef_ = ""; - - subscriptionRef_ = ""; - - organization_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.internal_static_wso2_discovery_subscription_ApplicationMapping_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping(this); - result.uuid_ = uuid_; - result.applicationRef_ = applicationRef_; - result.subscriptionRef_ = subscriptionRef_; - result.organization_ = organization_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance()) return this; - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (!other.getApplicationRef().isEmpty()) { - applicationRef_ = other.applicationRef_; - onChanged(); - } - if (!other.getSubscriptionRef().isEmpty()) { - subscriptionRef_ = other.subscriptionRef_; - onChanged(); - } - if (!other.getOrganization().isEmpty()) { - organization_ = other.organization_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 1; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 1; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 1; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 1; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private java.lang.Object applicationRef_ = ""; - /** - * string applicationRef = 2; - * @return The applicationRef. - */ - public java.lang.String getApplicationRef() { - java.lang.Object ref = applicationRef_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationRef_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string applicationRef = 2; - * @return The bytes for applicationRef. - */ - public com.google.protobuf.ByteString - getApplicationRefBytes() { - java.lang.Object ref = applicationRef_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationRef_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string applicationRef = 2; - * @param value The applicationRef to set. - * @return This builder for chaining. - */ - public Builder setApplicationRef( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - applicationRef_ = value; - onChanged(); - return this; - } - /** - * string applicationRef = 2; - * @return This builder for chaining. - */ - public Builder clearApplicationRef() { - - applicationRef_ = getDefaultInstance().getApplicationRef(); - onChanged(); - return this; - } - /** - * string applicationRef = 2; - * @param value The bytes for applicationRef to set. - * @return This builder for chaining. - */ - public Builder setApplicationRefBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - applicationRef_ = value; - onChanged(); - return this; - } - - private java.lang.Object subscriptionRef_ = ""; - /** - * string subscriptionRef = 3; - * @return The subscriptionRef. - */ - public java.lang.String getSubscriptionRef() { - java.lang.Object ref = subscriptionRef_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscriptionRef_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string subscriptionRef = 3; - * @return The bytes for subscriptionRef. - */ - public com.google.protobuf.ByteString - getSubscriptionRefBytes() { - java.lang.Object ref = subscriptionRef_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subscriptionRef_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string subscriptionRef = 3; - * @param value The subscriptionRef to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionRef( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - subscriptionRef_ = value; - onChanged(); - return this; - } - /** - * string subscriptionRef = 3; - * @return This builder for chaining. - */ - public Builder clearSubscriptionRef() { - - subscriptionRef_ = getDefaultInstance().getSubscriptionRef(); - onChanged(); - return this; - } - /** - * string subscriptionRef = 3; - * @param value The bytes for subscriptionRef to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionRefBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - subscriptionRef_ = value; - onChanged(); - return this; - } - - private java.lang.Object organization_ = ""; - /** - * string organization = 4; - * @return The organization. - */ - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organization = 4; - * @return The bytes for organization. - */ - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organization = 4; - * @param value The organization to set. - * @return This builder for chaining. - */ - public Builder setOrganization( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organization_ = value; - onChanged(); - return this; - } - /** - * string organization = 4; - * @return This builder for chaining. - */ - public Builder clearOrganization() { - - organization_ = getDefaultInstance().getOrganization(); - onChanged(); - return this; - } - /** - * string organization = 4; - * @param value The bytes for organization to set. - * @return This builder for chaining. - */ - public Builder setOrganizationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organization_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationMapping) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationMapping) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationMapping parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationMapping(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingOrBuilder.java deleted file mode 100644 index 1bc44878cd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingOrBuilder.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationMappingOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationMapping) - com.google.protobuf.MessageOrBuilder { - - /** - * string uuid = 1; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * string applicationRef = 2; - * @return The applicationRef. - */ - java.lang.String getApplicationRef(); - /** - * string applicationRef = 2; - * @return The bytes for applicationRef. - */ - com.google.protobuf.ByteString - getApplicationRefBytes(); - - /** - * string subscriptionRef = 3; - * @return The subscriptionRef. - */ - java.lang.String getSubscriptionRef(); - /** - * string subscriptionRef = 3; - * @return The bytes for subscriptionRef. - */ - com.google.protobuf.ByteString - getSubscriptionRefBytes(); - - /** - * string organization = 4; - * @return The organization. - */ - java.lang.String getOrganization(); - /** - * string organization = 4; - * @return The bytes for organization. - */ - com.google.protobuf.ByteString - getOrganizationBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingProto.java deleted file mode 100644 index 6162841889..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingProto.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationMappingProto { - private ApplicationMappingProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationMapping_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationMapping_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n4wso2/discovery/subscription/applicatio" + - "nmapping.proto\022\033wso2.discovery.subscript" + - "ion\"i\n\022ApplicationMapping\022\014\n\004uuid\030\001 \001(\t\022" + - "\026\n\016applicationRef\030\002 \001(\t\022\027\n\017subscriptionR" + - "ef\030\003 \001(\t\022\024\n\014organization\030\004 \001(\tB\233\001\n,org.w" + - "so2.apk.enforcer.discovery.subscriptionB" + - "\027ApplicationMappingProtoP\001ZPgithub.com/w" + - "so2/apk/common-go-libs/pkg/discovery/api" + - "/wso2/discovery/subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_ApplicationMapping_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationMapping_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationMapping_descriptor, - new java.lang.String[] { "Uuid", "ApplicationRef", "SubscriptionRef", "Organization", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationOrBuilder.java deleted file mode 100644 index 38bd966196..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.Application) - com.google.protobuf.MessageOrBuilder { - - /** - * string uuid = 1; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * string name = 2; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 2; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string owner = 3; - * @return The owner. - */ - java.lang.String getOwner(); - /** - * string owner = 3; - * @return The bytes for owner. - */ - com.google.protobuf.ByteString - getOwnerBytes(); - - /** - * string organization = 4; - * @return The organization. - */ - java.lang.String getOrganization(); - /** - * string organization = 4; - * @return The bytes for organization. - */ - com.google.protobuf.ByteString - getOrganizationBytes(); - - /** - * map<string, string> attributes = 5; - */ - int getAttributesCount(); - /** - * map<string, string> attributes = 5; - */ - boolean containsAttributes( - java.lang.String key); - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getAttributes(); - /** - * map<string, string> attributes = 5; - */ - java.util.Map - getAttributesMap(); - /** - * map<string, string> attributes = 5; - */ - - java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - * map<string, string> attributes = 5; - */ - - java.lang.String getAttributesOrThrow( - java.lang.String key); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationProto.java deleted file mode 100644 index bfcf136f55..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationProto.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationProto { - private ApplicationProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_Application_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_Application_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_Application_AttributesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_Application_AttributesEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n-wso2/discovery/subscription/applicatio" + - "n.proto\022\033wso2.discovery.subscription\"\317\001\n" + - "\013Application\022\014\n\004uuid\030\001 \001(\t\022\014\n\004name\030\002 \001(\t" + - "\022\r\n\005owner\030\003 \001(\t\022\024\n\014organization\030\004 \001(\t\022L\n" + - "\nattributes\030\005 \003(\01328.wso2.discovery.subsc" + - "ription.Application.AttributesEntry\0321\n\017A" + - "ttributesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + - "(\t:\0028\001B\224\001\n,org.wso2.apk.enforcer.discove" + - "ry.subscriptionB\020ApplicationProtoP\001ZPgit" + - "hub.com/wso2/apk/common-go-libs/pkg/disc" + - "overy/api/wso2/discovery/subscriptionb\006p" + - "roto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_Application_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_Application_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_Application_descriptor, - new java.lang.String[] { "Uuid", "Name", "Owner", "Organization", "Attributes", }); - internal_static_wso2_discovery_subscription_Application_AttributesEntry_descriptor = - internal_static_wso2_discovery_subscription_Application_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_subscription_Application_AttributesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_Application_AttributesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Certificate.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Certificate.java deleted file mode 100644 index b2e343943c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Certificate.java +++ /dev/null @@ -1,745 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.Certificate} - */ -public final class Certificate extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.Certificate) - CertificateOrBuilder { -private static final long serialVersionUID = 0L; - // Use Certificate.newBuilder() to construct. - private Certificate(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Certificate() { - certificate_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Certificate(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Certificate( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - certificate_ = s; - break; - } - case 18: { - org.wso2.apk.enforcer.discovery.subscription.JWKS.Builder subBuilder = null; - if (jwks_ != null) { - subBuilder = jwks_.toBuilder(); - } - jwks_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.JWKS.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(jwks_); - jwks_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_Certificate_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_Certificate_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Certificate.class, org.wso2.apk.enforcer.discovery.subscription.Certificate.Builder.class); - } - - public static final int CERTIFICATE_FIELD_NUMBER = 1; - private volatile java.lang.Object certificate_; - /** - * string certificate = 1; - * @return The certificate. - */ - @java.lang.Override - public java.lang.String getCertificate() { - java.lang.Object ref = certificate_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificate_ = s; - return s; - } - } - /** - * string certificate = 1; - * @return The bytes for certificate. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCertificateBytes() { - java.lang.Object ref = certificate_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificate_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int JWKS_FIELD_NUMBER = 2; - private org.wso2.apk.enforcer.discovery.subscription.JWKS jwks_; - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - * @return Whether the jwks field is set. - */ - @java.lang.Override - public boolean hasJwks() { - return jwks_ != null; - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - * @return The jwks. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWKS getJwks() { - return jwks_ == null ? org.wso2.apk.enforcer.discovery.subscription.JWKS.getDefaultInstance() : jwks_; - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWKSOrBuilder getJwksOrBuilder() { - return getJwks(); - } - - 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 (!getCertificateBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, certificate_); - } - if (jwks_ != null) { - output.writeMessage(2, getJwks()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getCertificateBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, certificate_); - } - if (jwks_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getJwks()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.Certificate)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.Certificate other = (org.wso2.apk.enforcer.discovery.subscription.Certificate) obj; - - if (!getCertificate() - .equals(other.getCertificate())) return false; - if (hasJwks() != other.hasJwks()) return false; - if (hasJwks()) { - if (!getJwks() - .equals(other.getJwks())) 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) + CERTIFICATE_FIELD_NUMBER; - hash = (53 * hash) + getCertificate().hashCode(); - if (hasJwks()) { - hash = (37 * hash) + JWKS_FIELD_NUMBER; - hash = (53 * hash) + getJwks().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Certificate parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.Certificate prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.Certificate} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.Certificate) - org.wso2.apk.enforcer.discovery.subscription.CertificateOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_Certificate_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_Certificate_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Certificate.class, org.wso2.apk.enforcer.discovery.subscription.Certificate.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.Certificate.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(); - certificate_ = ""; - - if (jwksBuilder_ == null) { - jwks_ = null; - } else { - jwks_ = null; - jwksBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_Certificate_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Certificate getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.Certificate.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Certificate build() { - org.wso2.apk.enforcer.discovery.subscription.Certificate result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Certificate buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.Certificate result = new org.wso2.apk.enforcer.discovery.subscription.Certificate(this); - result.certificate_ = certificate_; - if (jwksBuilder_ == null) { - result.jwks_ = jwks_; - } else { - result.jwks_ = jwksBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.Certificate) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.Certificate)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.Certificate other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.Certificate.getDefaultInstance()) return this; - if (!other.getCertificate().isEmpty()) { - certificate_ = other.certificate_; - onChanged(); - } - if (other.hasJwks()) { - mergeJwks(other.getJwks()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.Certificate parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.Certificate) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object certificate_ = ""; - /** - * string certificate = 1; - * @return The certificate. - */ - public java.lang.String getCertificate() { - java.lang.Object ref = certificate_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - certificate_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string certificate = 1; - * @return The bytes for certificate. - */ - public com.google.protobuf.ByteString - getCertificateBytes() { - java.lang.Object ref = certificate_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - certificate_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string certificate = 1; - * @param value The certificate to set. - * @return This builder for chaining. - */ - public Builder setCertificate( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - certificate_ = value; - onChanged(); - return this; - } - /** - * string certificate = 1; - * @return This builder for chaining. - */ - public Builder clearCertificate() { - - certificate_ = getDefaultInstance().getCertificate(); - onChanged(); - return this; - } - /** - * string certificate = 1; - * @param value The bytes for certificate to set. - * @return This builder for chaining. - */ - public Builder setCertificateBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - certificate_ = value; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.subscription.JWKS jwks_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.JWKS, org.wso2.apk.enforcer.discovery.subscription.JWKS.Builder, org.wso2.apk.enforcer.discovery.subscription.JWKSOrBuilder> jwksBuilder_; - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - * @return Whether the jwks field is set. - */ - public boolean hasJwks() { - return jwksBuilder_ != null || jwks_ != null; - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - * @return The jwks. - */ - public org.wso2.apk.enforcer.discovery.subscription.JWKS getJwks() { - if (jwksBuilder_ == null) { - return jwks_ == null ? org.wso2.apk.enforcer.discovery.subscription.JWKS.getDefaultInstance() : jwks_; - } else { - return jwksBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - public Builder setJwks(org.wso2.apk.enforcer.discovery.subscription.JWKS value) { - if (jwksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - jwks_ = value; - onChanged(); - } else { - jwksBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - public Builder setJwks( - org.wso2.apk.enforcer.discovery.subscription.JWKS.Builder builderForValue) { - if (jwksBuilder_ == null) { - jwks_ = builderForValue.build(); - onChanged(); - } else { - jwksBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - public Builder mergeJwks(org.wso2.apk.enforcer.discovery.subscription.JWKS value) { - if (jwksBuilder_ == null) { - if (jwks_ != null) { - jwks_ = - org.wso2.apk.enforcer.discovery.subscription.JWKS.newBuilder(jwks_).mergeFrom(value).buildPartial(); - } else { - jwks_ = value; - } - onChanged(); - } else { - jwksBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - public Builder clearJwks() { - if (jwksBuilder_ == null) { - jwks_ = null; - onChanged(); - } else { - jwks_ = null; - jwksBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.JWKS.Builder getJwksBuilder() { - - onChanged(); - return getJwksFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.JWKSOrBuilder getJwksOrBuilder() { - if (jwksBuilder_ != null) { - return jwksBuilder_.getMessageOrBuilder(); - } else { - return jwks_ == null ? - org.wso2.apk.enforcer.discovery.subscription.JWKS.getDefaultInstance() : jwks_; - } - } - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.JWKS, org.wso2.apk.enforcer.discovery.subscription.JWKS.Builder, org.wso2.apk.enforcer.discovery.subscription.JWKSOrBuilder> - getJwksFieldBuilder() { - if (jwksBuilder_ == null) { - jwksBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.JWKS, org.wso2.apk.enforcer.discovery.subscription.JWKS.Builder, org.wso2.apk.enforcer.discovery.subscription.JWKSOrBuilder>( - getJwks(), - getParentForChildren(), - isClean()); - jwks_ = null; - } - return jwksBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.Certificate) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.Certificate) - private static final org.wso2.apk.enforcer.discovery.subscription.Certificate DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.Certificate(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.Certificate getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Certificate parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Certificate(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Certificate getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/CertificateOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/CertificateOrBuilder.java deleted file mode 100644 index 95be48bd39..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/CertificateOrBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface CertificateOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.Certificate) - com.google.protobuf.MessageOrBuilder { - - /** - * string certificate = 1; - * @return The certificate. - */ - java.lang.String getCertificate(); - /** - * string certificate = 1; - * @return The bytes for certificate. - */ - com.google.protobuf.ByteString - getCertificateBytes(); - - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - * @return Whether the jwks field is set. - */ - boolean hasJwks(); - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - * @return The jwks. - */ - org.wso2.apk.enforcer.discovery.subscription.JWKS getJwks(); - /** - * .wso2.discovery.subscription.JWKS jwks = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.JWKSOrBuilder getJwksOrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Event.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Event.java deleted file mode 100644 index 5cca96f547..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Event.java +++ /dev/null @@ -1,1520 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/event.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * Event data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.Event} - */ -public final class Event extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.Event) - EventOrBuilder { -private static final long serialVersionUID = 0L; - // Use Event.newBuilder() to construct. - private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Event() { - uuid_ = ""; - type_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Event(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Event( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 16: { - - timeStamp_ = input.readInt64(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 34: { - org.wso2.apk.enforcer.discovery.subscription.Application.Builder subBuilder = null; - if (application_ != null) { - subBuilder = application_.toBuilder(); - } - application_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Application.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(application_); - application_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder subBuilder = null; - if (applicationMapping_ != null) { - subBuilder = applicationMapping_.toBuilder(); - } - applicationMapping_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(applicationMapping_); - applicationMapping_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder subBuilder = null; - if (applicationKeyMapping_ != null) { - subBuilder = applicationKeyMapping_.toBuilder(); - } - applicationKeyMapping_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(applicationKeyMapping_); - applicationKeyMapping_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder subBuilder = null; - if (subscription_ != null) { - subBuilder = subscription_.toBuilder(); - } - subscription_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Subscription.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(subscription_); - subscription_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Event.class, org.wso2.apk.enforcer.discovery.subscription.Event.Builder.class); - } - - public static final int UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object uuid_; - /** - * string uuid = 1; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 2; - private long timeStamp_; - /** - * int64 timeStamp = 2; - * @return The timeStamp. - */ - @java.lang.Override - public long getTimeStamp() { - return timeStamp_; - } - - public static final int TYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object type_; - /** - * string type = 3; - * @return The type. - */ - @java.lang.Override - public java.lang.String getType() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - /** - * string type = 3; - * @return The bytes for type. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APPLICATION_FIELD_NUMBER = 4; - private org.wso2.apk.enforcer.discovery.subscription.Application application_; - /** - * .wso2.discovery.subscription.Application application = 4; - * @return Whether the application field is set. - */ - @java.lang.Override - public boolean hasApplication() { - return application_ != null; - } - /** - * .wso2.discovery.subscription.Application application = 4; - * @return The application. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Application getApplication() { - return application_ == null ? org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance() : application_; - } - /** - * .wso2.discovery.subscription.Application application = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getApplicationOrBuilder() { - return getApplication(); - } - - public static final int APPLICATIONMAPPING_FIELD_NUMBER = 5; - private org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping_; - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - * @return Whether the applicationMapping field is set. - */ - @java.lang.Override - public boolean hasApplicationMapping() { - return applicationMapping_ != null; - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - * @return The applicationMapping. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getApplicationMapping() { - return applicationMapping_ == null ? org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance() : applicationMapping_; - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getApplicationMappingOrBuilder() { - return getApplicationMapping(); - } - - public static final int APPLICATIONKEYMAPPING_FIELD_NUMBER = 6; - private org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping_; - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - * @return Whether the applicationKeyMapping field is set. - */ - @java.lang.Override - public boolean hasApplicationKeyMapping() { - return applicationKeyMapping_ != null; - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - * @return The applicationKeyMapping. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getApplicationKeyMapping() { - return applicationKeyMapping_ == null ? org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance() : applicationKeyMapping_; - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getApplicationKeyMappingOrBuilder() { - return getApplicationKeyMapping(); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 7; - private org.wso2.apk.enforcer.discovery.subscription.Subscription subscription_; - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - * @return Whether the subscription field is set. - */ - @java.lang.Override - public boolean hasSubscription() { - return subscription_ != null; - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - * @return The subscription. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Subscription getSubscription() { - return subscription_ == null ? org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance() : subscription_; - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getSubscriptionOrBuilder() { - return getSubscription(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); - } - if (timeStamp_ != 0L) { - output.writeInt64(2, timeStamp_); - } - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); - } - if (application_ != null) { - output.writeMessage(4, getApplication()); - } - if (applicationMapping_ != null) { - output.writeMessage(5, getApplicationMapping()); - } - if (applicationKeyMapping_ != null) { - output.writeMessage(6, getApplicationKeyMapping()); - } - if (subscription_ != null) { - output.writeMessage(7, getSubscription()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); - } - if (timeStamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, timeStamp_); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); - } - if (application_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getApplication()); - } - if (applicationMapping_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getApplicationMapping()); - } - if (applicationKeyMapping_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getApplicationKeyMapping()); - } - if (subscription_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getSubscription()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.Event)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.Event other = (org.wso2.apk.enforcer.discovery.subscription.Event) obj; - - if (!getUuid() - .equals(other.getUuid())) return false; - if (getTimeStamp() - != other.getTimeStamp()) return false; - if (!getType() - .equals(other.getType())) return false; - if (hasApplication() != other.hasApplication()) return false; - if (hasApplication()) { - if (!getApplication() - .equals(other.getApplication())) return false; - } - if (hasApplicationMapping() != other.hasApplicationMapping()) return false; - if (hasApplicationMapping()) { - if (!getApplicationMapping() - .equals(other.getApplicationMapping())) return false; - } - if (hasApplicationKeyMapping() != other.hasApplicationKeyMapping()) return false; - if (hasApplicationKeyMapping()) { - if (!getApplicationKeyMapping() - .equals(other.getApplicationKeyMapping())) return false; - } - if (hasSubscription() != other.hasSubscription()) return false; - if (hasSubscription()) { - if (!getSubscription() - .equals(other.getSubscription())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimeStamp()); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - if (hasApplication()) { - hash = (37 * hash) + APPLICATION_FIELD_NUMBER; - hash = (53 * hash) + getApplication().hashCode(); - } - if (hasApplicationMapping()) { - hash = (37 * hash) + APPLICATIONMAPPING_FIELD_NUMBER; - hash = (53 * hash) + getApplicationMapping().hashCode(); - } - if (hasApplicationKeyMapping()) { - hash = (37 * hash) + APPLICATIONKEYMAPPING_FIELD_NUMBER; - hash = (53 * hash) + getApplicationKeyMapping().hashCode(); - } - if (hasSubscription()) { - hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.Event prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Event data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.Event} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.Event) - org.wso2.apk.enforcer.discovery.subscription.EventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Event.class, org.wso2.apk.enforcer.discovery.subscription.Event.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.Event.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - uuid_ = ""; - - timeStamp_ = 0L; - - type_ = ""; - - if (applicationBuilder_ == null) { - application_ = null; - } else { - application_ = null; - applicationBuilder_ = null; - } - if (applicationMappingBuilder_ == null) { - applicationMapping_ = null; - } else { - applicationMapping_ = null; - applicationMappingBuilder_ = null; - } - if (applicationKeyMappingBuilder_ == null) { - applicationKeyMapping_ = null; - } else { - applicationKeyMapping_ = null; - applicationKeyMappingBuilder_ = null; - } - if (subscriptionBuilder_ == null) { - subscription_ = null; - } else { - subscription_ = null; - subscriptionBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Event getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Event build() { - org.wso2.apk.enforcer.discovery.subscription.Event result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Event buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.Event result = new org.wso2.apk.enforcer.discovery.subscription.Event(this); - result.uuid_ = uuid_; - result.timeStamp_ = timeStamp_; - result.type_ = type_; - if (applicationBuilder_ == null) { - result.application_ = application_; - } else { - result.application_ = applicationBuilder_.build(); - } - if (applicationMappingBuilder_ == null) { - result.applicationMapping_ = applicationMapping_; - } else { - result.applicationMapping_ = applicationMappingBuilder_.build(); - } - if (applicationKeyMappingBuilder_ == null) { - result.applicationKeyMapping_ = applicationKeyMapping_; - } else { - result.applicationKeyMapping_ = applicationKeyMappingBuilder_.build(); - } - if (subscriptionBuilder_ == null) { - result.subscription_ = subscription_; - } else { - result.subscription_ = subscriptionBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.Event) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.Event)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.Event other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance()) return this; - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (other.getTimeStamp() != 0L) { - setTimeStamp(other.getTimeStamp()); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (other.hasApplication()) { - mergeApplication(other.getApplication()); - } - if (other.hasApplicationMapping()) { - mergeApplicationMapping(other.getApplicationMapping()); - } - if (other.hasApplicationKeyMapping()) { - mergeApplicationKeyMapping(other.getApplicationKeyMapping()); - } - if (other.hasSubscription()) { - mergeSubscription(other.getSubscription()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.Event parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.Event) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 1; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 1; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 1; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 1; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private long timeStamp_ ; - /** - * int64 timeStamp = 2; - * @return The timeStamp. - */ - @java.lang.Override - public long getTimeStamp() { - return timeStamp_; - } - /** - * int64 timeStamp = 2; - * @param value The timeStamp to set. - * @return This builder for chaining. - */ - public Builder setTimeStamp(long value) { - - timeStamp_ = value; - onChanged(); - return this; - } - /** - * int64 timeStamp = 2; - * @return This builder for chaining. - */ - public Builder clearTimeStamp() { - - timeStamp_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object type_ = ""; - /** - * string type = 3; - * @return The type. - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string type = 3; - * @return The bytes for type. - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string type = 3; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - * string type = 3; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - * string type = 3; - * @param value The bytes for type to set. - * @return This builder for chaining. - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.subscription.Application application_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder> applicationBuilder_; - /** - * .wso2.discovery.subscription.Application application = 4; - * @return Whether the application field is set. - */ - public boolean hasApplication() { - return applicationBuilder_ != null || application_ != null; - } - /** - * .wso2.discovery.subscription.Application application = 4; - * @return The application. - */ - public org.wso2.apk.enforcer.discovery.subscription.Application getApplication() { - if (applicationBuilder_ == null) { - return application_ == null ? org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance() : application_; - } else { - return applicationBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.Application application = 4; - */ - public Builder setApplication(org.wso2.apk.enforcer.discovery.subscription.Application value) { - if (applicationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - application_ = value; - onChanged(); - } else { - applicationBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.Application application = 4; - */ - public Builder setApplication( - org.wso2.apk.enforcer.discovery.subscription.Application.Builder builderForValue) { - if (applicationBuilder_ == null) { - application_ = builderForValue.build(); - onChanged(); - } else { - applicationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.Application application = 4; - */ - public Builder mergeApplication(org.wso2.apk.enforcer.discovery.subscription.Application value) { - if (applicationBuilder_ == null) { - if (application_ != null) { - application_ = - org.wso2.apk.enforcer.discovery.subscription.Application.newBuilder(application_).mergeFrom(value).buildPartial(); - } else { - application_ = value; - } - onChanged(); - } else { - applicationBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.Application application = 4; - */ - public Builder clearApplication() { - if (applicationBuilder_ == null) { - application_ = null; - onChanged(); - } else { - application_ = null; - applicationBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.Application application = 4; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application.Builder getApplicationBuilder() { - - onChanged(); - return getApplicationFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.Application application = 4; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getApplicationOrBuilder() { - if (applicationBuilder_ != null) { - return applicationBuilder_.getMessageOrBuilder(); - } else { - return application_ == null ? - org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance() : application_; - } - } - /** - * .wso2.discovery.subscription.Application application = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder> - getApplicationFieldBuilder() { - if (applicationBuilder_ == null) { - applicationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder>( - getApplication(), - getParentForChildren(), - isClean()); - application_ = null; - } - return applicationBuilder_; - } - - private org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder> applicationMappingBuilder_; - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - * @return Whether the applicationMapping field is set. - */ - public boolean hasApplicationMapping() { - return applicationMappingBuilder_ != null || applicationMapping_ != null; - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - * @return The applicationMapping. - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getApplicationMapping() { - if (applicationMappingBuilder_ == null) { - return applicationMapping_ == null ? org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance() : applicationMapping_; - } else { - return applicationMappingBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - public Builder setApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { - if (applicationMappingBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - applicationMapping_ = value; - onChanged(); - } else { - applicationMappingBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - public Builder setApplicationMapping( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder builderForValue) { - if (applicationMappingBuilder_ == null) { - applicationMapping_ = builderForValue.build(); - onChanged(); - } else { - applicationMappingBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - public Builder mergeApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { - if (applicationMappingBuilder_ == null) { - if (applicationMapping_ != null) { - applicationMapping_ = - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.newBuilder(applicationMapping_).mergeFrom(value).buildPartial(); - } else { - applicationMapping_ = value; - } - onChanged(); - } else { - applicationMappingBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - public Builder clearApplicationMapping() { - if (applicationMappingBuilder_ == null) { - applicationMapping_ = null; - onChanged(); - } else { - applicationMapping_ = null; - applicationMappingBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder getApplicationMappingBuilder() { - - onChanged(); - return getApplicationMappingFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getApplicationMappingOrBuilder() { - if (applicationMappingBuilder_ != null) { - return applicationMappingBuilder_.getMessageOrBuilder(); - } else { - return applicationMapping_ == null ? - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance() : applicationMapping_; - } - } - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder> - getApplicationMappingFieldBuilder() { - if (applicationMappingBuilder_ == null) { - applicationMappingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder>( - getApplicationMapping(), - getParentForChildren(), - isClean()); - applicationMapping_ = null; - } - return applicationMappingBuilder_; - } - - private org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder> applicationKeyMappingBuilder_; - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - * @return Whether the applicationKeyMapping field is set. - */ - public boolean hasApplicationKeyMapping() { - return applicationKeyMappingBuilder_ != null || applicationKeyMapping_ != null; - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - * @return The applicationKeyMapping. - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getApplicationKeyMapping() { - if (applicationKeyMappingBuilder_ == null) { - return applicationKeyMapping_ == null ? org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance() : applicationKeyMapping_; - } else { - return applicationKeyMappingBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - public Builder setApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { - if (applicationKeyMappingBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - applicationKeyMapping_ = value; - onChanged(); - } else { - applicationKeyMappingBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - public Builder setApplicationKeyMapping( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder builderForValue) { - if (applicationKeyMappingBuilder_ == null) { - applicationKeyMapping_ = builderForValue.build(); - onChanged(); - } else { - applicationKeyMappingBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - public Builder mergeApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { - if (applicationKeyMappingBuilder_ == null) { - if (applicationKeyMapping_ != null) { - applicationKeyMapping_ = - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.newBuilder(applicationKeyMapping_).mergeFrom(value).buildPartial(); - } else { - applicationKeyMapping_ = value; - } - onChanged(); - } else { - applicationKeyMappingBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - public Builder clearApplicationKeyMapping() { - if (applicationKeyMappingBuilder_ == null) { - applicationKeyMapping_ = null; - onChanged(); - } else { - applicationKeyMapping_ = null; - applicationKeyMappingBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder getApplicationKeyMappingBuilder() { - - onChanged(); - return getApplicationKeyMappingFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getApplicationKeyMappingOrBuilder() { - if (applicationKeyMappingBuilder_ != null) { - return applicationKeyMappingBuilder_.getMessageOrBuilder(); - } else { - return applicationKeyMapping_ == null ? - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance() : applicationKeyMapping_; - } - } - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder> - getApplicationKeyMappingFieldBuilder() { - if (applicationKeyMappingBuilder_ == null) { - applicationKeyMappingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder>( - getApplicationKeyMapping(), - getParentForChildren(), - isClean()); - applicationKeyMapping_ = null; - } - return applicationKeyMappingBuilder_; - } - - private org.wso2.apk.enforcer.discovery.subscription.Subscription subscription_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder> subscriptionBuilder_; - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - * @return Whether the subscription field is set. - */ - public boolean hasSubscription() { - return subscriptionBuilder_ != null || subscription_ != null; - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - * @return The subscription. - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription getSubscription() { - if (subscriptionBuilder_ == null) { - return subscription_ == null ? org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance() : subscription_; - } else { - return subscriptionBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - public Builder setSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription value) { - if (subscriptionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - onChanged(); - } else { - subscriptionBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - public Builder setSubscription( - org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder builderForValue) { - if (subscriptionBuilder_ == null) { - subscription_ = builderForValue.build(); - onChanged(); - } else { - subscriptionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - public Builder mergeSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription value) { - if (subscriptionBuilder_ == null) { - if (subscription_ != null) { - subscription_ = - org.wso2.apk.enforcer.discovery.subscription.Subscription.newBuilder(subscription_).mergeFrom(value).buildPartial(); - } else { - subscription_ = value; - } - onChanged(); - } else { - subscriptionBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - public Builder clearSubscription() { - if (subscriptionBuilder_ == null) { - subscription_ = null; - onChanged(); - } else { - subscription_ = null; - subscriptionBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder getSubscriptionBuilder() { - - onChanged(); - return getSubscriptionFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getSubscriptionOrBuilder() { - if (subscriptionBuilder_ != null) { - return subscriptionBuilder_.getMessageOrBuilder(); - } else { - return subscription_ == null ? - org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance() : subscription_; - } - } - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder> - getSubscriptionFieldBuilder() { - if (subscriptionBuilder_ == null) { - subscriptionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder>( - getSubscription(), - getParentForChildren(), - isClean()); - subscription_ = null; - } - return subscriptionBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.Event) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.Event) - private static final org.wso2.apk.enforcer.discovery.subscription.Event DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.Event(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.Event getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Event parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Event(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Event getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventOrBuilder.java deleted file mode 100644 index 8f693067fe..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventOrBuilder.java +++ /dev/null @@ -1,99 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/event.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface EventOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.Event) - com.google.protobuf.MessageOrBuilder { - - /** - * string uuid = 1; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * int64 timeStamp = 2; - * @return The timeStamp. - */ - long getTimeStamp(); - - /** - * string type = 3; - * @return The type. - */ - java.lang.String getType(); - /** - * string type = 3; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - * .wso2.discovery.subscription.Application application = 4; - * @return Whether the application field is set. - */ - boolean hasApplication(); - /** - * .wso2.discovery.subscription.Application application = 4; - * @return The application. - */ - org.wso2.apk.enforcer.discovery.subscription.Application getApplication(); - /** - * .wso2.discovery.subscription.Application application = 4; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getApplicationOrBuilder(); - - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - * @return Whether the applicationMapping field is set. - */ - boolean hasApplicationMapping(); - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - * @return The applicationMapping. - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getApplicationMapping(); - /** - * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getApplicationMappingOrBuilder(); - - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - * @return Whether the applicationKeyMapping field is set. - */ - boolean hasApplicationKeyMapping(); - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - * @return The applicationKeyMapping. - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getApplicationKeyMapping(); - /** - * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getApplicationKeyMappingOrBuilder(); - - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - * @return Whether the subscription field is set. - */ - boolean hasSubscription(); - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - * @return The subscription. - */ - org.wso2.apk.enforcer.discovery.subscription.Subscription getSubscription(); - /** - * .wso2.discovery.subscription.Subscription subscription = 7; - */ - org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getSubscriptionOrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventProto.java deleted file mode 100644 index ddf36b01e0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventProto.java +++ /dev/null @@ -1,73 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/event.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class EventProto { - private EventProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_Event_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_Event_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\'wso2/discovery/subscription/event.prot" + - "o\022\033wso2.discovery.subscription\032-wso2/dis" + - "covery/subscription/application.proto\0324w" + - "so2/discovery/subscription/applicationma" + - "pping.proto\0329wso2/discovery/subscription" + - "/application_key_mapping.proto\032.wso2/dis" + - "covery/subscription/subscription.proto\"\326" + - "\002\n\005Event\022\014\n\004uuid\030\001 \001(\t\022\021\n\ttimeStamp\030\002 \001(" + - "\003\022\014\n\004type\030\003 \001(\t\022=\n\013application\030\004 \001(\0132(.w" + - "so2.discovery.subscription.Application\022K" + - "\n\022applicationMapping\030\005 \001(\0132/.wso2.discov" + - "ery.subscription.ApplicationMapping\022Q\n\025a" + - "pplicationKeyMapping\030\006 \001(\01322.wso2.discov" + - "ery.subscription.ApplicationKeyMapping\022?" + - "\n\014subscription\030\007 \001(\0132).wso2.discovery.su" + - "bscription.SubscriptionB\216\001\n,org.wso2.apk" + - ".enforcer.discovery.subscriptionB\nEventP" + - "rotoP\001ZPgithub.com/wso2/apk/common-go-li" + - "bs/pkg/discovery/api/wso2/discovery/subs" + - "criptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_Event_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_Event_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_Event_descriptor, - new java.lang.String[] { "Uuid", "TimeStamp", "Type", "Application", "ApplicationMapping", "ApplicationKeyMapping", "Subscription", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWKS.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWKS.java deleted file mode 100644 index a427eb7176..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWKS.java +++ /dev/null @@ -1,695 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.JWKS} - */ -public final class JWKS extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.JWKS) - JWKSOrBuilder { -private static final long serialVersionUID = 0L; - // Use JWKS.newBuilder() to construct. - private JWKS(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JWKS() { - url_ = ""; - tls_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JWKS(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JWKS( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - url_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - tls_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWKS_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWKS_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.JWKS.class, org.wso2.apk.enforcer.discovery.subscription.JWKS.Builder.class); - } - - public static final int URL_FIELD_NUMBER = 1; - private volatile java.lang.Object url_; - /** - * string url = 1; - * @return The url. - */ - @java.lang.Override - public java.lang.String getUrl() { - java.lang.Object ref = url_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - url_ = s; - return s; - } - } - /** - * string url = 1; - * @return The bytes for url. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUrlBytes() { - java.lang.Object ref = url_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - url_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TLS_FIELD_NUMBER = 2; - private volatile java.lang.Object tls_; - /** - * string tls = 2; - * @return The tls. - */ - @java.lang.Override - public java.lang.String getTls() { - java.lang.Object ref = tls_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tls_ = s; - return s; - } - } - /** - * string tls = 2; - * @return The bytes for tls. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTlsBytes() { - java.lang.Object ref = tls_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tls_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUrlBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); - } - if (!getTlsBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tls_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUrlBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); - } - if (!getTlsBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tls_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.JWKS)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.JWKS other = (org.wso2.apk.enforcer.discovery.subscription.JWKS) obj; - - if (!getUrl() - .equals(other.getUrl())) return false; - if (!getTls() - .equals(other.getTls())) 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) + URL_FIELD_NUMBER; - hash = (53 * hash) + getUrl().hashCode(); - hash = (37 * hash) + TLS_FIELD_NUMBER; - hash = (53 * hash) + getTls().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWKS parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.JWKS prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.JWKS} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.JWKS) - org.wso2.apk.enforcer.discovery.subscription.JWKSOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWKS_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWKS_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.JWKS.class, org.wso2.apk.enforcer.discovery.subscription.JWKS.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.JWKS.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(); - url_ = ""; - - tls_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWKS_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWKS getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.JWKS.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWKS build() { - org.wso2.apk.enforcer.discovery.subscription.JWKS result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWKS buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.JWKS result = new org.wso2.apk.enforcer.discovery.subscription.JWKS(this); - result.url_ = url_; - result.tls_ = tls_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.JWKS) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.JWKS)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.JWKS other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.JWKS.getDefaultInstance()) return this; - if (!other.getUrl().isEmpty()) { - url_ = other.url_; - onChanged(); - } - if (!other.getTls().isEmpty()) { - tls_ = other.tls_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.JWKS parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.JWKS) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object url_ = ""; - /** - * string url = 1; - * @return The url. - */ - public java.lang.String getUrl() { - java.lang.Object ref = url_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - url_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string url = 1; - * @return The bytes for url. - */ - public com.google.protobuf.ByteString - getUrlBytes() { - java.lang.Object ref = url_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - url_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string url = 1; - * @param value The url to set. - * @return This builder for chaining. - */ - public Builder setUrl( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - url_ = value; - onChanged(); - return this; - } - /** - * string url = 1; - * @return This builder for chaining. - */ - public Builder clearUrl() { - - url_ = getDefaultInstance().getUrl(); - onChanged(); - return this; - } - /** - * string url = 1; - * @param value The bytes for url to set. - * @return This builder for chaining. - */ - public Builder setUrlBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - url_ = value; - onChanged(); - return this; - } - - private java.lang.Object tls_ = ""; - /** - * string tls = 2; - * @return The tls. - */ - public java.lang.String getTls() { - java.lang.Object ref = tls_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tls_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string tls = 2; - * @return The bytes for tls. - */ - public com.google.protobuf.ByteString - getTlsBytes() { - java.lang.Object ref = tls_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tls_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string tls = 2; - * @param value The tls to set. - * @return This builder for chaining. - */ - public Builder setTls( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tls_ = value; - onChanged(); - return this; - } - /** - * string tls = 2; - * @return This builder for chaining. - */ - public Builder clearTls() { - - tls_ = getDefaultInstance().getTls(); - onChanged(); - return this; - } - /** - * string tls = 2; - * @param value The bytes for tls to set. - * @return This builder for chaining. - */ - public Builder setTlsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tls_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.JWKS) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.JWKS) - private static final org.wso2.apk.enforcer.discovery.subscription.JWKS DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.JWKS(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.JWKS getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JWKS parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JWKS(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWKS getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWKSOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWKSOrBuilder.java deleted file mode 100644 index 8008c96d44..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWKSOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface JWKSOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.JWKS) - com.google.protobuf.MessageOrBuilder { - - /** - * string url = 1; - * @return The url. - */ - java.lang.String getUrl(); - /** - * string url = 1; - * @return The bytes for url. - */ - com.google.protobuf.ByteString - getUrlBytes(); - - /** - * string tls = 2; - * @return The tls. - */ - java.lang.String getTls(); - /** - * string tls = 2; - * @return The bytes for tls. - */ - com.google.protobuf.ByteString - getTlsBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuer.java deleted file mode 100644 index d36ddcc769..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuer.java +++ /dev/null @@ -1,1921 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * JWTIssuer data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.JWTIssuer} - */ -public final class JWTIssuer extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.JWTIssuer) - JWTIssuerOrBuilder { -private static final long serialVersionUID = 0L; - // Use JWTIssuer.newBuilder() to construct. - private JWTIssuer(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JWTIssuer() { - eventId_ = ""; - name_ = ""; - organization_ = ""; - issuer_ = ""; - consumerKeyClaim_ = ""; - scopesClaim_ = ""; - environments_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JWTIssuer(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JWTIssuer( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - eventId_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - organization_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - issuer_ = s; - break; - } - case 42: { - org.wso2.apk.enforcer.discovery.subscription.Certificate.Builder subBuilder = null; - if (certificate_ != null) { - subBuilder = certificate_.toBuilder(); - } - certificate_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Certificate.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(certificate_); - certificate_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - consumerKeyClaim_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - scopesClaim_ = s; - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - claimMapping_ = com.google.protobuf.MapField.newMapField( - ClaimMappingDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - claimMapping__ = input.readMessage( - ClaimMappingDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - claimMapping_.getMutableMap().put( - claimMapping__.getKey(), claimMapping__.getValue()); - break; - } - case 74: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - environments_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - environments_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - environments_ = environments_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWTIssuer_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 8: - return internalGetClaimMapping(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWTIssuer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.class, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder.class); - } - - public static final int EVENTID_FIELD_NUMBER = 1; - private volatile java.lang.Object eventId_; - /** - * string eventId = 1; - * @return The eventId. - */ - @java.lang.Override - public java.lang.String getEventId() { - java.lang.Object ref = eventId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - eventId_ = s; - return s; - } - } - /** - * string eventId = 1; - * @return The bytes for eventId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEventIdBytes() { - java.lang.Object ref = eventId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - eventId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - * string name = 2; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 2; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATION_FIELD_NUMBER = 3; - private volatile java.lang.Object organization_; - /** - * string organization = 3; - * @return The organization. - */ - @java.lang.Override - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } - } - /** - * string organization = 3; - * @return The bytes for organization. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ISSUER_FIELD_NUMBER = 4; - private volatile java.lang.Object issuer_; - /** - * string issuer = 4; - * @return The issuer. - */ - @java.lang.Override - public java.lang.String getIssuer() { - java.lang.Object ref = issuer_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - issuer_ = s; - return s; - } - } - /** - * string issuer = 4; - * @return The bytes for issuer. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIssuerBytes() { - java.lang.Object ref = issuer_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - issuer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CERTIFICATE_FIELD_NUMBER = 5; - private org.wso2.apk.enforcer.discovery.subscription.Certificate certificate_; - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - * @return Whether the certificate field is set. - */ - @java.lang.Override - public boolean hasCertificate() { - return certificate_ != null; - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - * @return The certificate. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Certificate getCertificate() { - return certificate_ == null ? org.wso2.apk.enforcer.discovery.subscription.Certificate.getDefaultInstance() : certificate_; - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.CertificateOrBuilder getCertificateOrBuilder() { - return getCertificate(); - } - - public static final int CONSUMERKEYCLAIM_FIELD_NUMBER = 6; - private volatile java.lang.Object consumerKeyClaim_; - /** - * string consumerKeyClaim = 6; - * @return The consumerKeyClaim. - */ - @java.lang.Override - public java.lang.String getConsumerKeyClaim() { - java.lang.Object ref = consumerKeyClaim_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - consumerKeyClaim_ = s; - return s; - } - } - /** - * string consumerKeyClaim = 6; - * @return The bytes for consumerKeyClaim. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getConsumerKeyClaimBytes() { - java.lang.Object ref = consumerKeyClaim_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - consumerKeyClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SCOPESCLAIM_FIELD_NUMBER = 7; - private volatile java.lang.Object scopesClaim_; - /** - * string scopesClaim = 7; - * @return The scopesClaim. - */ - @java.lang.Override - public java.lang.String getScopesClaim() { - java.lang.Object ref = scopesClaim_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - scopesClaim_ = s; - return s; - } - } - /** - * string scopesClaim = 7; - * @return The bytes for scopesClaim. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getScopesClaimBytes() { - java.lang.Object ref = scopesClaim_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - scopesClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLAIMMAPPING_FIELD_NUMBER = 8; - private static final class ClaimMappingDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWTIssuer_ClaimMappingEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> claimMapping_; - private com.google.protobuf.MapField - internalGetClaimMapping() { - if (claimMapping_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ClaimMappingDefaultEntryHolder.defaultEntry); - } - return claimMapping_; - } - - public int getClaimMappingCount() { - return internalGetClaimMapping().getMap().size(); - } - /** - * map<string, string> claimMapping = 8; - */ - - @java.lang.Override - public boolean containsClaimMapping( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetClaimMapping().getMap().containsKey(key); - } - /** - * Use {@link #getClaimMappingMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getClaimMapping() { - return getClaimMappingMap(); - } - /** - * map<string, string> claimMapping = 8; - */ - @java.lang.Override - - public java.util.Map getClaimMappingMap() { - return internalGetClaimMapping().getMap(); - } - /** - * map<string, string> claimMapping = 8; - */ - @java.lang.Override - - public java.lang.String getClaimMappingOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetClaimMapping().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> claimMapping = 8; - */ - @java.lang.Override - - public java.lang.String getClaimMappingOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetClaimMapping().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int ENVIRONMENTS_FIELD_NUMBER = 9; - private com.google.protobuf.LazyStringList environments_; - /** - * repeated string environments = 9; - * @return A list containing the environments. - */ - public com.google.protobuf.ProtocolStringList - getEnvironmentsList() { - return environments_; - } - /** - * repeated string environments = 9; - * @return The count of environments. - */ - public int getEnvironmentsCount() { - return environments_.size(); - } - /** - * repeated string environments = 9; - * @param index The index of the element to return. - * @return The environments at the given index. - */ - public java.lang.String getEnvironments(int index) { - return environments_.get(index); - } - /** - * repeated string environments = 9; - * @param index The index of the value to return. - * @return The bytes of the environments at the given index. - */ - public com.google.protobuf.ByteString - getEnvironmentsBytes(int index) { - return environments_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getEventIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, eventId_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (!getOrganizationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, organization_); - } - if (!getIssuerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, issuer_); - } - if (certificate_ != null) { - output.writeMessage(5, getCertificate()); - } - if (!getConsumerKeyClaimBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, consumerKeyClaim_); - } - if (!getScopesClaimBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, scopesClaim_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetClaimMapping(), - ClaimMappingDefaultEntryHolder.defaultEntry, - 8); - for (int i = 0; i < environments_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, environments_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getEventIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, eventId_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (!getOrganizationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, organization_); - } - if (!getIssuerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, issuer_); - } - if (certificate_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getCertificate()); - } - if (!getConsumerKeyClaimBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, consumerKeyClaim_); - } - if (!getScopesClaimBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, scopesClaim_); - } - for (java.util.Map.Entry entry - : internalGetClaimMapping().getMap().entrySet()) { - com.google.protobuf.MapEntry - claimMapping__ = ClaimMappingDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, claimMapping__); - } - { - int dataSize = 0; - for (int i = 0; i < environments_.size(); i++) { - dataSize += computeStringSizeNoTag(environments_.getRaw(i)); - } - size += dataSize; - size += 1 * getEnvironmentsList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.JWTIssuer)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer other = (org.wso2.apk.enforcer.discovery.subscription.JWTIssuer) obj; - - if (!getEventId() - .equals(other.getEventId())) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getOrganization() - .equals(other.getOrganization())) return false; - if (!getIssuer() - .equals(other.getIssuer())) return false; - if (hasCertificate() != other.hasCertificate()) return false; - if (hasCertificate()) { - if (!getCertificate() - .equals(other.getCertificate())) return false; - } - if (!getConsumerKeyClaim() - .equals(other.getConsumerKeyClaim())) return false; - if (!getScopesClaim() - .equals(other.getScopesClaim())) return false; - if (!internalGetClaimMapping().equals( - other.internalGetClaimMapping())) return false; - if (!getEnvironmentsList() - .equals(other.getEnvironmentsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + EVENTID_FIELD_NUMBER; - hash = (53 * hash) + getEventId().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; - hash = (53 * hash) + getOrganization().hashCode(); - hash = (37 * hash) + ISSUER_FIELD_NUMBER; - hash = (53 * hash) + getIssuer().hashCode(); - if (hasCertificate()) { - hash = (37 * hash) + CERTIFICATE_FIELD_NUMBER; - hash = (53 * hash) + getCertificate().hashCode(); - } - hash = (37 * hash) + CONSUMERKEYCLAIM_FIELD_NUMBER; - hash = (53 * hash) + getConsumerKeyClaim().hashCode(); - hash = (37 * hash) + SCOPESCLAIM_FIELD_NUMBER; - hash = (53 * hash) + getScopesClaim().hashCode(); - if (!internalGetClaimMapping().getMap().isEmpty()) { - hash = (37 * hash) + CLAIMMAPPING_FIELD_NUMBER; - hash = (53 * hash) + internalGetClaimMapping().hashCode(); - } - if (getEnvironmentsCount() > 0) { - hash = (37 * hash) + ENVIRONMENTS_FIELD_NUMBER; - hash = (53 * hash) + getEnvironmentsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.JWTIssuer 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; - } - /** - *
-   * JWTIssuer data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.JWTIssuer} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.JWTIssuer) - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWTIssuer_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 8: - return internalGetClaimMapping(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 8: - return internalGetMutableClaimMapping(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWTIssuer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.class, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.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(); - eventId_ = ""; - - name_ = ""; - - organization_ = ""; - - issuer_ = ""; - - if (certificateBuilder_ == null) { - certificate_ = null; - } else { - certificate_ = null; - certificateBuilder_ = null; - } - consumerKeyClaim_ = ""; - - scopesClaim_ = ""; - - internalGetMutableClaimMapping().clear(); - environments_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.internal_static_wso2_discovery_subscription_JWTIssuer_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer build() { - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer result = new org.wso2.apk.enforcer.discovery.subscription.JWTIssuer(this); - int from_bitField0_ = bitField0_; - result.eventId_ = eventId_; - result.name_ = name_; - result.organization_ = organization_; - result.issuer_ = issuer_; - if (certificateBuilder_ == null) { - result.certificate_ = certificate_; - } else { - result.certificate_ = certificateBuilder_.build(); - } - result.consumerKeyClaim_ = consumerKeyClaim_; - result.scopesClaim_ = scopesClaim_; - result.claimMapping_ = internalGetClaimMapping(); - result.claimMapping_.makeImmutable(); - if (((bitField0_ & 0x00000002) != 0)) { - environments_ = environments_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.environments_ = environments_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.JWTIssuer) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.JWTIssuer)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.JWTIssuer other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.getDefaultInstance()) return this; - if (!other.getEventId().isEmpty()) { - eventId_ = other.eventId_; - onChanged(); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getOrganization().isEmpty()) { - organization_ = other.organization_; - onChanged(); - } - if (!other.getIssuer().isEmpty()) { - issuer_ = other.issuer_; - onChanged(); - } - if (other.hasCertificate()) { - mergeCertificate(other.getCertificate()); - } - if (!other.getConsumerKeyClaim().isEmpty()) { - consumerKeyClaim_ = other.consumerKeyClaim_; - onChanged(); - } - if (!other.getScopesClaim().isEmpty()) { - scopesClaim_ = other.scopesClaim_; - onChanged(); - } - internalGetMutableClaimMapping().mergeFrom( - other.internalGetClaimMapping()); - if (!other.environments_.isEmpty()) { - if (environments_.isEmpty()) { - environments_ = other.environments_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureEnvironmentsIsMutable(); - environments_.addAll(other.environments_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.JWTIssuer) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object eventId_ = ""; - /** - * string eventId = 1; - * @return The eventId. - */ - public java.lang.String getEventId() { - java.lang.Object ref = eventId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - eventId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string eventId = 1; - * @return The bytes for eventId. - */ - public com.google.protobuf.ByteString - getEventIdBytes() { - java.lang.Object ref = eventId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - eventId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string eventId = 1; - * @param value The eventId to set. - * @return This builder for chaining. - */ - public Builder setEventId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - eventId_ = value; - onChanged(); - return this; - } - /** - * string eventId = 1; - * @return This builder for chaining. - */ - public Builder clearEventId() { - - eventId_ = getDefaultInstance().getEventId(); - onChanged(); - return this; - } - /** - * string eventId = 1; - * @param value The bytes for eventId to set. - * @return This builder for chaining. - */ - public Builder setEventIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - eventId_ = value; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 2; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 2; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 2; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 2; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 2; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object organization_ = ""; - /** - * string organization = 3; - * @return The organization. - */ - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organization = 3; - * @return The bytes for organization. - */ - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organization = 3; - * @param value The organization to set. - * @return This builder for chaining. - */ - public Builder setOrganization( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organization_ = value; - onChanged(); - return this; - } - /** - * string organization = 3; - * @return This builder for chaining. - */ - public Builder clearOrganization() { - - organization_ = getDefaultInstance().getOrganization(); - onChanged(); - return this; - } - /** - * string organization = 3; - * @param value The bytes for organization to set. - * @return This builder for chaining. - */ - public Builder setOrganizationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organization_ = value; - onChanged(); - return this; - } - - private java.lang.Object issuer_ = ""; - /** - * string issuer = 4; - * @return The issuer. - */ - public java.lang.String getIssuer() { - java.lang.Object ref = issuer_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - issuer_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string issuer = 4; - * @return The bytes for issuer. - */ - public com.google.protobuf.ByteString - getIssuerBytes() { - java.lang.Object ref = issuer_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - issuer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string issuer = 4; - * @param value The issuer to set. - * @return This builder for chaining. - */ - public Builder setIssuer( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - issuer_ = value; - onChanged(); - return this; - } - /** - * string issuer = 4; - * @return This builder for chaining. - */ - public Builder clearIssuer() { - - issuer_ = getDefaultInstance().getIssuer(); - onChanged(); - return this; - } - /** - * string issuer = 4; - * @param value The bytes for issuer to set. - * @return This builder for chaining. - */ - public Builder setIssuerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - issuer_ = value; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.subscription.Certificate certificate_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Certificate, org.wso2.apk.enforcer.discovery.subscription.Certificate.Builder, org.wso2.apk.enforcer.discovery.subscription.CertificateOrBuilder> certificateBuilder_; - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - * @return Whether the certificate field is set. - */ - public boolean hasCertificate() { - return certificateBuilder_ != null || certificate_ != null; - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - * @return The certificate. - */ - public org.wso2.apk.enforcer.discovery.subscription.Certificate getCertificate() { - if (certificateBuilder_ == null) { - return certificate_ == null ? org.wso2.apk.enforcer.discovery.subscription.Certificate.getDefaultInstance() : certificate_; - } else { - return certificateBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - public Builder setCertificate(org.wso2.apk.enforcer.discovery.subscription.Certificate value) { - if (certificateBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - certificate_ = value; - onChanged(); - } else { - certificateBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - public Builder setCertificate( - org.wso2.apk.enforcer.discovery.subscription.Certificate.Builder builderForValue) { - if (certificateBuilder_ == null) { - certificate_ = builderForValue.build(); - onChanged(); - } else { - certificateBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - public Builder mergeCertificate(org.wso2.apk.enforcer.discovery.subscription.Certificate value) { - if (certificateBuilder_ == null) { - if (certificate_ != null) { - certificate_ = - org.wso2.apk.enforcer.discovery.subscription.Certificate.newBuilder(certificate_).mergeFrom(value).buildPartial(); - } else { - certificate_ = value; - } - onChanged(); - } else { - certificateBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - public Builder clearCertificate() { - if (certificateBuilder_ == null) { - certificate_ = null; - onChanged(); - } else { - certificate_ = null; - certificateBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - public org.wso2.apk.enforcer.discovery.subscription.Certificate.Builder getCertificateBuilder() { - - onChanged(); - return getCertificateFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - public org.wso2.apk.enforcer.discovery.subscription.CertificateOrBuilder getCertificateOrBuilder() { - if (certificateBuilder_ != null) { - return certificateBuilder_.getMessageOrBuilder(); - } else { - return certificate_ == null ? - org.wso2.apk.enforcer.discovery.subscription.Certificate.getDefaultInstance() : certificate_; - } - } - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Certificate, org.wso2.apk.enforcer.discovery.subscription.Certificate.Builder, org.wso2.apk.enforcer.discovery.subscription.CertificateOrBuilder> - getCertificateFieldBuilder() { - if (certificateBuilder_ == null) { - certificateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Certificate, org.wso2.apk.enforcer.discovery.subscription.Certificate.Builder, org.wso2.apk.enforcer.discovery.subscription.CertificateOrBuilder>( - getCertificate(), - getParentForChildren(), - isClean()); - certificate_ = null; - } - return certificateBuilder_; - } - - private java.lang.Object consumerKeyClaim_ = ""; - /** - * string consumerKeyClaim = 6; - * @return The consumerKeyClaim. - */ - public java.lang.String getConsumerKeyClaim() { - java.lang.Object ref = consumerKeyClaim_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - consumerKeyClaim_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string consumerKeyClaim = 6; - * @return The bytes for consumerKeyClaim. - */ - public com.google.protobuf.ByteString - getConsumerKeyClaimBytes() { - java.lang.Object ref = consumerKeyClaim_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - consumerKeyClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string consumerKeyClaim = 6; - * @param value The consumerKeyClaim to set. - * @return This builder for chaining. - */ - public Builder setConsumerKeyClaim( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - consumerKeyClaim_ = value; - onChanged(); - return this; - } - /** - * string consumerKeyClaim = 6; - * @return This builder for chaining. - */ - public Builder clearConsumerKeyClaim() { - - consumerKeyClaim_ = getDefaultInstance().getConsumerKeyClaim(); - onChanged(); - return this; - } - /** - * string consumerKeyClaim = 6; - * @param value The bytes for consumerKeyClaim to set. - * @return This builder for chaining. - */ - public Builder setConsumerKeyClaimBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - consumerKeyClaim_ = value; - onChanged(); - return this; - } - - private java.lang.Object scopesClaim_ = ""; - /** - * string scopesClaim = 7; - * @return The scopesClaim. - */ - public java.lang.String getScopesClaim() { - java.lang.Object ref = scopesClaim_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - scopesClaim_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string scopesClaim = 7; - * @return The bytes for scopesClaim. - */ - public com.google.protobuf.ByteString - getScopesClaimBytes() { - java.lang.Object ref = scopesClaim_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - scopesClaim_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string scopesClaim = 7; - * @param value The scopesClaim to set. - * @return This builder for chaining. - */ - public Builder setScopesClaim( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - scopesClaim_ = value; - onChanged(); - return this; - } - /** - * string scopesClaim = 7; - * @return This builder for chaining. - */ - public Builder clearScopesClaim() { - - scopesClaim_ = getDefaultInstance().getScopesClaim(); - onChanged(); - return this; - } - /** - * string scopesClaim = 7; - * @param value The bytes for scopesClaim to set. - * @return This builder for chaining. - */ - public Builder setScopesClaimBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - scopesClaim_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> claimMapping_; - private com.google.protobuf.MapField - internalGetClaimMapping() { - if (claimMapping_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ClaimMappingDefaultEntryHolder.defaultEntry); - } - return claimMapping_; - } - private com.google.protobuf.MapField - internalGetMutableClaimMapping() { - onChanged();; - if (claimMapping_ == null) { - claimMapping_ = com.google.protobuf.MapField.newMapField( - ClaimMappingDefaultEntryHolder.defaultEntry); - } - if (!claimMapping_.isMutable()) { - claimMapping_ = claimMapping_.copy(); - } - return claimMapping_; - } - - public int getClaimMappingCount() { - return internalGetClaimMapping().getMap().size(); - } - /** - * map<string, string> claimMapping = 8; - */ - - @java.lang.Override - public boolean containsClaimMapping( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetClaimMapping().getMap().containsKey(key); - } - /** - * Use {@link #getClaimMappingMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getClaimMapping() { - return getClaimMappingMap(); - } - /** - * map<string, string> claimMapping = 8; - */ - @java.lang.Override - - public java.util.Map getClaimMappingMap() { - return internalGetClaimMapping().getMap(); - } - /** - * map<string, string> claimMapping = 8; - */ - @java.lang.Override - - public java.lang.String getClaimMappingOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetClaimMapping().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> claimMapping = 8; - */ - @java.lang.Override - - public java.lang.String getClaimMappingOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetClaimMapping().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearClaimMapping() { - internalGetMutableClaimMapping().getMutableMap() - .clear(); - return this; - } - /** - * map<string, string> claimMapping = 8; - */ - - public Builder removeClaimMapping( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableClaimMapping().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableClaimMapping() { - return internalGetMutableClaimMapping().getMutableMap(); - } - /** - * map<string, string> claimMapping = 8; - */ - public Builder putClaimMapping( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableClaimMapping().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, string> claimMapping = 8; - */ - - public Builder putAllClaimMapping( - java.util.Map values) { - internalGetMutableClaimMapping().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.LazyStringList environments_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureEnvironmentsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - environments_ = new com.google.protobuf.LazyStringArrayList(environments_); - bitField0_ |= 0x00000002; - } - } - /** - * repeated string environments = 9; - * @return A list containing the environments. - */ - public com.google.protobuf.ProtocolStringList - getEnvironmentsList() { - return environments_.getUnmodifiableView(); - } - /** - * repeated string environments = 9; - * @return The count of environments. - */ - public int getEnvironmentsCount() { - return environments_.size(); - } - /** - * repeated string environments = 9; - * @param index The index of the element to return. - * @return The environments at the given index. - */ - public java.lang.String getEnvironments(int index) { - return environments_.get(index); - } - /** - * repeated string environments = 9; - * @param index The index of the value to return. - * @return The bytes of the environments at the given index. - */ - public com.google.protobuf.ByteString - getEnvironmentsBytes(int index) { - return environments_.getByteString(index); - } - /** - * repeated string environments = 9; - * @param index The index to set the value at. - * @param value The environments to set. - * @return This builder for chaining. - */ - public Builder setEnvironments( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvironmentsIsMutable(); - environments_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string environments = 9; - * @param value The environments to add. - * @return This builder for chaining. - */ - public Builder addEnvironments( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvironmentsIsMutable(); - environments_.add(value); - onChanged(); - return this; - } - /** - * repeated string environments = 9; - * @param values The environments to add. - * @return This builder for chaining. - */ - public Builder addAllEnvironments( - java.lang.Iterable values) { - ensureEnvironmentsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, environments_); - onChanged(); - return this; - } - /** - * repeated string environments = 9; - * @return This builder for chaining. - */ - public Builder clearEnvironments() { - environments_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * repeated string environments = 9; - * @param value The bytes of the environments to add. - * @return This builder for chaining. - */ - public Builder addEnvironmentsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureEnvironmentsIsMutable(); - environments_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.JWTIssuer) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.JWTIssuer) - private static final org.wso2.apk.enforcer.discovery.subscription.JWTIssuer DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.JWTIssuer(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuer getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JWTIssuer parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JWTIssuer(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerList.java deleted file mode 100644 index 59f4c63b5d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * JWTIssuerList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.JWTIssuerList} - */ -public final class JWTIssuerList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.JWTIssuerList) - JWTIssuerListOrBuilder { -private static final long serialVersionUID = 0L; - // Use JWTIssuerList.newBuilder() to construct. - private JWTIssuerList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JWTIssuerList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JWTIssuerList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JWTIssuerList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerListProto.internal_static_wso2_discovery_subscription_JWTIssuerList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerListProto.internal_static_wso2_discovery_subscription_JWTIssuerList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList.class, org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuerOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList other = (org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList 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; - } - /** - *
-   * JWTIssuerList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.JWTIssuerList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.JWTIssuerList) - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerListProto.internal_static_wso2_discovery_subscription_JWTIssuerList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerListProto.internal_static_wso2_discovery_subscription_JWTIssuerList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList.class, org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerListProto.internal_static_wso2_discovery_subscription_JWTIssuerList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList build() { - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList result = new org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder, org.wso2.apk.enforcer.discovery.subscription.JWTIssuerOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.JWTIssuer value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuerOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder, org.wso2.apk.enforcer.discovery.subscription.JWTIssuerOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer, org.wso2.apk.enforcer.discovery.subscription.JWTIssuer.Builder, org.wso2.apk.enforcer.discovery.subscription.JWTIssuerOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.JWTIssuerList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.JWTIssuerList) - private static final org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JWTIssuerList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JWTIssuerList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.JWTIssuerList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerListOrBuilder.java deleted file mode 100644 index 991ff7e511..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface JWTIssuerListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.JWTIssuerList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.JWTIssuer getList(int index); - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.JWTIssuer list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerListProto.java deleted file mode 100644 index 2087aae3a0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerListProto.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class JWTIssuerListProto { - private JWTIssuerListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_JWTIssuerList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_JWTIssuerList_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/subscription/jwtIssuer_" + - "list.proto\022\033wso2.discovery.subscription\032" + - "+wso2/discovery/subscription/jwtIssuer.p" + - "roto\"E\n\rJWTIssuerList\0224\n\004list\030\002 \003(\0132&.ws" + - "o2.discovery.subscription.JWTIssuerB\225\001\n," + - "org.wso2.apk.enforcer.discovery.subscrip" + - "tionB\022JWTIssuerListProtoP\001ZOgithub.com/e" + - "nvoyproxy/go-control-plane/wso2/discover" + - "y/subscription;subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_JWTIssuerList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_JWTIssuerList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_JWTIssuerList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.JWTIssuerProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerOrBuilder.java deleted file mode 100644 index 421995fec5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerOrBuilder.java +++ /dev/null @@ -1,155 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface JWTIssuerOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.JWTIssuer) - com.google.protobuf.MessageOrBuilder { - - /** - * string eventId = 1; - * @return The eventId. - */ - java.lang.String getEventId(); - /** - * string eventId = 1; - * @return The bytes for eventId. - */ - com.google.protobuf.ByteString - getEventIdBytes(); - - /** - * string name = 2; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 2; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string organization = 3; - * @return The organization. - */ - java.lang.String getOrganization(); - /** - * string organization = 3; - * @return The bytes for organization. - */ - com.google.protobuf.ByteString - getOrganizationBytes(); - - /** - * string issuer = 4; - * @return The issuer. - */ - java.lang.String getIssuer(); - /** - * string issuer = 4; - * @return The bytes for issuer. - */ - com.google.protobuf.ByteString - getIssuerBytes(); - - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - * @return Whether the certificate field is set. - */ - boolean hasCertificate(); - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - * @return The certificate. - */ - org.wso2.apk.enforcer.discovery.subscription.Certificate getCertificate(); - /** - * .wso2.discovery.subscription.Certificate certificate = 5; - */ - org.wso2.apk.enforcer.discovery.subscription.CertificateOrBuilder getCertificateOrBuilder(); - - /** - * string consumerKeyClaim = 6; - * @return The consumerKeyClaim. - */ - java.lang.String getConsumerKeyClaim(); - /** - * string consumerKeyClaim = 6; - * @return The bytes for consumerKeyClaim. - */ - com.google.protobuf.ByteString - getConsumerKeyClaimBytes(); - - /** - * string scopesClaim = 7; - * @return The scopesClaim. - */ - java.lang.String getScopesClaim(); - /** - * string scopesClaim = 7; - * @return The bytes for scopesClaim. - */ - com.google.protobuf.ByteString - getScopesClaimBytes(); - - /** - * map<string, string> claimMapping = 8; - */ - int getClaimMappingCount(); - /** - * map<string, string> claimMapping = 8; - */ - boolean containsClaimMapping( - java.lang.String key); - /** - * Use {@link #getClaimMappingMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getClaimMapping(); - /** - * map<string, string> claimMapping = 8; - */ - java.util.Map - getClaimMappingMap(); - /** - * map<string, string> claimMapping = 8; - */ - - java.lang.String getClaimMappingOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - * map<string, string> claimMapping = 8; - */ - - java.lang.String getClaimMappingOrThrow( - java.lang.String key); - - /** - * repeated string environments = 9; - * @return A list containing the environments. - */ - java.util.List - getEnvironmentsList(); - /** - * repeated string environments = 9; - * @return The count of environments. - */ - int getEnvironmentsCount(); - /** - * repeated string environments = 9; - * @param index The index of the element to return. - * @return The environments at the given index. - */ - java.lang.String getEnvironments(int index); - /** - * repeated string environments = 9; - * @param index The index of the value to return. - * @return The bytes of the environments at the given index. - */ - com.google.protobuf.ByteString - getEnvironmentsBytes(int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerProto.java deleted file mode 100644 index 705c0d9bc8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/JWTIssuerProto.java +++ /dev/null @@ -1,96 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/jwtIssuer.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class JWTIssuerProto { - private JWTIssuerProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_JWTIssuer_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_JWTIssuer_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_JWTIssuer_ClaimMappingEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_JWTIssuer_ClaimMappingEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_Certificate_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_Certificate_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_JWKS_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_JWKS_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n+wso2/discovery/subscription/jwtIssuer." + - "proto\022\033wso2.discovery.subscription\"\331\002\n\tJ" + - "WTIssuer\022\017\n\007eventId\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022" + - "\024\n\014organization\030\003 \001(\t\022\016\n\006issuer\030\004 \001(\t\022=\n" + - "\013certificate\030\005 \001(\0132(.wso2.discovery.subs" + - "cription.Certificate\022\030\n\020consumerKeyClaim" + - "\030\006 \001(\t\022\023\n\013scopesClaim\030\007 \001(\t\022N\n\014claimMapp" + - "ing\030\010 \003(\01328.wso2.discovery.subscription." + - "JWTIssuer.ClaimMappingEntry\022\024\n\014environme" + - "nts\030\t \003(\t\0323\n\021ClaimMappingEntry\022\013\n\003key\030\001 " + - "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"S\n\013Certificate\022\023\n" + - "\013certificate\030\001 \001(\t\022/\n\004jwks\030\002 \001(\0132!.wso2." + - "discovery.subscription.JWKS\" \n\004JWKS\022\013\n\003u" + - "rl\030\001 \001(\t\022\013\n\003tls\030\002 \001(\tB\221\001\n,org.wso2.apk.e" + - "nforcer.discovery.subscriptionB\016JWTIssue" + - "rProtoP\001ZOgithub.com/envoyproxy/go-contr" + - "ol-plane/wso2/discovery/subscription;sub" + - "scriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_JWTIssuer_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_JWTIssuer_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_JWTIssuer_descriptor, - new java.lang.String[] { "EventId", "Name", "Organization", "Issuer", "Certificate", "ConsumerKeyClaim", "ScopesClaim", "ClaimMapping", "Environments", }); - internal_static_wso2_discovery_subscription_JWTIssuer_ClaimMappingEntry_descriptor = - internal_static_wso2_discovery_subscription_JWTIssuer_descriptor.getNestedTypes().get(0); - internal_static_wso2_discovery_subscription_JWTIssuer_ClaimMappingEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_JWTIssuer_ClaimMappingEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_wso2_discovery_subscription_Certificate_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_subscription_Certificate_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_Certificate_descriptor, - new java.lang.String[] { "Certificate", "Jwks", }); - internal_static_wso2_discovery_subscription_JWKS_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_wso2_discovery_subscription_JWKS_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_JWKS_descriptor, - new java.lang.String[] { "Url", "Tls", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscribedAPI.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscribedAPI.java deleted file mode 100644 index 9b2274d4b1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscribedAPI.java +++ /dev/null @@ -1,695 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.SubscribedAPI} - */ -public final class SubscribedAPI extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SubscribedAPI) - SubscribedAPIOrBuilder { -private static final long serialVersionUID = 0L; - // Use SubscribedAPI.newBuilder() to construct. - private SubscribedAPI(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SubscribedAPI() { - name_ = ""; - version_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SubscribedAPI(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SubscribedAPI( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - version_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_SubscribedAPI_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_SubscribedAPI_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.class, org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VERSION_FIELD_NUMBER = 2; - private volatile java.lang.Object version_; - /** - * string version = 2; - * @return The version. - */ - @java.lang.Override - public java.lang.String getVersion() { - java.lang.Object ref = version_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - version_ = s; - return s; - } - } - /** - * string version = 2; - * @return The bytes for version. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getVersionBytes() { - java.lang.Object ref = version_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - version_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI other = (org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getVersion() - .equals(other.getVersion())) 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) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.SubscribedAPI} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SubscribedAPI) - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPIOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_SubscribedAPI_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_SubscribedAPI_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.class, org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.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(); - name_ = ""; - - version_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_SubscribedAPI_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI build() { - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI result = new org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI(this); - result.name_ = name_; - result.version_ = version_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getVersion().isEmpty()) { - version_ = other.version_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object version_ = ""; - /** - * string version = 2; - * @return The version. - */ - public java.lang.String getVersion() { - java.lang.Object ref = version_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - version_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string version = 2; - * @return The bytes for version. - */ - public com.google.protobuf.ByteString - getVersionBytes() { - java.lang.Object ref = version_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - version_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string version = 2; - * @param value The version to set. - * @return This builder for chaining. - */ - public Builder setVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - version_ = value; - onChanged(); - return this; - } - /** - * string version = 2; - * @return This builder for chaining. - */ - public Builder clearVersion() { - - version_ = getDefaultInstance().getVersion(); - onChanged(); - return this; - } - /** - * string version = 2; - * @param value The bytes for version to set. - * @return This builder for chaining. - */ - public Builder setVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - version_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SubscribedAPI) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SubscribedAPI) - private static final org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SubscribedAPI parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SubscribedAPI(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscribedAPIOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscribedAPIOrBuilder.java deleted file mode 100644 index 2d67f40954..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscribedAPIOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SubscribedAPIOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SubscribedAPI) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string version = 2; - * @return The version. - */ - java.lang.String getVersion(); - /** - * string version = 2; - * @return The bytes for version. - */ - com.google.protobuf.ByteString - getVersionBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Subscription.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Subscription.java deleted file mode 100644 index 177c99c0fb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Subscription.java +++ /dev/null @@ -1,1167 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * Subscription data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.Subscription} - */ -public final class Subscription extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.Subscription) - SubscriptionOrBuilder { -private static final long serialVersionUID = 0L; - // Use Subscription.newBuilder() to construct. - private Subscription(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Subscription() { - subStatus_ = ""; - uuid_ = ""; - organization_ = ""; - ratelimitTier_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Subscription(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Subscription( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - subStatus_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - organization_ = s; - break; - } - case 34: { - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.Builder subBuilder = null; - if (subscribedApi_ != null) { - subBuilder = subscribedApi_.toBuilder(); - } - subscribedApi_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(subscribedApi_); - subscribedApi_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - ratelimitTier_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_Subscription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_Subscription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Subscription.class, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder.class); - } - - public static final int SUBSTATUS_FIELD_NUMBER = 1; - private volatile java.lang.Object subStatus_; - /** - * string subStatus = 1; - * @return The subStatus. - */ - @java.lang.Override - public java.lang.String getSubStatus() { - java.lang.Object ref = subStatus_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subStatus_ = s; - return s; - } - } - /** - * string subStatus = 1; - * @return The bytes for subStatus. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSubStatusBytes() { - java.lang.Object ref = subStatus_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subStatus_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UUID_FIELD_NUMBER = 2; - private volatile java.lang.Object uuid_; - /** - * string uuid = 2; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORGANIZATION_FIELD_NUMBER = 3; - private volatile java.lang.Object organization_; - /** - * string organization = 3; - * @return The organization. - */ - @java.lang.Override - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } - } - /** - * string organization = 3; - * @return The bytes for organization. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SUBSCRIBEDAPI_FIELD_NUMBER = 4; - private org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI subscribedApi_; - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - * @return Whether the subscribedApi field is set. - */ - @java.lang.Override - public boolean hasSubscribedApi() { - return subscribedApi_ != null; - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - * @return The subscribedApi. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI getSubscribedApi() { - return subscribedApi_ == null ? org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.getDefaultInstance() : subscribedApi_; - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPIOrBuilder getSubscribedApiOrBuilder() { - return getSubscribedApi(); - } - - public static final int RATELIMITTIER_FIELD_NUMBER = 5; - private volatile java.lang.Object ratelimitTier_; - /** - * string ratelimitTier = 5; - * @return The ratelimitTier. - */ - @java.lang.Override - public java.lang.String getRatelimitTier() { - java.lang.Object ref = ratelimitTier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ratelimitTier_ = s; - return s; - } - } - /** - * string ratelimitTier = 5; - * @return The bytes for ratelimitTier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRatelimitTierBytes() { - java.lang.Object ref = ratelimitTier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - ratelimitTier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getSubStatusBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subStatus_); - } - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uuid_); - } - if (!getOrganizationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, organization_); - } - if (subscribedApi_ != null) { - output.writeMessage(4, getSubscribedApi()); - } - if (!getRatelimitTierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, ratelimitTier_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getSubStatusBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subStatus_); - } - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uuid_); - } - if (!getOrganizationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, organization_); - } - if (subscribedApi_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getSubscribedApi()); - } - if (!getRatelimitTierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, ratelimitTier_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.Subscription)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.Subscription other = (org.wso2.apk.enforcer.discovery.subscription.Subscription) obj; - - if (!getSubStatus() - .equals(other.getSubStatus())) return false; - if (!getUuid() - .equals(other.getUuid())) return false; - if (!getOrganization() - .equals(other.getOrganization())) return false; - if (hasSubscribedApi() != other.hasSubscribedApi()) return false; - if (hasSubscribedApi()) { - if (!getSubscribedApi() - .equals(other.getSubscribedApi())) return false; - } - if (!getRatelimitTier() - .equals(other.getRatelimitTier())) 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) + SUBSTATUS_FIELD_NUMBER; - hash = (53 * hash) + getSubStatus().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; - hash = (53 * hash) + getOrganization().hashCode(); - if (hasSubscribedApi()) { - hash = (37 * hash) + SUBSCRIBEDAPI_FIELD_NUMBER; - hash = (53 * hash) + getSubscribedApi().hashCode(); - } - hash = (37 * hash) + RATELIMITTIER_FIELD_NUMBER; - hash = (53 * hash) + getRatelimitTier().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Subscription parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.Subscription 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; - } - /** - *
-   * Subscription data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.Subscription} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.Subscription) - org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_Subscription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_Subscription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Subscription.class, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.Subscription.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(); - subStatus_ = ""; - - uuid_ = ""; - - organization_ = ""; - - if (subscribedApiBuilder_ == null) { - subscribedApi_ = null; - } else { - subscribedApi_ = null; - subscribedApiBuilder_ = null; - } - ratelimitTier_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.internal_static_wso2_discovery_subscription_Subscription_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Subscription getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Subscription build() { - org.wso2.apk.enforcer.discovery.subscription.Subscription result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Subscription buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.Subscription result = new org.wso2.apk.enforcer.discovery.subscription.Subscription(this); - result.subStatus_ = subStatus_; - result.uuid_ = uuid_; - result.organization_ = organization_; - if (subscribedApiBuilder_ == null) { - result.subscribedApi_ = subscribedApi_; - } else { - result.subscribedApi_ = subscribedApiBuilder_.build(); - } - result.ratelimitTier_ = ratelimitTier_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.Subscription) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.Subscription)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.Subscription other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance()) return this; - if (!other.getSubStatus().isEmpty()) { - subStatus_ = other.subStatus_; - onChanged(); - } - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (!other.getOrganization().isEmpty()) { - organization_ = other.organization_; - onChanged(); - } - if (other.hasSubscribedApi()) { - mergeSubscribedApi(other.getSubscribedApi()); - } - if (!other.getRatelimitTier().isEmpty()) { - ratelimitTier_ = other.ratelimitTier_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.Subscription parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.Subscription) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object subStatus_ = ""; - /** - * string subStatus = 1; - * @return The subStatus. - */ - public java.lang.String getSubStatus() { - java.lang.Object ref = subStatus_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subStatus_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string subStatus = 1; - * @return The bytes for subStatus. - */ - public com.google.protobuf.ByteString - getSubStatusBytes() { - java.lang.Object ref = subStatus_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - subStatus_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string subStatus = 1; - * @param value The subStatus to set. - * @return This builder for chaining. - */ - public Builder setSubStatus( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - subStatus_ = value; - onChanged(); - return this; - } - /** - * string subStatus = 1; - * @return This builder for chaining. - */ - public Builder clearSubStatus() { - - subStatus_ = getDefaultInstance().getSubStatus(); - onChanged(); - return this; - } - /** - * string subStatus = 1; - * @param value The bytes for subStatus to set. - * @return This builder for chaining. - */ - public Builder setSubStatusBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - subStatus_ = value; - onChanged(); - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 2; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 2; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 2; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 2; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private java.lang.Object organization_ = ""; - /** - * string organization = 3; - * @return The organization. - */ - public java.lang.String getOrganization() { - java.lang.Object ref = organization_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - organization_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string organization = 3; - * @return The bytes for organization. - */ - public com.google.protobuf.ByteString - getOrganizationBytes() { - java.lang.Object ref = organization_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - organization_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string organization = 3; - * @param value The organization to set. - * @return This builder for chaining. - */ - public Builder setOrganization( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - organization_ = value; - onChanged(); - return this; - } - /** - * string organization = 3; - * @return This builder for chaining. - */ - public Builder clearOrganization() { - - organization_ = getDefaultInstance().getOrganization(); - onChanged(); - return this; - } - /** - * string organization = 3; - * @param value The bytes for organization to set. - * @return This builder for chaining. - */ - public Builder setOrganizationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - organization_ = value; - onChanged(); - return this; - } - - private org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI subscribedApi_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI, org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscribedAPIOrBuilder> subscribedApiBuilder_; - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - * @return Whether the subscribedApi field is set. - */ - public boolean hasSubscribedApi() { - return subscribedApiBuilder_ != null || subscribedApi_ != null; - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - * @return The subscribedApi. - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI getSubscribedApi() { - if (subscribedApiBuilder_ == null) { - return subscribedApi_ == null ? org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.getDefaultInstance() : subscribedApi_; - } else { - return subscribedApiBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - public Builder setSubscribedApi(org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI value) { - if (subscribedApiBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - subscribedApi_ = value; - onChanged(); - } else { - subscribedApiBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - public Builder setSubscribedApi( - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.Builder builderForValue) { - if (subscribedApiBuilder_ == null) { - subscribedApi_ = builderForValue.build(); - onChanged(); - } else { - subscribedApiBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - public Builder mergeSubscribedApi(org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI value) { - if (subscribedApiBuilder_ == null) { - if (subscribedApi_ != null) { - subscribedApi_ = - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.newBuilder(subscribedApi_).mergeFrom(value).buildPartial(); - } else { - subscribedApi_ = value; - } - onChanged(); - } else { - subscribedApiBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - public Builder clearSubscribedApi() { - if (subscribedApiBuilder_ == null) { - subscribedApi_ = null; - onChanged(); - } else { - subscribedApi_ = null; - subscribedApiBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.Builder getSubscribedApiBuilder() { - - onChanged(); - return getSubscribedApiFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscribedAPIOrBuilder getSubscribedApiOrBuilder() { - if (subscribedApiBuilder_ != null) { - return subscribedApiBuilder_.getMessageOrBuilder(); - } else { - return subscribedApi_ == null ? - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.getDefaultInstance() : subscribedApi_; - } - } - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI, org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscribedAPIOrBuilder> - getSubscribedApiFieldBuilder() { - if (subscribedApiBuilder_ == null) { - subscribedApiBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI, org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscribedAPIOrBuilder>( - getSubscribedApi(), - getParentForChildren(), - isClean()); - subscribedApi_ = null; - } - return subscribedApiBuilder_; - } - - private java.lang.Object ratelimitTier_ = ""; - /** - * string ratelimitTier = 5; - * @return The ratelimitTier. - */ - public java.lang.String getRatelimitTier() { - java.lang.Object ref = ratelimitTier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ratelimitTier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string ratelimitTier = 5; - * @return The bytes for ratelimitTier. - */ - public com.google.protobuf.ByteString - getRatelimitTierBytes() { - java.lang.Object ref = ratelimitTier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - ratelimitTier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string ratelimitTier = 5; - * @param value The ratelimitTier to set. - * @return This builder for chaining. - */ - public Builder setRatelimitTier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - ratelimitTier_ = value; - onChanged(); - return this; - } - /** - * string ratelimitTier = 5; - * @return This builder for chaining. - */ - public Builder clearRatelimitTier() { - - ratelimitTier_ = getDefaultInstance().getRatelimitTier(); - onChanged(); - return this; - } - /** - * string ratelimitTier = 5; - * @param value The bytes for ratelimitTier to set. - * @return This builder for chaining. - */ - public Builder setRatelimitTierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - ratelimitTier_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.Subscription) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.Subscription) - private static final org.wso2.apk.enforcer.discovery.subscription.Subscription DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.Subscription(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.Subscription getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Subscription parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Subscription(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Subscription getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionOrBuilder.java deleted file mode 100644 index 77c25683fe..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionOrBuilder.java +++ /dev/null @@ -1,72 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SubscriptionOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.Subscription) - com.google.protobuf.MessageOrBuilder { - - /** - * string subStatus = 1; - * @return The subStatus. - */ - java.lang.String getSubStatus(); - /** - * string subStatus = 1; - * @return The bytes for subStatus. - */ - com.google.protobuf.ByteString - getSubStatusBytes(); - - /** - * string uuid = 2; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * string organization = 3; - * @return The organization. - */ - java.lang.String getOrganization(); - /** - * string organization = 3; - * @return The bytes for organization. - */ - com.google.protobuf.ByteString - getOrganizationBytes(); - - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - * @return Whether the subscribedApi field is set. - */ - boolean hasSubscribedApi(); - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - * @return The subscribedApi. - */ - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI getSubscribedApi(); - /** - * .wso2.discovery.subscription.SubscribedAPI subscribedApi = 4; - */ - org.wso2.apk.enforcer.discovery.subscription.SubscribedAPIOrBuilder getSubscribedApiOrBuilder(); - - /** - * string ratelimitTier = 5; - * @return The ratelimitTier. - */ - java.lang.String getRatelimitTier(); - /** - * string ratelimitTier = 5; - * @return The bytes for ratelimitTier. - */ - com.google.protobuf.ByteString - getRatelimitTierBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionProto.java deleted file mode 100644 index 20d8c74130..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionProto.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class SubscriptionProto { - private SubscriptionProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_Subscription_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_Subscription_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_SubscribedAPI_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_SubscribedAPI_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n.wso2/discovery/subscription/subscripti" + - "on.proto\022\033wso2.discovery.subscription\"\237\001" + - "\n\014Subscription\022\021\n\tsubStatus\030\001 \001(\t\022\014\n\004uui" + - "d\030\002 \001(\t\022\024\n\014organization\030\003 \001(\t\022A\n\rsubscri" + - "bedApi\030\004 \001(\0132*.wso2.discovery.subscripti" + - "on.SubscribedAPI\022\025\n\rratelimitTier\030\005 \001(\t\"" + - ".\n\rSubscribedAPI\022\014\n\004name\030\001 \001(\t\022\017\n\007versio" + - "n\030\002 \001(\tB\225\001\n,org.wso2.apk.enforcer.discov" + - "ery.subscriptionB\021SubscriptionProtoP\001ZPg" + - "ithub.com/wso2/apk/common-go-libs/pkg/di" + - "scovery/api/wso2/discovery/subscriptionb" + - "\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_Subscription_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_Subscription_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_Subscription_descriptor, - new java.lang.String[] { "SubStatus", "Uuid", "Organization", "SubscribedApi", "RatelimitTier", }); - internal_static_wso2_discovery_subscription_SubscribedAPI_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_subscription_SubscribedAPI_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_SubscribedAPI_descriptor, - new java.lang.String[] { "Name", "Version", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMapping.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMapping.java deleted file mode 100644 index 8d49f5a5f3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMapping.java +++ /dev/null @@ -1,1036 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/url_mapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * URLMapping data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.URLMapping} - */ -public final class URLMapping extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.URLMapping) - URLMappingOrBuilder { -private static final long serialVersionUID = 0L; - // Use URLMapping.newBuilder() to construct. - private URLMapping(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private URLMapping() { - authScheme_ = ""; - httpMethod_ = ""; - urlPattern_ = ""; - scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new URLMapping(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private URLMapping( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - authScheme_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - httpMethod_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - urlPattern_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - scopes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - scopes_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - scopes_ = scopes_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.URLMappingProto.internal_static_wso2_discovery_subscription_URLMapping_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.URLMappingProto.internal_static_wso2_discovery_subscription_URLMapping_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.URLMapping.class, org.wso2.apk.enforcer.discovery.subscription.URLMapping.Builder.class); - } - - public static final int AUTHSCHEME_FIELD_NUMBER = 1; - private volatile java.lang.Object authScheme_; - /** - * string authScheme = 1; - * @return The authScheme. - */ - @java.lang.Override - public java.lang.String getAuthScheme() { - java.lang.Object ref = authScheme_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - authScheme_ = s; - return s; - } - } - /** - * string authScheme = 1; - * @return The bytes for authScheme. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAuthSchemeBytes() { - java.lang.Object ref = authScheme_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - authScheme_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HTTPMETHOD_FIELD_NUMBER = 2; - private volatile java.lang.Object httpMethod_; - /** - * string httpMethod = 2; - * @return The httpMethod. - */ - @java.lang.Override - public java.lang.String getHttpMethod() { - java.lang.Object ref = httpMethod_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - httpMethod_ = s; - return s; - } - } - /** - * string httpMethod = 2; - * @return The bytes for httpMethod. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getHttpMethodBytes() { - java.lang.Object ref = httpMethod_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - httpMethod_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int URLPATTERN_FIELD_NUMBER = 3; - private volatile java.lang.Object urlPattern_; - /** - * string urlPattern = 3; - * @return The urlPattern. - */ - @java.lang.Override - public java.lang.String getUrlPattern() { - java.lang.Object ref = urlPattern_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - urlPattern_ = s; - return s; - } - } - /** - * string urlPattern = 3; - * @return The bytes for urlPattern. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUrlPatternBytes() { - java.lang.Object ref = urlPattern_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - urlPattern_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SCOPES_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList scopes_; - /** - * repeated string scopes = 4; - * @return A list containing the scopes. - */ - public com.google.protobuf.ProtocolStringList - getScopesList() { - return scopes_; - } - /** - * repeated string scopes = 4; - * @return The count of scopes. - */ - public int getScopesCount() { - return scopes_.size(); - } - /** - * repeated string scopes = 4; - * @param index The index of the element to return. - * @return The scopes at the given index. - */ - public java.lang.String getScopes(int index) { - return scopes_.get(index); - } - /** - * repeated string scopes = 4; - * @param index The index of the value to return. - * @return The bytes of the scopes at the given index. - */ - public com.google.protobuf.ByteString - getScopesBytes(int index) { - return scopes_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getAuthSchemeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, authScheme_); - } - if (!getHttpMethodBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, httpMethod_); - } - if (!getUrlPatternBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, urlPattern_); - } - for (int i = 0; i < scopes_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, scopes_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getAuthSchemeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, authScheme_); - } - if (!getHttpMethodBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, httpMethod_); - } - if (!getUrlPatternBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, urlPattern_); - } - { - int dataSize = 0; - for (int i = 0; i < scopes_.size(); i++) { - dataSize += computeStringSizeNoTag(scopes_.getRaw(i)); - } - size += dataSize; - size += 1 * getScopesList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.URLMapping)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.URLMapping other = (org.wso2.apk.enforcer.discovery.subscription.URLMapping) obj; - - if (!getAuthScheme() - .equals(other.getAuthScheme())) return false; - if (!getHttpMethod() - .equals(other.getHttpMethod())) return false; - if (!getUrlPattern() - .equals(other.getUrlPattern())) return false; - if (!getScopesList() - .equals(other.getScopesList())) 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) + AUTHSCHEME_FIELD_NUMBER; - hash = (53 * hash) + getAuthScheme().hashCode(); - hash = (37 * hash) + HTTPMETHOD_FIELD_NUMBER; - hash = (53 * hash) + getHttpMethod().hashCode(); - hash = (37 * hash) + URLPATTERN_FIELD_NUMBER; - hash = (53 * hash) + getUrlPattern().hashCode(); - if (getScopesCount() > 0) { - hash = (37 * hash) + SCOPES_FIELD_NUMBER; - hash = (53 * hash) + getScopesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.URLMapping 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; - } - /** - *
-   * URLMapping data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.URLMapping} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.URLMapping) - org.wso2.apk.enforcer.discovery.subscription.URLMappingOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.URLMappingProto.internal_static_wso2_discovery_subscription_URLMapping_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.URLMappingProto.internal_static_wso2_discovery_subscription_URLMapping_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.URLMapping.class, org.wso2.apk.enforcer.discovery.subscription.URLMapping.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.URLMapping.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(); - authScheme_ = ""; - - httpMethod_ = ""; - - urlPattern_ = ""; - - scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.URLMappingProto.internal_static_wso2_discovery_subscription_URLMapping_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.URLMapping getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.URLMapping.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.URLMapping build() { - org.wso2.apk.enforcer.discovery.subscription.URLMapping result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.URLMapping buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.URLMapping result = new org.wso2.apk.enforcer.discovery.subscription.URLMapping(this); - int from_bitField0_ = bitField0_; - result.authScheme_ = authScheme_; - result.httpMethod_ = httpMethod_; - result.urlPattern_ = urlPattern_; - if (((bitField0_ & 0x00000001) != 0)) { - scopes_ = scopes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.scopes_ = scopes_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.URLMapping) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.URLMapping)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.URLMapping other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.URLMapping.getDefaultInstance()) return this; - if (!other.getAuthScheme().isEmpty()) { - authScheme_ = other.authScheme_; - onChanged(); - } - if (!other.getHttpMethod().isEmpty()) { - httpMethod_ = other.httpMethod_; - onChanged(); - } - if (!other.getUrlPattern().isEmpty()) { - urlPattern_ = other.urlPattern_; - onChanged(); - } - if (!other.scopes_.isEmpty()) { - if (scopes_.isEmpty()) { - scopes_ = other.scopes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureScopesIsMutable(); - scopes_.addAll(other.scopes_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.URLMapping parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.URLMapping) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object authScheme_ = ""; - /** - * string authScheme = 1; - * @return The authScheme. - */ - public java.lang.String getAuthScheme() { - java.lang.Object ref = authScheme_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - authScheme_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string authScheme = 1; - * @return The bytes for authScheme. - */ - public com.google.protobuf.ByteString - getAuthSchemeBytes() { - java.lang.Object ref = authScheme_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - authScheme_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string authScheme = 1; - * @param value The authScheme to set. - * @return This builder for chaining. - */ - public Builder setAuthScheme( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - authScheme_ = value; - onChanged(); - return this; - } - /** - * string authScheme = 1; - * @return This builder for chaining. - */ - public Builder clearAuthScheme() { - - authScheme_ = getDefaultInstance().getAuthScheme(); - onChanged(); - return this; - } - /** - * string authScheme = 1; - * @param value The bytes for authScheme to set. - * @return This builder for chaining. - */ - public Builder setAuthSchemeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - authScheme_ = value; - onChanged(); - return this; - } - - private java.lang.Object httpMethod_ = ""; - /** - * string httpMethod = 2; - * @return The httpMethod. - */ - public java.lang.String getHttpMethod() { - java.lang.Object ref = httpMethod_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - httpMethod_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string httpMethod = 2; - * @return The bytes for httpMethod. - */ - public com.google.protobuf.ByteString - getHttpMethodBytes() { - java.lang.Object ref = httpMethod_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - httpMethod_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string httpMethod = 2; - * @param value The httpMethod to set. - * @return This builder for chaining. - */ - public Builder setHttpMethod( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - httpMethod_ = value; - onChanged(); - return this; - } - /** - * string httpMethod = 2; - * @return This builder for chaining. - */ - public Builder clearHttpMethod() { - - httpMethod_ = getDefaultInstance().getHttpMethod(); - onChanged(); - return this; - } - /** - * string httpMethod = 2; - * @param value The bytes for httpMethod to set. - * @return This builder for chaining. - */ - public Builder setHttpMethodBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - httpMethod_ = value; - onChanged(); - return this; - } - - private java.lang.Object urlPattern_ = ""; - /** - * string urlPattern = 3; - * @return The urlPattern. - */ - public java.lang.String getUrlPattern() { - java.lang.Object ref = urlPattern_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - urlPattern_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string urlPattern = 3; - * @return The bytes for urlPattern. - */ - public com.google.protobuf.ByteString - getUrlPatternBytes() { - java.lang.Object ref = urlPattern_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - urlPattern_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string urlPattern = 3; - * @param value The urlPattern to set. - * @return This builder for chaining. - */ - public Builder setUrlPattern( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - urlPattern_ = value; - onChanged(); - return this; - } - /** - * string urlPattern = 3; - * @return This builder for chaining. - */ - public Builder clearUrlPattern() { - - urlPattern_ = getDefaultInstance().getUrlPattern(); - onChanged(); - return this; - } - /** - * string urlPattern = 3; - * @param value The bytes for urlPattern to set. - * @return This builder for chaining. - */ - public Builder setUrlPatternBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - urlPattern_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureScopesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - scopes_ = new com.google.protobuf.LazyStringArrayList(scopes_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string scopes = 4; - * @return A list containing the scopes. - */ - public com.google.protobuf.ProtocolStringList - getScopesList() { - return scopes_.getUnmodifiableView(); - } - /** - * repeated string scopes = 4; - * @return The count of scopes. - */ - public int getScopesCount() { - return scopes_.size(); - } - /** - * repeated string scopes = 4; - * @param index The index of the element to return. - * @return The scopes at the given index. - */ - public java.lang.String getScopes(int index) { - return scopes_.get(index); - } - /** - * repeated string scopes = 4; - * @param index The index of the value to return. - * @return The bytes of the scopes at the given index. - */ - public com.google.protobuf.ByteString - getScopesBytes(int index) { - return scopes_.getByteString(index); - } - /** - * repeated string scopes = 4; - * @param index The index to set the value at. - * @param value The scopes to set. - * @return This builder for chaining. - */ - public Builder setScopes( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureScopesIsMutable(); - scopes_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string scopes = 4; - * @param value The scopes to add. - * @return This builder for chaining. - */ - public Builder addScopes( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureScopesIsMutable(); - scopes_.add(value); - onChanged(); - return this; - } - /** - * repeated string scopes = 4; - * @param values The scopes to add. - * @return This builder for chaining. - */ - public Builder addAllScopes( - java.lang.Iterable values) { - ensureScopesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, scopes_); - onChanged(); - return this; - } - /** - * repeated string scopes = 4; - * @return This builder for chaining. - */ - public Builder clearScopes() { - scopes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string scopes = 4; - * @param value The bytes of the scopes to add. - * @return This builder for chaining. - */ - public Builder addScopesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureScopesIsMutable(); - scopes_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.URLMapping) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.URLMapping) - private static final org.wso2.apk.enforcer.discovery.subscription.URLMapping DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.URLMapping(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.URLMapping getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public URLMapping parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new URLMapping(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.URLMapping getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMappingOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMappingOrBuilder.java deleted file mode 100644 index 951a2668d7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMappingOrBuilder.java +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/url_mapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface URLMappingOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.URLMapping) - com.google.protobuf.MessageOrBuilder { - - /** - * string authScheme = 1; - * @return The authScheme. - */ - java.lang.String getAuthScheme(); - /** - * string authScheme = 1; - * @return The bytes for authScheme. - */ - com.google.protobuf.ByteString - getAuthSchemeBytes(); - - /** - * string httpMethod = 2; - * @return The httpMethod. - */ - java.lang.String getHttpMethod(); - /** - * string httpMethod = 2; - * @return The bytes for httpMethod. - */ - com.google.protobuf.ByteString - getHttpMethodBytes(); - - /** - * string urlPattern = 3; - * @return The urlPattern. - */ - java.lang.String getUrlPattern(); - /** - * string urlPattern = 3; - * @return The bytes for urlPattern. - */ - com.google.protobuf.ByteString - getUrlPatternBytes(); - - /** - * repeated string scopes = 4; - * @return A list containing the scopes. - */ - java.util.List - getScopesList(); - /** - * repeated string scopes = 4; - * @return The count of scopes. - */ - int getScopesCount(); - /** - * repeated string scopes = 4; - * @param index The index of the element to return. - * @return The scopes at the given index. - */ - java.lang.String getScopes(int index); - /** - * repeated string scopes = 4; - * @param index The index of the value to return. - * @return The bytes of the scopes at the given index. - */ - com.google.protobuf.ByteString - getScopesBytes(int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMappingProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMappingProto.java deleted file mode 100644 index ba60317b93..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/URLMappingProto.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/url_mapping.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class URLMappingProto { - private URLMappingProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_URLMapping_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_URLMapping_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n-wso2/discovery/subscription/url_mappin" + - "g.proto\022\033wso2.discovery.subscription\"X\n\n" + - "URLMapping\022\022\n\nauthScheme\030\001 \001(\t\022\022\n\nhttpMe" + - "thod\030\002 \001(\t\022\022\n\nurlPattern\030\003 \001(\t\022\016\n\006scopes" + - "\030\004 \003(\tB\222\001\n,org.wso2.apk.enforcer.discove" + - "ry.subscriptionB\017URLMappingProtoP\001ZOgith" + - "ub.com/envoyproxy/go-control-plane/wso2/" + - "discovery/subscription;subscriptionb\006pro" + - "to3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_URLMapping_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_URLMapping_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_URLMapping_descriptor, - new java.lang.String[] { "AuthScheme", "HttpMethod", "UrlPattern", "Scopes", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/dto/APIKeyValidationInfoDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/dto/APIKeyValidationInfoDTO.java deleted file mode 100644 index 99db9c3ad7..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/dto/APIKeyValidationInfoDTO.java +++ /dev/null @@ -1,457 +0,0 @@ -/* - * Copyright (c) 2020, 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.dto; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * This class represent the API key validation Info DTO. - */ -public class APIKeyValidationInfoDTO implements Serializable { - - private static final long serialVersionUID = 12345L; - - private String organization; - - private boolean authorized; - private String subscriber; - private String tier; - private String type; - //isContentAware property is here to notify if there is at least one content based tier associated with request - //If this property is true then throttle handler should build message or get content length and pass it to - //throttle server. - private boolean contentAware; - //JWT or SAML token containing details of API invoker - private String userType; - private String endUserToken; - private String endUserName; - private String applicationName; - //use this to pass key validation status - private int validationStatus; - private long validityPeriod; - private long issuedTime; - private List authorizedDomains; - private int spikeArrestLimit; - private String subscriberOrganization; - private String spikeArrestUnit; - private boolean stopOnQuotaReach; - //keeps productId of product for which the key was validated, if key was validated for an api this will be null - private String productName; - private String productProvider; - private String keyManager; - private int graphQLMaxDepth; - private int graphQLMaxComplexity; - private String apiVersion; - private String apiUUID; - private String apiName; - private String apiContext; - private String applicationUUID; - private Map appAttributes; - private String envType; - private String environment; - - public String getOrganization() { - - return organization; - } - - public void setOrganization(String organization) { - - this.organization = organization; - } - - public boolean isContentAware() { - - return contentAware; - } - - public void setContentAware(boolean contentAware) { - - this.contentAware = contentAware; - } - - private Set scopes; - - private String consumerKey; - - private String apiPublisher; - private String securityScheme; - - public boolean isAuthorized() { - - return authorized; - } - - public void setAuthorized(boolean authorized) { - - this.authorized = authorized; - } - - public String getTier() { - - return tier; - } - - public void setTier(String tier) { - - this.tier = tier; - } - - public String getSubscriber() { - - return subscriber; - } - - public void setSubscriber(String subscriber) { - - this.subscriber = subscriber; - } - - public String getType() { - - return type; - } - - public void setType(String type) { - - this.type = type; - } - - public String getEndUserToken() { - - return endUserToken; - } - - public void setEndUserToken(String endUserToken) { - - this.endUserToken = endUserToken; - } - - public String getEndUserName() { - - return endUserName; - } - - public void setEndUserName(String endUserName) { - - this.endUserName = endUserName; - } - - public String getApplicationName() { - - return applicationName; - } - - public void setApplicationName(String applicationName) { - - this.applicationName = applicationName; - } - - public int getValidationStatus() { - - return validationStatus; - } - - public void setValidationStatus(int validationStatus) { - - this.validationStatus = validationStatus; - } - - public long getValidityPeriod() { - - return validityPeriod; - } - - public void setValidityPeriod(long validityPeriod) { - - this.validityPeriod = validityPeriod; - } - - public long getIssuedTime() { - - return issuedTime; - } - - public void setIssuedTime(long issuedTime) { - - this.issuedTime = issuedTime; - } - - public List getAuthorizedDomains() { - - return authorizedDomains; - } - - public void setAuthorizedDomains(List authorizedDomains) { - - this.authorizedDomains = authorizedDomains; - } - - public String getUserType() { - - return userType; - } - - public void setUserType(String userType) { - - this.userType = userType; - } - - public String getApiName() { - - return apiName; - } - - public void setApiName(String apiName) { - - this.apiName = apiName; - } - - public String getApiContext() { - - return apiContext; - } - - public void setApiContext(String apiContext) { - - this.apiContext = apiContext; - } - - public String getConsumerKey() { - - return consumerKey; - } - - public void setConsumerKey(String consumerKey) { - - this.consumerKey = consumerKey; - } - - public String getApiPublisher() { - - return apiPublisher; - } - - public void setApiPublisher(String apiPublisher) { - - this.apiPublisher = apiPublisher; - } - - public String getSecurityScheme() { - - return securityScheme; - } - - public void setSecurityScheme(String securityScheme) { - - this.securityScheme = securityScheme; - } - - public Set getScopes() { - - return scopes; - } - - public void setScopes(Set scopes) { - - this.scopes = scopes; - } - - public String toString() { - - StringBuilder builder = new StringBuilder(20); - builder.append("APIKeyValidationInfoDTO = { authorized:").append(authorized).append(" , subscriber:").append(subscriber).append(" , tier:").append(tier).append(" , type:").append(type).append(" , userType:").append(userType).append(" , endUserToken:").append(endUserToken).append(" , endUserName:").append(endUserName).append(" , applicationName:").append(applicationName).append(" , validationStatus:").append(validationStatus).append(" , validityPeriod:").append(validityPeriod).append(" , issuedTime:").append(issuedTime).append(" , apiName:").append(apiName).append(" , apiContext:").append(apiContext).append(" , consumerKey:").append(consumerKey).append(" , spikeArrestLimit:").append(spikeArrestLimit).append(" , spikeArrestUnit:").append(spikeArrestUnit).append(" , subscriberOrganization:").append(subscriberOrganization).append(" , stopOnQuotaReach:").append(stopOnQuotaReach).append(" , productName:").append(productName).append(" , productProvider:").append(productProvider).append(" , apiPublisher:").append(apiPublisher).append(" , securityScheme:").append(securityScheme).append(" , graphQLMaxDepth:").append(graphQLMaxDepth).append(" , graphQLMaxComplexity:").append(graphQLMaxComplexity); - - if (authorizedDomains != null && !authorizedDomains.isEmpty()) { - builder.append(" , authorizedDomains:["); - for (String domain : authorizedDomains) { - builder.append(domain).append(','); - } - builder.replace(builder.length() - 1, builder.length() - 1, "]"); - } else { - builder.append(']'); - } - - if (scopes != null && !scopes.isEmpty()) { - builder.append(" , scopes:["); - for (String scope : scopes) { - builder.append(scope).append(','); - } - builder.replace(builder.length() - 1, builder.length() - 1, "]"); - } else { - builder.append(']'); - } - - return builder.toString(); - } - - public int getSpikeArrestLimit() { - - return spikeArrestLimit; - } - - public void setSpikeArrestLimit(int spikeArrestLimit) { - - this.spikeArrestLimit = spikeArrestLimit; - } - - public String getSpikeArrestUnit() { - - return spikeArrestUnit; - } - - public void setSpikeArrestUnit(String spikeArrestUnit) { - - this.spikeArrestUnit = spikeArrestUnit; - } - - public boolean isStopOnQuotaReach() { - - return stopOnQuotaReach; - } - - public void setStopOnQuotaReach(boolean stopOnQuotaReach) { - - this.stopOnQuotaReach = stopOnQuotaReach; - } - - public String getSubscriberOrganization() { - - return subscriberOrganization; - } - - public void setSubscriberOrganization(String subscriberOrganization) { - - this.subscriberOrganization = subscriberOrganization; - } - - public void setProductName(String productName) { - - this.productName = productName; - } - - public String getProductName() { - - return productName; - } - - public void setProductProvider(String productProvider) { - - this.productProvider = productProvider; - } - - public String getProductProvider() { - - return productProvider; - } - - public void setKeyManager(String keyManager) { - - this.keyManager = keyManager; - } - - public String getKeyManager() { - - return keyManager; - } - - public int getGraphQLMaxDepth() { - - return graphQLMaxDepth; - } - - public void setGraphQLMaxDepth(int graphQLMaxDepth) { - - this.graphQLMaxDepth = graphQLMaxDepth; - } - - public int getGraphQLMaxComplexity() { - - return graphQLMaxComplexity; - } - - public void setGraphQLMaxComplexity(int graphQLMaxComplexity) { - - this.graphQLMaxComplexity = graphQLMaxComplexity; - } - - public String getApiVersion() { - - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - - this.apiVersion = apiVersion; - } - - public String getApplicationUUID() { - - return applicationUUID; - } - - public void setApplicationUUID(String applicationUUID) { - - this.applicationUUID = applicationUUID; - } - - public Map getAppAttributes() { - - return appAttributes; - } - - public void setAppAttributes(Map appAttributes) { - - this.appAttributes = appAttributes; - } - - public String getApiUUID() { - - return apiUUID; - } - - public void setApiUUID(String apiUUID) { - - this.apiUUID = apiUUID; - } - - public void setEnvType(String envType) { - - this.envType = envType; - } - - public String getEnvType() { - - return envType; - } - - public void setEnvironment(String environment) { - - this.environment = environment; - } - - public String getEnvironment() { - - return environment; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/dto/JWTTokenPayloadInfo.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/dto/JWTTokenPayloadInfo.java deleted file mode 100644 index 9afc1bc2d1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/dto/JWTTokenPayloadInfo.java +++ /dev/null @@ -1,48 +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.dto; - -import com.nimbusds.jwt.JWTClaimsSet; - -import java.io.Serializable; - -/** - * Dto class to store JWT payload information - */ -public class JWTTokenPayloadInfo implements Serializable { - - - JWTClaimsSet payload; - String accessToken; - - public JWTClaimsSet getPayload() { - return payload; - } - - public void setPayload(JWTClaimsSet payload) { - this.payload = payload; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/graphql/GraphQLPayloadUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/graphql/GraphQLPayloadUtils.java deleted file mode 100644 index b0140b904a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/graphql/GraphQLPayloadUtils.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.graphql; - -import graphql.language.Definition; -import graphql.language.Document; -import graphql.language.OperationDefinition; -import graphql.parser.InvalidSyntaxException; -import graphql.parser.Parser; -import graphql.schema.GraphQLSchema; -import graphql.validation.Validator; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.json.JSONException; -import org.json.JSONObject; -import org.wso2.apk.enforcer.commons.constants.GraphQLConstants; -import org.wso2.apk.enforcer.commons.graphql.GraphQLProcessorUtil; -import org.wso2.apk.enforcer.commons.graphql.QueryValidator; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.discovery.api.GraphqlComplexity; -import org.wso2.apk.enforcer.api.API; -import org.wso2.apk.enforcer.api.APIFactory; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.GraphQLCustomComplexityInfoDTO; -import org.wso2.apk.enforcer.commons.model.GraphQLSchemaDTO; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.constants.APIConstants; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -/** - * utils for GraphQL Request payload processing. - */ -public class GraphQLPayloadUtils { - private static final Logger logger = LogManager.getLogger(GraphQLPayloadUtils.class); - - /** - * This method will decode the graphQL query body. - * - * @param api matched api - * @param queryBody graphQL query - * @return matching resource configs for the request - * @throws EnforcerException use for error response handling - */ - public static ArrayList buildGQLRequestContext(API api, String queryBody, String routeName) throws EnforcerException { - GraphQLSchemaDTO graphQLSchemaDTO = api.getAPIConfig().getGraphQLSchemaDTO(); - try { - // Validate payload with graphQLSchema - Document document = new Parser().parseDocument(queryBody); - String validationErrors = validatePayloadWithSchema(graphQLSchemaDTO.getGraphQLSchema(), document); - if (validationErrors == null) { - ArrayList operationList = new ArrayList<>(); - String method = ""; - // Extract the operation type and operations from the payload - for (Definition definition : document.getDefinitions()) { - // we only allow one operation type per request - if (definition instanceof OperationDefinition) { - OperationDefinition operation = (OperationDefinition) definition; - if (operation.getOperation() != null) { - method = operation.getOperation().toString(); - operationList = GraphQLProcessorUtil.getOperationList(operation, - graphQLSchemaDTO.getTypeDefinitionRegistry()); - logger.debug("Found operation list : " + operationList.toString()); - break; - } - } else { - throw new EnforcerException("Operation definition cannot be empty"); - } - } - ArrayList resourceConfigs = new ArrayList<>(); - for (String op : operationList) { - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - ResourceConfig resourceConfig; - if (enforcerConfig.getEnableGatewayClassController()) { - resourceConfig = APIFactory.getInstance().getMatchedResource(api, routeName); - } else { - resourceConfig = APIFactory.getInstance().getMatchedResource(api, op, method); - } - - if (resourceConfig != null) { - resourceConfigs.add(resourceConfig); - } else { - logger.error("No matching operations found for {} in APIUUID : {} API : {}, version : {}", op, - api.getAPIConfig().getName(), api.getAPIConfig().getUuid(), - api.getAPIConfig().getVersion(), - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6705)); - return new ArrayList<>(); - } - } - return resourceConfigs; - } else { - throw new EnforcerException("Payload is invalid", new Exception(validationErrors)); - } - } catch (InvalidSyntaxException exception) { - throw new EnforcerException("Invalid syntax", exception); - } - } - - /** - * @param requestPayload request payload - * @param requestHeaders request headers - * @return - * @throws EnforcerException invalid payloads - */ - public static String getGQLRequestPayload(String requestPayload, Map requestHeaders) - throws EnforcerException { - String queryBody = ""; - if (!requestHeaders.containsKey(APIConstants.CONTENT_TYPE_HEADER) || - (requestHeaders.containsKey(APIConstants.CONTENT_TYPE_HEADER) && APIConstants.APPLICATION_JSON - .equalsIgnoreCase(requestHeaders.get(APIConstants.CONTENT_TYPE_HEADER)))) { - try { - JSONObject jsonObject = new JSONObject(requestPayload); - queryBody = jsonObject.getString(GraphQLConstants.GRAPHQL_QUERY.toLowerCase(Locale.ROOT)); - } catch (JSONException e) { - throw new EnforcerException("Invalid GraphQL query body structure"); - } - } else if (requestHeaders.containsKey(APIConstants.CONTENT_TYPE_HEADER) && APIConstants.APPLICATION_GRAPHQL - .equalsIgnoreCase(requestHeaders.get(APIConstants.CONTENT_TYPE_HEADER))) { - queryBody = requestPayload; - } else { - throw new EnforcerException("Invalid content type. Make sure the content type is " + - APIConstants.APPLICATION_JSON + " or " + APIConstants.APPLICATION_GRAPHQL); - } - if (StringUtils.isNotBlank(queryBody)) { - return queryBody; - } - throw new EnforcerException("Query cannot be empty"); - } - - /** - * This method validate the payload. - * - * @param graphQLSchema graphql sdl - * @param document graphQL schema of the request - * @return true or false - */ - private static String validatePayloadWithSchema(GraphQLSchema graphQLSchema, Document document) { - QueryValidator queryValidator = new QueryValidator(new Validator()); - return queryValidator.validatePayload(graphQLSchema, document); - } - - public static List parseComplexityDTO(List - customComplexityDetailsList) { - List graphQLCustomComplexityInfoDTOList = new ArrayList<>(); - for (GraphqlComplexity complexity : customComplexityDetailsList) { - GraphQLCustomComplexityInfoDTO graphQLCustomComplexityInfoDTO = new GraphQLCustomComplexityInfoDTO( - complexity.getType(), complexity.getField(), complexity.getComplexityValue()); - graphQLCustomComplexityInfoDTOList.add(graphQLCustomComplexityInfoDTO); - } - return graphQLCustomComplexityInfoDTOList; - } -} - - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/graphql/GraphQLQueryAnalysisFilter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/graphql/GraphQLQueryAnalysisFilter.java deleted file mode 100644 index 04260ec0c1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/graphql/GraphQLQueryAnalysisFilter.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.graphql; - -import graphql.schema.GraphQLSchema; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.json.simple.JSONObject; -import org.json.simple.parser.ParseException; -import org.wso2.apk.enforcer.commons.constants.GraphQLConstants; -import org.wso2.apk.enforcer.commons.dto.QueryAnalyzerResponseDTO; -import org.wso2.apk.enforcer.commons.graphql.QueryAnalyzer; -import org.wso2.apk.enforcer.commons.Filter; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.GraphQLCustomComplexityInfoDTO; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; - -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - * This Handler can be used to analyse GraphQL Query. This implementation uses previously set - * complexity and depth limitation to block the complex queries before it reaches the backend. - */ -public class GraphQLQueryAnalysisFilter implements Filter { - - private static final Logger logger = LogManager.getLogger(GraphQLQueryAnalysisFilter.class); - private QueryAnalyzer queryAnalyzer; - - @Override - public void init(APIConfig apiConfig, Map configProperties) { - GraphQLSchema schema = apiConfig.getGraphQLSchemaDTO().getGraphQLSchema(); - queryAnalyzer = new QueryAnalyzer(schema); - } - - @Override - public boolean handleRequest(RequestContext requestContext) { - String payload = requestContext.getRequestPayload(); - if (!isDepthAndComplexityValid(requestContext, payload)) { - logger.debug("Query was blocked by the static query analyser"); - return false; - } - return true; - } - - /** - * This method analyses the query. - * - * @param requestContext message context of the request - * @param payload payload of the request - * @return true, if the query is not blocked or false, if the query is blocked - */ - private boolean isDepthAndComplexityValid(RequestContext requestContext, String payload) { - try { - return isDepthValid(requestContext, payload) && isComplexityValid(requestContext, payload); - } catch (Exception e) { - logger.error("Policy definition parsing failed for API UUID : {} API : {} version : {}", - requestContext.getMatchedAPI().getUuid(), requestContext.getMatchedAPI().getName(), - requestContext.getMatchedAPI().getVersion(), - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 7300), e); - handleFailure(requestContext); - return false; - } - } - - private boolean isDepthValid(RequestContext requestContext, String payload) { - int maxQueryDepth = -1; - if (requestContext.getProperties().containsKey(GraphQLConstants.MAXIMUM_QUERY_DEPTH)) { - maxQueryDepth = (Integer) requestContext.getProperties().get(GraphQLConstants.MAXIMUM_QUERY_DEPTH); - } - QueryAnalyzerResponseDTO responseDTO = queryAnalyzer.analyseQueryDepth(maxQueryDepth, payload); - if (!responseDTO.isSuccess() && !responseDTO.getErrorList().isEmpty()) { - handleFailure(requestContext, GraphQLConstants.GRAPHQL_QUERY_TOO_DEEP, - GraphQLConstants.GRAPHQL_QUERY_TOO_DEEP_MESSAGE, responseDTO.getErrorList().toString()); - logger.error("Requested query's depth has exceeded. API : {}, version : {}, Error : {}", - requestContext.getMatchedAPI().getName(), requestContext.getMatchedAPI().getVersion(), - responseDTO.getErrorList().toString(), ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, - 7301)); - return false; - } - return true; - } - - private boolean isComplexityValid(RequestContext requestContext, String payload) { - int queryComplexity = -1; - if (requestContext.getProperties().containsKey(GraphQLConstants.MAXIMUM_QUERY_COMPLEXITY)) { - queryComplexity = (Integer) requestContext.getProperties() - .get(GraphQLConstants.MAXIMUM_QUERY_COMPLEXITY); - } - QueryAnalyzerResponseDTO responseDTO = null; - try { - responseDTO = queryAnalyzer.analyseQueryMutationComplexity(payload, queryComplexity, - policyDefinitionToJson(requestContext.getMatchedAPI().getGraphQLSchemaDTO() - .getGraphQLCustomComplexityInfoDTO()).toJSONString()); - } catch (ParseException e) { - String errorMessage = "Policy definition parsing failed. "; - handleFailure(requestContext, GraphQLConstants.GRAPHQL_INVALID_QUERY, errorMessage, errorMessage); - } - if (responseDTO != null && !responseDTO.isSuccess() && !responseDTO.getErrorList().isEmpty()) { - handleFailure(requestContext, GraphQLConstants.GRAPHQL_QUERY_TOO_COMPLEX, - GraphQLConstants.GRAPHQL_QUERY_TOO_COMPLEX_MESSAGE, responseDTO.getErrorList().toString()); - logger.error("Requested query's complexity has exceeded. API : {}, version : {}, Error: {}", - requestContext.getMatchedAPI().getName(), requestContext.getMatchedAPI().getVersion(), - responseDTO.getErrorList().toString(), ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, - 7303)); - return false; - } - return true; - } - - /** - * This method handle the failure. - * - * @param requestContext message context of the request - */ - private void handleFailure(RequestContext requestContext) { - requestContext.getProperties().put(APIConstants.MessageFormat.STATUS_CODE, - APIConstants.StatusCodes.INTERNAL_SERVER_ERROR); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, - APISecurityConstants.API_AUTH_GENERAL_ERROR); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - } - - /** - * This method handle the query mutation analysis failures. - * - * @param errorCodeValue error code of the failure - * @param requestContext message context of the request - * @param errorMessage error message of the failure - * @param errorDescription error description of the failure - */ - private void handleFailure(RequestContext requestContext, int errorCodeValue, String errorMessage, - String errorDescription) { - requestContext.getProperties().put(APIConstants.MessageFormat.STATUS_CODE, - APIConstants.StatusCodes.BAD_REQUEST_ERROR.getCode()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, - errorCodeValue); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, - errorMessage); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - errorDescription); - } - - - /** - * Method to convert GraphqlComplexityInfo object to a JSONObject. - * - * @param graphqlComplexityInfoList GraphqlComplexityInfo object - * @return json object which contains the policy definition - */ - private JSONObject policyDefinitionToJson(List graphqlComplexityInfoList) { - JSONObject policyDefinition = new JSONObject(); - HashMap> customComplexityMap = new HashMap<>(); - for (GraphQLCustomComplexityInfoDTO graphqlComplexityInfo : graphqlComplexityInfoList) { - String type = graphqlComplexityInfo.getType(); - String field = graphqlComplexityInfo.getField(); - int complexityValue = graphqlComplexityInfo.getComplexityValue(); - if (customComplexityMap.containsKey(type)) { - customComplexityMap.get(type).put(field, complexityValue); - } else { - HashMap complexityValueMap = new HashMap<>(); - complexityValueMap.put(field, complexityValue); - customComplexityMap.put(type, complexityValueMap); - } - } - - Map> customComplexityObject = new LinkedHashMap<>(customComplexityMap.size()); - for (HashMap.Entry> entry : customComplexityMap.entrySet()) { - HashMap fieldValueMap = entry.getValue(); - String type = entry.getKey(); - Map fieldValueObject = new LinkedHashMap<>(fieldValueMap.size()); - for (HashMap.Entry subEntry : fieldValueMap.entrySet()) { - String field = subEntry.getKey(); - int complexityValue = subEntry.getValue(); - fieldValueObject.put(field, complexityValue); - } - customComplexityObject.put(type, fieldValueObject); - } - - policyDefinition.put(GraphQLConstants.QUERY_ANALYSIS_COMPLEXITY, customComplexityObject); - return policyDefinition; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExtAuthService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExtAuthService.java deleted file mode 100644 index e582beafee..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExtAuthService.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (c) 2020, 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.grpc; - -import com.google.protobuf.Struct; -import com.google.protobuf.Value; -import com.google.rpc.Code; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.HeaderValue; -import io.envoyproxy.envoy.config.core.v3.HeaderValueOption; -import io.envoyproxy.envoy.service.auth.v3.AuthorizationGrpc; -import io.envoyproxy.envoy.service.auth.v3.CheckRequest; -import io.envoyproxy.envoy.service.auth.v3.CheckResponse; -import io.envoyproxy.envoy.service.auth.v3.DeniedHttpResponse; -import io.envoyproxy.envoy.service.auth.v3.OkHttpResponse; -import io.envoyproxy.envoy.type.v3.HttpStatus; -import io.grpc.stub.StreamObserver; -import io.opentelemetry.context.Context; -import io.opentelemetry.context.Scope; -import org.json.JSONObject; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.api.ResponseObject; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.HttpConstants; -import org.wso2.apk.enforcer.constants.MetadataConstants; -import org.wso2.apk.enforcer.constants.RouterAccessLogConstants; -import org.wso2.apk.enforcer.deniedresponse.DeniedResponsePreparer; -import org.wso2.apk.enforcer.jmx.JMXUtils; -import org.wso2.apk.enforcer.metrics.MetricsExporter; -import org.wso2.apk.enforcer.metrics.MetricsManager; -import org.wso2.apk.enforcer.metrics.jmx.impl.ExtAuthMetrics; -import org.wso2.apk.enforcer.server.HttpRequestHandler; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingContextHolder; -import org.wso2.apk.enforcer.tracing.TracingSpan; -import org.wso2.apk.enforcer.tracing.TracingTracer; -import org.wso2.apk.enforcer.tracing.Utils; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.zip.GZIPInputStream; -import java.util.zip.InflaterInputStream; - -/** - * This is the gRPC server written to match with the envoy ext-authz filter proto file. Envoy proxy call this service. - * This is the entry point to the filter chain process for a request. - */ -public class ExtAuthService extends AuthorizationGrpc.AuthorizationImplBase { - private HttpRequestHandler requestHandler = new HttpRequestHandler(); - - @Override - public void check(CheckRequest request, StreamObserver responseObserver) { - TracingSpan extAuthServiceSpan = null; - Scope extAuthServiceSpanScope = null; - long startTimestamp = System.currentTimeMillis(); - try { - String traceId = request.getAttributes().getRequest().getHttp() - .getHeadersOrDefault(HttpConstants.X_REQUEST_ID_HEADER, - request.getAttributes().getRequest().getHttp().getId()); - if (Utils.tracingEnabled()) { - TracingTracer tracer = Utils.getGlobalTracer(); - Context parentContext = TracingContextHolder.getContext(traceId); - // This span will be the parent span for all the filters - extAuthServiceSpan = Utils.startSpan(TracingConstants.EXT_AUTH_SERVICE_SPAN, parentContext, tracer); - extAuthServiceSpanScope = extAuthServiceSpan.getSpan().makeCurrent(); - Utils.setTag(extAuthServiceSpan, APIConstants.LOG_TRACE_ID, traceId); - } - ThreadContext.put(APIConstants.LOG_TRACE_ID, traceId); - ResponseObject responseObject = requestHandler.process(request); - CheckResponse response = buildResponse(request, responseObject); - responseObserver.onNext(response); - // When you are done, you must call onCompleted. - responseObserver.onCompleted(); - } finally { - ThreadContext.remove(APIConstants.LOG_TRACE_ID); - ThreadContext.remove(APIConstants.API_UUID); - if (Utils.tracingEnabled()) { - extAuthServiceSpanScope.close(); - Utils.finishSpan(extAuthServiceSpan); - } - if (MetricsManager.isMetricsEnabled()) { - MetricsExporter metricsExporter = MetricsManager.getInstance(); - metricsExporter.trackMetric("enforcerLatency", System.currentTimeMillis() - startTimestamp); - } - if (JMXUtils.isJMXMetricsEnabled()) { - ExtAuthMetrics.getInstance().recordMetric(System.currentTimeMillis() - startTimestamp); - } - } - } - - private CheckResponse buildResponse(CheckRequest request, ResponseObject responseObject) { - CheckResponse.Builder checkResponseBuilder = CheckResponse.newBuilder(); - if (responseObject.isDirectResponse()) { - DeniedResponsePreparer deniedResponsePreparer = new DeniedResponsePreparer(DeniedHttpResponse.newBuilder()); - // set headers - if (responseObject.getHeaderMap() != null) { - responseObject.getHeaderMap().forEach((key, value) -> { - HeaderValueOption headerValueOption = HeaderValueOption.newBuilder() - .setHeader(HeaderValue.newBuilder().setKey(key).setValue(value).build()) - .build(); - deniedResponsePreparer.addHeaders(headerValueOption); - } - ); - } - - // set status code - HttpStatus status = HttpStatus.newBuilder().setCodeValue(responseObject.getStatusCode()).build(); - deniedResponsePreparer.setStatus(status); - - // handle the response of the '/ready' request - if (APIConstants.ReadinessCheck.ENDPOINT.equals(responseObject.getRequestPath())) { - return buildReadyCheckResponse(checkResponseBuilder, status); - } - - // set body content - if (responseObject.getResponsePayload() != null) { - deniedResponsePreparer.setBody(responseObject.getResponsePayload()); - } - - // set error response body content and headers - if (responseObject.getErrorCode() != null) { - // Error handling create an XML(text/xml or application/soap+xml based on SOAP protocol version) - // payload if SoapErrorInXMLEnabled is true. - // Otherwise, it will create an application/json error payload. - deniedResponsePreparer.setErrorMessage(request, responseObject); - } - - // set meta data - Struct.Builder metadataStructBuilder = Struct.newBuilder(); - if (responseObject.getMetaDataMap() != null) { - responseObject.getMetaDataMap().forEach((key, value) -> - addMetadata(metadataStructBuilder, key, value)); - } - addMetadata(metadataStructBuilder, "correlationID", responseObject.getCorrelationID()); - addMetadata(metadataStructBuilder, MetadataConstants.APK_ENFORCER_REPLY, "Ok"); - - return checkResponseBuilder - .setDynamicMetadata(metadataStructBuilder.build()) - .setDeniedResponse(deniedResponsePreparer.build()) - .setStatus(Status.newBuilder().setCode(getDirectResponseCode(responseObject.getStatusCode()))) - .build(); - } else { - OkHttpResponse.Builder okResponseBuilder = OkHttpResponse.newBuilder(); - - // If the user is sending the APIKey credentials within query parameters, those query parameters should - // not be sent to the backend. Hence, the :path header needs to be constructed again removing the apiKey - // query parameter. In this scenario, apiKey query parameter is sent within the property called - // 'queryParamsToRemove' so that the custom filters also can utilize the method. - if (responseObject.getQueryParamsToRemove().size() > 0 || responseObject.getQueryParamsToAdd().size() > 0 || - responseObject.isRemoveAllQueryParams()) { - String constructedPath = constructQueryParamString(responseObject.isRemoveAllQueryParams(), - responseObject.getRequestPath(), responseObject.getQueryParamMap(), - responseObject.getQueryParamsToRemove(), responseObject.getQueryParamsToAdd()); - HeaderValueOption headerValueOption = HeaderValueOption.newBuilder() - .setHeader(HeaderValue.newBuilder().setKey(APIConstants.PATH_HEADER).setValue(constructedPath) - .build()).build(); - okResponseBuilder.addHeaders(headerValueOption); - } - - if (responseObject.getHeaderMap() != null) { - responseObject.getHeaderMap().forEach((key, value) -> { - HeaderValueOption headerValueOption = HeaderValueOption.newBuilder() - .setHeader(HeaderValue.newBuilder().setKey(key).setValue(value).build()) - .build(); - okResponseBuilder.addHeaders(headerValueOption); - } - ); - } - okResponseBuilder.addAllHeadersToRemove(responseObject.getRemoveHeaderMap()); - - Struct.Builder structBuilder = Struct.newBuilder(); - if (responseObject.getMetaDataMap() != null) { - responseObject.getMetaDataMap().forEach((key, value) -> { - if (value != null) { - addMetadata(structBuilder, key, value); - } - }); - } - - //Adds original request path header without params as a metadata for access logging. - addMetadata(structBuilder, RouterAccessLogConstants.ORIGINAL_PATH_DATA_NAME, - responseObject.getRequestPath().split("\\?")[0]); - // adding org level ratelimit key to metadata - addMetadata(structBuilder, MetadataConstants.RATELIMIT_WSO2_ORG_PREFIX, responseObject.getOrganizationId()); - addMetadata(structBuilder, MetadataConstants.APK_ENFORCER_REPLY, "Ok"); - - return CheckResponse.newBuilder().setStatus(Status.newBuilder().setCode(Code.OK_VALUE).build()) - .setOkResponse(okResponseBuilder.build()) - .setDynamicMetadata(structBuilder.build()) - .build(); - } - } - - private int getDirectResponseCode(int statusCode) { - switch (statusCode) { - // removed ok value from here since this method is used strictly for direct response, - // which should not sent a request to the upstream. - // case 200: - // return Code.OK_VALUE; - case 401: - return Code.UNAUTHENTICATED_VALUE; - case 403: - return Code.PERMISSION_DENIED_VALUE; - case 409: - return Code.RESOURCE_EXHAUSTED_VALUE; - } - return Code.INTERNAL_VALUE; - } - - private String constructQueryParamString(boolean removeAllQueryParams, String requestPath, - Map currentQueryParamMap, List queryParamsToRemove, - Map queryParamsToAdd) { - // If no query parameters needs to be removed/added, then the request path can be applied as it is. - if (!removeAllQueryParams && queryParamsToRemove.size() == 0 && queryParamsToAdd.size() == 0) { - return requestPath; - } - - Map queryParamMap = new HashMap<>(); - if (currentQueryParamMap != null) { - queryParamMap.putAll(currentQueryParamMap); - } - queryParamMap.putAll(queryParamsToAdd); - - String pathWithoutQueryParams = requestPath.split("\\?")[0]; - StringBuilder requestPathBuilder = new StringBuilder(pathWithoutQueryParams); - int count = 0; - if (!removeAllQueryParams && queryParamMap.size() > 0) { - for (String queryParam : queryParamMap.keySet()) { - if (queryParamsToRemove.contains(queryParam)) { - continue; - } - if (count == 0) { - requestPathBuilder.append("?"); - } else { - requestPathBuilder.append("&"); - } - requestPathBuilder.append(queryParam); - if (queryParamMap.get(queryParam) != null) { - requestPathBuilder.append("=").append(queryParamMap.get(queryParam)); - } - count++; - } - } - return requestPathBuilder.toString(); - } - - /** - * Adds a given key and value as a metadata - * - * @param structBuilder - * @param key - * @param value - */ - private void addMetadata(Struct.Builder structBuilder, String key, String value) { - structBuilder.putFields(key, Value.newBuilder().setStringValue(value).build()); - } - - /** - * This method builds the CheckResponse to be returned as response to '/ready' - * request of router - * - * @param responseBuilder CheckResponse.Builder object - * @param status HttpStatus object - * @return CheckResponse with body {"status":"ready"} and status code 200 OK. - */ - private CheckResponse buildReadyCheckResponse(CheckResponse.Builder responseBuilder, HttpStatus status) { - /* - * The DeniedResponsePreparer.Builder is used to send a direct response from - * ext-authz - * with status 200 and body {"status":"ready"} - */ - - JSONObject responseJson = new JSONObject(); - responseJson.put(APIConstants.ReadinessCheck.RESPONSE_KEY, APIConstants.ReadinessCheck.RESPONSE_VALUE); - HeaderValueOption headerValueOption = HeaderValueOption.newBuilder().setHeader(HeaderValue.newBuilder() - .setKey(APIConstants.CONTENT_TYPE_HEADER).setValue(APIConstants.APPLICATION_JSON).build()) - .build(); - - DeniedResponsePreparer deniedResponsePreparer = new DeniedResponsePreparer(DeniedHttpResponse.newBuilder()); - deniedResponsePreparer.addHeaders(headerValueOption); - deniedResponsePreparer.setStatus(status); - deniedResponsePreparer.setBody(responseJson.toString()); - - Struct.Builder metadataStructBuilder = Struct.newBuilder(); - addMetadata(metadataStructBuilder, MetadataConstants.APK_ENFORCER_REPLY, "Ok"); - - return CheckResponse.newBuilder() - .setDynamicMetadata(metadataStructBuilder.build()) - .setStatus(Status.newBuilder().setCode(Code.INTERNAL_VALUE).build()) - .setDeniedResponse(deniedResponsePreparer.build()) - .build(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExternalProcessorService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExternalProcessorService.java deleted file mode 100644 index f242827c94..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExternalProcessorService.java +++ /dev/null @@ -1,530 +0,0 @@ -/* - * Copyright (c) 2020, 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.grpc; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.protobuf.Struct; -import com.google.protobuf.Value; -import io.envoyproxy.envoy.config.core.v3.HeaderValue; -import io.envoyproxy.envoy.service.ext_proc.v3.BodyMutation; -import io.envoyproxy.envoy.service.ext_proc.v3.BodyResponse; -import io.envoyproxy.envoy.service.ext_proc.v3.CommonResponse; -import io.envoyproxy.envoy.service.ext_proc.v3.ExternalProcessorGrpc; -import io.envoyproxy.envoy.service.ext_proc.v3.HeaderMutation; -import io.envoyproxy.envoy.service.ext_proc.v3.HeadersResponse; -import io.envoyproxy.envoy.service.ext_proc.v3.HttpHeaders; -import io.envoyproxy.envoy.service.ext_proc.v3.ProcessingRequest; -import io.envoyproxy.envoy.service.ext_proc.v3.ProcessingResponse; -import io.grpc.stub.StreamObserver; -import org.apache.commons.compress.compressors.CompressorStreamFactory; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.constants.MetadataConstants; -import org.wso2.apk.enforcer.grpc.client.RatelimitClient; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * This is the gRPC server written to match with the envoy ext-authz filter proto file. Envoy proxy call this service. - * This is the entry point to the filter chain process for a request. - */ -public class ExternalProcessorService extends ExternalProcessorGrpc.ExternalProcessorImplBase { - private static final Logger logger = LogManager.getLogger(ExternalProcessorService.class); - private static final String DESCRIPTOR_KEY_FOR_AI_REQUEST_TOKEN_COUNT = "airequesttokencount"; - private static final String DESCRIPTOR_KEY_FOR_AI_RESPONSE_TOKEN_COUNT = "airesponsetokencount"; - private static final String DESCRIPTOR_KEY_FOR_AI_TOTAL_TOKEN_COUNT = "aitotaltokencount"; - private static final String DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_REQUEST_TOKEN_COUNT = "airequesttokencountsubs"; - private static final String DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_RESPONSE_TOKEN_COUNT = "airesponsetokencountsubs"; - private static final String DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_TOTAL_TOKEN_COUNT = "aitotaltokencountsubs"; - private static final String DESCRIPTOR_KEY_FOR_AI_SUBSCRIPTION = "subscription"; - private final ExecutorService executorService = Executors.newFixedThreadPool(10);; - RatelimitClient ratelimitClient = new RatelimitClient(); - @Override - public StreamObserver process( - final StreamObserver responseObserver) { - FilterMetadata filterMetadata = new FilterMetadata(); - return new StreamObserver() { - - @Override - public void onNext(ProcessingRequest request) { - ProcessingRequest.RequestCase r = request.getRequestCase(); - logger.info("Starting to serve external processing request"); - switch (r) { - case RESPONSE_HEADERS: - if (!request.getAttributesMap().isEmpty() && request.getAttributesMap().get(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY) != null && request.getAttributesMap().get(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY).getFieldsMap().get("xds.route_metadata") != null){ - Value value = request.getAttributesMap().get(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY).getFieldsMap().get("xds.route_metadata"); - FilterMetadata metadata = convertStringToFilterMetadata(value.getStringValue()); - filterMetadata.backendBasedAIRatelimitDescriptorValue = metadata.backendBasedAIRatelimitDescriptorValue; - filterMetadata.enableBackendBasedAIRatelimit = metadata.enableBackendBasedAIRatelimit; - } - Struct filterMetadataFromAuthZForHeader = request.getMetadataContext().getFilterMetadataOrDefault("envoy.filters.http.ext_authz", null); - if (filterMetadataFromAuthZForHeader != null) { - String extractTokenFrom = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.EXTRACT_TOKEN_FROM).getStringValue(); - String promptTokenID = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.PROMPT_TOKEN_ID).getStringValue(); - String completionTokenID = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.COMPLETION_TOKEN_ID).getStringValue(); - String totalTokenID = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.TOTAL_TOKEN_ID).getStringValue(); - String modelID = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.MODEL_ID).getStringValue(); - String providerName = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.AI_PROVIDER_NAME).getStringValue(); - String providerAPIVersion = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.AI_PROVIDER_API_VERSION).getStringValue(); - - Usage usage = extractUsageFromHeaders(request.getResponseHeaders(), completionTokenID, promptTokenID, totalTokenID, modelID); - - executorService.submit(() -> { - if (usage == null) { - logger.error("Usage details not found.."); - responseObserver.onCompleted(); - return; - } - List configs = new ArrayList<>(); - if (filterMetadata.enableBackendBasedAIRatelimit) { - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_REQUEST_TOKEN_COUNT, filterMetadata.backendBasedAIRatelimitDescriptorValue, usage.getPrompt_tokens() - 1)); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_RESPONSE_TOKEN_COUNT, filterMetadata.backendBasedAIRatelimitDescriptorValue, usage.getCompletion_tokens() - 1)); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_TOTAL_TOKEN_COUNT, filterMetadata.backendBasedAIRatelimitDescriptorValue, usage.getTotal_tokens() - 1)); - } - if (request.hasMetadataContext()) { - if (filterMetadataFromAuthZForHeader != null) { - if (filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.ORGANIZATION_AND_AIRL_POLICY) != null && filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.SUBSCRIPTION) != null) { - String orgAndAIRLPolicyValue = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.ORGANIZATION_AND_AIRL_POLICY).getStringValue(); - String aiRLSubsValue = filterMetadataFromAuthZForHeader.getFieldsMap().get(MetadataConstants.SUBSCRIPTION).getStringValue(); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_REQUEST_TOKEN_COUNT, orgAndAIRLPolicyValue, new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_SUBSCRIPTION, aiRLSubsValue, usage.getPrompt_tokens() - 1))); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_RESPONSE_TOKEN_COUNT, orgAndAIRLPolicyValue, new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_SUBSCRIPTION, aiRLSubsValue, usage.getCompletion_tokens() - 1))); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_TOTAL_TOKEN_COUNT, orgAndAIRLPolicyValue, new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_SUBSCRIPTION, aiRLSubsValue, usage.getTotal_tokens() - 1))); - } - } - } - ratelimitClient.shouldRatelimit(configs); - }); - if (usage != null) { - Struct.Builder structBuilder = Struct.newBuilder(); - addMetadata(structBuilder, MetadataConstants.AI_PROVIDER_API_VERSION, providerAPIVersion); - addMetadata(structBuilder, MetadataConstants.AI_PROVIDER_NAME, providerName); - addMetadata(structBuilder, MetadataConstants.MODEL, usage.model); - addMetadata(structBuilder, MetadataConstants.COMPLETION_TOKEN_COUNT, usage.completion_tokens); - addMetadata(structBuilder, MetadataConstants.TOTAL_TOKEN_COUNT, usage.total_tokens); - addMetadata(structBuilder, MetadataConstants.PROMPT_TOKEN_COUNT, usage.prompt_tokens); - Struct.Builder rootStructBuilder = Struct.newBuilder(); - rootStructBuilder.putFields(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY, Value.newBuilder().setStructValue(structBuilder.build()).build()); - responseObserver.onNext(ProcessingResponse.newBuilder().setDynamicMetadata(rootStructBuilder.build()).setResponseHeaders(prepareHeadersResponse()).build()); - } - } - responseObserver.onCompleted(); - case RESPONSE_BODY: - - if (!request.getAttributesMap().isEmpty() && request.getAttributesMap().get(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY) != null && request.getAttributesMap().get(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY).getFieldsMap().get("xds.route_metadata") != null){ - Value value = request.getAttributesMap().get(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY).getFieldsMap().get("xds.route_metadata"); - FilterMetadata metadata = convertStringToFilterMetadata(value.getStringValue()); - filterMetadata.backendBasedAIRatelimitDescriptorValue = metadata.backendBasedAIRatelimitDescriptorValue; - filterMetadata.enableBackendBasedAIRatelimit = metadata.enableBackendBasedAIRatelimit; - } - if (request.hasResponseBody()) { - final byte[] bodyFromResponse = request.getResponseBody().getBody().toByteArray(); - String body; - try { - body = decompress(bodyFromResponse); - } catch (Exception e) { - throw new RuntimeException(e); - } - - Struct filterMetadataFromAuthZForBody = request.getMetadataContext().getFilterMetadataOrDefault("envoy.filters.http.ext_authz", null); - if (filterMetadataFromAuthZForBody != null) { - String extractTokenFrom = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.EXTRACT_TOKEN_FROM).getStringValue(); - String promptTokenID = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.PROMPT_TOKEN_ID).getStringValue(); - String completionTokenID = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.COMPLETION_TOKEN_ID).getStringValue(); - String totalTokenID = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.TOTAL_TOKEN_ID).getStringValue(); - String modelID = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.MODEL_ID).getStringValue(); - String providerName = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.AI_PROVIDER_NAME).getStringValue(); - String providerAPIVersion = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.AI_PROVIDER_API_VERSION).getStringValue(); - - Usage usage = extractUsageFromBody(body, completionTokenID, promptTokenID, totalTokenID, modelID); - - executorService.submit(() -> { - if (usage == null) { - logger.error("Usage details not found.."); - responseObserver.onCompleted(); - return; - } - List configs = new ArrayList<>(); - if (filterMetadata.enableBackendBasedAIRatelimit) { - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_REQUEST_TOKEN_COUNT, filterMetadata.backendBasedAIRatelimitDescriptorValue, usage.getPrompt_tokens() - 1)); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_RESPONSE_TOKEN_COUNT, filterMetadata.backendBasedAIRatelimitDescriptorValue, usage.getCompletion_tokens() - 1)); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_TOTAL_TOKEN_COUNT, filterMetadata.backendBasedAIRatelimitDescriptorValue, usage.getTotal_tokens() - 1)); - } - if (request.hasMetadataContext()) { - if (filterMetadataFromAuthZForBody != null) { - if (filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.ORGANIZATION_AND_AIRL_POLICY) != null && filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.SUBSCRIPTION) != null) { - String orgAndAIRLPolicyValue = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.ORGANIZATION_AND_AIRL_POLICY).getStringValue(); - String aiRLSubsValue = filterMetadataFromAuthZForBody.getFieldsMap().get(MetadataConstants.SUBSCRIPTION).getStringValue(); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_REQUEST_TOKEN_COUNT, orgAndAIRLPolicyValue, new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_SUBSCRIPTION, aiRLSubsValue, usage.getPrompt_tokens() - 1))); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_RESPONSE_TOKEN_COUNT, orgAndAIRLPolicyValue, new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_SUBSCRIPTION, aiRLSubsValue, usage.getCompletion_tokens() - 1))); - configs.add(new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_SUBSCRIPTION_BASED_AI_TOTAL_TOKEN_COUNT, orgAndAIRLPolicyValue, new RatelimitClient.KeyValueHitsAddend(DESCRIPTOR_KEY_FOR_AI_SUBSCRIPTION, aiRLSubsValue, usage.getTotal_tokens() - 1))); - } - } - } - ratelimitClient.shouldRatelimit(configs); - }); - if (usage != null) { - Struct.Builder structBuilder = Struct.newBuilder(); - addMetadata(structBuilder, MetadataConstants.AI_PROVIDER_API_VERSION, providerAPIVersion); - addMetadata(structBuilder, MetadataConstants.AI_PROVIDER_NAME, providerName); - addMetadata(structBuilder, MetadataConstants.MODEL, usage.model); - addMetadata(structBuilder, MetadataConstants.COMPLETION_TOKEN_COUNT, usage.completion_tokens); - addMetadata(structBuilder, MetadataConstants.TOTAL_TOKEN_COUNT, usage.total_tokens); - addMetadata(structBuilder, MetadataConstants.PROMPT_TOKEN_COUNT, usage.prompt_tokens); - Struct.Builder rootStructBuilder = Struct.newBuilder(); - rootStructBuilder.putFields(MetadataConstants.EXT_PROC_METADATA_CONTEXT_KEY, Value.newBuilder().setStructValue(structBuilder.build()).build()); - responseObserver.onNext(ProcessingResponse.newBuilder().setDynamicMetadata(rootStructBuilder.build()).setResponseBody(prepareBodyResponse()).build()); - } - } - responseObserver.onCompleted(); - } else { - logger.error("Response body not found"); - responseObserver.onCompleted(); - } - - } - } - - @Override - public void onError(Throwable err) { - logger.error("Error initiated from envoy in the external processing session. Error: " + err); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - } - - protected BodyResponse prepareBodyResponse() { - return BodyResponse.newBuilder() - .setResponse( - CommonResponse.newBuilder() - .setStatus(CommonResponse.ResponseStatus.CONTINUE) -// .setBodyMutation(BodyMutation.newBuilder().build()) - - .build()) - - .build(); - } - - protected HeadersResponse prepareHeadersResponse() { - return HeadersResponse.newBuilder() - .setResponse( - CommonResponse.newBuilder() - .setStatus(CommonResponse.ResponseStatus.CONTINUE) -// .setHeaderMutation( -// HeaderMutation.newBuilder() -// .build()) -// .setBodyMutation(BodyMutation.newBuilder().build()) - .build()) - .build(); - } - - // The FilterMetadata class as per your request - private static class FilterMetadata { - boolean enableBackendBasedAIRatelimit; - String backendBasedAIRatelimitDescriptorValue; - @Override - public String toString() { - return "FilterMetadata{" + - ", enableBackendBasedAIRatelimit=" + enableBackendBasedAIRatelimit + - ", backendBasedAIRatelimitDescriptorValue='" + backendBasedAIRatelimitDescriptorValue + '\'' + - '}'; - } - } - - // Method to parse the string and create FilterMetadata object - public static FilterMetadata convertStringToFilterMetadata(String input) { - FilterMetadata metadata = new FilterMetadata(); - // Regex patterns to extract specific fields - String backendValuePattern = "key: \"BackendBasedAIRatelimitDescriptorValue\".*?string_value: \"(.*?)\""; - String enableBackendPattern = "key: \"EnableBackendBasedAIRatelimit\".*?string_value: \"(.*?)\""; - - // Extract and assign to the FilterMetadata object - metadata.backendBasedAIRatelimitDescriptorValue = extractValue(input, backendValuePattern); - metadata.enableBackendBasedAIRatelimit = Boolean.parseBoolean(extractValue(input, enableBackendPattern)); - - return metadata; - } - - /** - * Adds a given key and value as a metadata - * - * @param structBuilder - * @param key - * @param value - */ - private void addMetadata(Struct.Builder structBuilder, String key, String value) { - structBuilder.putFields(key, Value.newBuilder().setStringValue(value).build()); - } - - private void addMetadata(Struct.Builder structBuilder, String key, int value) { - structBuilder.putFields(key, Value.newBuilder().setNumberValue(value).build()); - } - - // Helper method to extract value based on a regex pattern - private static String extractValue(String input, String pattern) { - Pattern p = Pattern.compile(pattern); - Matcher m = p.matcher(input); - if (m.find()) { - return m.group(1); - } - return null; - } - - public static String sanitize(String input) { - // Replace all newline characters and tabs with a space - return input.replaceAll("[\\t\\n\\r]+", " ").trim(); - } - - private static Usage extractUsageFromHeaders(HttpHeaders headers, String completionTokenPath, String promptTokenPath, String totalTokenPath, String modelPath) { - try { - Usage usage = new Usage(); - boolean completionTokenExtracted = false; - boolean promptTokenExtracted = false; - boolean totalTokenExtracted = false; - boolean modelExtracted = false; - for (HeaderValue headerValue : headers.getHeaders().getHeadersList()) { - if (headerValue.getKey().equals(completionTokenPath)) { - completionTokenExtracted = true; - String value = headerValue.getValue(); - if (value.isEmpty()) { - value = headerValue.getRawValue().toString(StandardCharsets.UTF_8); - } - usage.completion_tokens = Integer.parseInt(value); - } - if (headerValue.getKey().equals(promptTokenPath)) { - promptTokenExtracted = true; - String value = headerValue.getValue(); - if (value.isEmpty()) { - value = headerValue.getRawValue().toString(StandardCharsets.UTF_8); - } - usage.prompt_tokens = Integer.parseInt(value); - } - if (headerValue.getKey().equals(totalTokenPath)) { - totalTokenExtracted = true; - String value = headerValue.getValue(); - if (value.isEmpty()) { - value = headerValue.getRawValue().toString(StandardCharsets.UTF_8); - } - usage.total_tokens = Integer.parseInt(value); - } - if (headerValue.getKey().equals(modelPath)) { - modelExtracted = true; - String value = headerValue.getValue(); - if (value.isEmpty()) { - value = headerValue.getRawValue().toString(StandardCharsets.UTF_8); - } - usage.model = value; - } - } - if (completionTokenExtracted && promptTokenExtracted && totalTokenExtracted) { - return usage; - } - return null; - } catch (Exception e) { - logger.error("Error occured while getting yusage info from headers" + e); - return null; - } - } - - private static Usage extractUsageFromBody(String body, String completionTokenPath, String promptTokenPath, String totalTokenPath, String modelPath) { - body = sanitize(body); - ObjectMapper mapper = new ObjectMapper(); - try { - Usage usage = new Usage(); - // Parse the JSON string - JsonNode rootNode = mapper.readTree(body); - // Extract prompt token count - String[] keysForPromtTokens = promptTokenPath.split("\\."); - if (keysForPromtTokens.length > 0 && "$".equals(keysForPromtTokens[0])) { - keysForPromtTokens = Arrays.copyOfRange(keysForPromtTokens, 1, keysForPromtTokens.length); - } - JsonNode currentNodeForPromtToken = null; - if (rootNode.has(keysForPromtTokens[0])) { - currentNodeForPromtToken = rootNode.get(keysForPromtTokens[0]); - } else { - return null; - } - for (int i = 1; i < keysForPromtTokens.length; i++) { - if (currentNodeForPromtToken.has(keysForPromtTokens[i])) { - currentNodeForPromtToken = currentNodeForPromtToken.get(keysForPromtTokens[i]); - } else { - return null; - } - } - usage.setPrompt_tokens(currentNodeForPromtToken.asInt()); - - // Extract completion token count - String[] keysForCompletionTokens = completionTokenPath.split("\\."); - if (keysForCompletionTokens.length > 0 && "$".equals(keysForCompletionTokens[0])) { - keysForCompletionTokens = Arrays.copyOfRange(keysForCompletionTokens, 1, keysForCompletionTokens.length); - } - JsonNode currentNodeForCompletionToken = null; - if (rootNode.has(keysForCompletionTokens[0])) { - currentNodeForCompletionToken = rootNode.get(keysForCompletionTokens[0]); - } else { - return null; - } - for (int i = 1; i < keysForCompletionTokens.length; i++) { - if (currentNodeForCompletionToken.has(keysForCompletionTokens[i])) { - currentNodeForCompletionToken = currentNodeForCompletionToken.get(keysForCompletionTokens[i]); - } else { - return null; - } - } - usage.setCompletion_tokens(currentNodeForCompletionToken.asInt()); - - // Extract total token count - String[] keysForTotalTokens = totalTokenPath.split("\\."); - if (keysForTotalTokens.length > 0 && "$".equals(keysForTotalTokens[0])) { - keysForTotalTokens = Arrays.copyOfRange(keysForTotalTokens, 1, keysForTotalTokens.length); - } - JsonNode currentNodeForTotalToken = null; - if (rootNode.has(keysForTotalTokens[0])) { - currentNodeForTotalToken = rootNode.get(keysForTotalTokens[0]); - } else { - return null; - } - for (int i = 1; i < keysForTotalTokens.length; i++) { - if (currentNodeForTotalToken.has(keysForTotalTokens[i])) { - currentNodeForTotalToken = currentNodeForTotalToken.get(keysForTotalTokens[i]); - } else { - return null; - } - } - usage.setTotal_tokens(currentNodeForTotalToken.asInt()); - - - // Extract model - String[] keysForModel = modelPath.split("\\."); - if (keysForModel.length > 0 && "$".equals(keysForModel[0])) { - keysForModel = Arrays.copyOfRange(keysForModel, 1, keysForModel.length); - } - JsonNode currentNodeForModel = null; - if (rootNode.has(keysForModel[0])) { - currentNodeForModel = rootNode.get(keysForModel[0]); - } else { - return null; - } - for (int i = 1; i < keysForModel.length; i++) { - if (currentNodeForModel.has(keysForModel[i])) { - currentNodeForModel = currentNodeForModel.get(keysForModel[i]); - } else { - return null; - } - } - usage.setModel(currentNodeForModel.asText()); - return usage; - - } catch (Exception e) { - logger.error(String.format("Unexpected error while extracting usage from the body: %s", body) + " \n" + e); - return null; - } - } - - public static class Usage { - private int completion_tokens; - private int prompt_tokens; - private int total_tokens; - private String model = ""; - - // Getters and Setters - public int getCompletion_tokens() { - return completion_tokens; - } - - public void setCompletion_tokens(int completion_tokens) { - this.completion_tokens = completion_tokens; - } - - public int getPrompt_tokens() { - return prompt_tokens; - } - - public void setPrompt_tokens(int prompt_tokens) { - this.prompt_tokens = prompt_tokens; - } - - public int getTotal_tokens() { - return total_tokens; - } - - public void setTotal_tokens(int total_tokens) { - this.total_tokens = total_tokens; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - @Override - public String toString() { - return String.format("%s_%s_%s", prompt_tokens, completion_tokens, total_tokens); - } - } - - public static String decompress(byte[] compressed) throws Exception { - String body = new String(compressed, StandardCharsets.UTF_8); - if (isValidJson(body)) { - return body; - } - try (InputStream is = new CompressorStreamFactory() - .createCompressorInputStream(new ByteArrayInputStream(compressed)); - BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { - StringBuilder outStr = new StringBuilder(); - String line; - while ((line = reader.readLine()) != null) { - outStr.append(line); - } - if (isValidJson(outStr.toString())) { - return outStr.toString(); - } else { - throw new RuntimeException("Could not decompress response body"); - } - } - } - - public static boolean isValidJson(String json) { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.readTree(json); - return true; - } catch (Exception e) { - return false; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/HealthService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/HealthService.java deleted file mode 100644 index e56acb71c9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/HealthService.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.wso2.apk.enforcer.grpc; - -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.service.health.HealthCheckRequest; -import org.wso2.apk.enforcer.discovery.service.health.HealthCheckResponse; -import org.wso2.apk.enforcer.discovery.service.health.HealthGrpc; - -/** - * This is the gRPC server written to serve the health state of enforcer. - */ -public class HealthService extends HealthGrpc.HealthImplBase { - - private static final Logger logger = LogManager.getLogger(HealthService.class); - - @Override - public void check(HealthCheckRequest request, StreamObserver responseObserver) { - logger.debug("Responding health state of Enforcer as HEALTHY"); - HealthCheckResponse response = HealthCheckResponse.newBuilder() - .setStatus(HealthCheckResponse.ServingStatus.SERVING).build(); - // respond for all without checking requested service name - // service name format: package_names.ServiceName - responseObserver.onNext(response); - responseObserver.onCompleted(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/WebSocketFrameService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/WebSocketFrameService.java deleted file mode 100644 index edcdb66760..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/WebSocketFrameService.java +++ /dev/null @@ -1,62 +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.grpc; -// -//import io.grpc.stub.StreamObserver; -//import org.apache.logging.log4j.LogManager; -//import org.apache.logging.log4j.Logger; -//import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest; -//import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse; -//import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameServiceGrpc; -//import org.wso2.apk.enforcer.websocket.WebSocketResponseObserver; -// -// -//import java.util.concurrent.ConcurrentHashMap; -// -///** -// * gRPC service for processing web socket frame related metadata for websocket throttling and analytics. This class -// * contains a ConcurrentHashMap of the StreamObservers that corresponds to open grpc bidirectional streams with -// * envoy mgw_wasm_websocket filter. -// */ -//public class WebSocketFrameService extends WebSocketFrameServiceGrpc.WebSocketFrameServiceImplBase { -// private static final Logger logger = LogManager.getLogger(WebSocketFrameService.class); -// private static ConcurrentHashMap responseObservers = new ConcurrentHashMap<>(); -// @Override -// public StreamObserver publishFrameData(StreamObserver -// responseObserver) { -// logger.debug("publishMetadata invoked from websocket metadata service"); -// return new WebSocketResponseObserver(responseObserver); -// } -// -// public static void addObserver(String streamId, WebSocketResponseObserver observer) { -// responseObservers.put(streamId, observer); -// } -// -// public static void removeObserver(String streamId) { -// // As per the class java doc, the map of observers is maintained to keep track of open grpc streams. -// // The map is updated when the first message from the router arrives at the enforcer. If a stream -// // was created, yet no WebSocketFrameRequests arrives, and the stream gets deleted, the class variable -// // streamId will not be set (streamId will be null) and an observer will not be added to the map. -// // Ex: when a backend does not exist. -// if (streamId != null) { -// responseObservers.remove(streamId); -// } -// } -// -// -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/client/RatelimitClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/client/RatelimitClient.java deleted file mode 100644 index e0b341cd13..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/client/RatelimitClient.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.wso2.apk.enforcer.grpc.client; - -import io.envoyproxy.envoy.extensions.common.ratelimit.v3.RateLimitDescriptor; -import io.envoyproxy.envoy.service.ratelimit.v3.RateLimitRequest; -import io.envoyproxy.envoy.service.ratelimit.v3.RateLimitServiceGrpc; -import io.envoyproxy.envoy.service.ratelimit.v3.RateLimitResponse; -import io.grpc.ManagedChannel; -import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; -import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; -import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.grpc.ExternalProcessorService; - -import java.io.File; -import java.nio.file.Paths; -import java.util.List; -import javax.net.ssl.SSLException; - -public class RatelimitClient { - private static final Logger logger = LogManager.getLogger(RatelimitClient.class); - RateLimitServiceGrpc.RateLimitServiceBlockingStub stub; - - public RatelimitClient(){ - File certFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()).toFile(); - File keyFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()).toFile(); - SslContext sslContext = null; - try { - sslContext = GrpcSslContexts - .forClient() - .trustManager(ConfigHolder.getInstance().getTrustManagerFactory()) - .keyManager(certFile, keyFile) - .build(); - } catch (SSLException e) { - logger.error("Error while generating SSL Context."+ e); - } - String rlHost = ConfigHolder.getInstance().getEnvVarConfig().getRatelimiterHost(); - int port = ConfigHolder.getInstance().getEnvVarConfig().getRatelimiterPort(); - ManagedChannel channel = NettyChannelBuilder.forAddress(rlHost, port) - .useTransportSecurity() - .sslContext(sslContext) - .build(); - this.stub = RateLimitServiceGrpc.newBlockingStub(channel); - } - - public void shouldRatelimit(List configs) { - for (KeyValueHitsAddend config : configs) { - RateLimitDescriptor.Builder builder = RateLimitDescriptor.newBuilder() - .addEntries(RateLimitDescriptor.Entry.newBuilder().setKey(config.getKey()).setValue(config.getValue()).build()); - KeyValueHitsAddend internalKeyValueHitsAddend = config.keyValueHitsAddend; - int hitsAddend = config.getHitsAddend(); - while (internalKeyValueHitsAddend != null) { - builder.addEntries(RateLimitDescriptor.Entry.newBuilder().setKey(internalKeyValueHitsAddend.getKey()).setValue(internalKeyValueHitsAddend.getValue()).build()); - hitsAddend = internalKeyValueHitsAddend.getHitsAddend(); - internalKeyValueHitsAddend = internalKeyValueHitsAddend.keyValueHitsAddend; - } - RateLimitDescriptor descriptor = builder.build(); - RateLimitRequest rateLimitRequest = RateLimitRequest.newBuilder() - .addDescriptors(descriptor) - .setDomain("Default") - .setHitsAddend(hitsAddend) - .build(); - RateLimitResponse rateLimitResponse = stub.shouldRateLimit(rateLimitRequest); - } - } - - public static class KeyValueHitsAddend { - private String key; - private String value; - private int hitsAddend; - private KeyValueHitsAddend keyValueHitsAddend; - - public KeyValueHitsAddend(String key, String value, int hitsAddend) { - this.key = key; - this.value = value; - this.hitsAddend = hitsAddend; - this.keyValueHitsAddend = null; - } - public KeyValueHitsAddend(String key, String value, KeyValueHitsAddend keyValueHitsAddend) { - this.key = key; - this.value = value; - this.hitsAddend = -1; - this.keyValueHitsAddend = keyValueHitsAddend; - } - - public String getKey() { - return key; - } - - public String getValue() { - return value; - } - - public int getHitsAddend() { - return hitsAddend; - } - } - - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/interceptors/AccessLogInterceptor.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/interceptors/AccessLogInterceptor.java deleted file mode 100644 index 141c56c1b0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/interceptors/AccessLogInterceptor.java +++ /dev/null @@ -1,119 +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.grpc.interceptors; - -import io.envoyproxy.envoy.service.auth.v3.CheckRequest; -import io.envoyproxy.envoy.service.auth.v3.CheckResponse; -import io.grpc.ForwardingServerCall; -import io.grpc.Metadata; -import io.grpc.MethodDescriptor; -import io.grpc.ServerCall; -import io.grpc.ServerCallHandler; -import io.grpc.ServerInterceptor; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.constants.HttpConstants; - -/** - * Intercepts the gRPC request comes to the enforcer and logs the request access data. - */ -public class AccessLogInterceptor implements ServerInterceptor { - private static final Logger logger = LogManager.getLogger(AccessLogInterceptor.class); - - @Override - public ServerCall.Listener interceptCall(ServerCall serverCall, - Metadata metadata, ServerCallHandler serverCallHandler) { - if (logger.isDebugEnabled()) { - EnforcerServerCall enforcerServerCall = new EnforcerServerCall(serverCall); - ServerCall.Listener listener = serverCallHandler.startCall(enforcerServerCall, metadata); - return new EnforcerForwardingServerCallListener(serverCall.getMethodDescriptor(), listener) { - @Override - public void onMessage(ReqT message) { - if (message instanceof CheckRequest) { - CheckRequest checkRequest = (CheckRequest) message; - enforcerServerCall.setStartTime(System.currentTimeMillis()); - String requestId = checkRequest.getAttributes().getRequest().getHttp().getId(); - // x-request-id equals to envoy access log entries "%REQ(X-REQUEST-ID)%". This allows - // to correlate the same request in Router and the Enforcer. If this header is not coming then - // we set the http request Id property as the default value. - enforcerServerCall.setTraceId(checkRequest.getAttributes().getRequest().getHttp() - .getHeadersOrDefault(HttpConstants.X_REQUEST_ID_HEADER, requestId)); - super.onMessage(message); -// } else if (message instanceof WebSocketFrameRequest) { -// WebSocketFrameRequest webSocketFrameRequest = (WebSocketFrameRequest) message; -// enforcerServerCall.setStartTime(System.currentTimeMillis()); -// enforcerServerCall.setTraceId(webSocketFrameRequest.getMetadata().getExtAuthzMetadataMap() -// .get(MetadataConstants.REQUEST_ID)); -// super.onMessage(message); - } - } - }; - } - return serverCallHandler.startCall(serverCall, metadata); - } - - private class EnforcerServerCall extends ForwardingServerCall.SimpleForwardingServerCall { - - ServerCall serverCall; - long startTime; - String traceId; - - protected EnforcerServerCall(ServerCall serverCall) { - super(serverCall); - this.serverCall = serverCall; - } - - @Override - public void sendMessage(RespT message) { - serverCall.sendMessage(message); - if (message instanceof CheckResponse) { - long responseTimeMillis = System.currentTimeMillis() - startTime; - CheckResponse checkResponse = (CheckResponse) message; - // log pattern -> trace ID, gRPC method name, response status code, response time - logger.info(String.format("%s %s %d %d", traceId, serverCall.getMethodDescriptor().getFullMethodName(), - checkResponse.getStatus().getCode(), responseTimeMillis)); -// } else if (message instanceof WebSocketFrameResponse) { -// long responseTimeMillis = System.currentTimeMillis() - startTime; -// WebSocketFrameResponse webSocketFrameResponse = (WebSocketFrameResponse) message; -// // log pattern -> trace ID, gRPC method name, throttle state, response time -// logger.info(String.format("%s %s %s %d", traceId, serverCall.getMethodDescriptor().getFullMethodName(), -// webSocketFrameResponse.getThrottleState(), responseTimeMillis)); - } - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - } - - public void setTraceId(String traceId) { - this.traceId = traceId; - } - } - - private class EnforcerForwardingServerCallListener - extends io.grpc.ForwardingServerCallListener.SimpleForwardingServerCallListener { - String methodName; - - protected EnforcerForwardingServerCallListener(MethodDescriptor method, ServerCall.Listener listener) { - super(listener); - methodName = method.getFullMethodName(); - } - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/interceptors/OpenTelemetryInterceptor.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/interceptors/OpenTelemetryInterceptor.java deleted file mode 100644 index 99c84fa062..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/interceptors/OpenTelemetryInterceptor.java +++ /dev/null @@ -1,77 +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.grpc.interceptors; - -import com.google.common.net.HttpHeaders; -import io.grpc.Contexts; -import io.grpc.Metadata; -import io.grpc.ServerCall; -import io.grpc.ServerCall.Listener; -import io.grpc.ServerCallHandler; -import io.grpc.ServerInterceptor; -import io.opentelemetry.context.Context; -import io.opentelemetry.context.propagation.TextMapGetter; -import io.opentelemetry.context.propagation.TextMapPropagator; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.tracing.TracerFactory; -import org.wso2.apk.enforcer.tracing.TracingContextHolder; -import org.wso2.apk.enforcer.tracing.Utils; - -/** - * gRPC interceptor to initialize tracing using context propagated from router. - */ -public class OpenTelemetryInterceptor implements ServerInterceptor { - private static final Logger logger = LogManager.getLogger(OpenTelemetryInterceptor.class); - - // Extract the Distributed Context from the gRPC metadata - private static final TextMapGetter getter = - new TextMapGetter<>() { - @Override - public Iterable keys(Metadata carrier) { - return carrier.keys(); - } - - @Override - public String get(Metadata carrier, String key) { - Metadata.Key k = Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); - if (carrier.containsKey(k)) { - return carrier.get(k); - } - return ""; - } - }; - - @Override - public Listener interceptCall(ServerCall call, Metadata headers, - ServerCallHandler next) { - logger.debug("Intercepting the request"); - - if (Utils.tracingEnabled()) { - TextMapPropagator propagator = TracerFactory.getInstance().getTextPropagator(); - Context parentContext = propagator.extract(Context.current(), headers, getter); - Metadata.Key xRequestIdKey = Metadata.Key.of(HttpHeaders.X_REQUEST_ID, - Metadata.ASCII_STRING_MARSHALLER); - String traceId = headers.get(xRequestIdKey); - TracingContextHolder.setContext(traceId, parentContext); - logger.debug("Attached to propagated parent tracing context."); - } - return Contexts.interceptCall(io.grpc.Context.current(), call, headers, next); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/MediationPolicyFilter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/MediationPolicyFilter.java deleted file mode 100644 index c99eb0abbb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/MediationPolicyFilter.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.interceptor; - -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpMethod; -import org.apache.http.NameValuePair; -import org.apache.http.client.utils.URLEncodedUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.Filter; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.Policy; -import org.wso2.apk.enforcer.commons.model.PolicyConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.opa.OPASecurityException; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.constants.GeneralErrorCodeConstants; -import org.wso2.apk.enforcer.interceptor.opa.OPAClient; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.nio.charset.StandardCharsets; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Apply mediation policies. - */ -public class MediationPolicyFilter implements Filter { - private static final Logger log = LogManager.getLogger(MediationPolicyFilter.class); - private static final String X_URI_MAPPING_PROPERTY = "x-uri-mapping"; - - public MediationPolicyFilter() { - OPAClient.init(); - } - - @Override - public boolean handleRequest(RequestContext requestContext) { - - // only getting first operation is enough as only one resource config will be present for non graphQL APIs. - // Mediation policy filter is not applied to graphQL apis - PolicyConfig policyConfig = requestContext.getMatchedResourcePaths().get(0).getPolicyConfig(); - // apply in policies - if (policyConfig != null && policyConfig.getRequest() != null && policyConfig.getRequest().size() > 0) { - for (Policy policy : policyConfig.getRequest()) { - if (!applyPolicy(requestContext, policy)) { - return false; - } - } - } - return true; - } - - private boolean applyPolicy(RequestContext requestContext, Policy policy) { - switch (policy.getAction()) { - case "RENAME_HEADER": { - renameHeader(requestContext, policy.getParameters()); - return true; - } - case "ADD_QUERY": { - addOrModifyQuery(requestContext, policy.getParameters()); - return true; - } - case "REMOVE_QUERY": { - removeQuery(requestContext, policy.getParameters()); - return true; - } - case "REWRITE_RESOURCE_PATH": { - removeAllQueries(requestContext, policy.getParameters()); - pathParamToQueryParamTransform(requestContext, policy.getParameters()); - return true; - } - case "REWRITE_RESOURCE_METHOD": { - modifyMethod(requestContext, policy.getParameters()); - return true; - } - case "OPA": { - return opaAuthValidation(requestContext, policy.getParameters()); - } - } - - // should not reach here, if reached, it is due to a validation error in Adapter - log.error("Operation policy action \"{}\" is not supported. " + - "Adapter has failed to validate the policy action. {}", - policy.getAction(), ErrorDetails.errorLog(LoggingConstants.Severity.MAJOR, 6100)); - FilterUtils.setErrorToContext(requestContext, GeneralErrorCodeConstants.MEDIATION_POLICY_ERROR_CODE, - APIConstants.StatusCodes.INTERNAL_SERVER_ERROR.getCode(), - APIConstants.INTERNAL_SERVER_ERROR_MESSAGE, null); - return false; - } - - private void renameHeader(RequestContext requestContext, Map policyAttrib) { - String currentHeaderName = policyAttrib.get("currentHeaderName").toLowerCase(); - String updatedHeaderValue = policyAttrib.get("updatedHeaderName"); - if (requestContext.getHeaders().containsKey(currentHeaderName)) { - String headerValue = requestContext.getHeaders().get(currentHeaderName); - requestContext.getRemoveHeaders().add(currentHeaderName); - requestContext.addOrModifyHeaders(updatedHeaderValue, headerValue); - } - } - - private void removeQuery(RequestContext requestContext, Map policyAttrib) { - String queryName = policyAttrib.get("queryParamName"); - requestContext.getQueryParamsToRemove().add(queryName); - } - - private void removeAllQueries(RequestContext requestContext, Map policyAttrib) { - // adapter may not pass, booleans with false in the map, hence empty, null or any other strings - // excepts "true" is considered as false. - boolean removeQuery = !Boolean.parseBoolean(policyAttrib.get("includeQueryParams")); - requestContext.setRemoveAllQueryParams(removeQuery); - } - - private void pathParamToQueryParamTransform(RequestContext requestContext, Map policyAttrib) { - // "x-uri-mapping" property is explicitly added when processing x-uri-mapping extension in async api definition - if (policyAttrib.containsKey(X_URI_MAPPING_PROPERTY)) { - String uriMappingValue = policyAttrib.get(X_URI_MAPPING_PROPERTY); - String[] queryParts = uriMappingValue.split("\\?"); - String queryParamString = queryParts.length > 1 ? queryParts[1] : ""; - List queryParams = URLEncodedUtils.parse(queryParamString, StandardCharsets.UTF_8); - for (NameValuePair param : queryParams) { - String singleQueryParamvalue = param.getValue(); - if (singleQueryParamvalue.contains("{uri.var.")) { - Matcher substituteParamMatcher = Pattern.compile("\\{uri\\.var\\.(.*?)\\}") - .matcher(singleQueryParamvalue); - while (substituteParamMatcher.find()) { - String pathParamId = singleQueryParamvalue - .substring(substituteParamMatcher.start() + 9, substituteParamMatcher.end() - 1) - .trim(); - if (requestContext.getPathParameters() != null - && requestContext.getPathParameters().containsKey(pathParamId)) { - requestContext.getQueryParamsToAdd().put(param.getName(), - requestContext.getPathParameters().get(pathParamId)); - } - } - } else { - requestContext.getQueryParamsToAdd().put(param.getName(), param.getValue()); - } - } - } - } - - private void addOrModifyQuery(RequestContext requestContext, Map policyAttrib) { - String queryName = policyAttrib.get("queryParamName"); - String queryValue = policyAttrib.get("queryParamValue"); - requestContext.getQueryParamsToAdd().put(queryName, queryValue); - } - - private void modifyMethod(RequestContext requestContext, Map policyAttrib) { - try { - HttpMethod updatedMethod = HttpMethod.valueOf(policyAttrib.get("updatedMethod")); - String newMethod = updatedMethod.toString().toUpperCase(); - String currentMethod = requestContext.getRequestMethod().toUpperCase(); - requestContext.addOrModifyHeaders(":method", newMethod); - requestContext.addMetadataToMap("method-rewrite", currentMethod + "_to_" + newMethod); - } catch (IllegalArgumentException ex) { - log.error("Error while getting mediation policy rewrite method", ex); - } - } - - private boolean opaAuthValidation(RequestContext requestContext, Map policyAttrib) { - try { - boolean isValid = OPAClient.getInstance().validateRequest(requestContext, policyAttrib); - if (!isValid) { - log.error("OPA validation failed for the request: {} {}", - requestContext.getRequestPathTemplate(), - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6101)); - FilterUtils.setErrorToContext(requestContext, APISecurityConstants.OPA_AUTH_FORBIDDEN, - APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.OPA_AUTH_FORBIDDEN_MESSAGE, null); - } - return isValid; - } catch (OPASecurityException e) { - log.error("Error while validating the OPA policy for the request: {} {} {}", - requestContext.getRequestPathTemplate(), - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6101), e.getMessage()); - FilterUtils.setErrorToContext(requestContext, e); - return false; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPAClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPAClient.java deleted file mode 100644 index 3e013f76bb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPAClient.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.interceptor.opa; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.HttpEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.opa.OPAConstants; -import org.wso2.apk.enforcer.commons.opa.OPARequestGenerator; -import org.wso2.apk.enforcer.commons.opa.OPASecurityException; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.nio.charset.Charset; -import java.security.KeyStore; -import java.util.HashMap; -import java.util.Map; -import java.util.ServiceLoader; - -/** - * HTTP Client which send requests to OPA server by selecting the implementation of {@link OPARequestGenerator} - * which is provided with policy attributes. - */ -public class OPAClient { - private static final Logger log = LogManager.getLogger(OPAClient.class); - private static final String DEFAULT_REQUEST_GENERATOR_CLASS = - "org.wso2.apk.enforcer.commons.model.RequestContext.OPADefaultRequestGenerator"; - private static final OPAClient opaClient = new OPAClient(); - - private final OPARequestGenerator defaultRequestGenerator = new OPADefaultRequestGenerator(); - private final Map requestGeneratorMap = new HashMap<>(); - - private OPAClient() { - } - - public static void init() { - getInstance().loadRequestGenerators(); - } - - public static OPAClient getInstance() { - return opaClient; - } - - public boolean validateRequest(RequestContext requestContext, Map policyAttrib) - throws OPASecurityException { - String requestGeneratorClassName = policyAttrib.get("requestGenerator"); - OPARequestGenerator requestGenerator = requestGeneratorMap.get(requestGeneratorClassName); - if (requestGenerator == null) { - log.error("OPA Request Generator Implementation is not found in the " + - "classPath under the provided name: {} {}", - requestGeneratorClassName, ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6103)); - throw new OPASecurityException(APIConstants.StatusCodes.INTERNAL_SERVER_ERROR.getCode(), - APISecurityConstants.OPA_REQUEST_FAILURE); - } - - String serverURL = policyAttrib.get("serverURL"); - String token = policyAttrib.get("accessKey"); - String policyName = policyAttrib.get("policy"); - String ruleName = policyAttrib.get("rule"); - - // additionalParameters - we provide this as a Map in the interface - // policyAttrib should support Map> - // and the additionalParameters should come inside this. Since APIM 4.1.0 not supports - // Map> in the UI, this is fine for now. - Map additionalParameters = new HashMap<>(); - additionalParameters.put(OPAConstants.AdditionalParameters.ADDITIONAL_PROPERTIES, - policyAttrib.get("additionalProperties")); - additionalParameters.put(OPAConstants.AdditionalParameters.SEND_ACCESS_TOKEN, - policyAttrib.get("sendAccessToken")); - - // client related configs - Map clientOptions = new HashMap<>(); - FilterUtils.putToMapIfNotNull(clientOptions, FilterUtils.HTTPClientOptions.MAX_OPEN_CONNECTIONS, - policyAttrib.get("maxOpenConnections")); - FilterUtils.putToMapIfNotNull(clientOptions, FilterUtils.HTTPClientOptions.MAX_PER_ROUTE, - policyAttrib.get("maxPerRoute")); - FilterUtils.putToMapIfNotNull(clientOptions, FilterUtils.HTTPClientOptions.CONNECT_TIMEOUT, - policyAttrib.get("connectionTimeout")); - - // evaluating server policy URL - serverURL = StringUtils.removeEnd(serverURL, "/"); - String evaluatingPolicyUrl; - if (StringUtils.isNotEmpty(ruleName)) { - evaluatingPolicyUrl = String.format("%s/%s/%s", serverURL, policyName, ruleName); - } else { - evaluatingPolicyUrl = String.format("%s/%s", serverURL, policyName); - } - - // calling OPA server and validate response - String requestBody = requestGenerator.generateRequest(policyName, ruleName, additionalParameters, - requestContext); - String opaResponse = callOPAServer(evaluatingPolicyUrl, requestBody, token, clientOptions); - return requestGenerator.handleResponse(policyName, ruleName, opaResponse, additionalParameters, - requestContext); - } - - private void loadRequestGenerators() { - ServiceLoader loader = ServiceLoader.load(OPARequestGenerator.class); - for (OPARequestGenerator generator : loader) { - requestGeneratorMap.put(generator.getClass().getName(), generator); - } - requestGeneratorMap.put("", defaultRequestGenerator); - requestGeneratorMap.put(null, defaultRequestGenerator); - requestGeneratorMap.put(DEFAULT_REQUEST_GENERATOR_CLASS, defaultRequestGenerator); - } - - private static String callOPAServer(String serverEp, String payload, String token, - Map clientOptions) throws OPASecurityException { - try { - URL url = new URL(serverEp); - KeyStore opaKeyStore = ConfigHolder.getInstance().getOpaKeyStore(); - try (CloseableHttpClient httpClient = (CloseableHttpClient) FilterUtils.getHttpClient( - opaKeyStore,null, clientOptions)) { - HttpPost httpPost = new HttpPost(serverEp); - HttpEntity reqEntity = new ByteArrayEntity(payload.getBytes(Charset.defaultCharset())); - httpPost.setEntity(reqEntity); - httpPost.setHeader(APIConstants.CONTENT_TYPE_HEADER, APIConstants.APPLICATION_JSON); - if (StringUtils.isNotEmpty(token)) { - httpPost.setHeader(APIConstants.AUTHORIZATION_HEADER_DEFAULT, - APIConstants.AUTHORIZATION_BEARER + token); - } - try (CloseableHttpResponse response = httpClient.execute(httpPost)) { - int statusCode = response.getStatusLine().getStatusCode(); - if (statusCode == 200) { - HttpEntity entity = response.getEntity(); - try (InputStream content = entity.getContent()) { - return IOUtils.toString(content, String.valueOf(Charset.defaultCharset())); - } - } else { - log.error("Unexpected HTTP response code responded by the OPA server, HTTP code: {} {}", - statusCode, ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6106)); - throw new OPASecurityException(APIConstants.StatusCodes.INTERNAL_SERVER_ERROR.getCode(), - APISecurityConstants.OPA_REQUEST_FAILURE); - } - } - } - } catch (IOException e) { - log.error("Error calling the OPA server with server endpoint: {} {} {}", serverEp, - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6104), e.getMessage()); - throw new OPASecurityException(APIConstants.StatusCodes.INTERNAL_SERVER_ERROR.getCode(), - APISecurityConstants.OPA_REQUEST_FAILURE, e); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPADefaultRequestGenerator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPADefaultRequestGenerator.java deleted file mode 100644 index b032cfd0ea..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPADefaultRequestGenerator.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.interceptor.opa; - -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.json.JSONException; -import org.json.JSONObject; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.opa.OPAConstants; -import org.wso2.apk.enforcer.commons.opa.OPARequestGenerator; -import org.wso2.apk.enforcer.commons.opa.OPASecurityException; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; - -import java.util.Arrays; -import java.util.Map; - -/** - * Default implementation of the {@link OPARequestGenerator}. - */ -public class OPADefaultRequestGenerator implements OPARequestGenerator { - private static final Logger log = LogManager.getLogger(OPADefaultRequestGenerator.class); - - @Override - public String generateRequest(String policyName, String rule, Map additionalParameters, - RequestContext requestContext) throws OPASecurityException { - JSONObject requestPayload = new JSONObject(); - JSONObject inputPayload = new JSONObject(); - requestPayload.put("input", inputPayload); - - // following fields are the same fields sent from the synapse request generator - JSONObject transportHeaders = new JSONObject(); - // To avoid publishing user tokens to OPA. - // If "SEND_ACCESS_TOKEN" is enabled, it is sent in auth context only - requestContext.getHeaders().keySet().stream() - .filter(header -> !requestContext.getRemoveHeaders().contains(header)) - .forEach(header -> transportHeaders.put(header, requestContext.getHeaders().get(header))); - // changes this - inputPayload.put("transportHeaders", transportHeaders); - inputPayload.put("requestOrigin", requestContext.getClientIp()); - inputPayload.put("method", requestContext.getRequestMethod()); - inputPayload.put("path", requestContext.getRequestPath()); - - // API context - JSONObject apiContext = new JSONObject(); - inputPayload.put("apiContext", apiContext); - apiContext.put("apiName", requestContext.getMatchedAPI().getName()); - apiContext.put("apiVersion", requestContext.getMatchedAPI().getVersion()); - apiContext.put("orgId", requestContext.getMatchedAPI().getOrganizationId()); - apiContext.put("vhost", requestContext.getMatchedAPI().getVhost()); - apiContext.put("pathTemplate", requestContext.getRequestPathTemplate()); - apiContext.put("clusterName", requestContext.getClusterHeader()); - - // Authentication Context - if (Boolean.parseBoolean(additionalParameters.get(OPAConstants.AdditionalParameters.SEND_ACCESS_TOKEN))) { - AuthenticationContext authContext = requestContext.getAuthenticationContext(); - JSONObject authContextPayload = new JSONObject(); - authContextPayload.put("token", authContext.getRawToken()); - authContextPayload.put("tokenType", authContext.getTokenType()); - authContextPayload.put("keyType", requestContext.getMatchedAPI().getEnvType()); - inputPayload.put("authenticationContext", authContextPayload); - } - - // Additional Properties - String addProps = additionalParameters.get(OPAConstants.AdditionalParameters.ADDITIONAL_PROPERTIES); - if (StringUtils.isNotEmpty(addProps)) { - Arrays.stream(addProps.split(OPAConstants.AdditionalParameters.PARAM_SEPARATOR)) - .forEach(key -> inputPayload.put(key, requestContext.getProperties().get(key))); - } - - return requestPayload.toString(); - } - - @Override - public boolean handleResponse(String policyName, String rule, String opaResponse, - Map additionalParameters, RequestContext requestContext) - throws OPASecurityException { - try { - JSONObject response = new JSONObject(opaResponse); - return response.getBoolean("result"); - } catch (JSONException e) { - log.error("Error parsing OPA JSON response, the field \"result\" not found or not a Boolean, " + - "response: {} {} {}", opaResponse, - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6104), e.getMessage()); - throw new OPASecurityException(APIConstants.StatusCodes.INTERNAL_SERVER_ERROR.getCode(), - APISecurityConstants.OPA_RESPONSE_FAILURE, e); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/JMXAgent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/JMXAgent.java deleted file mode 100644 index e0d9fedfab..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/JMXAgent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.jmx; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; - -import java.net.InetAddress; -import java.rmi.registry.LocateRegistry; - -import javax.management.remote.JMXConnectorServer; -import javax.management.remote.JMXConnectorServerFactory; -import javax.management.remote.JMXServiceURL; - -/** - * JMX Connector Agent - */ -public class JMXAgent { - private static final Logger logger = LogManager.getLogger(JMXAgent.class); - private static JMXConnectorServer jmxConnectorServer; - private static final String DEFAULT_RMI_SERVER_PORT = "11111"; - private static final String DEFAULT_RMI_REGISTRY_PORT = "9999"; - private static final String JAVA_JMX_RMI_SERVICE_PORT = "com.sun.management.jmxremote.port"; - private static final String JAVA_JMX_RMI_REGISTRY_PORT = "com.sun.management.jmxremote.rmi.port"; - - public static void initJMXAgent() { - if (JMXUtils.isJMXMetricsEnabled()) { - try { - String hostname = InetAddress.getLocalHost().getHostAddress(); - String rmiServerPort = System.getProperty(JAVA_JMX_RMI_SERVICE_PORT, DEFAULT_RMI_SERVER_PORT); - String rmiRegistryPort = System.getProperty(JAVA_JMX_RMI_REGISTRY_PORT, DEFAULT_RMI_REGISTRY_PORT); - - LocateRegistry.createRegistry(Integer.parseInt(rmiRegistryPort)); - - String jmxURL = String.format("service:jmx:rmi://%s:%s/jndi/rmi://%s:%s/jmxrmi", hostname, - rmiServerPort, - hostname, rmiRegistryPort); - JMXServiceURL jmxServiceURL = new JMXServiceURL(jmxURL); - - jmxConnectorServer = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, null, - MBeanManagementFactory.getMBeanServer()); - jmxConnectorServer.start(); - logger.info("JMXAgent JMX Service URL : " + jmxServiceURL.toString()); - } catch (Throwable throwable) { - logger.error("Failed to start JMX Agent", ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6805), - throwable); - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/JMXUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/JMXUtils.java deleted file mode 100644 index f460437ae4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/JMXUtils.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.jmx; - -/** - * JMX Utilities - */ -public class JMXUtils { - - private static final String APK_JMX_METRICS_ENABLE = "apk.jmx.metrics.enabled"; - - /** - * Returns true if jmx metrics enabled as a system property, otherwise false. - * - * @return boolean - */ - public static boolean isJMXMetricsEnabled() { - return Boolean.getBoolean(APK_JMX_METRICS_ENABLE); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/MBeanManagementFactory.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/MBeanManagementFactory.java deleted file mode 100644 index 9a4e33a51a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/MBeanManagementFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wso2.apk.enforcer.jmx; - -import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; - -/** - * The ManagementFactory class is a factory class for getting managed beans for - * the Enforcer. - */ -public class MBeanManagementFactory { - - /* - * If one already exists, it will return that else it will create a new one and - * return. - * - * @return A MBeanServer instance. - */ - public static MBeanServer getMBeanServer() { - MBeanServer mBeanServer; - if (MBeanServerFactory.findMBeanServer(null).size() > 0) { - mBeanServer = MBeanServerFactory.findMBeanServer(null).get(0); - } else { - mBeanServer = MBeanServerFactory.createMBeanServer(); - } - return mBeanServer; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/MBeanRegistrator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/MBeanRegistrator.java deleted file mode 100644 index ab9aab8ef2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jmx/MBeanRegistrator.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wso2.apk.enforcer.jmx; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.management.InstanceAlreadyExistsException; -import javax.management.MBeanRegistrationException; -import javax.management.MBeanServer; -import javax.management.MalformedObjectNameException; -import javax.management.NotCompliantMBeanException; -import javax.management.ObjectName; - -/** - * The class which is responsible for registering MBeans. - */ -public class MBeanRegistrator { - private static final Logger logger = LogManager.getLogger(MBeanRegistrator.class); - private static List mBeans = new ArrayList<>(); - - private static final String SERVER_PACKAGE = "org.wso2.apk.enforcer"; - - private MBeanRegistrator() { - } - - /** - * Registers an object as an MBean with the MBean server. - * - * @param mBeanInstance - The MBean to be registered as an MBean. - */ - public static void registerMBean(Object mBeanInstance) throws RuntimeException { - - if (JMXUtils.isJMXMetricsEnabled()) { - String className = mBeanInstance.getClass().getName(); - if (className.indexOf('.') != -1) { - className = className.substring(className.lastIndexOf('.') + 1); - } - - String objectName = String.format("%s:type=%s", SERVER_PACKAGE, className); - try { - MBeanServer mBeanServer = MBeanManagementFactory.getMBeanServer(); - Set set = mBeanServer.queryNames(new ObjectName(objectName), null); - if (set.isEmpty()) { - try { - ObjectName name = new ObjectName(objectName); - mBeanServer.registerMBean(mBeanInstance, name); - mBeans.add(name); - } catch (InstanceAlreadyExistsException e) { - String msg = "MBean " + objectName + " already exists"; - logger.error(msg, ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6801), e); - throw new RuntimeException(msg, e); - } catch (MBeanRegistrationException | NotCompliantMBeanException e) { - String msg = "Execption when registering MBean"; - logger.error(msg, ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6802), e); - throw new RuntimeException(msg, e); - } - } else { - String msg = "MBean " + objectName + " already exists"; - logger.error(msg, ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6803)); - throw new RuntimeException(msg); - } - } catch (MalformedObjectNameException e) { - String msg = "Could not register " + mBeanInstance.getClass() + " MBean"; - logger.error(msg, ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6804), e); - throw new RuntimeException(msg, e); - } - } else { - logger.debug("JMX Metrics should be enabled to register MBean instance: {}", - mBeanInstance.getClass().getName()); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/BackendJWKSDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/BackendJWKSDto.java deleted file mode 100644 index 34a3876948..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/BackendJWKSDto.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.jwks; - -import com.nimbusds.jose.jwk.JWK; -import com.nimbusds.jose.jwk.JWKSet; - -import java.util.List; - -/** - * Configuration holder for Backend JWKS endpoint - */ -public class BackendJWKSDto { - private JWKSet jwks; - - public JWKSet getJwks() { - if (jwks == null) { - this.jwks = new JWKSet(); - } - return jwks; - } - - public void setJwks(List ls) { - this.jwks = new JWKSet(ls); - } -} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/JWKSRequestHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/JWKSRequestHandler.java deleted file mode 100644 index 883c3d9bb6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/JWKSRequestHandler.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.jwks; - -import com.nimbusds.jose.jwk.JWKSet; -import io.grpc.netty.shaded.io.netty.buffer.Unpooled; -import io.grpc.netty.shaded.io.netty.channel.ChannelFuture; -import io.grpc.netty.shaded.io.netty.channel.ChannelFutureListener; -import io.grpc.netty.shaded.io.netty.channel.ChannelHandlerContext; -import io.grpc.netty.shaded.io.netty.channel.SimpleChannelInboundHandler; -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.HttpObject; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpRequest; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpUtil; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpVersion; -import org.apache.http.protocol.HTTP; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.HttpConstants; - -/** - * JWKS Request Handler for Backend JWTs - */ -public class JWKSRequestHandler extends SimpleChannelInboundHandler { - private static final Logger logger = LogManager.getLogger(JWKSRequestHandler.class); - private static final String route = "/jwks"; - private static final String CONNECTION = "Connection"; - private static final String CLOSE = "close"; - private static final String KEEP_ALIVE = "keep-alive"; - @Override - public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { - - ctx.flush(); - } - - @Override - protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) { - FullHttpResponse res = null; - FullHttpRequest req = null; - BackendJWKSDto backendJWKSDto = ConfigHolder.getInstance().getConfig().getBackendJWKSDto(); - JWKSet jwks = backendJWKSDto.getJwks(); - if (msg instanceof HttpRequest) { - req = (FullHttpRequest) msg; - boolean keepAlive = HttpUtil.isKeepAlive(req); - String path = req.uri().split("\\?")[0]; //Get the context without query params - - if (!(HttpMethod.GET.equals(req.method()) && path.equals(route))) { - ctx.fireChannelRead(msg); - return; - } - res = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, - Unpooled.wrappedBuffer(jwks.toJSONObject().toString().getBytes())); - res.headers() - .set(HTTP.CONN_DIRECTIVE, HTTP.CONN_KEEP_ALIVE) - .set(HTTP.CONTENT_TYPE, HttpConstants.APPLICATION_JSON) - .setInt(HTTP.CONTENT_LEN, res.content().readableBytes()); - if (keepAlive) { - if (!req.protocolVersion().isKeepAliveDefault()) { - res.headers().set(CONNECTION, KEEP_ALIVE); - } - } else { - // Tell the client we're going to close the connection. - res.headers().set(CONNECTION, CLOSE); - } - ChannelFuture f = ctx.write(res); - if (!keepAlive) { - f.addListener(ChannelFutureListener.CLOSE); - } - } - } -} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/JWKSServerInitializer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/JWKSServerInitializer.java deleted file mode 100644 index 7a490b1d3e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/jwks/JWKSServerInitializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.jwks; - - -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.HttpServerCodec; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpServerExpectContinueHandler; -import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; -import io.grpc.netty.shaded.io.netty.channel.ChannelInitializer; - -public class JWKSServerInitializer extends ChannelInitializer{ - private final SslContext sslCtx; - public JWKSServerInitializer(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 JWKSRequestHandler()); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/APIEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/APIEvent.java deleted file mode 100644 index 020e4b2d1e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/APIEvent.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import java.util.Objects; - -/** - * An Event Object which can holds the data related to API which are required for the validation purpose in a gateway. - */ -public class APIEvent extends Event { - - private String apiName; - private int apiId; - private String apiVersion; - private String apiContext; - private String apiProvider; - private String apiType; - private String apiStatus; - - public APIEvent(String eventId, long timestamp, String type, int tenantId, String tenantDomain, - String apiName, int apiId, String apiVersion, String apiType, String apiContext, - String apiProvider, String apiStatus) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.apiId = apiId; - this.apiVersion = apiVersion; - this.apiName = apiName; - this.apiType = apiType; - this.apiContext = apiContext; - this.apiProvider = apiProvider; - this.apiStatus = apiStatus; - this.tenantDomain = tenantDomain; - } - - @Override - public String toString() { - return "APIEvent{" + - "apiName='" + apiName + '\'' + - ", apiId=" + apiId + - ", apiVersion='" + apiVersion + '\'' + - ", apiContext='" + apiContext + '\'' + - ", apiStatus='" + apiStatus + '\'' + - ", apiProvider='" + apiProvider + '\'' + - ", apiType='" + apiType + '\'' + - ", eventId='" + eventId + '\'' + - ", timeStamp=" + timeStamp + - ", type='" + type + '\'' + - ", tenantId=" + tenantId + '\'' + - ", tenantDomain=" + tenantDomain + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof APIEvent)) { - return false; - } - APIEvent apiEvent = (APIEvent) o; - return getApiId() == apiEvent.getApiId() && - getApiName().equals(apiEvent.getApiName()) && - getApiVersion().equals(apiEvent.getApiVersion()) && - getApiContext().equals(apiEvent.getApiContext()) && - getApiStatus().equals(apiEvent.getApiStatus()) && - getApiProvider().equals(apiEvent.getApiProvider()) && - getApiType().equals(apiEvent.getApiType()); - } - - @Override - public int hashCode() { - return Objects.hash(getApiName(), getApiId(), getApiVersion(), getApiContext(), getApiStatus(), - getApiProvider(), getApiType()); - } - - public String getApiName() { - return apiName; - } - - public void setApiName(String apiName) { - this.apiName = apiName; - } - - public int getApiId() { - return apiId; - } - - public void setApiId(int apiId) { - this.apiId = apiId; - } - - public String getApiVersion() { - return apiVersion; - } - - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - public String getApiContext() { - return apiContext; - } - - public void setApiContext(String apiContext) { - this.apiContext = apiContext; - } - - public String getApiProvider() { - return apiProvider; - } - - public void setApiProvider(String apiProvider) { - this.apiProvider = apiProvider; - } - - public String getApiType() { - return apiType; - } - - public void setApiType(String apiType) { - this.apiType = apiType; - } - - public String getApiStatus() { - return apiStatus; - } - - public void setApiStatus(String apiStatus) { - this.apiStatus = apiStatus; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/APIPolicyEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/APIPolicyEvent.java deleted file mode 100644 index d47c57ef42..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/APIPolicyEvent.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2018, 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.listener.events; - -import org.wso2.apk.enforcer.constants.APIConstants; - -import java.util.Objects; - -/** - * An Event Object which can holds the data related to API Policy which are required - * for the validation purpose in a gateway. - */ -public class APIPolicyEvent extends PolicyEvent { - private int policyId; - private String policyName; - private String quotaType; - - public APIPolicyEvent(String eventId, long timestamp, String type, int tenantId, String tenantDomain, int policyId, - String policyName, String quotaType) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.policyId = policyId; - this.policyName = policyName; - this.quotaType = quotaType; - this.tenantDomain = tenantDomain; - this.policyType = APIConstants.PolicyType.API; - } - - @Override - public String toString() { - return "APIPolicyEvent{" + - "policyId=" + policyId + - ", policyName='" + policyName + '\'' + - ", quotaType='" + quotaType + '\'' + - ", eventId='" + eventId + '\'' + - ", timeStamp=" + timeStamp + - ", type='" + type + '\'' + - ", tenantId=" + tenantId + '\'' + - ", tenantDomain=" + tenantDomain + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof APIPolicyEvent)) { - return false; - } - APIPolicyEvent that = (APIPolicyEvent) o; - return getPolicyId() == that.getPolicyId() && - getPolicyName().equals(that.getPolicyName()) && - getQuotaType().equals(that.getQuotaType()); - } - - @Override - public int hashCode() { - return Objects.hash(getPolicyId(), getPolicyName(), getQuotaType()); - } - - public int getPolicyId() { - return policyId; - } - - public void setPolicyId(int policyId) { - this.policyId = policyId; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public String getQuotaType() { - return quotaType; - } - - public void setQuotaType(String quotaType) { - this.quotaType = quotaType; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationEvent.java deleted file mode 100644 index eb3b34437e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationEvent.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import java.util.Map; -import java.util.Objects; - -/** - * An Event Object which can holds the data related to Application which are required - * for the validation purpose in a gateway. - */ -public class ApplicationEvent extends Event { - private String uuid; - private int applicationId; - private String applicationName; - private String tokenType; - private String applicationPolicy; - private String groupId; - private Map attributes; - private String subscriber; - - public ApplicationEvent(String eventId, long timestamp, String type, int tenantId, String tenantDomain, - int applicationId, String uuid, String applicationName, String tokenType, - String applicationPolicy, String groupId, Map attributes, - String subscriber) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.applicationId = applicationId; - this.uuid = uuid; - this.applicationName = applicationName; - this.tokenType = tokenType; - this.applicationPolicy = applicationPolicy; - this.groupId = groupId; - this.tenantDomain = tenantDomain; - this.attributes = attributes; - this.subscriber = subscriber; - } - - @Override - public String toString() { - return "ApplicationEvent{" + - "applicationId=" + applicationId + - ", applicationName='" + applicationName + '\'' + - ", tokenType='" + tokenType + '\'' + - ", applicationPolicy='" + applicationPolicy + '\'' + - ", groupId='" + groupId + '\'' + - ", eventId='" + eventId + '\'' + - ", timeStamp=" + timeStamp + - ", type='" + type + '\'' + - ", tenantId=" + tenantId + '\'' + - ", tenantDomain=" + tenantDomain + - ", subscriber=" + subscriber + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof ApplicationEvent)) { - return false; - } - ApplicationEvent that = (ApplicationEvent) o; - return getApplicationId() == that.getApplicationId() && - getApplicationName().equals(that.getApplicationName()) && - getTokenType().equals(that.getTokenType()) && - getGroupId().equals(that.getGroupId()) && - getApplicationPolicy().equals(that.getApplicationPolicy()); - } - - @Override - public int hashCode() { - return Objects.hash(getApplicationId(), getApplicationName(), - getTokenType(), getApplicationPolicy(), getGroupId()); - } - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - public String getApplicationName() { - return applicationName; - } - - public void setApplicationName(String applicationName) { - this.applicationName = applicationName; - } - - public String getTokenType() { - return tokenType; - } - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - public String getApplicationPolicy() { - return applicationPolicy; - } - - public void setApplicationPolicy(String applicationPolicy) { - this.applicationPolicy = applicationPolicy; - } - - public String getGroupId() { - return groupId; - } - - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - public Map getAttributes() { - - return attributes; - } - - public void setAttributes(Map attributes) { - - this.attributes = attributes; - } - - public String getUuid() { - - return uuid; - } - - public void setUuid(String uuid) { - - this.uuid = uuid; - } - - public String getSubscriber() { - return subscriber; - } - - public void setSubscriber(String subscriber) { - this.subscriber = subscriber; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationPolicyEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationPolicyEvent.java deleted file mode 100644 index 6199fd3aea..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationPolicyEvent.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import org.wso2.apk.enforcer.constants.APIConstants; - -import java.util.Objects; - -/** - * An Event Object which can holds the data related to Application Policy which are required - * for the validation purpose in a gateway. - */ -public class ApplicationPolicyEvent extends PolicyEvent { - private int policyId; - private String policyName; - private String quotaType; - - public ApplicationPolicyEvent(String eventId, long timestamp, String type, int tenantId, String tenantDomain, - int policyId, String policyName, String quotaType) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.policyId = policyId; - this.policyName = policyName; - this.quotaType = quotaType; - this.tenantDomain = tenantDomain; - this.policyType = APIConstants.PolicyType.APPLICATION; - } - - @Override - public String toString() { - return "ApplicationPolicyEvent{" + - "policyId=" + policyId + - ", policyName='" + policyName + '\'' + - ", quotaType='" + quotaType + '\'' + - ", eventId='" + eventId + '\'' + - ", timeStamp=" + timeStamp + - ", type='" + type + '\'' + - ", tenantId=" + tenantId + '\'' + - ", tenantDomain=" + tenantDomain + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof ApplicationPolicyEvent)) { - return false; - } - ApplicationPolicyEvent that = (ApplicationPolicyEvent) o; - return getPolicyId() == that.getPolicyId() && - getPolicyName().equals(that.getPolicyName()) && - getQuotaType().equals(that.getQuotaType()); - } - - @Override - public int hashCode() { - return Objects.hash(getPolicyId(), getPolicyName(), getQuotaType()); - } - - public int getPolicyId() { - return policyId; - } - - public void setPolicyId(int policyId) { - this.policyId = policyId; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public String getQuotaType() { - return quotaType; - } - - public void setQuotaType(String quotaType) { - this.quotaType = quotaType; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationRegistrationEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationRegistrationEvent.java deleted file mode 100644 index bc2ae54b79..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ApplicationRegistrationEvent.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import java.util.Objects; - -/** - * An Event Object which can holds the data related to Application Registration which are required - * for the validation purpose in a gateway. - */ -public class ApplicationRegistrationEvent extends Event { - - private int applicationId; - private String consumerKey; - private String keyType; - private String keyManager; - - public ApplicationRegistrationEvent(String eventId, long timestamp, String type, int tenantId, String tenantDomain, - int applicationId, String consumerKey, String keyType, String keyManager) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.applicationId = applicationId; - this.consumerKey = consumerKey; - this.keyType = keyType; - this.keyManager = keyManager; - this.tenantDomain = tenantDomain; - } - - @Override - public String toString() { - return "ApplicationRegistrationEvent{" + - "applicationId=" + applicationId + - ", consumerKey='" + consumerKey + '\'' + - ", keyType='" + keyType + '\'' + - ", eventId='" + eventId + '\'' + - ", timeStamp=" + timeStamp + - ", type='" + type + '\'' + - ", tenantId=" + tenantId + '\'' + - ", tenantDomain=" + tenantDomain + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof ApplicationRegistrationEvent)) { - return false; - } - ApplicationRegistrationEvent that = (ApplicationRegistrationEvent) o; - return getApplicationId() == that.getApplicationId() && - getConsumerKey().equals(that.getConsumerKey()) && - getKeyType().equals(that.getKeyType()); - } - - @Override - public int hashCode() { - return Objects.hash(getApplicationId(), getConsumerKey(), getKeyType()); - } - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - public String getConsumerKey() { - return consumerKey; - } - - public void setConsumerKey(String consumerKey) { - this.consumerKey = consumerKey; - } - - public String getKeyType() { - return keyType; - } - - public void setKeyType(String keyType) { - this.keyType = keyType; - } - - public String getKeyManager() { - - return keyManager; - } - - public void setKeyManager(String keyManager) { - - this.keyManager = keyManager; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/DeployAPIInGatewayEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/DeployAPIInGatewayEvent.java deleted file mode 100644 index e67d65d5c5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/DeployAPIInGatewayEvent.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import java.util.Set; - -/** - * Deploy API in Gateway Event. - */ -public class DeployAPIInGatewayEvent extends Event { - - private String apiId; - private Set gatewayLabels; - - public DeployAPIInGatewayEvent(String eventId, long timestamp, String type, String tenanrDomain, String apiId, - Set gatewayLabels) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantDomain = tenanrDomain; - - this.apiId = apiId; - this.gatewayLabels = gatewayLabels; - - } - - public Set getGatewayLabels() { - - return gatewayLabels; - } - - public void setGatewayLabels(Set gatewayLabels) { - - this.gatewayLabels = gatewayLabels; - } - - public String getApiId() { - - return apiId; - } - - public void setApiId(String apiId) { - - this.apiId = apiId; - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/Event.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/Event.java deleted file mode 100644 index e98396ce96..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/Event.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import java.io.Serializable; - -/** - * An abstract class which can be extended to create specific events. - */ -public abstract class Event implements Serializable { - - public String eventId; - public long timeStamp; - public String type; - public int tenantId; - public String tenantDomain; - - public String getTenantDomain() { - return tenantDomain; - } - - public void setTenantDomain(String tenantDomain) { - this.tenantDomain = tenantDomain; - } - - public String getEventId() { - return eventId; - } - - public void setEventId(String eventId) { - this.eventId = eventId; - } - - public long getTimeStamp() { - return timeStamp; - } - - public void setTimeStamp(long timeStamp) { - this.timeStamp = timeStamp; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public int getTenantId() { - return tenantId; - } - - public void setTenantId(int tenantId) { - this.tenantId = tenantId; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/PolicyEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/PolicyEvent.java deleted file mode 100644 index cbe8a656b2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/PolicyEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - - -import org.wso2.apk.enforcer.constants.APIConstants; - -/** - * Policy Event class. - */ -public class PolicyEvent extends Event { - protected APIConstants.PolicyType policyType; - - public APIConstants.PolicyType getPolicyType() { - return policyType; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ScopeEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ScopeEvent.java deleted file mode 100644 index f0260387ac..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ScopeEvent.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Scope Event to handle updates in Scopes. - */ -public class ScopeEvent extends Event { - private String name; - private String displayName; - private String description; - private List roles = new ArrayList<>(); - private Map mappings = new HashMap<>(); - - public ScopeEvent(String eventId, long timestamp, String type, int tenantId, String tenantDomain, String name, - String displayName, String description) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.tenantDomain = tenantDomain; - this.name = name; - this.displayName = displayName; - this.description = description; - } - - public String getName() { - - return name; - } - - public void setName(String name) { - - this.name = name; - } - - public String getDisplayName() { - - return displayName; - } - - public void setDisplayName(String displayName) { - - this.displayName = displayName; - } - - public String getDescription() { - - return description; - } - - public void setDescription(String description) { - - this.description = description; - } - - public List getRoles() { - - return roles; - } - - public void setRoles(List roles) { - - this.roles = roles; - } - - public Map getMappings() { - - return mappings; - } - - public void setMappings(Map mappings) { - - this.mappings = mappings; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/SubscriptionEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/SubscriptionEvent.java deleted file mode 100644 index 8130b21a2b..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/SubscriptionEvent.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import java.util.Objects; - -/** - * An Event Object which can holds the data related to Subscription which are required - * for the validation purpose in a gateway. - */ -public class SubscriptionEvent extends Event { - private int subscriptionId; - private int apiId; - private int applicationId; - private String policyId; - private String subscriptionState; - - public SubscriptionEvent(String eventId, long timestamp, String type, int tenantId, String tenantDomain, - int subscriptionId, int apiId, int applicationId, - String policyId, String subscriptionState) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.subscriptionId = subscriptionId; - this.apiId = apiId; - this.applicationId = applicationId; - this.policyId = policyId; - this.subscriptionState = subscriptionState; - this.tenantDomain = tenantDomain; - } - - @Override - public String toString() { - return "SubscriptionEvent{" + - "subscriptionId=" + subscriptionId + - ", apiId='" + apiId + '\'' + - ", applicationId=" + applicationId + - ", policyId='" + policyId + '\'' + - ", subscriptionState='" + subscriptionState + '\'' + - ", eventId='" + eventId + '\'' + - ", timeStamp=" + timeStamp + - ", type='" + type + '\'' + - ", tenantId=" + tenantId + '\'' + - ", tenantDomain=" + tenantDomain + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof SubscriptionEvent)) { - return false; - } - SubscriptionEvent that = (SubscriptionEvent) o; - return getSubscriptionId() == that.getSubscriptionId() && - getApplicationId() == that.getApplicationId() && - getApiId() == (that.getApiId()) && - getPolicyId().equals(that.getPolicyId()) && - getSubscriptionState().equals(that.getSubscriptionState()); - } - - @Override - public int hashCode() { - return Objects.hash(getSubscriptionId(), getApiId(), getApplicationId(), getPolicyId(), getSubscriptionState()); - } - - public int getSubscriptionId() { - return subscriptionId; - } - - public void setSubscriptionId(int subscriptionId) { - this.subscriptionId = subscriptionId; - } - - public int getApiId() { - return apiId; - } - - public void setApiName(int apiId) { - this.apiId = apiId; - } - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - public String getPolicyId() { - return policyId; - } - - public void setPolicyId(String policyId) { - this.policyId = policyId; - } - - public String getSubscriptionState() { - return subscriptionState; - } - - public void setSubscriptionState(String subscriptionState) { - this.subscriptionState = subscriptionState; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/SubscriptionPolicyEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/SubscriptionPolicyEvent.java deleted file mode 100644 index 4095d149a6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/SubscriptionPolicyEvent.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import org.wso2.apk.enforcer.constants.APIConstants; - -import java.util.Objects; - -/** - * An Event Object which can holds the data related to Subscription Policy which are required - * for the validation purpose in a gateway. - */ -public class SubscriptionPolicyEvent extends PolicyEvent { - private int policyId; - private String policyName; - private String quotaType; - private int rateLimitCount; - private String rateLimitTimeUnit; - private boolean stopOnQuotaReach; - private int graphQLMaxDepth; - private int graphQLMaxComplexity; - - public SubscriptionPolicyEvent(String eventId, long timestamp, String type, int tenantId, String tenantDomain, - int policyId, String policyName, String quotaType, int rateLimitCount, - String rateLimitTimeUnit, boolean stopOnQuotaReach, int graphQLMaxDepth, - int graphQLMaxComplexity) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.policyId = policyId; - this.policyName = policyName; - this.quotaType = quotaType; - this.rateLimitCount = rateLimitCount; - this.rateLimitTimeUnit = rateLimitTimeUnit; - this.stopOnQuotaReach = stopOnQuotaReach; - this.graphQLMaxComplexity = graphQLMaxComplexity; - this.graphQLMaxDepth = graphQLMaxDepth; - this.tenantDomain = tenantDomain; - this.policyType = APIConstants.PolicyType.SUBSCRIPTION; - } - - @Override - public String toString() { - return "SubscriptionPolicyEvent{" + - "policyId=" + policyId + - ", policyName='" + policyName + '\'' + - ", quotaType='" + quotaType + '\'' + - ", rateLimitCount=" + rateLimitCount + - ", rateLimitTimeUnit='" + rateLimitTimeUnit + '\'' + - ", stopOnQuotaReach=" + stopOnQuotaReach + - ", graphQLMaxDepth=" + graphQLMaxDepth + - ", graphQLMaxComplexity=" + graphQLMaxComplexity + - ", eventId='" + eventId + '\'' + - ", timeStamp=" + timeStamp + - ", type='" + type + '\'' + - ", tenantId=" + tenantId + '\'' + - ", tenantDomain=" + tenantDomain + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof SubscriptionPolicyEvent)) { - return false; - } - SubscriptionPolicyEvent that = (SubscriptionPolicyEvent) o; - return getPolicyId() == that.getPolicyId() && - getRateLimitCount() == that.getRateLimitCount() && - isStopOnQuotaReach() == that.isStopOnQuotaReach() && - getPolicyName().equals(that.getPolicyName()) && - getQuotaType().equals(that.getQuotaType()) && - getRateLimitTimeUnit().equals(that.getRateLimitTimeUnit()) && - getGraphQLMaxDepth() == that.getGraphQLMaxDepth() && - getGraphQLMaxComplexity() == that.getGraphQLMaxComplexity(); - } - - @Override - public int hashCode() { - return Objects.hash(getPolicyId(), getPolicyName(), getQuotaType(), getRateLimitCount(), - getRateLimitTimeUnit(), isStopOnQuotaReach(), getGraphQLMaxDepth(), getGraphQLMaxComplexity()); - } - - public int getPolicyId() { - return policyId; - } - - public void setPolicyId(int policyId) { - this.policyId = policyId; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public String getQuotaType() { - return quotaType; - } - - public void setQuotaType(String quotaType) { - this.quotaType = quotaType; - } - - public int getRateLimitCount() { - return rateLimitCount; - } - - public void setRateLimitCount(int rateLimitCount) { - this.rateLimitCount = rateLimitCount; - } - - public String getRateLimitTimeUnit() { - return rateLimitTimeUnit; - } - - public void setRateLimitTimeUnit(String rateLimitTimeUnit) { - this.rateLimitTimeUnit = rateLimitTimeUnit; - } - - public boolean isStopOnQuotaReach() { - return stopOnQuotaReach; - } - - public void setStopOnQuotaReach(boolean stopOnQuotaReach) { - this.stopOnQuotaReach = stopOnQuotaReach; - } - - public int getGraphQLMaxDepth() { - return graphQLMaxDepth; - } - - public void setGraphQLMaxDepth(int graphQLMaxDepth) { - this.graphQLMaxDepth = graphQLMaxDepth; - } - - public int getGraphQLMaxComplexity() { - return graphQLMaxComplexity; - } - - public void setGraphQLMaxComplexity(int graphQLMaxComplexity) { - this.graphQLMaxComplexity = graphQLMaxComplexity; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ThrottlePolicyEvent.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ThrottlePolicyEvent.java deleted file mode 100644 index 05da996ebb..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/listener/events/ThrottlePolicyEvent.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2020, 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.listener.events; - -import java.util.Objects; - -/** - * An Event Object which can holds the data related to Throttling Policy which are required - * for the validation purpose in a gateway. - */ -public class ThrottlePolicyEvent extends Event { - private int policyId; - private String policyName; - private String quotaType; - - public ThrottlePolicyEvent(String eventId, long timestamp, String type, int tenantId, int policyId, - String policyName, String quotaType) { - this.eventId = eventId; - this.timeStamp = timestamp; - this.type = type; - this.tenantId = tenantId; - this.policyId = policyId; - this.policyName = policyName; - this.quotaType = quotaType; - } - - @Override - public String toString() { - return "ThrottlePolicyEvent{" + - "policyId=" + policyId + - ", policyName='" + policyName + '\'' + - ", quotaType='" + quotaType + '\'' + - ", eventId='" + eventId + '\'' + - ", timeStamp=" + timeStamp + - ", type='" + type + '\'' + - ", tenantId=" + tenantId + - '}'; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof ThrottlePolicyEvent)) { - return false; - } - ThrottlePolicyEvent that = (ThrottlePolicyEvent) o; - return getPolicyId() == that.getPolicyId() && - getPolicyName().equals(that.getPolicyName()) && - getQuotaType().equals(that.getQuotaType()); - } - - @Override - public int hashCode() { - return Objects.hash(getPolicyId(), getPolicyName(), getQuotaType()); - } - - public int getPolicyId() { - return policyId; - } - - public void setPolicyId(int policyId) { - this.policyId = policyId; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public String getQuotaType() { - return quotaType; - } - - public void setQuotaType(String quotaType) { - this.quotaType = quotaType; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/AzureMetricsExporter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/AzureMetricsExporter.java deleted file mode 100644 index 6384f9c7c8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/AzureMetricsExporter.java +++ /dev/null @@ -1,50 +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.metrics; - -import com.microsoft.applicationinsights.TelemetryClient; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.util.HashMap; - -/** - * This class is responsible for managing and exporting metrics for azure application insights. - */ -public class AzureMetricsExporter implements MetricsExporter { - - private static final Logger LOGGER = LogManager.getLogger(AzureMetricsExporter.class); - private TelemetryClient telemetry; - - public AzureMetricsExporter() { - telemetry = new TelemetryClient(); - LOGGER.debug("AzureTraceExporter is successfully initialized."); - } - - public void trackMetrics(HashMap metrics) { - for (String key:metrics.keySet()) { - telemetry.trackMetric(key, metrics.get(key)); - } - } - - public void trackMetric(String key, double value) { - telemetry.trackMetric(key, value); - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsConstants.java deleted file mode 100644 index 393d703787..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsConstants.java +++ /dev/null @@ -1,32 +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.metrics; - -/** - * This class contains all the constants related to publishing metrics. - */ -public class MetricsConstants { - - public static final String AZURE_METRICS_EXPORTER = "azure"; - public static final String RESPONSE_LATENCY = "responseLatency"; - public static final String RESPONSE_MEDIATION_LATENCY = "responseMediationLatency"; - public static final String REQUEST_MEDIATION_LATENCY = "requestMediationLatency"; - public static final String BACKEND_LATENCY = "backendLatency"; - public static final String RESPONSE_CODE = "responseCode"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsExporter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsExporter.java deleted file mode 100644 index 77c2f7a877..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsExporter.java +++ /dev/null @@ -1,41 +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.metrics; - -import java.util.HashMap; - -/** - * This interface contains the definition for a Metrics Exporting implementation. - */ -public interface MetricsExporter { - - /** - * Accepts a map of metrics information that needs to be published - * - * @param metrics a hashmap with the metrics key value pairs - */ - void trackMetrics(HashMap metrics); - - /** - * Accepts a key key value pair pertaining to the metrics information that needs to be published - * - * @param key the key pertaining to the metric - * @param value the value of the metric - */ - void trackMetric(String key, double value); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsManager.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsManager.java deleted file mode 100644 index 87f645a428..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsManager.java +++ /dev/null @@ -1,72 +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.metrics; - -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.dto.MetricsDTO; - -/** - * This class is responsible for managing configs and instances related to metrics - */ -public class MetricsManager { - - private static final Logger LOGGER = LogManager.getLogger(MetricsManager.class); - private static String exporterType = "none"; - private static boolean isMetricsEnabled = false; - private static MetricsExporter metricsExporter; - - public static MetricsExporter getInstance() { - if (metricsExporter == null) { - synchronized (new Object()) { - if (metricsExporter == null) { - if (exporterType.equals(MetricsConstants.AZURE_METRICS_EXPORTER)) { - metricsExporter = new AzureMetricsExporter(); - } else { - LOGGER.error("Metrics exporter type: " + exporterType + " not found!"); - } - } - } - } - return metricsExporter; - } - - /** - * Method to initialize metrics - */ - public static void initializeMetrics(MetricsDTO enforcerConfig) { - - String type = enforcerConfig.getMetricsType(); - if (StringUtils.isEmpty(type)) { - LOGGER.warn("Metrics type not defined, defaulting to Azure metrics"); - exporterType = MetricsConstants.AZURE_METRICS_EXPORTER; - } else { - exporterType = type; - } - - isMetricsEnabled = true; - LOGGER.debug("Metrics Manager is successfully initialized with type: " + exporterType + "."); - } - - public static boolean isMetricsEnabled() { - - return isMetricsEnabled; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsUtils.java deleted file mode 100644 index 5d1e939e8a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/MetricsUtils.java +++ /dev/null @@ -1,93 +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.metrics; - -import com.google.protobuf.UInt32Value; -import io.envoyproxy.envoy.data.accesslog.v3.HTTPAccessLogEntry; -import io.envoyproxy.envoy.service.accesslog.v3.StreamAccessLogsMessage; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.analytics.collectors.AnalyticsDataProvider; -import org.wso2.apk.enforcer.commons.analytics.publishers.dto.Latencies; -import org.wso2.apk.enforcer.analytics.ChoreoAnalyticsProvider; -import org.wso2.apk.enforcer.constants.AnalyticsConstants; - -import java.util.HashMap; - -/** - * Common utility functions to publish metrics. - */ -public class MetricsUtils { - - private static final Logger LOGGER = LogManager.getLogger(MetricsUtils.class); - - /** - * Method to process and publish metrics obtained from access logs. - * - * @param message the StreamAccessLogsMessage object. - */ - public static void handlePublishingMetrics(StreamAccessLogsMessage message) { - - for (int i = 0; i < message.getHttpLogs().getLogEntryCount(); i++) { - HTTPAccessLogEntry logEntry = message.getHttpLogs().getLogEntry(i); - MetricsExporter metricsExporter = MetricsManager.getInstance(); - - UInt32Value httpResponseProperties = logEntry.getResponse().getResponseCode(); - metricsExporter.trackMetric(MetricsConstants.RESPONSE_CODE, httpResponseProperties.getValue()); - AnalyticsDataProvider provider = new ChoreoAnalyticsProvider(logEntry); - Latencies latencies = provider.getLatencies(); - - // handle do not publish event - if ((!StringUtils.isEmpty(logEntry.getResponse().getResponseCodeDetails())) - && logEntry.getResponse().getResponseCodeDetails() - .equals(AnalyticsConstants.EXT_AUTH_DENIED_RESPONSE_DETAIL) - // Token endpoint calls needs to be removed as well - || (AnalyticsConstants.TOKEN_ENDPOINT_PATH.equals(logEntry.getRequest().getOriginalPath())) - // Health endpoint calls are not published - || (AnalyticsConstants.HEALTH_ENDPOINT_PATH.equals(logEntry.getRequest().getOriginalPath()))) { - LOGGER.debug("Metric is ignored as it is already published by the enforcer."); - publishMetrics(metricsExporter, latencies); - continue; - } - publishMetrics(metricsExporter, latencies); - } - } - - /** - * Method to export/publish metrics. - * - * @param metricsExporter the exporter instance. - * @param latencies the latencies to be exported. - */ - private static void publishMetrics(MetricsExporter metricsExporter, Latencies latencies) { - - HashMap valueMap = new HashMap<>(); - - valueMap.put(MetricsConstants.RESPONSE_LATENCY, (double) latencies.getResponseLatency()); - valueMap.put(MetricsConstants.RESPONSE_MEDIATION_LATENCY, - (double) latencies.getResponseMediationLatency()); - valueMap.put(MetricsConstants.REQUEST_MEDIATION_LATENCY, - (double) latencies.getRequestMediationLatency()); - valueMap.put(MetricsConstants.BACKEND_LATENCY, (double) latencies.getBackendLatency()); - - metricsExporter.trackMetrics(valueMap); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/jmx/api/ExtAuthMetricsMXBean.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/jmx/api/ExtAuthMetricsMXBean.java deleted file mode 100644 index 4755ebb45a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/jmx/api/ExtAuthMetricsMXBean.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.metrics.jmx.api; - -/** - * MBean API for ExtAuth Service metrics. - */ -public interface ExtAuthMetricsMXBean { - - /** - * Getter for total request count. - * - * @return long - */ - public long getTotalRequestCount(); - - /** - * Getter for average response time in milli seconds. - * - * @return double - */ - public double getAverageResponseTimeMillis(); - - /** - * Getter for maximum response time in milliseconds. - * - * @return double - */ - public double getMaxResponseTimeMillis(); - - /** - * Getter for mimnimum response time in milliseconds. - * - * @return double - */ - public double getMinResponseTimeMillis(); - - /** - * Resets all the metrics to their initial values. - */ - public void resetExtAuthMetrics(); - - /** - * Get request count in last five minutes window - * - * @return long - */ - public long getRequestCountInLastFiveMinuteWindow(); - - /** - * Get the start time of request count window - * - * @return - */ - public long getRequestCountWindowStartTimeMillis(); - - /** - * Get the number of token issuers - * - * @return - */ - public int getTokenIssuerCount(); - - /** - * Get the number of subscriptions - * - * @return - */ - public int getSubscriptionCount(); - -} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/jmx/impl/ExtAuthMetrics.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/jmx/impl/ExtAuthMetrics.java deleted file mode 100644 index be72384af3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/metrics/jmx/impl/ExtAuthMetrics.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.metrics.jmx.impl; - -import org.wso2.apk.enforcer.jmx.MBeanRegistrator; -import org.wso2.apk.enforcer.metrics.jmx.api.ExtAuthMetricsMXBean; - -import java.util.Timer; -import java.util.TimerTask; - -/** - * Singleton MBean for ExtAuth Service metrics. - */ -public class ExtAuthMetrics extends TimerTask implements ExtAuthMetricsMXBean { - - private static final long REQUEST_COUNT_INTERVAL_MILLIS = 5 * 60 * 1000; - private static ExtAuthMetrics extAuthMetricsMBean = null; - private long requestCountInLastFiveMinuteWindow = 0; - private int tokenIssuerCount = 0; - private long requestCountWindowStartTimeMillis = System.currentTimeMillis(); - private long totalRequestCount = 0; - private int subscriptionCount = 0; - private double averageResponseTimeMillis = 0; - private double maxResponseTimeMillis = Double.MIN_VALUE; - private double minResponseTimeMillis = Double.MAX_VALUE; - - private ExtAuthMetrics() { - MBeanRegistrator.registerMBean(this); - } - -/** - * Getter for the Singleton ExtAuthMetrics instance. - * - * @return ExtAuthMetrics - */ -public static ExtAuthMetrics getInstance() { - if (extAuthMetricsMBean == null) { - synchronized (ExtAuthMetrics.class) { - if (extAuthMetricsMBean == null) { - Timer timer = new Timer(); - extAuthMetricsMBean = new ExtAuthMetrics(); - extAuthMetricsMBean.requestCountWindowStartTimeMillis = System.currentTimeMillis(); - timer.schedule(extAuthMetricsMBean, REQUEST_COUNT_INTERVAL_MILLIS, REQUEST_COUNT_INTERVAL_MILLIS); - } - } - } - return extAuthMetricsMBean; -} - - @Override - public long getTotalRequestCount() { - return totalRequestCount; - }; - - @Override - public double getAverageResponseTimeMillis() { - return averageResponseTimeMillis; - }; - - @Override - public double getMaxResponseTimeMillis() { - return maxResponseTimeMillis; - }; - - @Override - public double getMinResponseTimeMillis() { - return minResponseTimeMillis; - }; - - public synchronized void recordMetric(long responseTimeMillis) { - this.requestCountInLastFiveMinuteWindow += 1; - this.totalRequestCount += 1; - this.averageResponseTimeMillis = this.averageResponseTimeMillis + - (responseTimeMillis - this.averageResponseTimeMillis) / totalRequestCount; - this.minResponseTimeMillis = Math.min(this.minResponseTimeMillis, responseTimeMillis); - this.maxResponseTimeMillis = Math.max(this.maxResponseTimeMillis, responseTimeMillis); - } - - public synchronized void recordJWTIssuerMetrics(int jwtIssuers) { - this.tokenIssuerCount = jwtIssuers; - } - - public synchronized void recordSubscriptionMetrics(int subscriptionCount) { - this.subscriptionCount = subscriptionCount; - } - - @Override - public synchronized void resetExtAuthMetrics() { - this.totalRequestCount = 0; - this.averageResponseTimeMillis = 0; - this.maxResponseTimeMillis = Double.MIN_VALUE; - this.minResponseTimeMillis = Double.MAX_VALUE; - } - - @Override - public synchronized void run() { - requestCountWindowStartTimeMillis = System.currentTimeMillis(); - requestCountInLastFiveMinuteWindow = 0; - } - - @Override - public long getRequestCountInLastFiveMinuteWindow() { - return requestCountInLastFiveMinuteWindow; - } - - @Override - public long getRequestCountWindowStartTimeMillis() { - return requestCountWindowStartTimeMillis; - } - - @Override - public int getTokenIssuerCount() { - return tokenIssuerCount; - } - - @Override - public int getSubscriptionCount() { - return subscriptionCount; - } -} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/API.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/API.java deleted file mode 100644 index af71a56c72..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/API.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import org.wso2.apk.enforcer.common.CacheableEntity; - -import java.util.ArrayList; -import java.util.List; - -/** - * Entity for keeping API related information. - */ -public class API implements CacheableEntity { - - private Integer apiId = null; - private String provider = null; - private String name = null; - private String version = null; - private String context = null; - private String policy = null; - private String apiType = null; - private boolean isDefaultVersion = false; - private String apiUUID = null; - private String lcState = null; - - private List urlMappings = new ArrayList<>(); - - - public void addResource(URLMapping resource) { - - urlMappings.add(resource); - } - - public List getResources() { - - return urlMappings; - } - - public void removeResource(URLMapping resource) { - urlMappings.remove(resource); - } - - public String getContext() { - - return context; - } - - public void setContext(String context) { - - this.context = context; - } - - public String getApiTier() { - - return policy; - } - - public void setApiTier(String apiTier) { - - this.policy = apiTier; - } - - public int getApiId() { - - return apiId; - } - - public void setApiId(int apiId) { - - this.apiId = apiId; - } - - public String getApiProvider() { - - return provider; - } - - public void setApiProvider(String apiProvider) { - - this.provider = apiProvider; - } - - public String getApiName() { - - return name; - } - - public void setApiName(String apiName) { - - this.name = apiName; - } - - public String getApiVersion() { - - return version; - } - - public void setApiVersion(String apiVersion) { - - this.version = apiVersion; - } - - public String getCacheKey() { - - return apiUUID; - } - - public String getApiType() { - - return apiType; - } - - public void setApiType(String apiType) { - - this.apiType = apiType; - } - - public String getLcState() { - return lcState; - } - - public void setLcState(String lcState) { - this.lcState = lcState; - } - - @Override - public String toString() { - return "API [apiId=" + apiId + ", provider=" + provider + ", name=" + name + ", version=" + version - + ", context=" + context + ", policy=" + policy + ", apiType=" + apiType + ", urlMappings=" - + urlMappings + "]"; - } - - public boolean isDefaultVersion() { - return isDefaultVersion; - } - - public void setDefaultVersion(boolean isDefaultVersion) { - this.isDefaultVersion = isDefaultVersion; - } - - public String getApiUUID() { - return apiUUID; - } - - public void setApiUUID(String apiUUID) { - this.apiUUID = apiUUID; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIList.java deleted file mode 100644 index 11f6231eb3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIList.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * Holds details about list of APIs. - */ -public class APIList { - - private Integer count = null; - private List list = new ArrayList<>(); - - public Integer getCount() { - - return count; - } - - public void setCount(Integer count) { - - this.count = count; - } - - public List getList() { - - return list; - } - - public void setList(List list) { - - this.list = list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIPolicyConditionGroup.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIPolicyConditionGroup.java deleted file mode 100644 index f04f704643..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIPolicyConditionGroup.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import org.wso2.apk.enforcer.constants.APIConstants; - -import java.util.Set; -import java.util.concurrent.locks.Condition; - -/** - * Entity for keeping details related to ConditionGroups. - */ -public class APIPolicyConditionGroup { - - private int policyId = -1; - private String quotaType; - private int conditionGroupId = -1; - private Set condition; - - public int getPolicyId() { - - return policyId; - } - - public void setPolicyId(int policyId) { - - this.policyId = policyId; - } - - public int getConditionGroupId() { - - return conditionGroupId; - } - - public void setConditionGroupId(int conditionGroupId) { - - this.conditionGroupId = conditionGroupId; - } - - public String getQuotaType() { - - return quotaType; - } - - public void setQuotaType(String quotaType) { - - this.quotaType = quotaType; - } - - public Set getCondition() { - - return condition; - } - - public void setCondition(Set condition) { - - this.condition = condition; - } - - public boolean isContentAware() { - - if (APIConstants.BANDWIDTH_TYPE.equals(quotaType)) { - return true; - } - if (condition != null) { - condition.stream().anyMatch(conditionDTO -> - APIConstants.BANDWIDTH_TYPE.equals(quotaType) - ); - return false; - } - return false; - } - - @Override - public boolean equals(Object obj) { - - if (obj == this) { - return true; - } - - if (obj == null || obj.getClass() != this.getClass()) { - return false; - } - APIPolicyConditionGroup conditionGroup = (APIPolicyConditionGroup) obj; - return conditionGroup.policyId == policyId && - conditionGroup.conditionGroupId == conditionGroupId; - - } - - @Override - public int hashCode() { - - return (policyId == -1 || conditionGroupId == -1) ? super.hashCode() : policyId * conditionGroupId; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIPolicyList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIPolicyList.java deleted file mode 100644 index a26613b6d2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/APIPolicyList.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * Holds details about list of policies. - */ -public class APIPolicyList { - - private Integer count = null; - private List list = new ArrayList<>(); - - public Integer getCount() { - - return count; - } - - public void setCount(Integer count) { - - this.count = count; - } - - public List getList() { - - return list; - } - - public void setList(List list) { - - this.list = list; - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApiPolicy.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApiPolicy.java deleted file mode 100644 index 2a35953af0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApiPolicy.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import org.wso2.apk.enforcer.common.CacheableEntity; - -import java.util.ArrayList; -import java.util.List; - -/** - * Holds details about API/resource level Policy. - */ -public class ApiPolicy extends Policy { - - private List conditionGroups = new ArrayList<>(); - private String applicableLevel; - - @Override - public String getCacheKey() { - - return PolicyType.API + CacheableEntity.DELEM_PERIOD + super.getCacheKey(); - } - - public List getConditionGroups() { - return conditionGroups; - } - - public void setConditionGroups(List conditionGroups) { - this.conditionGroups = conditionGroups; - } - @Override - public boolean isContentAware() { - boolean isContentAware = super.isContentAware(); - for (APIPolicyConditionGroup apiPolicyConditionGroup : conditionGroups) { - isContentAware = isContentAware || apiPolicyConditionGroup.isContentAware(); - } - return isContentAware; - } - - public String getApplicableLevel() { - return applicableLevel; - } - - public void setApplicableLevel(String applicableLevel) { - this.applicableLevel = applicableLevel; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java deleted file mode 100644 index ab472da4f2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import org.wso2.apk.enforcer.common.CacheableEntity; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Entity for keeping Application related information. Represents an Application in APIM. - */ -public class Application implements CacheableEntity { - - private String uuid; - private String name = null; - private String owner = null; - - public void setAttributes(Map attributes) { - - this.attributes = attributes; - } - - public String getOrganization() { - - return organization; - } - - public void setOrganization(String organization) { - - this.organization = organization; - } - - private String organization = null; - - public String getUuid() { - - return uuid; - } - - public void setUuid(String uuid) { - - this.uuid = uuid; - } - - private Map attributes = new ConcurrentHashMap<>(); - - public String getUUID() { - - return uuid; - } - - public void setUUID(String uuid) { - - this.uuid = uuid; - } - - public String getName() { - - return name; - } - - public void setName(String name) { - - this.name = name; - } - - public String getOwner() { - - return owner; - } - - public void setOwner(String owner) { - - this.owner = owner; - } - - public Map getAttributes() { - - return attributes; - } - - public void addAttribute(String key, String value) { - - this.attributes.put(key, value); - } - - public void removeAttribute(String key) { - - this.attributes.remove(key); - } - - public String getCacheKey() { - - return uuid; - } - - @Override - public String toString() { - - return "Application [uuid=" + uuid + ", name=" + name + ", owner=" + owner + ", attributes=" + attributes - + "]"; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationKeyMapping.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationKeyMapping.java deleted file mode 100644 index e9777c5377..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationKeyMapping.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import org.wso2.apk.enforcer.common.CacheableEntity; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreUtil; - -/** - * Entity for keeping mapping between Application and Consumer key. - */ -public class ApplicationKeyMapping implements CacheableEntity { - - private String applicationUUID; - private String securityScheme; - private String applicationIdentifier; - private String keyType; - private String envId; - - public String getApplicationUUID() { - - return applicationUUID; - } - - public void setApplicationUUID(String applicationUUID) { - - this.applicationUUID = applicationUUID; - } - - public String getSecurityScheme() { - - return securityScheme; - } - - public void setSecurityScheme(String securityScheme) { - - this.securityScheme = securityScheme; - } - - public String getApplicationIdentifier() { - - return applicationIdentifier; - } - - public void setApplicationIdentifier(String applicationIdentifier) { - - this.applicationIdentifier = applicationIdentifier; - } - - public String getKeyType() { - - return keyType; - } - - public void setKeyType(String keyType) { - - this.keyType = keyType; - } - - public String getEnvId() { - - return envId; - } - - public void setEnvId(String envId) { - - this.envId = envId; - } - - @Override - public String getCacheKey() { - - return SubscriptionDataStoreUtil.getApplicationKeyMappingCacheKey(applicationIdentifier, keyType, - securityScheme, envId); - } - - @Override - public String toString() { - - return "ApplicationKeyMapping{" + - "applicationUUID='" + applicationUUID + '\'' + - ", securityScheme='" + securityScheme + '\'' + - ", applicationIdentifier='" + applicationIdentifier + '\'' + - ", keyType='" + keyType + '\'' + - ", envId='" + envId + '\'' + - '}'; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationKeyMappingList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationKeyMappingList.java deleted file mode 100644 index 4ed3746504..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationKeyMappingList.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * Holds details about list of application key mappings. - */ -public class ApplicationKeyMappingList { - - private Integer count = null; - private List list = new ArrayList<>(); - - public Integer getCount() { - - return count; - } - - public void setCount(Integer count) { - - this.count = count; - } - - public List getList() { - - return list; - } - - public void setList(List list) { - - this.list = list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationList.java deleted file mode 100644 index 4de30a3a0f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationList.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * Holds details about list of applications. - */ -public class ApplicationList { - - private Integer count = null; - private List list = new ArrayList<>(); - - public Integer getCount() { - - return count; - } - - public void setCount(Integer count) { - - this.count = count; - } - - public List getList() { - - return list; - } - - public void setList(List list) { - - this.list = list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationMapping.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationMapping.java deleted file mode 100644 index 1975839d41..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationMapping.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.models; - -import org.wso2.apk.enforcer.common.CacheableEntity; - -/** - * Entity for keeping mapping between Application and Subscription. - */ -public class ApplicationMapping implements CacheableEntity { - - private String uuid = null; - private String applicationUUID = null; - private String subscriptionUUID = null; - - private String organization; - - public String getUuid() { - - return uuid; - } - - public void setUuid(String uuid) { - - this.uuid = uuid; - } - - public String getApplicationUUID() { - - return applicationUUID; - } - - public void setApplicationUUID(String applicationUUID) { - - this.applicationUUID = applicationUUID; - } - - public String getSubscriptionUUID() { - - return subscriptionUUID; - } - - public void setSubscriptionUUID(String subscriptionUUID) { - - this.subscriptionUUID = subscriptionUUID; - } - - public String getOrganization() { - - return organization; - } - - public void setOrganization(String organization) { - - this.organization = organization; - } - - @Override - public String getCacheKey() { - - return organization + ":" + applicationUUID+ ":" + subscriptionUUID; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationMappingList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationMappingList.java deleted file mode 100644 index e3abcd6fab..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationMappingList.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * Holds details about list of application and subscription mappings. - */ -public class ApplicationMappingList { - - private Integer count = null; - private List list = new ArrayList<>(); - - public Integer getCount() { - - return count; - } - - public void setCount(Integer count) { - - this.count = count; - } - - public List getList() { - - return list; - } - - public void setList(List list) { - - this.list = list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationPolicy.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationPolicy.java deleted file mode 100644 index 1c94c4195e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationPolicy.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import org.wso2.apk.enforcer.common.CacheableEntity; - -/** - * Entity for keeping Application Policy. - */ -public class ApplicationPolicy extends Policy { - - private static final String type = "APPLICATION"; - - @Override - public String getCacheKey() { - - return PolicyType.APPLICATION + CacheableEntity.DELEM_PERIOD + super.getCacheKey(); - } - - @Override - public String toString() { - return "ApplicationPolicy [getId()=" + getId() + ", getQuotaType()=" + getQuotaType() + ", isContentAware()=" - + isContentAware() + ", getTenantId()=" + getTenantId() + ", getName()=" + getName() + "]"; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationPolicyList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationPolicyList.java deleted file mode 100644 index 0b022aeb87..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ApplicationPolicyList.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * Holds details about list of application policies. - */ -public class ApplicationPolicyList { - - private Integer count = null; - private List list = new ArrayList<>(); - - public Integer getCount() { - - return count; - } - - public void setCount(Integer count) { - - this.count = count; - } - - public List getList() { - - return list; - } - - public void setList(List list) { - - this.list = list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Policy.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Policy.java deleted file mode 100644 index 6cc9c3c95d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Policy.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import org.wso2.apk.enforcer.common.CacheableEntity; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreUtil; - -/** - * Top level entity for representing a Throttling Policy. - */ -public class Policy implements CacheableEntity { - - /** - * ENUM to hold type of policies. - */ - public enum PolicyType { - SUBSCRIPTION, - APPLICATION, - API - } - private Integer id = null; - private Integer tenantId = null; - private String name = null; - private String quotaType = null; - - public int getId() { - - return id; - } - - public void setId(int id) { - - this.id = id; - } - - public String getQuotaType() { - - return quotaType; - } - - public void setQuotaType(String quotaType) { - - this.quotaType = quotaType; - } - - public boolean isContentAware() { - - return APIConstants.BANDWIDTH_TYPE.equals(quotaType); - } - - public int getTenantId() { - - return tenantId; - } - - public void setTenantId(int tenantId) { - - this.tenantId = tenantId; - } - - public String getName() { - - return name; - } - - public void setTierName(String name) { - - this.name = name; - } - - @Override - public String getCacheKey() { - - return SubscriptionDataStoreUtil.getPolicyCacheKey(getName()); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ResponsePayload.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ResponsePayload.java deleted file mode 100644 index 21c06d6296..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/ResponsePayload.java +++ /dev/null @@ -1,55 +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.models; - -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; - -/** - * Model class for Response Payload - */ -public class ResponsePayload { - - private String content; - private HttpResponseStatus status; - private boolean isError; - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public HttpResponseStatus getStatus() { - return status; - } - - public void setStatus(HttpResponseStatus status) { - this.status = status; - } - - public boolean isError() { - return isError; - } - - public void setError(boolean error) { - isError = error; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/RevokedToken.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/RevokedToken.java deleted file mode 100644 index 9d92291673..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/RevokedToken.java +++ /dev/null @@ -1,43 +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.models; - -/** - * Model class for Revoked Tokens - */ -public class RevokedToken { - - private String token; - private Long expiredTime; - - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public Long getExpiredTime() { - return expiredTime; - } - - public void setExpiredTime(Long expiredTime) { - this.expiredTime = expiredTime; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/RevokedTokenList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/RevokedTokenList.java deleted file mode 100644 index 152de14869..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/RevokedTokenList.java +++ /dev/null @@ -1,44 +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.models; - -import java.util.List; - -/** - * Model class for Revoked Token list - */ -public class RevokedTokenList { - private Integer count; - private List tokens; - - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - public List getTokens() { - return tokens; - } - - public void setTokens(List tokens) { - this.tokens = tokens; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java deleted file mode 100644 index 02e4dfd1e6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.models; - -import org.wso2.apk.enforcer.subscription.SubscribedAPIDto; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -/** - * Model class for Subscription related API details - */ -public class SubscribedAPI { - - private String name; - private String version; - private Pattern versionRegexPattern; - - public SubscribedAPI(org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI subscribedApi) { - - this.name = subscribedApi.getName(); - this.version = subscribedApi.getVersion(); - this.versionRegexPattern = Pattern.compile(this.version); - } - - public SubscribedAPI(SubscribedAPIDto subscribedApi) { - - this.name = subscribedApi.getName(); - this.version = subscribedApi.getVersion(); - this.versionRegexPattern = Pattern.compile(this.version); - - } - - public String getName() { - - return name; - } - - public void setName(String name) { - - this.name = name; - } - - public String getVersion() { - - return version; - } - - public void setVersion(String version) { - - this.version = version; - } - - public Pattern getVersionRegexPattern() { - - return versionRegexPattern; - } - - public void setVersionRegexPattern(Pattern versionRegexPattern) { - - this.versionRegexPattern = versionRegexPattern; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Subscription.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Subscription.java deleted file mode 100644 index f41457abf3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Subscription.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import org.wso2.apk.enforcer.common.CacheableEntity; - -/** - * Entity for representing a SubscriptionDTO in APIM. - */ -public class Subscription implements CacheableEntity { - - private String subscriptionId = null; - private String subscriptionStatus = null; - private String organization = null; - private SubscribedAPI subscribedApi = null; - private String ratelimitTier = null; - private long timeStamp; - - public String getSubscriptionId() { - - return subscriptionId; - } - - public void setSubscriptionId(String subscriptionId) { - - this.subscriptionId = subscriptionId; - } - - public String getSubscriptionStatus() { - - return subscriptionStatus; - } - - public void setSubscriptionStatus(String subscriptionStatus) { - - this.subscriptionStatus = subscriptionStatus; - } - - public String getOrganization() { - - return organization; - } - - public void setOrganization(String organization) { - - this.organization = organization; - } - - public SubscribedAPI getSubscribedApi() { - - return subscribedApi; - } - - public void setSubscribedApi(SubscribedAPI subscribedApi) { - - this.subscribedApi = subscribedApi; - } - - public long getTimeStamp() { - - return timeStamp; - } - - public void setTimeStamp(long timeStamp) { - - this.timeStamp = timeStamp; - } - - @Override - public String getCacheKey() { - - return subscriptionId; - } - - public String getRatelimitTier() { - return ratelimitTier; - } - - public void setRatelimitTier(String ratelimitTier) { - this.ratelimitTier = ratelimitTier; - } - - @Override - public String toString() { - - return "Subscription{" + - "subscriptionId='" + subscriptionId + '\'' + - ", subscriptionStatus='" + subscriptionStatus + '\'' + - ", organization='" + organization + '\'' + - ", subscribedApi=" + subscribedApi + - ", timeStamp=" + timeStamp + - '}'; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscriptionList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscriptionList.java deleted file mode 100644 index bdec514427..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscriptionList.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import java.util.ArrayList; -import java.util.List; - -/** - * Holds details about list of subscriptions. - */ -public class SubscriptionList { - - private Integer count = null; - private List list = new ArrayList<>(); - - public Integer getCount() { - - return count; - } - - public void setCount(Integer count) { - - this.count = count; - } - - public List getList() { - - return list; - } - - public void setList(List list) { - - this.list = list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/URLMapping.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/URLMapping.java deleted file mode 100644 index a416f563aa..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/URLMapping.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2020, 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.models; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Holds details about url mapping of API resources. - */ -public class URLMapping { - - private String throttlingPolicy; - private String authScheme; - private String httpMethod; - private String urlPattern; - private List scopes = new ArrayList<>(); - - - public String getHttpMethod() { - - return httpMethod; - } - - public void setHttpMethod(String httpMethod) { - - this.httpMethod = httpMethod; - } - - public String getThrottlingPolicy() { - - return throttlingPolicy; - } - - public void setThrottlingPolicy(String throttlingPolicy) { - - this.throttlingPolicy = throttlingPolicy; - } - - public String getAuthScheme() { - - return authScheme; - } - - public void setAuthScheme(String authScheme) { - - this.authScheme = authScheme; - } - - public String getUrlPattern() { - - return urlPattern; - } - - public void setUrlPattern(String urlPattern) { - - this.urlPattern = urlPattern; - } - - public void addScope(String scope) { - scopes.add(scope); - } - - public List getScopes() { - return scopes; - } - - @Override - public boolean equals(Object o) { - - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - URLMapping that = (URLMapping) o; - return Objects.equals(throttlingPolicy, that.throttlingPolicy) && - Objects.equals(authScheme, that.authScheme) && - Objects.equals(httpMethod, that.httpMethod) && - Objects.equals(urlPattern, that.urlPattern); - } - - @Override - public int hashCode() { - - return Objects.hash(throttlingPolicy, authScheme, httpMethod, urlPattern); - } - - @Override - public String toString() { - - return "URLMapping {" + - ", throttlingPolicy ='" + throttlingPolicy + '\'' + - ", authScheme ='" + authScheme + '\'' + - ", httpMethod ='" + httpMethod + '\'' + - ", urlPattern ='" + urlPattern + '\'' + - '}'; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AccessTokenInfo.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AccessTokenInfo.java deleted file mode 100644 index 2d23159808..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AccessTokenInfo.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2020, 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.security; - -import net.minidev.json.JSONObject; - -import java.util.Arrays; -import java.util.HashMap; - -/** - * Details about an Access Token. - */ -public class AccessTokenInfo { - - private boolean isTokenValid; - - private boolean isApplicationToken; - - private String consumerKey; - - private String consumerSecret; - - private String[] scope; - - private String tokenState; - - private String accessToken; - - private long issuedTime; - - private long validityPeriod; - - private int errorcode; - - private String endUserName; - - public String[] getScopes() { - return scope; - } - - public int getErrorcode() { - return errorcode; - } - - public void setErrorcode(int errorcode) { - this.errorcode = errorcode; - } - - public void setScope(String[] scope) { - this.scope = scope; - } - - public String getTokenState() { - return tokenState; - } - - public void setTokenState(String tokenState) { - this.tokenState = tokenState; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public long getIssuedTime() { - return issuedTime; - } - - public long getValidityPeriod() { - return validityPeriod; - } - - private HashMap parameters = new HashMap(); - - public String getConsumerKey() { - return consumerKey; - } - - public void setConsumerKey(String consumerKey) { - this.consumerKey = consumerKey; - } - - /** - * Get consumer secret corresponding to the access token. - * - * @return consumer secret - */ - public String getConsumerSecret() { - return consumerSecret; - } - - /** - * Set consumer secret corresponding to the access token. - * - * @param consumerSecret consumer secret to set - */ - public void setConsumerSecret(String consumerSecret) { - this.consumerSecret = consumerSecret; - } - - public void setIssuedTime(long issuedTime) { - this.issuedTime = issuedTime; - } - - public void setValidityPeriod(long validityPeriod) { - this.validityPeriod = validityPeriod; - } - - public void addParameter(String paramName, Object paramValue) { - parameters.put(paramName, paramValue); - } - - public Object getParameter(String paramName) { - return parameters.get(paramName); - } - - public boolean isTokenValid() { - return isTokenValid; - } - - public void setTokenValid(boolean isTokenValid) { - this.isTokenValid = isTokenValid; - } - - public boolean isApplicationToken() { - return isApplicationToken; - } - - public void setApplicationToken(boolean isApplicationToken) { - this.isApplicationToken = isApplicationToken; - } - - /** - * Sending additional properties as a JSON String. - */ - public String getJSONString() { - - // TODO:Need to add other parameters into the param Map. - if (!parameters.containsKey("scopes") && scope != null) { - parameters.put("scopes", Arrays.toString(scope)); - } - - if (!parameters.containsKey("tokenState")) { - parameters.put("tokenState", tokenState); - } - - return JSONObject.toJSONString(parameters); - } - - public String getEndUserName() { - return endUserName; - } - - public void setEndUserName(String endUserName) { - this.endUserName = endUserName; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AuthFilter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AuthFilter.java deleted file mode 100644 index 6e7856f23c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AuthFilter.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (c) 2020, 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.security; - -import java.util.stream.Collectors; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.Filter; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.APIKeyAuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.JWTAuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.Oauth2AuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.config.dto.MutualSSLDto; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.InterceptorConstants; -import org.wso2.apk.enforcer.constants.MetadataConstants; -import org.wso2.apk.enforcer.grpc.ExternalProcessorService; -import org.wso2.apk.enforcer.security.jwt.APIKeyAuthenticator; -import org.wso2.apk.enforcer.security.jwt.JWTAuthenticator; -import org.wso2.apk.enforcer.security.jwt.Oauth2Authenticator; -import org.wso2.apk.enforcer.security.jwt.UnsecuredAPIAuthenticator; -import org.wso2.apk.enforcer.security.mtls.MTLSAuthenticator; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * This is the filter handling the authentication for the requests flowing - * through the gateway. - */ -public class AuthFilter implements Filter { - private List authenticators = new ArrayList<>(); - private static final Logger log = LogManager.getLogger(AuthFilter.class); - private boolean isMutualSSLMandatory; - private boolean isOAuth2Mandatory; - private boolean isAPIKeyMandatory; - - @Override - public void init(APIConfig apiConfig, Map configProperties) { - initializeAuthenticators(apiConfig); - } - - private void initializeAuthenticators(APIConfig apiConfig) { - // TODO: Check security schema and add relevant authenticators. - boolean isMutualSSLProtected = false; - boolean isAPIKeyProtected = false; - isMutualSSLMandatory = false; - - // Set security conditions - Map securityMaps = apiConfig.getApplicationSecurity(); - isOAuth2Mandatory = securityMaps.getOrDefault("OAuth2", true); - isAPIKeyProtected = securityMaps.containsKey("APIKey"); - if (isAPIKeyProtected) { - isAPIKeyMandatory = securityMaps.getOrDefault("APIKey", false); - } - - if (!Objects.isNull(apiConfig.getMutualSSL())) { - if (apiConfig.isTransportSecurity()) { - if (apiConfig.getMutualSSL().equalsIgnoreCase(APIConstants.Optionality.MANDATORY)) { - isMutualSSLProtected = true; - isMutualSSLMandatory = true; - } else if (apiConfig.getMutualSSL().equalsIgnoreCase(APIConstants.Optionality.OPTIONAL)) { - isMutualSSLProtected = true; - } - } else { - isMutualSSLProtected = false; - } - } - - if (isMutualSSLProtected) { - Authenticator mtlsAuthenticator = new MTLSAuthenticator(); - authenticators.add(mtlsAuthenticator); - } - - // check whether the backend JWT token is enabled - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - boolean isGatewayTokenCacheEnabled = enforcerConfig.getCacheDto().isEnabled(); - JWTConfigurationDto jwtConfigurationDto = apiConfig.getJwtConfigurationDto(); - - Authenticator oauthAuthenticator = new Oauth2Authenticator(jwtConfigurationDto, isGatewayTokenCacheEnabled); - authenticators.add(oauthAuthenticator); - - if (isAPIKeyProtected){ - APIKeyAuthenticator apiKeyAuthenticator = new APIKeyAuthenticator(jwtConfigurationDto); - authenticators.add(apiKeyAuthenticator); - } - - Authenticator jwtAuthenticator = new JWTAuthenticator(jwtConfigurationDto, isGatewayTokenCacheEnabled); - authenticators.add(jwtAuthenticator); - - Authenticator unsecuredAPIAuthenticator = new UnsecuredAPIAuthenticator(); - authenticators.add(unsecuredAPIAuthenticator); - - authenticators.sort(Comparator.comparingInt(Authenticator::getPriority)); - } - - @Override - public boolean handleRequest(RequestContext requestContext) { - populateRemoveAndProtectedAuthHeaders(requestContext); - // Set API metadata for interceptors - setInterceptorAPIMetadata(requestContext); - - // It is required to skip the auth Filter if the lifecycle status is prototype - if (APIConstants.PROTOTYPED_LIFE_CYCLE_STATUS.equals( - requestContext.getMatchedAPI().getApiLifeCycleState()) && - !requestContext.getMatchedAPI().isMockedApi()) { - return true; - } - - // Authentication status of the request - boolean authenticated = false; - // Any auth token has been provided for application-level security or not - boolean canAuthenticated = false; - if (requestContext.getMatchedAPI() != null && requestContext.getMatchedAPI().getAiProvider() != null) { - if (requestContext.getMatchedAPI().getAiProvider().getPromptTokens() != null) { - requestContext.addMetadataToMap(MetadataConstants.PROMPT_TOKEN_ID, requestContext.getMatchedAPI().getAiProvider().getPromptTokens().getValue()); - } - if (requestContext.getMatchedAPI().getAiProvider().getCompletionToken() != null) { - requestContext.addMetadataToMap(MetadataConstants.EXTRACT_TOKEN_FROM, requestContext.getMatchedAPI().getAiProvider().getCompletionToken().getIn()); - requestContext.addMetadataToMap(MetadataConstants.COMPLETION_TOKEN_ID, requestContext.getMatchedAPI().getAiProvider().getCompletionToken().getValue()); - } - if (requestContext.getMatchedAPI().getAiProvider().getTotalToken() != null) { - requestContext.addMetadataToMap(MetadataConstants.TOTAL_TOKEN_ID, requestContext.getMatchedAPI().getAiProvider().getTotalToken().getValue()); - } - if (requestContext.getMatchedAPI().getAiProvider().getModel() != null) { - requestContext.addMetadataToMap(MetadataConstants.MODEL_ID, requestContext.getMatchedAPI().getAiProvider().getModel().getValue()); - } - if (requestContext.getMatchedAPI().getAiProvider().getProviderName() != null) { - requestContext.addMetadataToMap(MetadataConstants.AI_PROVIDER_NAME, requestContext.getMatchedAPI().getAiProvider().getProviderName()); - } - if (requestContext.getMatchedAPI().getAiProvider().getProviderAPIVersion() != null) { - requestContext.addMetadataToMap(MetadataConstants.AI_PROVIDER_API_VERSION, requestContext.getMatchedAPI().getAiProvider().getProviderAPIVersion()); - } - } - for (Authenticator authenticator : authenticators) { - if (authenticator.canAuthenticate(requestContext)) { - // For transport level securities (mTLS), canAuthenticated will not be applied - if (!authenticator.getName().contains(APIConstants.API_SECURITY_MUTUAL_SSL_NAME)) { - canAuthenticated = true; - } - AuthenticationResponse authenticateResponse = authenticate(authenticator, requestContext); - - authenticated = authenticateResponse.isAuthenticated(); - setInterceptorAuthContextMetadata(authenticator, requestContext); - - if (!authenticateResponse.isContinueToNextAuthenticator()) { - break; - } - } else { - // Check if the failed authentication is mandatory mTLS - if (isMutualSSLMandatory && authenticator.getName() - .contains(APIConstants.API_SECURITY_MUTUAL_SSL_NAME)) { - authenticated = false; - log.debug("mTLS authentication was failed for the request: {} , API: {}:{} APIUUID: {} ", - requestContext.getMatchedResourcePaths().get(0).getPath(), - requestContext.getMatchedAPI().getName(), requestContext.getMatchedAPI().getVersion(), - requestContext.getMatchedAPI().getUuid()); - break; - } - // Check if the failed authentication is a mandatory application level security - if (!authenticator.getName() - .contains(APIConstants.API_SECURITY_MUTUAL_SSL_NAME) && (isAPIKeyMandatory || isOAuth2Mandatory)) { - authenticated = false; - } - - } - } - if (authenticated) { - return true; - } - if (!canAuthenticated) { - FilterUtils.setUnauthenticatedErrorToContext(requestContext); - } - log.debug("None of the authenticators were able to authenticate the request: {}", - requestContext.getRequestPathTemplate(), - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6600)); - // set WWW_AUTHENTICATE header to error response - requestContext.addOrModifyHeaders(APIConstants.WWW_AUTHENTICATE, getAuthenticatorsChallengeString() + - ", error=\"invalid_token\"" + - ", error_description=\"The provided token is invalid\""); - return false; - } - - private AuthenticationResponse authenticate(Authenticator authenticator, RequestContext requestContext) { - try { - AuthenticationContext authenticate = authenticator.authenticate(requestContext); - requestContext.setAuthenticationContext(authenticate); - if (authenticator.getName().contains(APIConstants.API_SECURITY_MUTUAL_SSL_NAME)) { - // This section is for mTLS authentication - if (authenticate.isAuthenticated()) { - log.debug("mTLS authentication was passed for the request: {} , API: {}:{}, APIUUID: {} ", - requestContext.getMatchedResourcePaths().get(0).getPath(), - requestContext.getMatchedAPI().getName(), requestContext.getMatchedAPI().getVersion(), - requestContext.getMatchedAPI().getUuid()); - - boolean isApplicationSecurityDisabled = requestContext.getMatchedResourcePaths().get(0) - .getAuthenticationConfig().isDisabled(); - // proceed to the next authenticator only if application security is enabled and - // is mandatory - return new AuthenticationResponse(true, isMutualSSLMandatory, - !isApplicationSecurityDisabled && (isOAuth2Mandatory || isAPIKeyMandatory)); - } else { - if (isMutualSSLMandatory) { - log.debug("Mandatory mTLS authentication was failed for the request: {} , API: {}:{}, " + - "APIUUID: {} ", - requestContext.getMatchedResourcePaths().get(0).getPath(), - requestContext.getMatchedAPI().getName(), requestContext.getMatchedAPI().getVersion(), - requestContext.getMatchedAPI().getUuid()); - } else { - log.debug("Optional mTLS authentication was failed for the request: {} , API: {}:{}, " + - "APIUUID: {} ", - requestContext.getMatchedResourcePaths().get(0).getPath(), - requestContext.getMatchedAPI().getName(), requestContext.getMatchedAPI().getVersion(), - requestContext.getMatchedAPI().getUuid()); - } - return new AuthenticationResponse(false, isMutualSSLMandatory, false); - - } - // for all authenticators other than mTLS - } else if (authenticate.isAuthenticated()) { - return new AuthenticationResponse(true, isOAuth2Mandatory && isAPIKeyMandatory, false); - } - } catch (APISecurityException e) { - // TODO: (VirajSalaka) provide the error code properly based on exception (401, - // 403, 429 etc) - FilterUtils.setErrorToContext(requestContext, e); - } - boolean continueToNextAuth = true; - if (authenticator.getName().contains(APIConstants.API_SECURITY_MUTUAL_SSL_NAME)) { - continueToNextAuth = false; - } - return new AuthenticationResponse(false, - isOAuth2Mandatory || isMutualSSLMandatory, continueToNextAuth); - } - - private String getAuthenticatorsChallengeString() { - StringBuilder challengeString = new StringBuilder(); - if (authenticators != null) { - for (Authenticator authenticator : authenticators) { - challengeString.append(authenticator.getChallengeString()).append(" "); - } - } - return challengeString.toString().trim(); - } - - private void setInterceptorAuthContextMetadata(Authenticator authenticator, RequestContext requestContext) { - // add auth context to metadata, lua script will add it to the auth context of - // the interceptor - AuthenticationContext authContext = requestContext.getAuthenticationContext(); - String tokenType = authenticator.getName(); - authContext.setTokenType(tokenType); - requestContext.addMetadataToMap(InterceptorConstants.AuthContextFields.TOKEN_TYPE, - Objects.toString(tokenType, "")); - requestContext.addMetadataToMap(InterceptorConstants.AuthContextFields.TOKEN, - Objects.toString(authContext.getRawToken(), "")); - requestContext.addMetadataToMap(InterceptorConstants.AuthContextFields.KEY_TYPE, - Objects.toString(requestContext.getMatchedAPI().getEnvType(), "")); - } - - private void setInterceptorAPIMetadata(RequestContext requestContext) { - requestContext.addMetadataToMap(InterceptorConstants.APIMetadataFields.API_BASE_PATH, - Objects.toString(requestContext.getMatchedAPI().getBasePath(), "")); - requestContext.addMetadataToMap(InterceptorConstants.APIMetadataFields.API_VERSION, - Objects.toString(requestContext.getMatchedAPI().getVersion(), "")); - requestContext.addMetadataToMap(InterceptorConstants.APIMetadataFields.API_NAME, - Objects.toString(requestContext.getMatchedAPI().getName(), "")); - requestContext.addMetadataToMap(InterceptorConstants.APIMetadataFields.API_VHOST, - Objects.toString(requestContext.getMatchedAPI().getVhost(), "")); - requestContext.addMetadataToMap(InterceptorConstants.APIMetadataFields.API_ORGANIZATION_ID, - Objects.toString(requestContext.getMatchedAPI().getOrganizationId(), "")); - requestContext.addMetadataToMap(InterceptorConstants.APIMetadataFields.ENVIRONMENT, - Objects.toString(requestContext.getMatchedAPI().getEnvironment(), "")); - } - - private void populateRemoveAndProtectedAuthHeaders(RequestContext requestContext) { - requestContext.getMatchedResourcePaths().forEach(resourcePath -> { - Oauth2AuthenticationConfig oauth2AuthenticationConfig = resourcePath.getAuthenticationConfig() - .getOauth2AuthenticationConfig(); - JWTAuthenticationConfig jwtAuthenticationConfig = resourcePath.getAuthenticationConfig() - .getJwtAuthenticationConfig(); - List apiKeyAuthenticationConfig = resourcePath.getAuthenticationConfig() - .getApiKeyAuthenticationConfigs(); - if (oauth2AuthenticationConfig != null && !oauth2AuthenticationConfig.isSendTokenToUpstream()) { - requestContext.getRemoveHeaders().add(oauth2AuthenticationConfig.getHeader()); - } - if (jwtAuthenticationConfig != null && !jwtAuthenticationConfig.isSendTokenToUpstream()) { - requestContext.getRemoveHeaders().add(jwtAuthenticationConfig.getHeader()); - } - if (apiKeyAuthenticationConfig != null && !apiKeyAuthenticationConfig.isEmpty()) { - requestContext.getQueryParamsToRemove().addAll(apiKeyAuthenticationConfig.stream() - .filter(apiKeyAuthenticationConfig1 -> !apiKeyAuthenticationConfig1.isSendTokenToUpstream() - && Objects.equals(apiKeyAuthenticationConfig1.getIn(), "In")) - .map(APIKeyAuthenticationConfig::getName).collect(Collectors.toList())); - List apikeyHeadersToRemove = apiKeyAuthenticationConfig.stream() - .filter(apiKeyAuthenticationConfig1 -> !apiKeyAuthenticationConfig1.isSendTokenToUpstream() - && Objects.equals(apiKeyAuthenticationConfig1.getIn(), "Header")) - .map(APIKeyAuthenticationConfig::getName).collect(Collectors.toList()); - requestContext.getRemoveHeaders().addAll(apikeyHeadersToRemove); - } - }); - - // Remove mTLS certificate header - MutualSSLDto mtlsInfo = ConfigHolder.getInstance().getConfig().getMtlsInfo(); - String certificateHeaderName = FilterUtils.getCertificateHeaderName(); - if (!mtlsInfo.isEnableOutboundCertificateHeader()) { - requestContext.getRemoveHeaders().add(certificateHeaderName); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AuthenticationResponse.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AuthenticationResponse.java deleted file mode 100644 index 35b083362c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/AuthenticationResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wso2.apk.enforcer.security; - -/** - * AuthenticationResponse object contains the authentication status of the request when it passed - * through an authenticator. - */ -public class AuthenticationResponse { - private boolean authenticated; - private boolean mandatoryAuthentication; - private boolean continueToNextAuthenticator; - - public AuthenticationResponse(boolean authenticated, boolean mandatoryAuthentication, - boolean continueToNextAuthenticator) { - this.authenticated = authenticated; - this.mandatoryAuthentication = mandatoryAuthentication; - this.continueToNextAuthenticator = continueToNextAuthenticator; - } - - public boolean isAuthenticated() { - return authenticated; - } - - public boolean isMandatoryAuthentication() { - return mandatoryAuthentication; - } - - public boolean isContinueToNextAuthenticator() { - return continueToNextAuthenticator; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/Authenticator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/Authenticator.java deleted file mode 100644 index 88649ed4af..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/Authenticator.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2020, 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.security; - -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; - -/** - * Defines the interface to implement an authenticator. This authenticator can be oauth2(opaque, jwt), MTLS, basic - * and etc. - */ -public interface Authenticator { - - boolean canAuthenticate(RequestContext requestContext); - - AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException; - - /** - * Returns a string representation of the authentication challenge imposed by this - * authenticator. In case of an authentication failure this value will be sent back - * to the API consumer in the form of a WWW-Authenticate header. - * - * @return A string representation of the authentication challenge - */ - String getChallengeString(); - - /** - * Name of the authenticator. - * This is used in authentication context of interceptors. - * @return Authenticator name - */ - String getName(); - - int getPriority(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/KeyValidator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/KeyValidator.java deleted file mode 100644 index c6bfc3fdae..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/KeyValidator.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright (c) 2020, 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.security; - -import com.nimbusds.jwt.JWTClaimsSet; -import net.minidev.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.dto.APIKeyValidationInfoDTO; -import org.wso2.apk.enforcer.models.Application; -import org.wso2.apk.enforcer.models.ApplicationKeyMapping; -import org.wso2.apk.enforcer.models.ApplicationMapping; -import org.wso2.apk.enforcer.models.Subscription; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStore; - -import java.util.List; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Does the subscription and scope validation. - */ -public class KeyValidator { - - private static final Logger log = LogManager.getLogger(KeyValidator.class); - - /** - * Validate the scopes related to the given validationContext. - * - * @param validationContext the token validation context - * @return true is the scopes are valid - * this will indicate the message body for the error response - */ - public static boolean validateScopes(TokenValidationContext validationContext) throws APISecurityException { - - if (validationContext.isCacheHit()) { - return true; - } - APIKeyValidationInfoDTO apiKeyValidationInfoDTO = validationContext.getValidationInfoDTO(); - - if (apiKeyValidationInfoDTO == null) { - log.error("Error while validating scopes. Key validation information has not been set.", - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6603)); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - "Error while validating scopes. Key validation information has not been set"); - } - - Set scopesFromToken = apiKeyValidationInfoDTO.getScopes(); - - List matchedResources; - // when it is a graphQL api multiple matching resources will be returned. - matchedResources = validationContext.getMatchingResourceConfigs(); - - boolean allScopesValidated = true; - // failedResourcePath - used to identify resource paths with failed scope validation. - String failedResourcePath = ""; - for (ResourceConfig matchedResource : matchedResources) { - // scopesValidated - indicate scope has validated - boolean scopesValidated = false; - String resourcePath = matchedResource.getPath(); - String[] scopesToValidate = matchedResource.getScopes(); - for (String scope : scopesToValidate) { - if (scopesFromToken.contains(scope)) { - scopesValidated = true; - break; - } - } - if (scopesToValidate.length > 0 && !scopesValidated) { - allScopesValidated = false; - failedResourcePath = resourcePath; - break; - } - } - if (!allScopesValidated) { - apiKeyValidationInfoDTO.setAuthorized(false); - apiKeyValidationInfoDTO.setValidationStatus(APIConstants.KeyValidationStatus.INVALID_SCOPE); - String message = "User is NOT authorized to access the Resource: " + failedResourcePath - + ". Scope validation failed."; - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.INVALID_SCOPE, message); - } - return true; - } - - /** - * Validate subscriptions for access tokens by utilizing the consumer key. - * - * @param validationInfo Token validation related details. This will be populated based on the available data during - * the subscription validation. - * @throws APISecurityException throws if subscription validation fails. - */ - public static void validateSubscriptionUsingConsumerKey(APIKeyValidationInfoDTO validationInfo) - throws APISecurityException { - - Application app; - Subscription sub = null; - ApplicationKeyMapping keyMapping; - Set appMappings; - String apiName = validationInfo.getApiName(); - String apiContext = validationInfo.getApiContext(); - String apiVersion = validationInfo.getApiVersion(); - String consumerKey = validationInfo.getConsumerKey(); - String securityScheme = validationInfo.getSecurityScheme(); - String keyType = validationInfo.getEnvType(); - - log.debug("Before validating subscriptions"); - log.debug("Validation Info : { name : {}, context : {}, version : {}, consumerKey : {} }", - apiName, apiContext, apiVersion, consumerKey); - - SubscriptionDataStore datastore = - SubscriptionDataHolder.getInstance().getSubscriptionDataStore(validationInfo.getSubscriberOrganization()); - - if (datastore != null) { - // Get application key mapping using the consumer key, key type and security scheme - keyMapping = datastore.getMatchingApplicationKeyMapping(consumerKey, keyType, securityScheme, - validationInfo.getEnvironment()); - - if (keyMapping != null) { - // Get application and application mapping using application UUID - String applicationUUID = keyMapping.getApplicationUUID(); - app = datastore.getApplicationById(applicationUUID); - appMappings = datastore.getMatchingApplicationMappings(applicationUUID); - - if (appMappings != null && app != null) { - // Get subscription using the subscription UUID - for (ApplicationMapping appMapping : appMappings) { - String subscriptionUUID = appMapping.getSubscriptionUUID(); - Subscription subscription = datastore.getMatchingSubscription(subscriptionUUID); - - if (validationInfo.getApiName().equals(subscription.getSubscribedApi().getName())) { - // Validate API version - Pattern pattern = subscription.getSubscribedApi().getVersionRegexPattern(); - String versionToMatch = validationInfo.getApiVersion(); - Matcher matcher = pattern.matcher(versionToMatch); - if (matcher.matches()) { - sub = subscription; - break; - } - } - } - // Validate subscription - if (sub != null) { - validate(validationInfo, app, sub); - if (!validationInfo.isAuthorized() && validationInfo.getValidationStatus() == 0) { - // Scenario where validation failed and message is not set - validationInfo.setValidationStatus( - APIConstants.KeyValidationStatus.API_AUTH_RESOURCE_FORBIDDEN); - } - log.debug("After validating subscriptions"); - return; - } else { - log.error( - "Valid subscription not found for access token. " + - "application: {}, app_UUID: {}, API name: {}, API context: {} API version" + - " : {}", - app.getName(), app.getUUID(), apiName, apiContext, apiVersion); - } - } else { - log.error( - "Valid application and / or application mapping not found for application uuid : " + applicationUUID); - } - } else { - log.error( - "Valid application key mapping not found in the data store for access token. " + - "Application identifier: {}, key type : {}, security scheme : {}", - consumerKey, keyType, securityScheme); - } - } else { - log.error("Subscription data store is null"); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - } - // If the execution reaches this point, it means that the subscription validation has failed. - log.error("User is NOT authorized to access the API. Subscription validation failed for consumer key : " - + consumerKey); - throw new - - APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - - APISecurityConstants.API_AUTH_FORBIDDEN, APISecurityConstants.API_AUTH_FORBIDDEN_MESSAGE); - } - - /** - * Validate subscriptions for API keys. - * - * @param apiUuid uuid of the API - * @param apiContext API context, used for logging purposes and to extract the tenant domain - * @param payload JWT claims set extracted from the API key - * @return validation information about the request - */ - public static APIKeyValidationInfoDTO validateSubscription(String apiUuid, String apiContext, APIConfig api, - JWTClaimsSet payload) { - - log.debug("Before validating subscriptions with API key. API_uuid: {}, context: {}", apiUuid, apiContext); - - Application app = null; - Subscription sub = null; - - SubscriptionDataStore datastore = - SubscriptionDataHolder.getInstance().getSubscriptionDataStore(api.getOrganizationId()); - if (datastore != null) { - JSONObject appObject = (JSONObject) payload.getClaim(APIConstants.JwtTokenConstants.APPLICATION); - String appUuid = appObject.getAsString("uuid"); - if (!appObject.isEmpty() && !appUuid.isEmpty()) { - app = datastore.getApplicationById(appUuid); - if (app != null) { - sub = datastore.getSubscriptionById(app.getUUID(), api.getUuid()); - if (sub != null) { - log.debug("All information is retrieved from the in memory data store."); - } else { - log.info( - "Valid subscription not found for API key. " + - "application: {} app_UUID: {} API_name: {} API_UUID : {}", - app.getName(), app.getUUID(), api.getName(), api.getUuid()); - } - } else { - log.info("Application not found in the data store for uuid {}", appUuid); - } - } else { - log.info("Application claim not found in jwt for uuid"); - } - } else { - log.error("Subscription data store is null"); - } - - APIKeyValidationInfoDTO infoDTO = new APIKeyValidationInfoDTO(); - if (app != null && sub != null) { - validate(infoDTO, app, sub); - } - if (!infoDTO.isAuthorized() && infoDTO.getValidationStatus() == 0) { - //Scenario where validation failed and message is not set - infoDTO.setValidationStatus(APIConstants.KeyValidationStatus.API_AUTH_RESOURCE_FORBIDDEN); - } - log.debug("After validating subscriptions with API key."); - return infoDTO; - } - - private static void validate(APIKeyValidationInfoDTO infoDTO, Application app, Subscription sub) { - - // Validate subscription status - String subscriptionStatus = sub.getSubscriptionStatus(); - if (APIConstants.SubscriptionStatus.INACTIVE.equals(subscriptionStatus)) { - infoDTO.setValidationStatus(APIConstants.KeyValidationStatus.SUBSCRIPTION_INACTIVE); - infoDTO.setAuthorized(false); - return; - } - if (APIConstants.SubscriptionStatus.ON_HOLD.equals(subscriptionStatus)) { - infoDTO.setValidationStatus(APIConstants.KeyValidationStatus.SUBSCRIPTION_ON_HOLD); - infoDTO.setAuthorized(false); - return; - } - if (APIConstants.SubscriptionStatus.PROD_ONLY_BLOCKED.equals(subscriptionStatus) && - StringUtils.equals(infoDTO.getEnvType(), APIConstants.API_KEY_TYPE_PRODUCTION) ) { - infoDTO.setValidationStatus(APIConstants.KeyValidationStatus.SUBSCRIPTION_PROD_BLOCKED); - infoDTO.setAuthorized(false); - return; - } - if (APIConstants.SubscriptionStatus.BLOCKED.equals(subscriptionStatus)) { - infoDTO.setValidationStatus(APIConstants.KeyValidationStatus.SUBSCRIPTION_BLOCKED); - infoDTO.setAuthorized(false); - return; - } - if (APIConstants.SubscriptionStatus.REJECTED.equals(subscriptionStatus)) { - infoDTO.setValidationStatus(APIConstants.KeyValidationStatus.SUBSCRIPTION_REJECTED); - infoDTO.setAuthorized(false); - return; - } - infoDTO.setApplicationUUID(app.getUUID()); - infoDTO.setSubscriber(app.getOwner()); - infoDTO.setApplicationName(app.getName()); - infoDTO.setAppAttributes(app.getAttributes()); - infoDTO.setAuthorized(true); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/TokenValidationContext.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/TokenValidationContext.java deleted file mode 100644 index 1c0b3845af..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/TokenValidationContext.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2020, 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.security; - -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.dto.APIKeyValidationInfoDTO; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Set if data to be used in order to validate a token. - */ -public class TokenValidationContext { - - private String context; - private String version; - private String accessToken; - private String requiredAuthenticationLevel; - private String clientDomain; - private String matchingResource; - private ArrayList matchingResourceConfigs; - private String httpVerb; - private Map attributeMap = new HashMap(); - private String cacheKey; - private APIKeyValidationInfoDTO validationInfoDTO; - private boolean isCacheHit; - private AccessTokenInfo tokenInfo; - private String authorizationCode; - private String tenantDomain; - private List keyManagers = new ArrayList<>(); - - public AccessTokenInfo getTokenInfo() { - return tokenInfo; - } - - public void setTokenInfo(AccessTokenInfo tokenInfo) { - this.tokenInfo = tokenInfo; - } - - public boolean isCacheHit() { - return isCacheHit; - } - - public void setCacheHit(boolean isCacheHit) { - this.isCacheHit = isCacheHit; - } - - public APIKeyValidationInfoDTO getValidationInfoDTO() { - return validationInfoDTO; - } - - public void setValidationInfoDTO(APIKeyValidationInfoDTO validationInfoDTO) { - this.validationInfoDTO = validationInfoDTO; - } - - public String getContext() { - return context; - } - - public void setContext(String context) { - this.context = context; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public String getRequiredAuthenticationLevel() { - return requiredAuthenticationLevel; - } - - public void setRequiredAuthenticationLevel(String requiredAuthenticationLevel) { - this.requiredAuthenticationLevel = requiredAuthenticationLevel; - } - - public String getClientDomain() { - return clientDomain; - } - - public void setClientDomain(String clientDomain) { - this.clientDomain = clientDomain; - } - - public String getMatchingResource() { - return matchingResource; - } - - public void setMatchingResource(String matchingResource) { - this.matchingResource = matchingResource; - } - - public ArrayList getMatchingResourceConfigs() { - return matchingResourceConfigs; - } - - public void setMatchingResourceConfigs(ArrayList matchingResourceConfigs) { - this.matchingResourceConfigs = matchingResourceConfigs; - } - - public String getHttpVerb() { - return httpVerb; - } - - public void setHttpVerb(String httpVerb) { - this.httpVerb = httpVerb; - } - - public String getCacheKey() { - return cacheKey; - } - - public void setCacheKey(String cacheKey) { - this.cacheKey = cacheKey; - } - - public void setAttribute(String key, Object value) { - this.attributeMap.put(key, value); - } - - public Object getAttribute(String key) { - return this.attributeMap.get(key); - } - - public String getAuthorizationCode() { - return authorizationCode; - } - - public void setAuthorizationCode(String authorizationCode) { - this.authorizationCode = authorizationCode; - } - - public String getTenantDomain() { - - return tenantDomain; - } - - public void setTenantDomain(String tenantDomain) { - - this.tenantDomain = tenantDomain; - } - - public List getKeyManagers() { - - return keyManagers; - } - - public void setKeyManagers(List keyManagers) { - - this.keyManagers = keyManagers; - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/APIKeyAuthenticator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/APIKeyAuthenticator.java deleted file mode 100644 index 50eacec26c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/APIKeyAuthenticator.java +++ /dev/null @@ -1,557 +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.security.jwt; - -import com.nimbusds.jwt.JWTClaimsSet; -import com.nimbusds.jwt.SignedJWT; - -import java.util.List; - -import net.minidev.json.JSONArray; -import net.minidev.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.common.CacheProviderUtil; -import org.wso2.apk.enforcer.commons.constants.GraphQLConstants; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.dto.JWTInfoDto; -import org.wso2.apk.enforcer.commons.dto.JWTValidationInfo; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.jwtgenerator.AbstractAPIMgtGatewayJWTGenerator; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.APIKeyAuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.config.dto.APIKeyIssuerDto; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.constants.GeneralErrorCodeConstants; -import org.wso2.apk.enforcer.dto.APIKeyValidationInfoDTO; -import org.wso2.apk.enforcer.dto.JWTTokenPayloadInfo; -import org.wso2.apk.enforcer.models.Application; -import org.wso2.apk.enforcer.models.ApplicationMapping; -import org.wso2.apk.enforcer.models.Subscription; -import org.wso2.apk.enforcer.security.KeyValidator; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStore; -import org.wso2.apk.enforcer.util.BackendJwtUtils; -import org.wso2.apk.enforcer.util.FilterUtils; -import org.wso2.apk.enforcer.util.JWTUtils; - -import java.math.BigInteger; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.security.cert.Certificate; -import java.text.ParseException; -import java.util.Map; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Extends the APIKeyHandler to authenticate request using API Key. - */ -public class APIKeyAuthenticator extends APIKeyHandler { - - private static final Logger log = LogManager.getLogger(APIKeyAuthenticator.class); - - private Certificate certificate; - private AbstractAPIMgtGatewayJWTGenerator jwtGenerator; - private final boolean isGatewayTokenCacheEnabled; - private static final int IPV4_ADDRESS_BIT_LENGTH = 32; - private static final int IPV6_ADDRESS_BIT_LENGTH = 128; - - public APIKeyAuthenticator(final JWTConfigurationDto jwtConfigurationDto) { - - log.debug("API key authenticator initialized."); - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - this.isGatewayTokenCacheEnabled = enforcerConfig.getCacheDto().isEnabled(); - if (jwtConfigurationDto.isEnabled()) { - this.jwtGenerator = BackendJwtUtils.getApiMgtGatewayJWTGenerator(jwtConfigurationDto); - } - APIKeyIssuerDto apiKeyIssuerDto = ConfigHolder.getInstance().getConfig().getApiKeyIssuerDto(); - if (apiKeyIssuerDto == null || !apiKeyIssuerDto.isEnabled()) { - log.error("Could not properly initialize APIKeyAuthenticator. Empty certificate alias. {}", - ErrorDetails.errorLog(LoggingConstants.Severity.CRITICAL, 6604)); - } else { - certificate = apiKeyIssuerDto.getPublicCertificate(); - } - } - - @Override - public boolean canAuthenticate(RequestContext requestContext) { - // only getting first operation is enough as all matched resource configs have the same security schemes - // i.e. graphQL apis do not support resource level security yet - return isAPIKey(getAPIKeyFromRequest(requestContext)); - } - - // Gets API key from request - private static String getAPIKeyFromRequest(RequestContext requestContext) { - - List apiKeyAuthenticationConfigs = requestContext.getMatchedResourcePaths().get(0) - .getAuthenticationConfig().getApiKeyAuthenticationConfigs(); - if (apiKeyAuthenticationConfigs == null) { - return ""; - } - - // loop over apikey auths and get apikey from the matching location - for (APIKeyAuthenticationConfig apiKeyAuthenticationConfig : apiKeyAuthenticationConfigs) { - switch (apiKeyAuthenticationConfig.getIn()) { - case APIConstants.SWAGGER_API_KEY_IN_HEADER: - String header = StringUtils.lowerCase(apiKeyAuthenticationConfig.getName()); - if (requestContext.getHeaders().containsKey(header)) { - return requestContext.getHeaders().get(header); - } - break; - case APIConstants.SWAGGER_API_KEY_IN_QUERY: - if (requestContext.getQueryParameters().containsKey(apiKeyAuthenticationConfig.getName())) { - return requestContext.getQueryParameters().get(apiKeyAuthenticationConfig.getName()); - } - break; - default: - log.error("Invalid API key location: " + apiKeyAuthenticationConfig.getIn()); - } - } - return ""; - } - - @Override - public AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException { - - if (certificate == null) { - log.error("APIKeyAuthenticator has not been properly initialized. Empty certificate alias.", - ErrorDetails.errorLog(LoggingConstants.Severity.CRITICAL, 6604)); - throw new APISecurityException(APIConstants.StatusCodes.INTERNAL_SERVER_ERROR.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - } - if (requestContext.getMatchedAPI() == null) { - log.debug("API Key Authentication failed"); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - } - String apiKey = getAPIKeyFromRequest(requestContext); - return processAPIKey(requestContext, apiKey); - } - - private AuthenticationContext processAPIKey(RequestContext requestContext, String apiKey) - throws APISecurityException { - - try { - String[] splitToken = apiKey.split("\\."); - - SignedJWT signedJWT = SignedJWT.parse(apiKey); - JWTClaimsSet payload = signedJWT.getJWTClaimsSet(); - - String apiVersion = requestContext.getMatchedAPI().getVersion(); - String apiContext = requestContext.getMatchedAPI().getBasePath(); - String apiUuid = requestContext.getMatchedAPI().getUuid(); - String envType = requestContext.getMatchedAPI().getEnvType(); - String organization = requestContext.getMatchedAPI().getOrganizationId(); - // Avoids using internal API keys, when internal key header or queryParam configured as api_key - if (isInternalKey(payload)) { - log.error("Invalid API Key token type. {} ", FilterUtils.getMaskedToken(splitToken[0])); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - - // Gives jti (also used to populate authentication context) - String tokenIdentifier = payload.getJWTID(); - - // Checks whether key contains in revoked map. - checkInRevokedMap(tokenIdentifier, splitToken); - - // Verifies the token if it is found in cache - JWTTokenPayloadInfo jwtTokenPayloadInfo = (JWTTokenPayloadInfo) - CacheProviderUtil.getOrganizationCache(organization).getGatewayAPIKeyDataCache().getIfPresent(tokenIdentifier); - boolean isVerified = isVerifiedApiKeyInCache(tokenIdentifier, apiKey, payload, splitToken, - "API Key", jwtTokenPayloadInfo, organization); - - // Verifies token when it is not found in cache - if (!isVerified) { - isVerified = verifyTokenWhenNotInCache(certificate, signedJWT, splitToken, payload, "API Key", - organization); - } - - if (isVerified) { - log.debug("API Key signature is verified."); - - if (jwtTokenPayloadInfo == null) { - log.debug("API Key payload not found in the cache."); - - jwtTokenPayloadInfo = new JWTTokenPayloadInfo(); - jwtTokenPayloadInfo.setPayload(payload); - jwtTokenPayloadInfo.setAccessToken(apiKey); - CacheProviderUtil.getOrganizationCache(organization).getGatewayAPIKeyDataCache().put(tokenIdentifier, jwtTokenPayloadInfo); - } - // Validate token type - Object keyType = payload.getClaim("keytype"); - if (keyType != null && !keyType.toString() - .equalsIgnoreCase(requestContext.getMatchedAPI().getEnvType())) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid key type."); - } - validateAPIKeyRestrictions(payload, requestContext, apiContext, apiVersion); - APIKeyValidationInfoDTO validationInfoDto; - log.debug("Validating subscription for API Key against subscription store." - + " context: {} version: {}", apiContext, apiVersion); - boolean isGatewayLevelSubscriptionValidationEnabled = ConfigHolder.getInstance().getConfig() - .getMandateSubscriptionValidation(); - if (!requestContext.getMatchedAPI().isSystemAPI() && (isGatewayLevelSubscriptionValidationEnabled || requestContext.getMatchedAPI() - .isSubscriptionValidation())) { -// validationInfoDto = KeyValidator.validateSubscription(apiUuid, apiContext, -// requestContext.getMatchedAPI(), payload); - log.debug("Validating subscription for API Key using JWT claims against invoked API info." - + " context: {} version: {}", apiContext, apiVersion); - validationInfoDto = getAPIKeyValidationDTO(requestContext, payload); - } else { - log.debug("Creating API Key info DTO for unknown API and Application." - + " context: {} version: {}", apiContext, apiVersion); - validationInfoDto = new APIKeyValidationInfoDTO(); - JWTUtils.updateApplicationNameForSubscriptionDisabledFlow(validationInfoDto, - APIConstants.KeyManager.APIM_APIKEY_ISSUER); - validationInfoDto.setAuthorized(true); - } - - if (!validationInfoDto.isAuthorized()) { - if (GeneralErrorCodeConstants.API_BLOCKED_CODE == validationInfoDto - .getValidationStatus()) { - FilterUtils.setErrorToContext(requestContext, - GeneralErrorCodeConstants.API_BLOCKED_CODE, - APIConstants.StatusCodes.SERVICE_UNAVAILABLE.getCode(), - GeneralErrorCodeConstants.API_BLOCKED_MESSAGE, - GeneralErrorCodeConstants.API_BLOCKED_DESCRIPTION); - throw new APISecurityException(APIConstants.StatusCodes.SERVICE_UNAVAILABLE - .getCode(), validationInfoDto.getValidationStatus(), - GeneralErrorCodeConstants.API_BLOCKED_MESSAGE); - } else if (APISecurityConstants.API_SUBSCRIPTION_BLOCKED == validationInfoDto - .getValidationStatus()) { - FilterUtils.setErrorToContext(requestContext, - APISecurityConstants.API_SUBSCRIPTION_BLOCKED, - APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_SUBSCRIPTION_BLOCKED_MESSAGE, - APISecurityConstants.API_SUBSCRIPTION_BLOCKED_DESCRIPTION); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED - .getCode(), validationInfoDto.getValidationStatus(), - APISecurityConstants.API_SUBSCRIPTION_BLOCKED_MESSAGE); - } - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - validationInfoDto.getValidationStatus(), - "User is NOT authorized to access the Resource. " - + "API Subscription validation failed."); - } - - log.debug("API Key authentication successful."); - - /* GraphQL Query Analysis Information */ - if (APIConstants.ApiType.GRAPHQL.equals(requestContext.getMatchedAPI() - .getApiType())) { - requestContext.getProperties().put(GraphQLConstants.MAXIMUM_QUERY_DEPTH, - validationInfoDto.getGraphQLMaxDepth()); - requestContext.getProperties().put(GraphQLConstants.MAXIMUM_QUERY_COMPLEXITY, - validationInfoDto.getGraphQLMaxComplexity()); - } - - // TODO: Add analytics data processing - - // Get JWTValidationInfo - JWTValidationInfo validationInfo = new JWTValidationInfo(); - validationInfo.setUser(payload.getSubject()); - - // Generate or get backend JWT - String endUserToken = null; - JWTConfigurationDto jwtConfigurationDto = ConfigHolder.getInstance(). - getConfig().getJwtConfigurationDto(); - if (jwtConfigurationDto.isEnabled()) { - JWTInfoDto jwtInfoDto = FilterUtils - .generateJWTInfoDto(null, validationInfo, validationInfoDto, requestContext); - endUserToken = BackendJwtUtils.generateAndRetrieveJWTToken(jwtGenerator, tokenIdentifier, - jwtInfoDto, isGatewayTokenCacheEnabled, organization); - // Set generated jwt token as a response header - requestContext.addOrModifyHeaders(jwtConfigurationDto.getJwtHeader(), endUserToken); - } - SubscriptionDataStore datastore = SubscriptionDataHolder.getInstance(). - getSubscriptionDataStore(organization); - Application app = getApplication(requestContext.getMatchedAPI(), payload); - Set appMappings = datastore.getMatchingApplicationMappings(app.getUUID()); - for (ApplicationMapping appMapping : appMappings) { - String subscriptionUUID = appMapping.getSubscriptionUUID(); - Subscription subscription = datastore.getMatchingSubscription(subscriptionUUID); - if (requestContext.getMatchedAPI().getName().equals(subscription.getSubscribedApi().getName())) { - // Validate API version - Pattern pattern = subscription.getSubscribedApi().getVersionRegexPattern(); - String versionToMatch = requestContext.getMatchedAPI().getVersion(); - Matcher matcher = pattern.matcher(versionToMatch); - if (matcher.matches()) { - if (!"Unlimited".equals(subscription.getRatelimitTier()) && subscription.getRatelimitTier() != null && !subscription.getRatelimitTier().isEmpty()) { - String subscriptionId = subscription.getSubscribedApi().getName() + ":" + - app.getUUID() + subscription.getSubscriptionId(); - requestContext.addMetadataToMap("ratelimit:subscription", subscriptionId); - requestContext.addMetadataToMap("ratelimit:usage-policy", subscription.getRatelimitTier()); - requestContext.addMetadataToMap("ratelimit:organization", subscription.getOrganization()); - requestContext.addMetadataToMap("ratelimit:organization-and-rlpolicy", String.format("%s-%s", subscription.getOrganization(), subscription.getRatelimitTier())); - } - break; - } - } - } - - // Create authentication context - AuthenticationContext authenticationContext = FilterUtils - .generateAuthenticationContext(requestContext, tokenIdentifier, validationInfo, - validationInfoDto, endUserToken, apiKey, false); - log.debug("Analytics data processing for API Key (jiti) {} was successful", tokenIdentifier); - return authenticationContext; - - } - } catch (ParseException e) { - log.warn("API Key authentication failed. ", e); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - "API key authentication failed."); - } - log.warn("API Key authentication failed."); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - "API key authentication failed."); - } - - private APIKeyValidationInfoDTO getAPIKeyValidationDTO(RequestContext requestContext, JWTClaimsSet payload) - throws ParseException, APISecurityException { - - APIKeyValidationInfoDTO validationInfoDTO = new APIKeyValidationInfoDTO(); - JSONObject app = payload.getJSONObjectClaim(APIConstants.JwtTokenConstants.APPLICATION); - JSONObject api = null; - validationInfoDTO.setType(requestContext.getMatchedAPI().getEnvType()); - - if (app != null) { - validationInfoDTO.setApplicationUUID(app.getAsString(APIConstants.JwtTokenConstants.APPLICATION_UUID)); - validationInfoDTO.setApplicationName(app.getAsString(APIConstants.JwtTokenConstants.APPLICATION_NAME)); - //validationInfoDTO.setSubscriber(app.getAsString(APIConstants.JwtTokenConstants.APPLICATION_OWNER)); - } - - // Check whether name is assigned correctly (This was not populated in JWTAuthenticator) - String name = requestContext.getMatchedAPI().getName(); - String version = requestContext.getMatchedAPI().getVersion(); - validationInfoDTO.setApiName(name); - validationInfoDTO.setApiVersion(version); - - if (payload.getClaim(APIConstants.JwtTokenConstants.SUBSCRIBED_APIS) != null) { - // Subscription validation - JSONArray subscribedAPIs = - (JSONArray) payload.getClaim(APIConstants.JwtTokenConstants.SUBSCRIBED_APIS); - for (Object apiObj : subscribedAPIs) { - JSONObject subApi = - (JSONObject) apiObj; - if (name.equals(subApi.getAsString(APIConstants.JwtTokenConstants.API_NAME)) && - version.equals(subApi.getAsString(APIConstants.JwtTokenConstants.API_VERSION) - )) { - api = subApi; - validationInfoDTO.setAuthorized(true); - - //set throttling attributes if present - String subTier = subApi.getAsString(APIConstants.JwtTokenConstants.SUBSCRIPTION_TIER); - String subPublisher = subApi.getAsString(APIConstants.JwtTokenConstants.API_PUBLISHER); - String subTenant = subApi.getAsString(APIConstants.JwtTokenConstants.SUBSCRIBER_TENANT_DOMAIN); - if (subTier != null) { - validationInfoDTO.setTier(subTier); - AuthenticatorUtils.populateTierInfo(validationInfoDTO, payload, subTier); - } - if (subPublisher != null) { - validationInfoDTO.setApiPublisher(subPublisher); - } - if (subTenant != null) { - validationInfoDTO.setSubscriberOrganization(subTenant); - } - - log.debug("APIKeyValidationInfoDTO populated for API: {}, version: {}.", name, version); - - break; - } - } - if (api == null) { - log.debug("Subscription data not populated in APIKeyValidationInfoDTO for the API: {}, version: {}.", - name, version); - log.error("User's subscription details cannot obtain for the API : {}", name); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.API_AUTH_FORBIDDEN, - APISecurityConstants.API_AUTH_FORBIDDEN_MESSAGE); - } - } - return validationInfoDTO; - } - - private void validateAPIKeyRestrictions(JWTClaimsSet payload, RequestContext requestContext, String apiContext, - String apiVersion) throws APISecurityException { - - String permittedIPList = null; - if (payload.getClaim(APIConstants.JwtTokenConstants.PERMITTED_IP) != null) { - permittedIPList = (String) payload.getClaim(APIConstants.JwtTokenConstants.PERMITTED_IP); - } - - if (StringUtils.isNotEmpty(permittedIPList)) { - // Validate client IP against permitted IPs - String clientIP = requestContext.getClientIp(); - - if (StringUtils.isNotEmpty(clientIP)) { - for (String restrictedIP : permittedIPList.split(",")) { - if (isIpInNetwork(clientIP, restrictedIP.trim())) { - // Client IP is allowed - return; - } - } - if (StringUtils.isNotEmpty(clientIP)) { - log.debug("Invocations to API: {}:{} is not permitted for client with IP: {}", - apiContext, apiVersion, clientIP); - } - - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.API_AUTH_FORBIDDEN, APISecurityConstants.API_AUTH_FORBIDDEN_MESSAGE); - } - - } - - String permittedRefererList = null; - if (payload.getClaim(APIConstants.JwtTokenConstants.PERMITTED_REFERER) != null) { - permittedRefererList = (String) payload.getClaim(APIConstants.JwtTokenConstants.PERMITTED_REFERER); - } - if (StringUtils.isNotEmpty(permittedRefererList)) { - // Validate http referer against the permitted referrers - Map transportHeaderMap = requestContext.getHeaders(); - if (transportHeaderMap != null) { - String referer = transportHeaderMap.get("referer"); - if (StringUtils.isNotEmpty(referer)) { - for (String restrictedReferer : permittedRefererList.split(",")) { - String restrictedRefererRegExp = restrictedReferer.trim() - .replace("*", "[^ ]*"); - if (referer.matches(restrictedRefererRegExp)) { - // Referer is allowed - return; - } - } - if (StringUtils.isNotEmpty(referer)) { - log.debug("Invocations to API: {}:{} is not permitted for referer: {}", - apiContext, apiVersion, referer); - } - } - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.API_AUTH_FORBIDDEN, APISecurityConstants.API_AUTH_FORBIDDEN_MESSAGE); - } - } - } - - private boolean isIpInNetwork(String ip, String cidr) { - - if (StringUtils.isEmpty(ip) || StringUtils.isEmpty(cidr)) { - return false; - } - ip = ip.trim(); - cidr = cidr.trim(); - - if (cidr.contains("/")) { - String[] cidrArr = cidr.split("/"); - if (cidrArr.length < 2 || (ip.contains(".") && !cidr.contains(".")) || - (ip.contains(":") && !cidr.contains(":"))) { - return false; - } - - BigInteger netAddress = ipToBigInteger(cidrArr[0]); - int netBits = Integer.parseInt(cidrArr[1]); - BigInteger givenIP = ipToBigInteger(ip); - - if (ip.contains(".")) { - // IPv4 - return netAddress.shiftRight(IPV4_ADDRESS_BIT_LENGTH - netBits) - .shiftLeft(IPV4_ADDRESS_BIT_LENGTH - netBits).compareTo( - givenIP.shiftRight(IPV4_ADDRESS_BIT_LENGTH - netBits) - .shiftLeft(IPV4_ADDRESS_BIT_LENGTH - netBits)) == 0; - } else if (ip.contains(":")) { - // IPv6 - return netAddress.shiftRight(IPV6_ADDRESS_BIT_LENGTH - netBits) - .shiftLeft(IPV6_ADDRESS_BIT_LENGTH - netBits).compareTo( - givenIP.shiftRight(IPV6_ADDRESS_BIT_LENGTH - netBits) - .shiftLeft(IPV6_ADDRESS_BIT_LENGTH - netBits)) == 0; - } - } else return ip.equals(cidr); - return false; - } - - private BigInteger ipToBigInteger(String ipAddress) { - - InetAddress address; - try { - address = getAddress(ipAddress); - byte[] bytes = address.getAddress(); - return new BigInteger(1, bytes); - } catch (UnknownHostException e) { - //ignore the error and log it - log.error("Error while parsing host IP {}", ipAddress, e); - } - return BigInteger.ZERO; - } - - private InetAddress getAddress(String ipAddress) throws UnknownHostException { - - return InetAddress.getByName(ipAddress); - } - - @Override - public String getChallengeString() { - - return ""; - } - - @Override - public String getName() { - - return "API Key"; - } - - @Override - public int getPriority() { - - return 30; - } - - public static Application getApplication(APIConfig api, JWTClaimsSet payload) { - Application app = null; - - SubscriptionDataStore datastore = - SubscriptionDataHolder.getInstance().getSubscriptionDataStore(api.getOrganizationId()); - if (datastore != null) { - JSONObject appObject = (JSONObject) payload.getClaim(APIConstants.JwtTokenConstants.APPLICATION); - String appUuid = appObject.getAsString("uuid"); - if (!appObject.isEmpty() && !appUuid.isEmpty()) { - app = datastore.getApplicationById(appUuid); - } else { - log.info("Application claim not found in jwt for uuid"); - } - } else { - log.error("Subscription data store is null"); - } - return app; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/APIKeyHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/APIKeyHandler.java deleted file mode 100644 index 03d67d13ea..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/APIKeyHandler.java +++ /dev/null @@ -1,240 +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.security.jwt; - -import com.nimbusds.jwt.JWTClaimsSet; -import com.nimbusds.jwt.SignedJWT; -import com.nimbusds.jwt.proc.BadJWTException; -import com.nimbusds.jwt.proc.DefaultJWTClaimsVerifier; -import net.minidev.json.JSONArray; -import net.minidev.json.JSONObject; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.common.CacheProviderUtil; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.dto.JWTTokenPayloadInfo; -import org.wso2.apk.enforcer.security.Authenticator; -import org.wso2.apk.enforcer.security.jwt.validator.RevokedJWTDataHolder; -import org.wso2.apk.enforcer.util.FilterUtils; -import org.wso2.apk.enforcer.util.JWTUtils; - -import java.security.cert.Certificate; - -/** - * An abstract class which can be used to handle API keys. - */ -public abstract class APIKeyHandler implements Authenticator { - - private static final Logger log = LogManager.getLogger(APIKeyHandler.class); - - /** - * Checks whether a given string is an API key. - * - * @param apiKey - API key string - * @return whether a given string is an API key or not. - */ - public boolean isAPIKey(String apiKey) { - - if (apiKey != null && apiKey.split("\\.").length == 3) { - return true; - } - return false; - } - - /** - * Recognizes internal API key type. - * - * @param jwtClaimsSet jwt claim set in the API key - * @return whether a given API key is an internal API key or not - */ - public boolean isInternalKey(JWTClaimsSet jwtClaimsSet) { - - Object tokenTypeClaim = jwtClaimsSet.getClaim(APIConstants.JwtTokenConstants.TOKEN_TYPE); - if (tokenTypeClaim != null) { - return APIConstants.JwtTokenConstants.INTERNAL_KEY_TOKEN_TYPE.equals(tokenTypeClaim); - } - return false; - } - - /** - * Checks the API key in revoked map. - * - * @param tokenIdentifier token identifier for the API key - * @param splitToken API key segments - * @throws APISecurityException if an invalid API key is passed to the method. - */ - public void checkInRevokedMap(String tokenIdentifier, String[] splitToken) throws APISecurityException { - - if (RevokedJWTDataHolder.isJWTTokenSignatureExistsInRevokedMap(tokenIdentifier)) { - log.debug("API key retrieved from the revoked jwt token map. Token: {}", - FilterUtils.getMaskedToken(splitToken[0])); - log.error("Invalid API Key. {}", FilterUtils.getMaskedToken(splitToken[0])); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - } - - /** - * Ensures whether a given API key is in the cache. - * - * @param tokenIdentifier token identifier for the API key - * @param apiKey API key relevant to the request - * @param payload payload in the API key - * @param splitToken API key segments - * @param apiKeyType API key type - * @param jwtTokenPayloadInfo payload information - * @return whether a given API key was in the cache or not - * @throws APISecurityException if there is an error when checking the token in cache - */ - public boolean isVerifiedApiKeyInCache(String tokenIdentifier, String apiKey, JWTClaimsSet payload, - String[] splitToken, String apiKeyType, - JWTTokenPayloadInfo jwtTokenPayloadInfo, String organization) throws APISecurityException { - - boolean isVerified = false; - if (jwtTokenPayloadInfo != null) { - String cachedToken = jwtTokenPayloadInfo.getAccessToken(); - isVerified = cachedToken.equals(apiKey) && !isJwtTokenExpired(payload, apiKeyType, organization); - } else { - boolean isInvalidInternalAPIKey = - CacheProviderUtil.getOrganizationCache(organization).getInvalidGatewayInternalKeyCache() - .getIfPresent(tokenIdentifier) != null && - apiKey.equals(CacheProviderUtil.getOrganizationCache(organization).getInvalidGatewayInternalKeyCache().getIfPresent(tokenIdentifier)); - boolean isInvalidAPIKey = - CacheProviderUtil.getOrganizationCache(organization).getInvalidGatewayAPIKeyCache() - .getIfPresent(tokenIdentifier) != null && - apiKey.equals(CacheProviderUtil.getOrganizationCache(organization).getInvalidGatewayAPIKeyCache().getIfPresent(tokenIdentifier)); - if (isInvalidInternalAPIKey || isInvalidAPIKey) { - log.debug("API key found in cache for invalid API keys. " + FilterUtils.getMaskedToken(splitToken[0]), - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6601)); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - } - return isVerified; - } - - /** - * Handles API key if it's not found in the cache. - * - * @param signedJWT Signed JWT for the API key - * @param splitToken API key segments. - * @param payload API key payload - * @param apiKeyType API key type - * @return verification status if API key not found in the cache - * @throws APISecurityException if the given API key is not in the cache and able to verify - */ - public boolean verifyTokenWhenNotInCache(Certificate certificate, SignedJWT signedJWT, String[] splitToken, - JWTClaimsSet payload, String apiKeyType, String organization) throws APISecurityException { - - boolean isVerified = false; - log.debug("{} not found in the cache.", apiKeyType); - - isVerified = - JWTUtils.verifyTokenSignature(signedJWT, certificate.getPublicKey()) && !isJwtTokenExpired(payload, - apiKeyType, organization); - return isVerified; - } - - /** - * Checks whether the jwt token is expired or not. - * - * @param payload JWT token payload - * @param keyType API key type - * @return returns true if the JWT token is expired - * @throws APISecurityException when there is an error while checking API key expiry details. - */ - public boolean isJwtTokenExpired(JWTClaimsSet payload, String keyType, String organization) throws APISecurityException { - - DefaultJWTClaimsVerifier jwtClaimsSetVerifier = new DefaultJWTClaimsVerifier(); - jwtClaimsSetVerifier.setMaxClockSkew((int) FilterUtils.getTimeStampSkewInSeconds()); - try { - jwtClaimsSetVerifier.verify(payload); - } catch (BadJWTException e) { - if ("Expired JWT".equals(e.getMessage())) { - log.debug("{} API key is expired.", keyType); - if (APIConstants.JwtTokenConstants.INTERNAL_KEY_TOKEN_TYPE.equals(keyType)) { - CacheProviderUtil.getOrganizationCache(organization).getGatewayInternalKeyDataCache().invalidate(payload.getJWTID()); - CacheProviderUtil.getOrganizationCache(organization).getInvalidGatewayInternalKeyCache().put(payload.getJWTID(), "carbon.super"); - } else { - CacheProviderUtil.getOrganizationCache(organization).getGatewayAPIKeyDataCache().invalidate(payload.getJWTID()); - CacheProviderUtil.getOrganizationCache(organization).getInvalidGatewayAPIKeyCache().put(payload.getJWTID(), "carbon.super"); - } - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - } - return false; - } - - /** - * Checks for API subscriptions. - * - * @param apiContext API context - * @param apiVersion API version - * @param payload Payload information - * @param splitToken API key segments - * @param isOauth indicates OAuth token type - * @return JSON object for the subscribed API - * @throws APISecurityException if error happens while validating subscription details - */ - public static JSONObject validateAPISubscription(String apiContext, String apiVersion, JWTClaimsSet payload, - String[] splitToken, boolean isOauth) - throws APISecurityException { - - JSONObject api = null; - - if (payload.getClaim(APIConstants.JwtTokenConstants.SUBSCRIBED_APIS) != null) { - // Subscription validation - JSONArray subscribedAPIs = - (JSONArray) payload.getClaim(APIConstants.JwtTokenConstants.SUBSCRIBED_APIS); - for (Object subscribedAPI : subscribedAPIs) { - JSONObject subscribedAPIsJSONObject = (JSONObject) subscribedAPI; - if (apiContext - .equals(subscribedAPIsJSONObject.getAsString(APIConstants.JwtTokenConstants.API_CONTEXT)) && - apiVersion - .equals(subscribedAPIsJSONObject.getAsString(APIConstants.JwtTokenConstants.API_VERSION) - )) { - api = subscribedAPIsJSONObject; - break; - } - } - if (api == null) { - log.error("User is not subscribed to access the API."); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.API_AUTH_FORBIDDEN, APISecurityConstants.API_AUTH_FORBIDDEN_MESSAGE); - } - } else { - log.debug("No subscription information found in the token."); - // we perform mandatory authentication for Api Keys - if (!isOauth) { - log.error("User is not subscribed to access the API."); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.API_AUTH_FORBIDDEN, APISecurityConstants.API_AUTH_FORBIDDEN_MESSAGE); - } - } - return api; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/AuthenticatorUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/AuthenticatorUtils.java deleted file mode 100644 index 7f8f91d393..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/AuthenticatorUtils.java +++ /dev/null @@ -1,44 +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.security.jwt; - -import com.nimbusds.jwt.JWTClaimsSet; -import net.minidev.json.JSONObject; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.dto.APIKeyValidationInfoDTO; - -/** - * Utility functions shared between different authenticators. - */ -public class AuthenticatorUtils { - - public static void populateTierInfo(APIKeyValidationInfoDTO validationInfo, JWTClaimsSet payload, - String subTier) { - validationInfo.setTier(subTier); - if (payload.getClaim(APIConstants.JwtTokenConstants.TIER_INFO) != null) { - JSONObject tierInfo = (JSONObject) payload.getClaim( - APIConstants.JwtTokenConstants.TIER_INFO); - if (tierInfo.get(subTier) != null) { - JSONObject subTierInfo = (JSONObject) tierInfo.get(subTier); - validationInfo.setStopOnQuotaReach((Boolean) - subTierInfo.get(APIConstants.JwtTokenConstants.STOP_ON_QUOTA_REACH)); - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JWTAuthenticator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JWTAuthenticator.java deleted file mode 100644 index a500f75899..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JWTAuthenticator.java +++ /dev/null @@ -1,497 +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.security.jwt; - -import com.nimbusds.jwt.JWTClaimsSet; -import com.nimbusds.jwt.SignedJWT; -import com.nimbusds.jwt.util.DateUtils; -import io.opentelemetry.context.Scope; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.common.CacheProviderUtil; -import org.wso2.apk.enforcer.commons.dto.ClaimValueDTO; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.dto.JWTInfoDto; -import org.wso2.apk.enforcer.commons.dto.JWTValidationInfo; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.commons.jwtgenerator.AbstractAPIMgtGatewayJWTGenerator; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.dto.APIKeyValidationInfoDTO; -import org.wso2.apk.enforcer.security.Authenticator; -import org.wso2.apk.enforcer.security.KeyValidator; -import org.wso2.apk.enforcer.security.TokenValidationContext; -import org.wso2.apk.enforcer.security.jwt.validator.JWTValidator; -import org.wso2.apk.enforcer.security.jwt.validator.RevokedJWTDataHolder; -import org.wso2.apk.enforcer.server.RevokedTokenRedisClient; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStore; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingSpan; -import org.wso2.apk.enforcer.tracing.TracingTracer; -import org.wso2.apk.enforcer.tracing.Utils; -import org.wso2.apk.enforcer.util.BackendJwtUtils; -import org.wso2.apk.enforcer.util.FilterUtils; -import org.wso2.apk.enforcer.util.JWTUtils; - -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * Implements the authenticator interface to authenticate request using a JWT token. - */ -public class JWTAuthenticator implements Authenticator { - - private static final Logger log = LogManager.getLogger(JWTAuthenticator.class); - private final boolean isGatewayTokenCacheEnabled; - private AbstractAPIMgtGatewayJWTGenerator jwtGenerator; - - public JWTAuthenticator(final JWTConfigurationDto jwtConfigurationDto, final boolean isGatewayTokenCacheEnabled) { - - this.isGatewayTokenCacheEnabled = isGatewayTokenCacheEnabled; - if (jwtConfigurationDto.isEnabled()) { - this.jwtGenerator = BackendJwtUtils.getApiMgtGatewayJWTGenerator(jwtConfigurationDto); - this.jwtGenerator.setJWTConfigurationDto(jwtConfigurationDto); - } - } - - @Override - public boolean canAuthenticate(RequestContext requestContext) { - String authHeader = getTokenHeader(requestContext.getMatchedResourcePaths()); - - if (!StringUtils.equals(authHeader, "")) { - String authHeaderValue = retrieveAuthHeaderValue(requestContext, authHeader); - return authHeaderValue != null && !StringUtils.containsWhitespace(authHeaderValue) && authHeaderValue.split("\\.").length == 3; - } - return false; - } - - @Override - public AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException { - - TracingTracer tracer = null; - TracingSpan jwtAuthenticatorInfoSpan = null; - Scope jwtAuthenticatorInfoSpanScope = null; - TracingSpan validateScopesSpan = null; - - try { - if (Utils.tracingEnabled()) { - tracer = Utils.getGlobalTracer(); - jwtAuthenticatorInfoSpan = Utils.startSpan(TracingConstants.JWT_AUTHENTICATOR_SPAN, tracer); - jwtAuthenticatorInfoSpanScope = jwtAuthenticatorInfoSpan.getSpan().makeCurrent(); - Utils.setTag(jwtAuthenticatorInfoSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - String authHeader = getTokenHeader(requestContext.getMatchedResourcePaths()); - String jwtToken = retrieveAuthHeaderValue(requestContext, authHeader); - String context = requestContext.getMatchedAPI().getBasePath(); - String version = requestContext.getMatchedAPI().getVersion(); - String organization = requestContext.getMatchedAPI().getOrganizationId(); - String environment = requestContext.getMatchedAPI().getEnvironment(); - - JWTValidationInfo validationInfo = getJwtValidationInfo(jwtToken, organization, environment); - if (RevokedTokenRedisClient.getRevokedTokens().contains(validationInfo.getIdentifier())) { - log.info("Revoked JWT token. ", validationInfo.getIdentifier()); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - if (validationInfo != null) { - if (validationInfo.isValid()) { - List audFromAPI = getAudience(requestContext.getMatchedResourcePaths()); - List audFromToken = validationInfo.getAudience(); - if (!checkAnyExist(audFromAPI, audFromToken)) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - Map claims = validationInfo.getClaims(); - // Validate token type - Object keyType = claims.get("keytype"); - if (keyType != null && !keyType.toString().equalsIgnoreCase(requestContext.getMatchedAPI().getEnvType())) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid key type."); - } - - // Scope validation is only done for tokens that are not of type InternalKey - Object tokenType = claims.get(APIConstants.JwtTokenConstants.TOKEN_TYPE); - if (!isInternalKey(tokenType)) { - // Validate scopes - Scope validateScopesSpanScope = null; - try { - if (Utils.tracingEnabled()) { - validateScopesSpan = Utils.startSpan(TracingConstants.SCOPES_VALIDATION_SPAN, tracer); - validateScopesSpanScope = validateScopesSpan.getSpan().makeCurrent(); - Utils.setTag(validateScopesSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - validateScopes(context, version, requestContext.getMatchedResourcePaths(), validationInfo, - jwtToken); - } finally { - if (Utils.tracingEnabled()) { - validateScopesSpanScope.close(); - Utils.finishSpan(validateScopesSpan); - } - } - } - - log.debug("JWT authentication successful."); - - // Generate or get backend JWT - String endUserToken = null; - - // JWT generator is only set if the backend JWT is enabled - if (this.jwtGenerator != null) { - JWTConfigurationDto configurationDto = this.jwtGenerator.getJWTConfigurationDto(); - Map claimMap = new HashMap<>(); - if (configurationDto != null) { - claimMap = configurationDto.getCustomClaims(); - } - JWTInfoDto jwtInfoDto = FilterUtils.generateJWTInfoDto(null, validationInfo, - null, requestContext); - - // set custom claims get from the CR - jwtInfoDto.setClaims(claimMap); - endUserToken = BackendJwtUtils.generateAndRetrieveJWTToken(this.jwtGenerator, - validationInfo.getIdentifier(), jwtInfoDto, isGatewayTokenCacheEnabled, organization); - // Set generated jwt token as a response header - // Change the backendJWTConfig to API level - requestContext.addOrModifyHeaders(this.jwtGenerator.getJWTConfigurationDto().getJwtHeader(), - endUserToken); - } - - return FilterUtils.generateAuthenticationContext(requestContext, validationInfo.getIdentifier(), - validationInfo, null, endUserToken, jwtToken, true); - } else { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - validationInfo.getValidationCode(), - APISecurityConstants.getAuthenticationFailureMessage(validationInfo.getValidationCode())); - } - } else { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - } - } finally { - if (Utils.tracingEnabled()) { - jwtAuthenticatorInfoSpanScope.close(); - Utils.finishSpan(jwtAuthenticatorInfoSpan); - } - } - - } - - public boolean isInternalKey(Object tokenType) { - return tokenType != null && tokenType.toString().equalsIgnoreCase(APIConstants.JwtTokenConstants.INTERNAL_KEY_TOKEN_TYPE); - } - - private String getTokenHeader(ArrayList matchedResourceConfigs) { - for (ResourceConfig resourceConfig : matchedResourceConfigs) { - if (resourceConfig.getAuthenticationConfig() != null && - resourceConfig.getAuthenticationConfig().getJwtAuthenticationConfig() != null) { - return resourceConfig.getAuthenticationConfig().getJwtAuthenticationConfig().getHeader(); - } - } - return ""; - } - - private List getAudience(ArrayList matchedResourceConfigs) { - List audience = new ArrayList<>(); - for (ResourceConfig resourceConfig : matchedResourceConfigs) { - if (resourceConfig.getAuthenticationConfig() != null && - resourceConfig.getAuthenticationConfig().getJwtAuthenticationConfig() != null) { - return resourceConfig.getAuthenticationConfig().getJwtAuthenticationConfig().getAudience(); - } - } - return audience; - } - - @Override - public String getChallengeString() { - - return "JWT realm=\"APK\""; - } - - @Override - public String getName() { - - return "JWT"; - } - - @Override - public int getPriority() { - - return 10; - } - - private String retrieveAuthHeaderValue(RequestContext requestContext, String header) { - Map headers = requestContext.getHeaders(); - return headers.get(header); - } - - /** - * Validate scopes bound to the resource of the API being invoked against the scopes specified - * in the JWT token payload. - * - * @param apiContext API Context - * @param apiVersion API Version - * @param matchingResources Accessed API resources - * @param jwtValidationInfo Validated JWT Information - * @param jwtToken JWT Token - * @throws APISecurityException in case of scope validation failure - */ - private void validateScopes(String apiContext, String apiVersion, ArrayList matchingResources, - JWTValidationInfo jwtValidationInfo, String jwtToken) throws APISecurityException { - - APIKeyValidationInfoDTO apiKeyValidationInfoDTO = new APIKeyValidationInfoDTO(); - Set scopeSet = new HashSet<>(jwtValidationInfo.getScopes()); - apiKeyValidationInfoDTO.setScopes(scopeSet); - - TokenValidationContext tokenValidationContext = new TokenValidationContext(); - tokenValidationContext.setValidationInfoDTO(apiKeyValidationInfoDTO); - - tokenValidationContext.setAccessToken(jwtToken); - // since matching resources has same method for all, just get the first element's method is adequate. - // i.e. graphQL matching resources has same operation type for a request. - tokenValidationContext.setHttpVerb(matchingResources.get(0).getMethod().toString()); - tokenValidationContext.setMatchingResourceConfigs(matchingResources); - tokenValidationContext.setContext(apiContext); - tokenValidationContext.setVersion(apiVersion); - - boolean valid = KeyValidator.validateScopes(tokenValidationContext); - if (valid) { - log.debug("Scope validation was successful for the resource."); - } - } - - /** - * Validate whether the user is subscribed to the invoked API using consumer key. If subscribed, validate - * the API information embedded within the Subscription against the information from the request context. - * - * @param validationInfo Token validation related details. This will be populated based on the available data - * during the subscription validation. - * @param name API name - * @param version API version - * @param context API context - * @param consumerKey Consumer key extracted from the jwt token claim set - * @param envType The environment type, i.e. PRODUCTION or SANDBOX - * @param organization Organization extracted from the request context - * @param tokenPrefix The split token - * @param matchedAPI - * @throws APISecurityException if the user is not subscribed to the API - */ - private void validateSubscriptionUsingConsumerKey(APIKeyValidationInfoDTO validationInfo, String name, - String version, String context, String consumerKey, - String envType, String organization, String tokenPrefix, - APIConfig matchedAPI) throws APISecurityException { - - validationInfo.setApiName(name); - validationInfo.setApiVersion(version); - validationInfo.setApiContext(context); - validationInfo.setConsumerKey(consumerKey); - validationInfo.setType(matchedAPI.getApiType()); - validationInfo.setEnvType(envType); - validationInfo.setEnvironment(matchedAPI.getEnvironment()); - validationInfo.setSecurityScheme(APIConstants.API_SECURITY_OAUTH2); - validationInfo.setSubscriberOrganization(organization); - validationInfo.setApiContext(matchedAPI.getBasePath()); - validationInfo.setApiVersion(matchedAPI.getVersion()); - validationInfo.setApiName(matchedAPI.getName()); - KeyValidator.validateSubscriptionUsingConsumerKey(validationInfo); - - if (validationInfo.isAuthorized()) { - if (log.isDebugEnabled()) { - log.debug("User is subscribed to the API: " + name + ", " + "version: " + version + ". Token:" + " " + - FilterUtils.getMaskedToken(tokenPrefix)); - } - } else { - if (log.isDebugEnabled()) { - log.debug("User is not subscribed to access the API: " + name + ", version: " + version + ". " + - "Token: " + FilterUtils.getMaskedToken(tokenPrefix)); - } - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.API_AUTH_FORBIDDEN, APISecurityConstants.API_AUTH_FORBIDDEN_MESSAGE); - } - } - - /** - * Validate whether the token is a valid JWT and generate the JWTValidationInfo object. - * - * @param jwtToken The full JWT token - * @param organization organization of the API - * @param environment environment of the API - * @return - * @throws APISecurityException - */ - private JWTValidationInfo getJwtValidationInfo(String jwtToken, String organization, String environment) throws APISecurityException { - - if (isGatewayTokenCacheEnabled) { - String[] jwtParts = jwtToken.split("\\."); - String signature = jwtParts[2]; - Object validCacheToken = CacheProviderUtil.getOrganizationCache(organization).getGatewayKeyCache() - .getIfPresent(signature); - if (validCacheToken != null) { - JWTValidationInfo validationInfo = (JWTValidationInfo) validCacheToken; - if (!isJWTExpired(validationInfo)) { - if (!StringUtils.equals(validationInfo.getToken(), jwtToken)) { - log.warn("Suspected tampered token; a JWT token with the same signature is " + - "already available in the cache. Tampered token: " + FilterUtils.getMaskedToken(jwtToken)); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid JWT token"); - } - if (RevokedJWTDataHolder.isJWTTokenSignatureExistsInRevokedMap(validationInfo.getIdentifier())) { - log.debug("Token found in the revoked jwt token map."); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid JWT token"); - } - return validationInfo; - } else { - CacheProviderUtil.getOrganizationCache(organization).getGatewayKeyCache().invalidate(signature); - CacheProviderUtil.getOrganizationCache(organization).getInvalidTokenCache().put(signature, true); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED, - APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED_MESSAGE); - } - } else if (CacheProviderUtil.getOrganizationCache(organization).getInvalidTokenCache() - .getIfPresent(signature) != null) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - } - - SignedJWT signedJWT; - JWTClaimsSet jwtClaimsSet; - SignedJWTInfo signedJWTInfo; - Scope decodeTokenHeaderSpanScope = null; - TracingSpan decodeTokenHeaderSpan = null; - try { - if (Utils.tracingEnabled()) { - TracingTracer tracer = Utils.getGlobalTracer(); - decodeTokenHeaderSpan = Utils.startSpan(TracingConstants.DECODE_TOKEN_HEADER_SPAN, tracer); - decodeTokenHeaderSpanScope = decodeTokenHeaderSpan.getSpan().makeCurrent(); - Utils.setTag(decodeTokenHeaderSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - signedJWT = SignedJWT.parse(jwtToken); - jwtClaimsSet = signedJWT.getJWTClaimsSet(); - signedJWTInfo = new SignedJWTInfo(jwtToken, signedJWT, jwtClaimsSet); - } catch (ParseException | IllegalArgumentException e) { - log.error("Failed to decode the token header. {}", e.getMessage()); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Not a JWT token. Failed to decode the " + - "token header", e); - } finally { - if (Utils.tracingEnabled()) { - decodeTokenHeaderSpanScope.close(); - Utils.finishSpan(decodeTokenHeaderSpan); - } - } - - String signature = signedJWT.getSignature().toString(); - String jwtTokenIdentifier = StringUtils.isNotEmpty(jwtClaimsSet.getJWTID()) ? jwtClaimsSet.getJWTID() : - signature; - - // check whether the token is revoked - String jwtHeader = signedJWT.getHeader().toString(); - if (RevokedJWTDataHolder.isJWTTokenSignatureExistsInRevokedMap(jwtTokenIdentifier)) { - log.debug("Token retrieved from the revoked jwt token map. Token: " + - FilterUtils.getMaskedToken(jwtHeader)); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid JWT token"); - } - - try { - // Get issuer - String issuer = jwtClaimsSet.getIssuer(); - SubscriptionDataStore subscriptionDataStore = SubscriptionDataHolder.getInstance() - .getSubscriptionDataStore(organization); - if (subscriptionDataStore == null) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - JWTValidator jwtValidator = subscriptionDataStore.getJWTValidatorByIssuer(issuer, environment); - // If no validator found for the issuer, we are not caching the token. - if (jwtValidator == null) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - - JWTValidationInfo jwtValidationInfo = jwtValidator.validateToken(jwtToken, signedJWTInfo); - if (isGatewayTokenCacheEnabled) { - // Add token to tenant token cache - if (jwtValidationInfo.isValid()) { - CacheProviderUtil.getOrganizationCache(organization).getGatewayKeyCache().put(signature, - jwtValidationInfo); - } else { - CacheProviderUtil.getOrganizationCache(organization).getInvalidTokenCache().put(signature, true); - } - } - return jwtValidationInfo; - } catch (EnforcerException e) { - log.error("JWT Validation failed", e); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - } - } - - /** - * Check whether the jwt token is expired or not. - * - * @param payload The payload of the JWT token - * @return boolean true if the token is not expired, false otherwise - */ - private Boolean isJWTExpired(JWTValidationInfo payload) { - - long timestampSkew = FilterUtils.getTimeStampSkewInSeconds(); - Date now = new Date(); - Date exp = new Date(payload.getExpiryTime()); - return !DateUtils.isAfter(exp, now, timestampSkew); - } - - /** - * Checks if at least one element from list1 exists in list2. - * - * @param list1 The first list to check. - * @param list2 The second list to check against. - * @return true if list1 is empty else if at least one element from list1 exists in list2, otherwise false. - */ - public static boolean checkAnyExist(List list1, List list2) { - - if (list1 == null || list1.size() == 0) { - return true; - } - return list1.stream().anyMatch(list2::contains); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JwtTransformerAnnotation.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JwtTransformerAnnotation.java deleted file mode 100644 index 8f524ca915..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JwtTransformerAnnotation.java +++ /dev/null @@ -1,39 +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.security.jwt; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -/** - * Annotation to retrieve data about the jwt transformer class. - */ - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) - -public @interface JwtTransformerAnnotation { - // make enable true to enable the custom claim mapping class for the issuer. - boolean enabled() default false; - // Name of the class. "ex:CustomJWTTransformer" - String name(); - // Issuer. ex: "https://localhost:9443/oauth2/token" - String issuer(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/Oauth2Authenticator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/Oauth2Authenticator.java deleted file mode 100644 index 7ef9831954..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/Oauth2Authenticator.java +++ /dev/null @@ -1,568 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.security.jwt; - -import com.nimbusds.jwt.JWTClaimsSet; -import com.nimbusds.jwt.SignedJWT; -import com.nimbusds.jwt.util.DateUtils; -import io.opentelemetry.context.Scope; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.common.CacheProviderUtil; -import org.wso2.apk.enforcer.commons.dto.ClaimValueDTO; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.dto.JWTInfoDto; -import org.wso2.apk.enforcer.commons.dto.JWTValidationInfo; -import org.wso2.apk.enforcer.commons.jwtgenerator.AbstractAPIMgtGatewayJWTGenerator; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.dto.APIKeyValidationInfoDTO; -import org.wso2.apk.enforcer.models.ApplicationKeyMapping; -import org.wso2.apk.enforcer.models.ApplicationMapping; -import org.wso2.apk.enforcer.models.Subscription; -import org.wso2.apk.enforcer.security.Authenticator; -import org.wso2.apk.enforcer.security.KeyValidator; -import org.wso2.apk.enforcer.security.TokenValidationContext; -import org.wso2.apk.enforcer.security.jwt.validator.JWTConstants; -import org.wso2.apk.enforcer.security.jwt.validator.JWTValidator; -import org.wso2.apk.enforcer.security.jwt.validator.RevokedJWTDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStore; -import org.wso2.apk.enforcer.server.RevokedTokenRedisClient; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingSpan; -import org.wso2.apk.enforcer.tracing.TracingTracer; -import org.wso2.apk.enforcer.tracing.Utils; -import org.wso2.apk.enforcer.util.BackendJwtUtils; -import org.wso2.apk.enforcer.util.FilterUtils; -import org.wso2.apk.enforcer.util.JWTUtils; - -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Implements the authenticator interface to authenticate request using a JWT token. - */ -public class Oauth2Authenticator implements Authenticator { - - private static final Logger log = LogManager.getLogger(Oauth2Authenticator.class); - private final boolean isGatewayTokenCacheEnabled; - private AbstractAPIMgtGatewayJWTGenerator jwtGenerator; - - public Oauth2Authenticator(final JWTConfigurationDto jwtConfigurationDto, final boolean isGatewayTokenCacheEnabled) { - - this.isGatewayTokenCacheEnabled = isGatewayTokenCacheEnabled; - if (jwtConfigurationDto.isEnabled()) { - this.jwtGenerator = BackendJwtUtils.getApiMgtGatewayJWTGenerator(jwtConfigurationDto); - this.jwtGenerator.setJWTConfigurationDto(jwtConfigurationDto); - } - } - - @Override - public boolean canAuthenticate(RequestContext requestContext) { - String authHeader = getTokenHeader(requestContext.getMatchedResourcePaths()); - - if (!StringUtils.equals(authHeader, "")) { - String authHeaderValue = retrieveAuthHeaderValue(requestContext, authHeader); - - // Check keyword bearer in header to prevent conflicts with custom authentication - // (that maybe added with custom filters / interceptors / opa) - // which also includes a jwt in the auth header yet with a scheme other than 'bearer'. - // - // StringUtils.startsWithIgnoreCase(null, "bearer") = false - // StringUtils.startsWithIgnoreCase("abc", "bearer") = false - // StringUtils.startsWithIgnoreCase("Bearer abc", "bearer") = true - return StringUtils.startsWithIgnoreCase(authHeaderValue, JWTConstants.BEARER) && authHeaderValue.trim().split("\\s+").length == 2 && authHeaderValue.split("\\.").length == 3; - } - return false; - } - - @Override - public AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException { - - TracingTracer tracer = null; - TracingSpan jwtAuthenticatorInfoSpan = null; - Scope jwtAuthenticatorInfoSpanScope = null; - TracingSpan validateSubscriptionSpan = null; - TracingSpan validateScopesSpan = null; - - try { - if (Utils.tracingEnabled()) { - tracer = Utils.getGlobalTracer(); - jwtAuthenticatorInfoSpan = Utils.startSpan(TracingConstants.JWT_AUTHENTICATOR_SPAN, tracer); - jwtAuthenticatorInfoSpanScope = jwtAuthenticatorInfoSpan.getSpan().makeCurrent(); - Utils.setTag(jwtAuthenticatorInfoSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - String authHeader = getTokenHeader(requestContext.getMatchedResourcePaths()); - String jwtToken = retrieveAuthHeaderValue(requestContext, authHeader); - String[] splitToken = jwtToken.split("\\s"); - // Extract the token when it is sent as bearer token. i.e Authorization: Bearer - if (splitToken.length > 1) { - jwtToken = splitToken[1]; - } - String context = requestContext.getMatchedAPI().getBasePath(); - String name = requestContext.getMatchedAPI().getName(); - String envType = requestContext.getMatchedAPI().getEnvType(); - String version = requestContext.getMatchedAPI().getVersion(); - String organization = requestContext.getMatchedAPI().getOrganizationId(); - String environment = requestContext.getMatchedAPI().getEnvironment(); - - JWTValidationInfo validationInfo = getJwtValidationInfo(jwtToken, organization, environment); - if (RevokedTokenRedisClient.getRevokedTokens().contains(validationInfo.getIdentifier())) { - log.info("Revoked JWT token. ", validationInfo.getIdentifier()); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - if (validationInfo != null) { - if (validationInfo.isValid()) { - Map claims = validationInfo.getClaims(); - // Validate token type - Object keyType = claims.get("keytype"); - if (keyType != null && !keyType.toString().equalsIgnoreCase(requestContext.getMatchedAPI().getEnvType())) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid key type."); - } - - // Validate subscriptions - APIKeyValidationInfoDTO apiKeyValidationInfoDTO = new APIKeyValidationInfoDTO(); - Scope validateSubscriptionSpanScope = null; - boolean isSystemAPI = requestContext.getMatchedAPI().isSystemAPI(); - boolean isGatewayLevelSubscriptionValidationEnabled = ConfigHolder.getInstance().getConfig() - .getMandateSubscriptionValidation(); - try { - // If subscription validation is mandated at Gateway level, all API invocations should undergo - // subscription validation. When not mandated, we check whether the API has enabled - // subscription validation. - if (!isSystemAPI && (isGatewayLevelSubscriptionValidationEnabled || requestContext.getMatchedAPI() - .isSubscriptionValidation())) { - if (Utils.tracingEnabled()) { - validateSubscriptionSpan = - Utils.startSpan(TracingConstants.SUBSCRIPTION_VALIDATION_SPAN, tracer); - validateSubscriptionSpanScope = validateSubscriptionSpan.getSpan().makeCurrent(); - Utils.setTag(validateSubscriptionSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - - // Get consumer key from the JWT token claim set - String consumerKey = validationInfo.getConsumerKey(); - - // Subscription validation using consumer key - if (consumerKey != null) { - validateSubscriptionUsingConsumerKey(apiKeyValidationInfoDTO, name, version, context, - consumerKey, envType, organization, - splitToken, requestContext.getMatchedAPI()); - } else { - log.error("Error while extracting consumer key from token"); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - "Invalid JWT token. Error while extracting consumer key from token"); - } - } else { - // In this case, the application related properties are populated so that analytics - // could provide much better insights. - // Since application notion becomes less meaningful with subscription validation disabled, - // the application name would be populated under the convention "anon:" - JWTUtils.updateApplicationNameForSubscriptionDisabledFlow(apiKeyValidationInfoDTO, - APIConstants.KeyManager.DEFAULT_KEY_MANAGER); - } - } finally { - if (Utils.tracingEnabled()) { - if (validateSubscriptionSpan != null) { - validateSubscriptionSpanScope.close(); - Utils.finishSpan(validateSubscriptionSpan); - } - } - } - - // Validate scopes - Scope validateScopesSpanScope = null; - try { - if (Utils.tracingEnabled()) { - validateScopesSpan = Utils.startSpan(TracingConstants.SCOPES_VALIDATION_SPAN, tracer); - validateScopesSpanScope = validateScopesSpan.getSpan().makeCurrent(); - Utils.setTag(validateScopesSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - validateScopes(context, version, requestContext.getMatchedResourcePaths(), validationInfo, - jwtToken); - } finally { - if (Utils.tracingEnabled()) { - validateScopesSpanScope.close(); - Utils.finishSpan(validateScopesSpan); - } - } - log.debug("JWT authentication successful."); - - // Generate or get backend JWT - String endUserToken = null; - - // jwt generator is only set if the backend jwt is enabled - if (this.jwtGenerator != null) { - JWTConfigurationDto configurationDto = this.jwtGenerator.getJWTConfigurationDto(); - Map claimMap = new HashMap<>(); - if (configurationDto != null) { - claimMap = configurationDto.getCustomClaims(); - } - JWTInfoDto jwtInfoDto = FilterUtils.generateJWTInfoDto(null, validationInfo, - apiKeyValidationInfoDTO, requestContext); - - // set custom claims get from the CR - jwtInfoDto.setClaims(claimMap); - endUserToken = BackendJwtUtils.generateAndRetrieveJWTToken(this.jwtGenerator, - validationInfo.getIdentifier(), jwtInfoDto, isGatewayTokenCacheEnabled, organization); - // Set generated jwt token as a response header - // Change the backendJWTConfig to API level - requestContext.addOrModifyHeaders(this.jwtGenerator.getJWTConfigurationDto().getJwtHeader(), - endUserToken); - } - - AuthenticationContext authenticationContext = FilterUtils.generateAuthenticationContext(requestContext, validationInfo.getIdentifier(), - validationInfo, apiKeyValidationInfoDTO, endUserToken, jwtToken, true); - - // For subscription rate limiting, it is required to populate dynamic metadata - SubscriptionDataStore datastore = SubscriptionDataHolder.getInstance(). - getSubscriptionDataStore(organization); - ApplicationKeyMapping keyMapping = datastore.getMatchingApplicationKeyMapping(validationInfo.getConsumerKey(), requestContext.getMatchedAPI().getEnvType(), APIConstants.API_SECURITY_OAUTH2, - requestContext.getMatchedAPI().getEnvironment()); - - if(keyMapping != null) { - String applicationId = keyMapping.getApplicationUUID(); - Set appMappings = datastore.getMatchingApplicationMappings(applicationId); - for (ApplicationMapping appMapping : appMappings) { - String subscriptionUUID = appMapping.getSubscriptionUUID(); - Subscription subscription = datastore.getMatchingSubscription(subscriptionUUID); - if (requestContext.getMatchedAPI().getName().equals(subscription.getSubscribedApi().getName())) { - // Validate API version - Pattern pattern = subscription.getSubscribedApi().getVersionRegexPattern(); - String versionToMatch = requestContext.getMatchedAPI().getVersion(); - Matcher matcher = pattern.matcher(versionToMatch); - if (matcher.matches()) { - if (!"Unlimited".equals(subscription.getRatelimitTier()) && subscription.getRatelimitTier() != null && !subscription.getRatelimitTier().isEmpty()) { - String subscriptionId = subscription.getSubscribedApi().getName() + ":" + - applicationId + subscription.getSubscriptionId(); - requestContext.addMetadataToMap("ratelimit:subscription", subscriptionId); - requestContext.addMetadataToMap("ratelimit:usage-policy", subscription.getRatelimitTier()); - requestContext.addMetadataToMap("ratelimit:organization", subscription.getOrganization()); - requestContext.addMetadataToMap("ratelimit:organization-and-rlpolicy", String.format("%s-%s", subscription.getOrganization(), subscription.getRatelimitTier())); - } - break; - } - } - } - } - return authenticationContext; - } else { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - validationInfo.getValidationCode(), - APISecurityConstants.getAuthenticationFailureMessage(validationInfo.getValidationCode())); - } - } else { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - } - } finally { - if (Utils.tracingEnabled()) { - jwtAuthenticatorInfoSpanScope.close(); - Utils.finishSpan(jwtAuthenticatorInfoSpan); - } - } - - } - - private String getTokenHeader(ArrayList matchedResourceConfigs) { - for (ResourceConfig resourceConfig : matchedResourceConfigs) { - if (resourceConfig.getAuthenticationConfig() != null && - resourceConfig.getAuthenticationConfig().getOauth2AuthenticationConfig() != null) { - return resourceConfig.getAuthenticationConfig().getOauth2AuthenticationConfig().getHeader(); - } - } - return ""; - } - - @Override - public String getChallengeString() { - - return "Bearer realm=\"APK\""; - } - - @Override - public String getName() { - - return "Oauth2"; - } - - @Override - public int getPriority() { - - return 10; - } - - private String retrieveAuthHeaderValue(RequestContext requestContext, String header) { - Map headers = requestContext.getHeaders(); - return headers.get(header); - } - - /** - * Validate scopes bound to the resource of the API being invoked against the scopes specified - * in the JWT token payload. - * - * @param apiContext API Context - * @param apiVersion API Version - * @param matchingResources Accessed API resources - * @param jwtValidationInfo Validated JWT Information - * @param jwtToken JWT Token - * @throws APISecurityException in case of scope validation failure - */ - private void validateScopes(String apiContext, String apiVersion, ArrayList matchingResources, - JWTValidationInfo jwtValidationInfo, String jwtToken) throws APISecurityException { - - APIKeyValidationInfoDTO apiKeyValidationInfoDTO = new APIKeyValidationInfoDTO(); - Set scopeSet = new HashSet<>(jwtValidationInfo.getScopes()); - apiKeyValidationInfoDTO.setScopes(scopeSet); - - TokenValidationContext tokenValidationContext = new TokenValidationContext(); - tokenValidationContext.setValidationInfoDTO(apiKeyValidationInfoDTO); - - tokenValidationContext.setAccessToken(jwtToken); - // since matching resources has same method for all, just get the first element's method is adequate. - // i.e. graphQL matching resources has same operation type for a request. - tokenValidationContext.setHttpVerb(matchingResources.get(0).getMethod().toString()); - tokenValidationContext.setMatchingResourceConfigs(matchingResources); - tokenValidationContext.setContext(apiContext); - tokenValidationContext.setVersion(apiVersion); - - boolean valid = KeyValidator.validateScopes(tokenValidationContext); - if (valid) { - log.debug("Scope validation was successful for the resource."); - } - } - - /** - * Validate whether the user is subscribed to the invoked API using consumer key. If subscribed, validate - * the API information embedded within the Subscription against the information from the request context. - * - * @param validationInfo Token validation related details. This will be populated based on the available data - * during the subscription validation. - * @param name API name - * @param version API version - * @param context API context - * @param consumerKey Consumer key extracted from the jwt token claim set - * @param envType The environment type, i.e. PRODUCTION or SANDBOX - * @param organization Organization extracted from the request context - * @param splitToken The split token - * @param matchedAPI - * @throws APISecurityException if the user is not subscribed to the API - */ - private void validateSubscriptionUsingConsumerKey(APIKeyValidationInfoDTO validationInfo, String name, - String version, String context, String consumerKey, - String envType, String organization, String[] splitToken, - APIConfig matchedAPI) throws APISecurityException { - - validationInfo.setApiName(name); - validationInfo.setApiVersion(version); - validationInfo.setApiContext(context); - validationInfo.setConsumerKey(consumerKey); - validationInfo.setType(matchedAPI.getApiType()); - validationInfo.setEnvType(envType); - validationInfo.setEnvironment(matchedAPI.getEnvironment()); - validationInfo.setSecurityScheme(APIConstants.API_SECURITY_OAUTH2); - validationInfo.setSubscriberOrganization(organization); - validationInfo.setApiContext(matchedAPI.getBasePath()); - validationInfo.setApiVersion(matchedAPI.getVersion()); - validationInfo.setApiName(matchedAPI.getName()); - KeyValidator.validateSubscriptionUsingConsumerKey(validationInfo); - - if (validationInfo.isAuthorized()) { - if (log.isDebugEnabled()) { - log.debug("User is subscribed to the API: " + name + ", " + "version: " + version + ". Token:" + " " + - FilterUtils.getMaskedToken(splitToken[0])); - } - } else { - if (log.isDebugEnabled()) { - log.debug("User is not subscribed to access the API: " + name + ", version: " + version + ". " + - "Token: " + FilterUtils.getMaskedToken(splitToken[0])); - } - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHORIZED.getCode(), - APISecurityConstants.API_AUTH_FORBIDDEN, APISecurityConstants.API_AUTH_FORBIDDEN_MESSAGE); - } - } - - /** - * Validate whether the token is a valid JWT and generate the JWTValidationInfo object. - * - * @param jwtToken The full JWT token - * @param organization organization of the API - * @param environment environment of the API - * @return - * @throws APISecurityException - */ - private JWTValidationInfo getJwtValidationInfo(String jwtToken, String organization, String environment) throws APISecurityException { - - if (isGatewayTokenCacheEnabled) { - String[] jwtParts = jwtToken.split("\\."); - String signature = jwtParts[2]; - Object validCacheToken = CacheProviderUtil.getOrganizationCache(organization).getGatewayKeyCache() - .getIfPresent(signature); - if (validCacheToken != null) { - JWTValidationInfo validationInfo = (JWTValidationInfo) validCacheToken; - if (!isJWTExpired(validationInfo)) { - if (!StringUtils.equals(validationInfo.getToken(), jwtToken)) { - log.warn("Suspected tampered token; a JWT token with the same signature is " + - "already available in the cache. Tampered token: " + FilterUtils.getMaskedToken(jwtToken)); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid JWT token"); - } - if (RevokedJWTDataHolder.isJWTTokenSignatureExistsInRevokedMap(validationInfo.getIdentifier())) { - log.debug("Token found in the revoked jwt token map."); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid JWT token"); - } - return validationInfo; - } else { - CacheProviderUtil.getOrganizationCache(organization).getGatewayKeyCache().invalidate(signature); - CacheProviderUtil.getOrganizationCache(organization).getInvalidTokenCache().put(signature, true); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED, - APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED_MESSAGE); - } - } else if (CacheProviderUtil.getOrganizationCache(organization).getInvalidTokenCache() - .getIfPresent(signature) != null) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - } - - SignedJWT signedJWT; - JWTClaimsSet jwtClaimsSet; - SignedJWTInfo signedJWTInfo; - Scope decodeTokenHeaderSpanScope = null; - TracingSpan decodeTokenHeaderSpan = null; - try { - if (Utils.tracingEnabled()) { - TracingTracer tracer = Utils.getGlobalTracer(); - decodeTokenHeaderSpan = Utils.startSpan(TracingConstants.DECODE_TOKEN_HEADER_SPAN, tracer); - decodeTokenHeaderSpanScope = decodeTokenHeaderSpan.getSpan().makeCurrent(); - Utils.setTag(decodeTokenHeaderSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - signedJWT = SignedJWT.parse(jwtToken); - jwtClaimsSet = signedJWT.getJWTClaimsSet(); - signedJWTInfo = new SignedJWTInfo(jwtToken, signedJWT, jwtClaimsSet); - } catch (ParseException | IllegalArgumentException e) { - log.error("Failed to decode the token header. {}", e.getMessage()); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Not a JWT token. Failed to decode the " + - "token header", e); - } finally { - if (Utils.tracingEnabled()) { - decodeTokenHeaderSpanScope.close(); - Utils.finishSpan(decodeTokenHeaderSpan); - } - } - - String signature = signedJWT.getSignature().toString(); - String jwtTokenIdentifier = StringUtils.isNotEmpty(jwtClaimsSet.getJWTID()) ? jwtClaimsSet.getJWTID() : - signature; - - // check whether the token is revoked - String jwtHeader = signedJWT.getHeader().toString(); - if (RevokedJWTDataHolder.isJWTTokenSignatureExistsInRevokedMap(jwtTokenIdentifier)) { - log.debug("Token retrieved from the revoked jwt token map. Token: " + - FilterUtils.getMaskedToken(jwtHeader)); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, "Invalid JWT token"); - } - - try { - // Get issuer - String issuer = jwtClaimsSet.getIssuer(); - SubscriptionDataStore subscriptionDataStore = SubscriptionDataHolder.getInstance() - .getSubscriptionDataStore(organization); - if (subscriptionDataStore == null) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - JWTValidator jwtValidator = subscriptionDataStore.getJWTValidatorByIssuer(issuer, environment); - // If no validator found for the issuer, we are not caching the token. - if (jwtValidator == null) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - - // If no validator found for the issuer, we are not caching the token. - if (jwtValidator == null) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - - JWTValidationInfo jwtValidationInfo = jwtValidator.validateToken(jwtToken, signedJWTInfo); - if (isGatewayTokenCacheEnabled) { - // Add token to tenant token cache - if (jwtValidationInfo.isValid()) { - CacheProviderUtil.getOrganizationCache(organization).getGatewayKeyCache().put(signature, - jwtValidationInfo); - } else { - CacheProviderUtil.getOrganizationCache(organization).getInvalidTokenCache().put(signature, true); - } - } - return jwtValidationInfo; - } catch (EnforcerException e) { - log.error("JWT Validation failed", e); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE); - } - } - - /** - * Check whether the jwt token is expired or not. - * - * @param payload The payload of the JWT token - * @return boolean true if the token is not expired, false otherwise - */ - private Boolean isJWTExpired(JWTValidationInfo payload) { - - long timestampSkew = FilterUtils.getTimeStampSkewInSeconds(); - Date now = new Date(); - Date exp = new Date(payload.getExpiryTime()); - return !DateUtils.isAfter(exp, now, timestampSkew); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/SignedJWTInfo.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/SignedJWTInfo.java deleted file mode 100644 index 082dc48a49..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/SignedJWTInfo.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2020, 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.security.jwt; - -import com.nimbusds.jwt.JWTClaimsSet; -import com.nimbusds.jwt.SignedJWT; - -import java.io.Serializable; - -/** - * JWT internal Representation. - */ -public class SignedJWTInfo implements Serializable { - - private String token; - private SignedJWT signedJWT; - private JWTClaimsSet jwtClaimsSet; - private ValidationStatus validationStatus = ValidationStatus.NOT_VALIDATED; - - /** - * To verify validation status of SignedJWTInfo - */ - public enum ValidationStatus { - NOT_VALIDATED, INVALID, VALID - } - - public SignedJWTInfo(String token, SignedJWT signedJWT, JWTClaimsSet jwtClaimsSet) { - - this.token = token; - this.signedJWT = signedJWT; - this.jwtClaimsSet = jwtClaimsSet; - } - - public SignedJWTInfo() { - - } - - public SignedJWT getSignedJWT() { - - return signedJWT; - } - - public void setSignedJWT(SignedJWT signedJWT) { - - this.signedJWT = signedJWT; - } - - public JWTClaimsSet getJwtClaimsSet() { - - return jwtClaimsSet; - } - - public void setJwtClaimsSet(JWTClaimsSet jwtClaimsSet) { - - this.jwtClaimsSet = jwtClaimsSet; - } - - public String getToken() { - - return token; - } - - public void setToken(String token) { - - this.token = token; - } - - public ValidationStatus getValidationStatus() { - return validationStatus; - } - - public void setValidationStatus(ValidationStatus validationStatus) { - this.validationStatus = validationStatus; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/UnsecuredAPIAuthenticator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/UnsecuredAPIAuthenticator.java deleted file mode 100644 index 5904dcaee5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/UnsecuredAPIAuthenticator.java +++ /dev/null @@ -1,98 +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.security.jwt; - -import io.opentelemetry.context.Scope; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.GeneralErrorCodeConstants; -import org.wso2.apk.enforcer.models.API; -import org.wso2.apk.enforcer.security.Authenticator; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStore; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingSpan; -import org.wso2.apk.enforcer.tracing.TracingTracer; -import org.wso2.apk.enforcer.tracing.Utils; -import org.wso2.apk.enforcer.util.FilterUtils; - -/** - * Implements the authenticator interface to authenticate non-secured APIs. - */ - -public class UnsecuredAPIAuthenticator implements Authenticator { - - @Override - public boolean canAuthenticate(RequestContext requestContext) { - // Retrieve the disable security value. If security is disabled for all matching resources, - // then you can proceed directly with the authentication. - for (ResourceConfig resourceConfig : requestContext.getMatchedResourcePaths()) { - if (!resourceConfig.getAuthenticationConfig().isDisabled() || requestContext.getMatchedAPI().isTransportSecurity()) { - return false; - } - } - return true; - } - - @Override - public AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException { - - TracingSpan unsecuredApiAuthenticatorSpan = null; - Scope unsecuredApiAuthenticatorSpanScope = null; - try { - if (Utils.tracingEnabled()) { - TracingTracer tracer = Utils.getGlobalTracer(); - unsecuredApiAuthenticatorSpan = Utils - .startSpan(TracingConstants.UNSECURED_API_AUTHENTICATOR_SPAN, tracer); - unsecuredApiAuthenticatorSpanScope = unsecuredApiAuthenticatorSpan.getSpan().makeCurrent(); - Utils.setTag(unsecuredApiAuthenticatorSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - String organization = requestContext.getMatchedAPI().getOrganizationId(); - return FilterUtils.generateAuthenticationContextForUnsecured(requestContext); - } finally { - if (Utils.tracingEnabled()) { - unsecuredApiAuthenticatorSpanScope.close(); - Utils.finishSpan(unsecuredApiAuthenticatorSpan); - } - } - } - - @Override - public String getChallengeString() { - - return ""; - } - - @Override - public String getName() { - - return "Unsecured"; - } - - @Override - public int getPriority() { - - return -20; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/JWTConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/JWTConstants.java deleted file mode 100644 index 5a4e6552a5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/JWTConstants.java +++ /dev/null @@ -1,35 +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.security.jwt.validator; - -/** - * Holds the constants related to JWT validation. - */ -public class JWTConstants { - public static final String AUTHORIZATION = "authorization"; - public static final String RSA = "RSA"; - public static final String BEARER = "bearer"; - public static final String UNAVAILABLE = "Token is not available in cache"; - public static final String VALID = "valid"; - public static final String INVALID = "invalid"; - public static final String DEFAULT_JWT_GENERATOR_CLASS_NAME = "org.wso2.apk.enforcer.commons." + - "jwtgenerator.APIMgtGatewayJWTGeneratorImpl"; - public static final String DEFAULT_JWT_TRANSFORMER_CLASS_NAME = "org.wso2.apk.enforcer.commons." + - "jwttransformer.DefaultJWTTransformer"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/JWTValidator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/JWTValidator.java deleted file mode 100644 index 38e7c0eb70..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/JWTValidator.java +++ /dev/null @@ -1,179 +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.security.jwt.validator; - -import com.nimbusds.jose.JOSEException; -import com.nimbusds.jose.jwk.ECKey; -import com.nimbusds.jose.jwk.JWK; -import com.nimbusds.jose.jwk.JWKSet; -import com.nimbusds.jose.jwk.RSAKey; -import com.nimbusds.jwt.JWTClaimsSet; -import com.nimbusds.jwt.SignedJWT; -import com.nimbusds.jwt.util.DateUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.dto.JWTValidationInfo; -import org.wso2.apk.enforcer.commons.exception.JWTGeneratorException; -import org.wso2.apk.enforcer.commons.jwttransformer.JWTTransformer; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.dto.ExtendedTokenIssuerDto; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.security.jwt.SignedJWTInfo; -import org.wso2.apk.enforcer.util.JWKSClient; -import org.wso2.apk.enforcer.util.JWTUtils; - -import java.security.PublicKey; -import java.security.cert.Certificate; -import java.security.interfaces.ECPublicKey; -import java.security.interfaces.RSAPublicKey; -import java.text.ParseException; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -/** - * Class responsible to validate jwt. This should validate the JWT signature, expiry time. - * validating the sub, aud, iss can be made optional. - */ -public class JWTValidator { - private static final Logger logger = LogManager.getLogger(JWTValidator.class); - private JWKSet jwkSet; - JWTTransformer jwtTransformer; - ExtendedTokenIssuerDto tokenIssuer; - JWKSClient jwksClient; - - public JWTValidator(ExtendedTokenIssuerDto tokenIssuer) throws EnforcerException { - jwtTransformer = ConfigHolder.getInstance().getConfig().getJwtTransformer(tokenIssuer.getIssuer()); - jwtTransformer.loadConfiguration(tokenIssuer); - this.tokenIssuer = tokenIssuer; - if (tokenIssuer.getJwksConfigurationDTO() != null && tokenIssuer.getJwksConfigurationDTO().isEnabled() && StringUtils.isNotEmpty(tokenIssuer.getJwksConfigurationDTO().getUrl())) { - Certificate certificate = tokenIssuer.getJwksConfigurationDTO().getCertificate(); - if (certificate != null) { - jwksClient = new JWKSClient(tokenIssuer.getJwksConfigurationDTO().getUrl(), List.of(certificate)); - } else { - jwksClient = new JWKSClient(tokenIssuer.getJwksConfigurationDTO().getUrl(), Collections.emptyList()); - } - } - } - - public JWTValidationInfo validateToken(String token, SignedJWTInfo signedJWTInfo) throws EnforcerException { - JWTValidationInfo jwtValidationInfo = new JWTValidationInfo(); - boolean state; - try { - state = validateSignature(signedJWTInfo.getSignedJWT()); - if (state) { - JWTClaimsSet jwtClaimsSet = signedJWTInfo.getJwtClaimsSet(); - state = validateTokenExpiry(jwtClaimsSet); - if (state) { - jwtValidationInfo.setConsumerKey(jwtTransformer.getTransformedConsumerKey(jwtClaimsSet)); - jwtValidationInfo.setScopes(jwtTransformer.getTransformedScopes(jwtClaimsSet)); - JWTClaimsSet transformedJWTClaimSet = jwtTransformer.transform(jwtClaimsSet); - createJWTValidationInfoFromJWT(jwtValidationInfo, transformedJWTClaimSet); - jwtValidationInfo.setKeyManager(tokenIssuer.getName()); - jwtValidationInfo.setIdentifier(JWTUtils.getJWTTokenIdentifier(signedJWTInfo)); - jwtValidationInfo.setJwtClaimsSet(signedJWTInfo.getJwtClaimsSet()); - jwtValidationInfo.setToken(token); - jwtValidationInfo.setAudience(jwtClaimsSet.getAudience()); - return jwtValidationInfo; - } - jwtValidationInfo.setValidationCode(APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED); - logger.debug("Token is expired."); - } else { - jwtValidationInfo.setValidationCode(APIConstants.KeyValidationStatus.API_AUTH_INVALID_CREDENTIALS); - logger.debug("Token signature is invalid."); - } - } catch (ParseException | JWTGeneratorException e) { - throw new EnforcerException("Error while parsing JWT", e); - } - jwtValidationInfo.setValid(false); - return jwtValidationInfo; - } - - protected boolean validateSignature(SignedJWT signedJWT) throws EnforcerException { - try { - String keyID = signedJWT.getHeader().getKeyID(); - if (jwksClient != null) { - // Check JWKSet Available in Cache - if (jwkSet == null) { - jwkSet = jwksClient.getJWKSet(); - } - JWK jwkSetKeyByKeyId = jwkSet.getKeyByKeyId(keyID); - if (jwkSetKeyByKeyId == null) { - jwkSet = jwksClient.getJWKSet(); - } - jwkSetKeyByKeyId = jwkSet.getKeyByKeyId(keyID); - if (jwkSetKeyByKeyId instanceof RSAKey) { - RSAKey keyByKeyId = (RSAKey) jwkSetKeyByKeyId; - RSAPublicKey rsaPublicKey = keyByKeyId.toRSAPublicKey(); - if (rsaPublicKey != null) { - return JWTUtils.verifyTokenSignature(signedJWT, rsaPublicKey); - } - } else if (jwkSetKeyByKeyId instanceof ECKey) { - ECKey keyByKeyId = (ECKey) jwkSetKeyByKeyId; - ECPublicKey ecPublicKey = keyByKeyId.toECPublicKey(); - if (ecPublicKey != null) { - return JWTUtils.verifyTokenSignature(signedJWT, ecPublicKey); - } - } else { - throw new EnforcerException("Key Algorithm not supported"); - } - } - if (tokenIssuer.getCertificate() != null) { - logger.debug("Retrieve certificate from Token issuer and validating"); - PublicKey publicKey = tokenIssuer.getCertificate().getPublicKey(); - return JWTUtils.verifyTokenSignature(signedJWT, publicKey); - } else { - throw new EnforcerException("Certificate not found for validation"); - } - } catch (JOSEException e) { - throw new EnforcerException("JWT Signature verification failed", e); - } - } - - protected boolean validateTokenExpiry(JWTClaimsSet jwtClaimsSet) { - - long timestampSkew = 5; //TODO : Read from config. - Date now = new Date(); - Date exp = jwtClaimsSet.getExpirationTime(); - return exp == null || DateUtils.isAfter(exp, now, timestampSkew); - } - - private void createJWTValidationInfoFromJWT(JWTValidationInfo jwtValidationInfo, JWTClaimsSet jwtClaimsSet) - throws ParseException { - jwtValidationInfo.setValid(true); - jwtValidationInfo.setClaims(jwtClaimsSet.getClaims()); - jwtValidationInfo.setExpiryTime(jwtClaimsSet.getExpirationTime().getTime()); - jwtValidationInfo.setUser(jwtClaimsSet.getSubject()); - if (jwtClaimsSet.getClaim(APIConstants.JwtTokenConstants.SCOPE) != null) { - if (jwtClaimsSet.getClaim(APIConstants.JwtTokenConstants.SCOPE) instanceof List) { - jwtValidationInfo.setScopes(jwtClaimsSet.getStringListClaim(APIConstants.JwtTokenConstants.SCOPE)); - } else { - jwtValidationInfo.setScopes(Arrays.asList( - jwtClaimsSet.getStringClaim(APIConstants.JwtTokenConstants.SCOPE) - .split(APIConstants.JwtTokenConstants.SCOPE_DELIMITER))); - } - } - } - - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java deleted file mode 100644 index cf5878f1f3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2020, 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.security.jwt.validator; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Singleton which stores the revoked JWT map. - */ -public class RevokedJWTDataHolder { - - private static final Logger log = LogManager.getLogger(RevokedJWTDataHolder.class); - private static Map revokedJWTMap = new ConcurrentHashMap<>(); - private static RevokedJWTDataHolder instance = new RevokedJWTDataHolder(); - - public void init() { - } - - /** - * Adds a given key,value pair to the revoke map. - * @param key key to be added. - * @param value value to be added. - */ - public void addRevokedJWTToMap(String key, Long value) { - if (key != null && value != null) { - log.debug("Adding revoked JWT key, value pair to the revoked map :" + key + " , " + value); - revokedJWTMap.put(key, value); - } - } - - /** - * Checks whether a given signature is in the map. - * @param jwtSignature signature to be checked. - * @return true if it exists and false otherwise. - */ - public static boolean isJWTTokenSignatureExistsInRevokedMap(String jwtSignature) { - return revokedJWTMap.containsKey(jwtSignature); - } - - private RevokedJWTDataHolder() { - - } - - /** - * Fetches the revoke map. - * @return - */ - public Map getRevokedJWTMap() { - return revokedJWTMap; - } - - /** - * This method can be used to get the singleton instance of this class. - * @return the singleton instance. - */ - public static RevokedJWTDataHolder getInstance() { - return instance; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/mtls/MTLSAuthenticator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/mtls/MTLSAuthenticator.java deleted file mode 100644 index 4dfab7c433..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/mtls/MTLSAuthenticator.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.security.mtls; - -import io.opentelemetry.context.Scope; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.security.Authenticator; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingSpan; -import org.wso2.apk.enforcer.tracing.TracingTracer; -import org.wso2.apk.enforcer.tracing.Utils; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.security.KeyStore; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.util.Map; -import java.util.Objects; - -/** - * Implements the authenticator interface to authenticate request using MTLS. - */ -public class MTLSAuthenticator implements Authenticator { - private static final Logger log = LogManager.getLogger(MTLSAuthenticator.class); - private final boolean isEnableClientValidation = ConfigHolder.getInstance().getConfig().getMtlsInfo() - .isEnableClientValidation(); - private final boolean isClientCertificateEncode = ConfigHolder.getInstance().getConfig().getMtlsInfo() - .isClientCertificateEncode(); - - @Override - public boolean canAuthenticate(RequestContext requestContext) { - String cert = ""; - - if (isEnableClientValidation) { - cert = requestContext.getClientCertificate(); - } else if (requestContext.getHeaders().containsKey(FilterUtils.getCertificateHeaderName())) { - cert = requestContext.getHeaders().get(FilterUtils.getCertificateHeaderName()); - } - if (StringUtils.isBlank(cert)) { - log.debug("Could not find a valid client certificate in the request: {} for the API: {}:{} ", - requestContext.getMatchedResourcePaths().get(0).getPath(), requestContext.getMatchedAPI().getName(), - requestContext.getMatchedAPI().getVersion()); - return false; - } - return true; - } - - @Override - public AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException { - TracingTracer tracer; - TracingSpan mtlsApiAuthenticatorSpan = null; - Scope mtlsApiAuthenticatorSpanScope = null; - - try { - if (Utils.tracingEnabled()) { - tracer = Utils.getGlobalTracer(); - mtlsApiAuthenticatorSpan = Utils.startSpan(TracingConstants.MTLS_API_AUTHENTICATOR_SPAN, tracer); - mtlsApiAuthenticatorSpanScope = mtlsApiAuthenticatorSpan.getSpan().makeCurrent(); - Utils.setTag(mtlsApiAuthenticatorSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - - AuthenticationContext authenticationContext = new AuthenticationContext(); - KeyStore trustStore = requestContext.getMatchedAPI().getTrustStore(); - boolean authenticated = false; - - try { - X509Certificate clientCert = getClientCertificate(requestContext); - String clientCertificateAlias = MtlsUtils - .getMatchedCertificateAliasFromTrustStore(clientCert, trustStore); - if (StringUtils.isBlank(clientCertificateAlias)) { - log.debug("Provided client certificate in request: {} is not in the truststore of the API: {}:{} ", - requestContext.getMatchedResourcePaths().get(0).getPath(), - requestContext.getMatchedAPI().getName(), requestContext.getMatchedAPI().getVersion()); - clientCert = null; - } - if (!Objects.isNull(clientCert)) { - authenticated = true; - String subjectDN = clientCert.getSubjectDN().getName(); - authenticationContext.setUsername(subjectDN); - } - } catch (CertificateException e) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, "Invalid client certificate"); - } - - String apiName = requestContext.getMatchedAPI().getName(); - String apiVersion = requestContext.getMatchedAPI().getVersion(); - String apiUUID = requestContext.getMatchedAPI().getUuid(); - - authenticationContext.setAuthenticated(authenticated); - authenticationContext.setApiUUID(apiUUID); - - return authenticationContext; - } finally { - if (Utils.tracingEnabled()) { - mtlsApiAuthenticatorSpanScope.close(); - Utils.finishSpan(mtlsApiAuthenticatorSpan); - } - } - } - - private X509Certificate getClientCertificate(RequestContext requestContext) throws CertificateException { - String certContent = ""; - - if (isEnableClientValidation) { - String encodedCert = requestContext.getClientCertificate(); - if (StringUtils.isNotBlank(encodedCert)) { - certContent = MtlsUtils.getCertContent(encodedCert, true); - } - } else { - Map headers = requestContext.getHeaders(); - if (headers.containsKey(FilterUtils.getCertificateHeaderName())) { - String cert = requestContext.getHeaders().get(FilterUtils.getCertificateHeaderName()); - requestContext.setClientCertificate(cert); - if (StringUtils.isNotBlank(cert)) { - certContent = MtlsUtils.getCertContent(cert, isClientCertificateEncode); - } - } - } - if (StringUtils.isNotBlank(certContent)) { - return MtlsUtils.getX509Cert(certContent); - } - log.debug("Provided client certificate in the request: {} for the API: {}:{} is invalid.", - requestContext.getMatchedResourcePaths().get(0).getPath(), requestContext.getMatchedAPI().getName(), - requestContext.getMatchedAPI().getVersion()); - return null; - } - - @Override - public String getChallengeString() { - return "Mutual SSL realm=\"APK\""; - } - - @Override - public String getName() { - return APIConstants.API_SECURITY_MUTUAL_SSL_NAME; - } - - @Override - public int getPriority() { - return -15; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/mtls/MtlsUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/mtls/MtlsUtils.java deleted file mode 100644 index 25d0b70ad4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/mtls/MtlsUtils.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.security.mtls; - -import org.apache.commons.codec.binary.Base64; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.api.Certificate; -import org.wso2.apk.enforcer.constants.APIConstants; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.util.List; -import java.util.Objects; - -/** - * Common functions for certificates. - */ -public class MtlsUtils { - private static final Logger log = LogManager.getLogger(MtlsUtils.class); - public static boolean isPublicCertificate(String cert) { - return cert.contains(APIConstants.BEGIN_CERTIFICATE_STRING) && - cert.contains(APIConstants.END_CERTIFICATE_STRING); - } - - public static String getCertContent(String cert) { - return getCertContent(cert, false); - } - public static String getCertContent(String cert, boolean isEncoded) { - if (isEncoded) { - try { - cert = URLDecoder.decode(cert, "UTF-8"); - } catch (UnsupportedEncodingException e) { - log.debug("Provided client certificate is unable to decode."); - throw new SecurityException(e); - } - } - if (isPublicCertificate(cert)) { - String content = cert.replaceAll(APIConstants.BEGIN_CERTIFICATE_STRING, "") - .replaceAll(APIConstants.END_CERTIFICATE_STRING, ""); - return content.trim(); - } - log.debug("Provided client certificate is not a public certificate."); - return ""; - } - - public static KeyStore createTrustStore(List clientCertificates) throws KeyStoreException { - KeyStore trustStore = KeyStore.getInstance("JKS"); - try { - trustStore.load(null, null); - } catch (IOException | NoSuchAlgorithmException | CertificateException e) { - log.debug("Creating the client certificate truststore was unsuccessful."); - throw new SecurityException(e); - } - for (Certificate certificate : clientCertificates) { - X509Certificate x509cert; - String alias = certificate.getAlias(); - String cert = certificate.getContent().toStringUtf8(); - String certContent = getCertContent(cert); - try { - x509cert = getX509Cert(certContent); - } catch (CertificateException e) { - throw new SecurityException(e); - } - trustStore.setCertificateEntry(alias, x509cert); - } - return trustStore; - } - - public static X509Certificate getX509Cert(String certContent) - throws CertificateException { - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - byte[] bytes = Base64.decodeBase64(certContent); - X509Certificate x509Certificate; - try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes)) { - x509Certificate = - (X509Certificate) cf.generateCertificate(byteArrayInputStream); - } catch (IOException e) { - log.error("Unable to generate x509 certificate format."); - throw new CertificateException(e); - } - return x509Certificate; - } - - public static String getMatchedCertificateAliasFromTrustStore(X509Certificate certificate, KeyStore trustStore) - throws CertificateException { - String alias = null; - try { - if (!Objects.isNull(trustStore)) { - alias = trustStore.getCertificateAlias(certificate); - } else { - log.debug("The API truststore has not been initialized."); - } - } catch (KeyStoreException e) { - log.debug("Error occurred while checking the API truststore."); - throw new CertificateException(e); - } - return alias; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/oauth/IntrospectInfo.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/oauth/IntrospectInfo.java deleted file mode 100644 index 86399bf3a8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/oauth/IntrospectInfo.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2020, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.security.oauth; - -import com.google.gson.annotations.SerializedName; - -/** - * Class to hold the token introspection response. - */ -public class IntrospectInfo { - - @SerializedName("active") - private boolean active; - @SerializedName("client_id") - private String clientId; - @SerializedName("device_id") - private String deviceId; - @SerializedName("exp") - private long expiry; - @SerializedName("iat") - private long iat; - @SerializedName("nbf") - private long nbf; - @SerializedName("scope") - private String scope; - @SerializedName("token_type") - private String tokenType; - @SerializedName("username") - private String username; - - public boolean isActive() { - - return active; - } - - public void setActive(boolean active) { - - this.active = active; - } - - public String getClientId() { - - return clientId; - } - - public void setClientId(String clientId) { - - this.clientId = clientId; - } - - public String getDeviceId() { - - return deviceId; - } - - public void setDeviceId(String deviceId) { - - this.deviceId = deviceId; - } - - public long getExpiry() { - - return expiry; - } - - public void setExpiry(long expiry) { - - this.expiry = expiry; - } - - public long getIat() { - - return iat; - } - - public void setIat(long iat) { - - this.iat = iat; - } - - public long getNbf() { - - return nbf; - } - - public void setNbf(long nbf) { - - this.nbf = nbf; - } - - public String getScope() { - - return scope; - } - - public void setScope(String scope) { - - this.scope = scope; - } - - public String getTokenType() { - - return tokenType; - } - - public void setTokenType(String tokenType) { - - this.tokenType = tokenType; - } - - public String getUsername() { - - return username; - } - - public void setUsername(String username) { - - this.username = username; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/oauth/OAuthAuthenticator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/oauth/OAuthAuthenticator.java deleted file mode 100644 index e5586be20d..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/oauth/OAuthAuthenticator.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (c) 2020, 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.security.oauth; - -import com.google.gson.Gson; -import io.opentelemetry.context.Scope; -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpEntity; -import org.apache.http.HttpHeaders; -import org.apache.http.NameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.message.BasicNameValuePair; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.security.AccessTokenInfo; -import org.wso2.apk.enforcer.security.Authenticator; -import org.wso2.apk.enforcer.security.jwt.validator.JWTValidator; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingSpan; -import org.wso2.apk.enforcer.tracing.TracingTracer; -import org.wso2.apk.enforcer.tracing.Utils; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.ArrayList; -import java.util.Base64; -import java.util.List; -import java.util.Map; - -/** - * An API consumer authenticator which authenticates user requests using - * the OAuth protocol. This implementation uses some default token/delimiter - * values to parse OAuth headers, but if needed these settings can be overridden - * through the APIManagerConfiguration. - * - * //TODO: Complete the implementation. - */ -public class OAuthAuthenticator implements Authenticator { - private static final Log log = LogFactory.getLog(OAuthAuthenticator.class); - private List keyManagerList; - - protected JWTValidator jwtValidator; - - private String kmEndpoint = "https://localhost:9443/oauth2"; - private String securityHeader = HttpHeaders.AUTHORIZATION; - private String defaultAPIHeader = "WSO2_AM_API_DEFAULT_VERSION"; - private String consumerKeyHeaderSegment = "Bearer"; - private String oauthHeaderSplitter = ","; - private String consumerKeySegmentDelimiter = " "; - private String securityContextHeader; - private boolean removeOAuthHeadersFromOutMessage = true; - private boolean removeDefaultAPIHeaderFromOutMessage = true; - private String clientDomainHeader = "referer"; - private String requestOrigin; - private String remainingAuthHeader; - private boolean isMandatory; - - public OAuthAuthenticator() { - } - - public OAuthAuthenticator(String authorizationHeader, boolean isMandatory, boolean removeOAuthHeader, - List keyManagerList) { - this.securityHeader = authorizationHeader; - this.removeOAuthHeadersFromOutMessage = removeOAuthHeader; - this.isMandatory = isMandatory; - this.keyManagerList = keyManagerList; - } - - @Override - public boolean canAuthenticate(RequestContext requestContext) { - String token = requestContext.getHeaders().get("authorization"); - return !token.contains("\\."); - } - - @Override - public AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException { - TracingSpan oAuthSpan = null; - Scope oAuthSpanScope = null; - try { - if (Utils.tracingEnabled()) { - TracingTracer tracer = Utils.getGlobalTracer(); - oAuthSpan = Utils.startSpan(TracingConstants.OAUTH_AUTHENTICATOR_SPAN, tracer); - oAuthSpanScope = oAuthSpan.getSpan().makeCurrent(); - Utils.setTag(oAuthSpan, APIConstants.LOG_TRACE_ID, - ThreadContext.get(APIConstants.LOG_TRACE_ID)); - } - String token = requestContext.getHeaders().get("authorization"); - AccessTokenInfo accessTokenInfo = new AccessTokenInfo(); - - if (token == null || !token.toLowerCase().contains("bearer")) { - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_MISSING_CREDENTIALS, "Missing Credentials"); - } - token = token.split("\\s")[1]; - - try { - IntrospectInfo introspectInfo = validateToken(token); - accessTokenInfo.setAccessToken(token); - accessTokenInfo.setConsumerKey(introspectInfo.getClientId()); - } catch (IOException e) { - throw new SecurityException(e); - } - - AuthenticationContext authContext = new AuthenticationContext(); - authContext.setRawToken(token); - return authContext; - } finally { - if (Utils.tracingEnabled()) { - oAuthSpanScope.close(); - Utils.finishSpan(oAuthSpan); - } - } - } - - @Override - public int getPriority() { - return 0; - } - - /** - * Extracts the customer API key from the OAuth Authentication header. If the required - * security header is present in the provided map, it will be removed from the map - * after processing. - * - * @param headersMap Map of HTTP headers - * @return extracted customer key value or null if the required header is not present - */ - public String extractCustomerKeyFromAuthHeader(Map headersMap) { - - //From 1.0.7 version of this component onwards remove the OAuth authorization header from - // the message is configurable. So we dont need to remove headers at this point. - String authHeader = (String) headersMap.get(securityHeader); - if (authHeader == null) { - if (log.isDebugEnabled()) { - log.debug("OAuth2 Authentication: Expected authorization header with the name '" - .concat(securityHeader).concat("' was not found.")); - } - return null; - } - - ArrayList remainingAuthHeaders = new ArrayList<>(); - String consumerKey = null; - boolean consumerkeyFound = false; - String[] headers = authHeader.split(oauthHeaderSplitter); - if (headers != null) { - for (int i = 0; i < headers.length; i++) { - String[] elements = headers[i].split(consumerKeySegmentDelimiter); - if (elements != null && elements.length > 1) { - int j = 0; - boolean isConsumerKeyHeaderAvailable = false; - for (String element : elements) { - if (!"".equals(element.trim())) { - if (consumerKeyHeaderSegment.equals(elements[j].trim())) { - isConsumerKeyHeaderAvailable = true; - } else if (isConsumerKeyHeaderAvailable) { - consumerKey = removeLeadingAndTrailing(elements[j].trim()); - consumerkeyFound = true; - } - } - j++; - } - } - if (!consumerkeyFound) { - remainingAuthHeaders.add(headers[i]); - } else { - consumerkeyFound = false; - } - } - } - remainingAuthHeader = String.join(oauthHeaderSplitter, remainingAuthHeaders); - return consumerKey; - } - - private String removeLeadingAndTrailing(String base) { - String result = base; - - if (base.startsWith("\"") || base.endsWith("\"")) { - result = base.replace("\"", ""); - } - return result.trim(); - } - - public String getChallengeString() { - return "Bearer realm=\"WSO2 API Manager\""; - } - - @Override - public String getName() { - return "OAuth"; - } - - - /** - * Validate the token via the token introspection. - * - * @param accessToken : The access token which needs to be validated - * @return The IntrospectInfo object - * @throws IOException : If any error occurred during invoking the introspect endpoint. - */ - private IntrospectInfo validateToken(String accessToken) throws IOException { - URL url = new URL(kmEndpoint + "/introspect"); - try (CloseableHttpClient httpClient = (CloseableHttpClient) FilterUtils.getHttpClient(url.getProtocol())) { - HttpPost introspectRequest = new HttpPost(kmEndpoint + "/introspect"); - List params = new ArrayList<>(); - NameValuePair token = new BasicNameValuePair("token", accessToken); - params.add(token); - introspectRequest.setEntity(new UrlEncodedFormEntity(params)); - introspectRequest.setHeader("Content-type", "application/x-www-form-urlencoded"); - introspectRequest.setHeader("Authorization", "Basic " + - Base64.getEncoder().encodeToString("admin:admin".getBytes())); - try (CloseableHttpResponse response = httpClient.execute(introspectRequest)) { - if (response.getStatusLine().getStatusCode() == 200) { - HttpEntity entity = response.getEntity(); - try (InputStream content = entity.getContent()) { - return new Gson().fromJson(IOUtils.toString(content), IntrospectInfo.class); - } - } else { - return null; - } - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/AuthServer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/AuthServer.java deleted file mode 100644 index 38ac92af25..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/AuthServer.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2020, 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.server; - -import io.grpc.Server; -import io.grpc.ServerInterceptors; -import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; -import io.grpc.netty.shaded.io.netty.channel.EventLoopGroup; -import io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoopGroup; -import io.grpc.netty.shaded.io.netty.channel.socket.nio.NioServerSocketChannel; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.analytics.AccessLoggingService; -import org.wso2.apk.enforcer.api.APIFactory; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.config.dto.AuthServiceConfigurationDto; -import org.wso2.apk.enforcer.config.dto.ThreadPoolConfig; -import org.wso2.apk.enforcer.discovery.ConfigDiscoveryClient; -import org.wso2.apk.enforcer.grpc.ExtAuthService; - import org.wso2.apk.enforcer.grpc.ExternalProcessorService; -import org.wso2.apk.enforcer.grpc.HealthService; -import org.wso2.apk.enforcer.grpc.interceptors.AccessLogInterceptor; -import org.wso2.apk.enforcer.grpc.interceptors.OpenTelemetryInterceptor; -import org.wso2.apk.enforcer.jmx.JMXAgent; -import org.wso2.apk.enforcer.metrics.MetricsManager; -import org.wso2.apk.enforcer.security.jwt.validator.RevokedJWTDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreUtil; -import org.wso2.apk.enforcer.tracing.TracerFactory; -import org.wso2.apk.enforcer.tracing.TracingException; -import org.wso2.apk.enforcer.tracing.Utils; -import org.wso2.apk.enforcer.util.TLSUtils; - -import java.io.IOException; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import javax.net.ssl.SSLException; - -/** - * gRPC netty based server that handles the incoming requests. - */ -public class AuthServer { - - private static final Logger logger = LogManager.getLogger(AuthServer.class); - - public static void main(String[] args) { - try { - // initialize the config holder - ConfigHolder.getInstance(); - - // wait until configurations are fetched from cds - CountDownLatch latch = new CountDownLatch(1); - ConfigDiscoveryClient cds = ConfigDiscoveryClient.init(latch); - cds.requestInitConfig(); - try { - latch.await(); - } catch (InterruptedException e) { - logger.error("Error while waiting for configurations from adapter", - ErrorDetails.errorLog(LoggingConstants.Severity.BLOCKER, 6700), e); - System.exit(1); - } - - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - - // rest api call initialization happens here - APIFactory.getInstance().init(); - - // Initialize tracing objects - if (enforcerConfig.getTracingConfig().isTracingEnabled()) { - try { - TracerFactory.getInstance().init(); - Utils.setTracingEnabled(true); - logger.info("Tracing is enabled."); - } catch (TracingException e) { - logger.error("Error enabling tracing", - ErrorDetails.errorLog(LoggingConstants.Severity.CRITICAL, 6901), e); - // prevent further tracing activation by disabling the config - Utils.setTracingEnabled(false); - } - } else { - logger.debug("Tracing is disabled."); - } - - // Create a new server to listen on port 8081 - Server server = initServer(); - - // Enable global filters - if (enforcerConfig.getAnalyticsConfig().isEnabled() || - enforcerConfig.getMetricsConfig().isMetricsEnabled()) { - AccessLoggingService accessLoggingService = new AccessLoggingService(); - accessLoggingService.init(); - if (enforcerConfig.getMetricsConfig().isMetricsEnabled()) { - //Initialize metrics - MetricsManager.initializeMetrics(enforcerConfig.getMetricsConfig()); - } - if (enforcerConfig.getAnalyticsConfig().isEnabled()) { - logger.info("analytics filter is enabled."); - } - } else { - logger.debug("analytics filter is disabled."); - } - // Start receiving revoked tokens from redis cache - RevokedTokenRedisClient.retrieveAndSubscribe(); - - // Start the server - server.start(); - logger.info("Sever started Listening in port : " + 8081); - - // Initialize JMX Agent - JMXAgent.initJMXAgent(); - SubscriptionDataStoreUtil.initializeLoadingTasks();; - SubscriptionDataStoreUtil.getInstance().loadStartupArtifacts(); - RevokedJWTDataHolder.getInstance().init(); - - // Create a new server to listen on port 8082 - RestServer restServer = new RestServer(); - restServer.initServer(); - - // Don't exit the main thread. Wait until server is terminated. - server.awaitTermination(); - } catch (IOException e) { - logger.error("Error while starting the enforcer gRPC server or http server.", - ErrorDetails.errorLog(LoggingConstants.Severity.BLOCKER, 6702), e); - System.exit(1); - } catch (InterruptedException e) { - logger.error("Enforcer server main thread interrupted.", - ErrorDetails.errorLog(LoggingConstants.Severity.BLOCKER, 6703), e); - System.exit(1); - } catch (Exception ex) { - // Printing the stack trace in case logger might not have been initialized - ex.printStackTrace(); - System.exit(1); - } - } - - private static Server initServer() throws SSLException { - final EventLoopGroup bossGroup = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors()); - final EventLoopGroup workerGroup = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors() * 2); - AuthServiceConfigurationDto authServerConfig = ConfigHolder.getInstance().getConfig().getAuthService(); - ThreadPoolConfig threadPoolConfig = authServerConfig.getThreadPool(); - EnforcerWorkerPool enforcerWorkerPool = new EnforcerWorkerPool(threadPoolConfig.getCoreSize(), - threadPoolConfig.getMaxSize(), threadPoolConfig.getKeepAliveTime(), threadPoolConfig.getQueueSize(), - Constants.EXTERNAL_AUTHZ_THREAD_GROUP, Constants.EXTERNAL_AUTHZ_THREAD_ID); - return NettyServerBuilder.forPort(authServerConfig.getPort()) - .keepAliveTime(authServerConfig.getKeepAliveTime(), TimeUnit.SECONDS).bossEventLoopGroup(bossGroup) - .workerEventLoopGroup(workerGroup) - .addService(ServerInterceptors.intercept(new ExtAuthService(), new OpenTelemetryInterceptor(), - new AccessLogInterceptor())) - .addService(new HealthService()) - .addService(new ExternalProcessorService()) -// .addService(ServerInterceptors.intercept(new WebSocketFrameService(), new AccessLogInterceptor())) - .maxInboundMessageSize(authServerConfig.getMaxMessageSize()) - .maxInboundMetadataSize(authServerConfig.getMaxHeaderLimit()).channelType(NioServerSocketChannel.class) - .executor(enforcerWorkerPool.getExecutor()) - .sslContext(TLSUtils.buildGRPCServerSSLContext()) - .build(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/Constants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/Constants.java deleted file mode 100644 index f5d14cf291..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/Constants.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2020, 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.server; - -/** - * Constants related to gRPC analytics/auth server components. - */ -public class Constants { - - public static final String EXTERNAL_AUTHZ_THREAD_GROUP = "External Authentication Service Thread Group"; - public static final String EXTERNAL_AUTHZ_THREAD_ID = "ExtAuthService"; - - public static final String ANALYTICS_THREAD_GROUP = "Analytics Receiver Service Thread Group"; - public static final String ANALYTICS_THREAD_ID = "AnalyticsReceiver"; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/EnforcerThreadPoolExecutor.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/EnforcerThreadPoolExecutor.java deleted file mode 100644 index d9f5868848..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/EnforcerThreadPoolExecutor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2020, 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.server; - -import org.wso2.apk.enforcer.grpc.ExtAuthService; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * This is the thread pool executor class which runs the executor service threads. {@link ExtAuthService} runs using - * this thread pool when requests are received. - */ -public class EnforcerThreadPoolExecutor extends ThreadPoolExecutor { - - public EnforcerThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, - BlockingQueue workQueue, ThreadFactory threadFactory) { - super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory); - - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/EnforcerWorkerPool.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/EnforcerWorkerPool.java deleted file mode 100644 index 7a11dee3af..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/EnforcerWorkerPool.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2020, 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.server; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * Class that holds the thread pool that serves the external auth requests coming from the router component. - */ -public class EnforcerWorkerPool { - private final BlockingQueue blockingQueue; - private final ThreadPoolExecutor executor; - private static final Logger log = LogManager.getLogger(EnforcerWorkerPool.class); - - public EnforcerWorkerPool(int core, int max, int keepAlive, int queueLength, String threadGroupName, - String threadGroupId) { - this.blockingQueue = queueLength == -1 ? new LinkedBlockingQueue() : new LinkedBlockingQueue(queueLength); - this.executor = new EnforcerThreadPoolExecutor(core, max, (long) keepAlive, TimeUnit.SECONDS, - this.blockingQueue, new NativeThreadFactory(new ThreadGroup(threadGroupName), threadGroupId)); - } - - public ThreadPoolExecutor getExecutor() { - return executor; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/HttpRequestHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/HttpRequestHandler.java deleted file mode 100644 index 7a65c2f4f6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/HttpRequestHandler.java +++ /dev/null @@ -1,179 +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.server; - -import com.google.protobuf.ByteString; -import io.envoyproxy.envoy.service.auth.v3.CheckRequest; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.ThreadContext; -import org.wso2.apk.enforcer.commons.constants.GraphQLConstants; -import org.wso2.apk.enforcer.api.API; -import org.wso2.apk.enforcer.api.APIFactory; -import org.wso2.apk.enforcer.api.ResponseObject; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.HttpConstants; -import org.wso2.apk.enforcer.graphql.GraphQLPayloadUtils; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.util.ArrayList; -import java.util.Map; - -/** - * This class handles the request coming via the external auth gRPC service. - */ -public class HttpRequestHandler implements RequestHandler { - private static final Logger logger = LogManager.getLogger(RequestHandler.class); - - public ResponseObject process(CheckRequest request) { - - // Handle the '/ready' request separately. - if (APIConstants.ReadinessCheck.ENDPOINT.equals(request.getAttributes().getRequest().getHttp().getPath())) { - return processReadyRequest(); - } - - API matchedAPI = APIFactory.getInstance().getMatchedAPI(request); - if (matchedAPI == null) { - ResponseObject responseObject = new ResponseObject(); - responseObject.setStatusCode(APIConstants.StatusCodes.NOTFOUND.getCode()); - responseObject.setErrorCode(APIConstants.StatusCodes.NOTFOUND.getValue()); - responseObject.setDirectResponse(true); - responseObject.setErrorMessage(APIConstants.NOT_FOUND_MESSAGE); - responseObject.setErrorDescription(APIConstants.NOT_FOUND_DESCRIPTION); - return responseObject; - } - APIConfig api = matchedAPI.getAPIConfig(); - ThreadContext.put(APIConstants.API_UUID, api.getUuid()); - logger.debug("API {}/{} found in the cache", api.getBasePath(), api.getVersion()); - - // putting API details into ThreadContext for logging purposes - ThreadContext.push(api.getName()); - ThreadContext.push(api.getOrganizationId()); - ThreadContext.push(api.getBasePath()); - - RequestContext requestContext = buildRequestContext(matchedAPI, request); - ResponseObject responseObject = matchedAPI.process(requestContext); - - // to clear the ThreadContext's stack used for logging - ThreadContext.removeStack(); - return responseObject; - } - - private RequestContext buildRequestContext(API api, CheckRequest request) { - String requestPath = request.getAttributes().getRequest().getHttp().getPath(); - String method = request.getAttributes().getRequest().getHttp().getMethod(); - String certificate = request.getAttributes().getSource().getCertificate(); - Map headers = request.getAttributes().getRequest().getHttp().getHeadersMap(); - String pathTemplate = request.getAttributes().getContextExtensionsMap().get(APIConstants.GW_RES_PATH_PARAM); - String routeName = request.getAttributes().getContextExtensionsMap().get(APIConstants.ROUTE_NAME_PARAM); - String cluster = request.getAttributes().getContextExtensionsMap() - .get(AdapterConstants.CLUSTER_HEADER_KEY); - long requestTimeInMillis = request.getAttributes().getRequest().getTime().getSeconds() * 1000 + - request.getAttributes().getRequest().getTime().getNanos() / 1000000; - String requestID = request.getAttributes().getRequest().getHttp(). - getHeadersOrDefault(HttpConstants.X_REQUEST_ID_HEADER, - request.getAttributes().getRequest().getHttp().getId()); - String address = ""; - if (request.getAttributes().getSource().hasAddress() && - request.getAttributes().getSource().getAddress().hasSocketAddress()) { - address = request.getAttributes().getSource().getAddress().getSocketAddress().getAddress(); - } - address = FilterUtils.getClientIp(headers, address); - String requestPayload = null; - if (!request.getAttributes().getRequest().getHttp().getRawBody().isEmpty()) { - ByteString byteString = request.getAttributes().getRequest().getHttp().getRawBody(); - if (byteString.isValidUtf8()) { - requestPayload = byteString.toStringUtf8(); - } - } - if (!request.getAttributes().getRequest().getHttp().getBody().isEmpty()) { - ByteString byteString = request.getAttributes().getRequest().getHttp().getBodyBytes(); - if (byteString.isValidUtf8()) { - requestPayload = byteString.toStringUtf8(); - } - } - ResourceConfig resourceConfig = null; - ArrayList resourceConfigs = null; - boolean isGraphQLAPI = api.getAPIConfig().getApiType().equals(APIConstants.ApiType.GRAPHQL); - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - if (isGraphQLAPI && !HttpConstants.OPTIONS.equals(method)) { - // need to decode the payload if request is graphql and a non option call. - try { - requestPayload = GraphQLPayloadUtils.getGQLRequestPayload(requestPayload, headers); - resourceConfigs = GraphQLPayloadUtils.buildGQLRequestContext(api, requestPayload, routeName); - } catch (EnforcerException exception) { - logger.error("Error while processing the graphql api request for {}", - api.getAPIConfig().getName(), - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 6704), exception); - RequestContext requestContext = new RequestContext.Builder(requestPath).requestMethod(method) - .matchedAPI(api.getAPIConfig()).headers(headers).requestID(requestID).address(address) - .clusterHeader(cluster).certificate(certificate) - .requestTimeStamp(requestTimeInMillis).requestPayload(requestPayload).build(); - requestContext.getProperties().put(APIConstants.MessageFormat.STATUS_CODE, - APIConstants.StatusCodes.BAD_REQUEST_ERROR.getCode()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, - GraphQLConstants.GRAPHQL_INVALID_QUERY); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, - GraphQLConstants.GRAPHQL_INVALID_QUERY_MESSAGE); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - exception.getMessage()); - return requestContext; - } - } else if (!isGraphQLAPI && !enforcerConfig.getEnableGatewayClassController()) { - resourceConfig = APIFactory.getInstance().getMatchedResource(api, pathTemplate, method); - if (resourceConfig != null) { - resourceConfigs = new ArrayList<>(); - resourceConfigs.add(resourceConfig); - } - } else if (!isGraphQLAPI && enforcerConfig.getEnableGatewayClassController()) { - resourceConfig = APIFactory.getInstance().getMatchedResource(api, - request.getAttributes().getContextExtensionsMap().get(APIConstants.ROUTE_NAME_PARAM)); - if (resourceConfig != null) { - resourceConfigs = new ArrayList<>(); - resourceConfigs.add(resourceConfig); - } - } - return new RequestContext.Builder(requestPath).matchedResourceConfigs(resourceConfigs).requestMethod(method) - .certificate(certificate).matchedAPI(api.getAPIConfig()).headers(headers).requestID(requestID) - .address(address).clusterHeader(cluster) - .requestTimeStamp(requestTimeInMillis).pathTemplate(pathTemplate).requestPayload(requestPayload) - .build(); - } - - /** - * This method handles the processing of '/ready' request sent by router. - * - * @return ResponseObject with status 200 - */ - private ResponseObject processReadyRequest() { - ResponseObject responseObject = new ResponseObject(); - responseObject.setStatusCode(APIConstants.StatusCodes.OK.getCode()); - responseObject.setRequestPath(APIConstants.ReadinessCheck.ENDPOINT); - responseObject.setDirectResponse(true); - return responseObject; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/NativeThreadFactory.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/NativeThreadFactory.java deleted file mode 100644 index a3d9bee193..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/NativeThreadFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2020, 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.server; - -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Creates thread with specific thread group and name prefix. - */ -public class NativeThreadFactory implements ThreadFactory { - - final ThreadGroup group; - final AtomicInteger count; - final String namePrefix; - - public NativeThreadFactory(final ThreadGroup group, final String namePrefix) { - super(); - this.count = new AtomicInteger(1); - this.group = group; - this.namePrefix = namePrefix; - } - - public Thread newThread(final Runnable runnable) { - StringBuffer buffer = new StringBuffer(); - buffer.append(this.namePrefix); - buffer.append('-'); - buffer.append(this.count.getAndIncrement()); - Thread t = new Thread(group, runnable, buffer.toString(), 0); - t.setDaemon(false); - t.setPriority(Thread.NORM_PRIORITY); - return t; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RequestHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RequestHandler.java deleted file mode 100644 index 02bea13300..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RequestHandler.java +++ /dev/null @@ -1,31 +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.server; - -/** - * This class handles the request coming via the external auth gRPC service. - */ -/** - * RequestHandler generic interface - * @param Request type - * @param Response type - * e.g - HttpRequestHandler implements RequestHandler - */ -public interface RequestHandler { - S process(T request); -} 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 deleted file mode 100644 index 88cbcfa32f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RestServer.java +++ /dev/null @@ -1,92 +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.server; - -import io.grpc.netty.shaded.io.netty.bootstrap.ServerBootstrap; -import io.grpc.netty.shaded.io.netty.channel.Channel; -import io.grpc.netty.shaded.io.netty.channel.ChannelOption; -import io.grpc.netty.shaded.io.netty.channel.EventLoopGroup; -import io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoopGroup; -import io.grpc.netty.shaded.io.netty.channel.socket.nio.NioServerSocketChannel; -import io.grpc.netty.shaded.io.netty.handler.logging.LogLevel; -import io.grpc.netty.shaded.io.netty.handler.logging.LoggingHandler; -import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; -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.config.ConfigHolder; -import org.wso2.apk.enforcer.jwks.JWKSRequestHandler; -import org.wso2.apk.enforcer.jwks.JWKSServerInitializer; -import org.wso2.apk.enforcer.server.swagger.SwaggerServerInitializer; - -import java.io.File; -import java.nio.file.Paths; - -import javax.net.ssl.SSLException; - -/** - * TokenServer to handle JWT /testkey endpoint backend HTTPS service. - */ -public class RestServer { - - private static final Logger logger = LogManager.getLogger(RestServer.class); - - public void initServer() throws SSLException, InterruptedException { - - logger.info("New Rest Server New"); - // Configure SSL - final SslContext sslCtx; - final SslContextBuilder ssl; - File certFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()).toFile(); - File keyFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()).toFile(); - ssl = SslContextBuilder.forServer(certFile, keyFile); - ssl.trustManager(ConfigHolder.getInstance().getTrustManagerFactory()); - sslCtx = ssl.build(); - - // Create the multithreaded event loops for the server - final EventLoopGroup bossGroup = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors()); - final EventLoopGroup workerGroup = new NioEventLoopGroup(Runtime.getRuntime().availableProcessors() * 2); - try { - ServerBootstrap swaggerServer = new ServerBootstrap(); - swaggerServer.option(ChannelOption.SO_BACKLOG, 1024); - swaggerServer.group(bossGroup, workerGroup) - .channel(NioServerSocketChannel.class) - .handler(new LoggingHandler(LogLevel.INFO)) - .childHandler(new SwaggerServerInitializer(sslCtx)); - Channel swaggerChannel = swaggerServer.bind(8084).sync().channel(); - logger.info("API Definition endpoint started Listening in port : " + 8084); - - ServerBootstrap jWKSServer = new ServerBootstrap(); - jWKSServer.option(ChannelOption.SO_BACKLOG, 1024); - jWKSServer.group(bossGroup, workerGroup) - .channel(NioServerSocketChannel.class) - .handler(new JWKSRequestHandler()) - .childHandler(new JWKSServerInitializer(sslCtx)); - Channel jwksChannel = jWKSServer.bind(9092).sync().channel(); - logger.info("JWKS endpoint started Listening in port : " + 9092); - jwksChannel.closeFuture().sync(); - - swaggerChannel.closeFuture().sync(); - - } finally { - workerGroup.shutdownGracefully(); - bossGroup.shutdownGracefully(); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RevokedTokenRedisClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RevokedTokenRedisClient.java deleted file mode 100644 index cc5919df27..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RevokedTokenRedisClient.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.server; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.util.JWTUtils; -import org.wso2.apk.enforcer.util.TLSUtils; -import redis.clients.jedis.DefaultJedisClientConfig; -import redis.clients.jedis.HostAndPort; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisClientConfig; -import redis.clients.jedis.JedisPool; -import redis.clients.jedis.JedisPubSub; -import redis.clients.jedis.params.ScanParams; -import redis.clients.jedis.resps.ScanResult; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.Key; -import java.security.KeyStore; -import java.security.cert.Certificate; -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Queue; -import java.util.Set; -import java.util.concurrent.Executors; -import java.util.concurrent.PriorityBlockingQueue; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.ManagerFactoryParameters; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManagerFactory; - -public class RevokedTokenRedisClient { - - private JedisPool jedisPool; - private Set revokedTokens; - private Queue> expiryQueue; - private static Set revokedTokensStatic; - private String redisRevokedTokensChannel; - private final ScheduledExecutorService revokedTokensCleanupScheduler = Executors.newScheduledThreadPool(1); - private int revokedTokenCleanupInterval; - private static volatile boolean isAlreadyStarted = false; - private static final Logger logger = LogManager.getLogger(RevokedTokenRedisClient.class); - private static final String TOKEN_EXPIRY_DIVIDER = "_##_"; - private static final String REVOKED_TOKEN_REDIS_KEY_PATTERN = "wso2:apk:revoked_token:*"; - private RevokedTokenRedisClient(Set revokedTokens, Queue> expiryQueue) throws EnforcerException { - this.revokedTokens = revokedTokens; - this.expiryQueue = expiryQueue; - - String userName = ConfigHolder.getInstance().getEnvVarConfig().getRedisUsername(); - String password = ConfigHolder.getInstance().getEnvVarConfig().getRedisPassword(); - String host = ConfigHolder.getInstance().getEnvVarConfig().getRedisHost(); - int port = ConfigHolder.getInstance().getEnvVarConfig().getRedisPort(); - boolean isSSLEnabled = ConfigHolder.getInstance().getEnvVarConfig().isRedisTlsEnabled(); - this.redisRevokedTokensChannel = ConfigHolder.getInstance().getEnvVarConfig().getRevokedTokensRedisChannel(); - this.revokedTokenCleanupInterval = ConfigHolder.getInstance().getEnvVarConfig().getRevokedTokenCleanupInterval(); - String caCert = ConfigHolder.getInstance().getEnvVarConfig().getRedisCaCertFile(); - DefaultJedisClientConfig.Builder builder = DefaultJedisClientConfig.builder() - .password(password); - if (!userName.isEmpty()) { - builder.user(userName); - } - if (isSSLEnabled) { - SSLSocketFactory sslFactory = createSslSocketFactory(caCert); - builder = builder - .ssl(true) - .sslSocketFactory(sslFactory); - } - JedisClientConfig config = builder.build(); - - HostAndPort hostAndPort = new HostAndPort(host, port); - this.jedisPool = new JedisPool(hostAndPort, config); - - } - - public static void retrieveAndSubscribe() throws EnforcerException { - if (isAlreadyStarted) { - logger.debug("Already a token retreival task is running"); - return; - } - logger.debug("Starting redis revoked token client..."); - isAlreadyStarted = true; - - HashSet revokedTokens = new HashSet<>(); - Set synchronizedRevokedTokens = Collections.synchronizedSet(revokedTokens); - PriorityBlockingQueue> expiryQueue = - new PriorityBlockingQueue<>(10, Map.Entry.comparingByKey()); - RevokedTokenRedisClient revokedTokenRedisClient = - new RevokedTokenRedisClient(synchronizedRevokedTokens, expiryQueue); - - revokedTokensStatic = revokedTokens; - revokedTokenRedisClient.subscribe(); - revokedTokenRedisClient.retrieveAllRevokedTokens(); - revokedTokenRedisClient.scheduleCleanup(); - } - - private void scheduleCleanup() { - this.revokedTokensCleanupScheduler.scheduleAtFixedRate(this::startCleanupTask, this.revokedTokenCleanupInterval, - this.revokedTokenCleanupInterval, TimeUnit.SECONDS); - } - - private void subscribe() { - Thread jedisThread = new Thread(new RevokedTokenRedisSubscriber(this.jedisPool, - this.revokedTokens, this.expiryQueue, this.redisRevokedTokensChannel)); - jedisThread.start(); - } - - private void retrieveAllRevokedTokens() { - try (Jedis jedis = this.jedisPool.getResource()) { - String cursor = "0"; - Set keysAndValues = new HashSet<>(); - do { - ScanResult scanResult = jedis.scan(cursor, - new ScanParams().match(REVOKED_TOKEN_REDIS_KEY_PATTERN)); - keysAndValues.addAll(scanResult.getResult()); - cursor = scanResult.getCursor(); - } while (!cursor.equals("0")); - - for (String key : keysAndValues) { - try { - String value = jedis.get(key); - Long expiry = Long.valueOf(value); - String token = key.substring(REVOKED_TOKEN_REDIS_KEY_PATTERN.length()-1); - revokedTokens.add(token); - expiryQueue.offer(Map.entry(expiry, token)); - logger.debug("New token added. Token : " + token + " expiry: " + expiry); - } catch(Exception e) { - logger.warn("Error while processing key: " + key, e); - } - } - } catch (Exception e) { - logger.error("Error while creating redis connection.", e); - } - } - - private void startCleanupTask() { - long currentTime = System.currentTimeMillis() / 1000L; - while (!this.expiryQueue.isEmpty() && this.expiryQueue.peek().getKey() <= currentTime) { - Map.Entry entry = this.expiryQueue.poll(); - String token = entry.getValue(); - this.revokedTokens.remove(token); - logger.debug("Token removed: " + token + " expiry: " + entry.getKey()); - } - } - - static class RevokedTokenRedisSubscriber implements Runnable { - JedisPool jedisPool; - Set revokedTokens; - Queue> expiryQueue; - private String redisRevokedTokensChannel; - - public RevokedTokenRedisSubscriber(JedisPool pool, - Set revokedTokens, - Queue> expiryQueue, - String channel) { - this.jedisPool = pool; - this.revokedTokens = revokedTokens; - this.expiryQueue = expiryQueue; - this.redisRevokedTokensChannel = channel; - } - @Override - public void run() { - try(Jedis jedis = this.jedisPool.getResource()) { - jedis.connect(); - JedisPubSub jedisPubSub = new JedisPubSub() { - @Override - public void onMessage(String channel, String message) { - try { - logger.debug("Received message: " + message); - String[] tokenAndExpiry = message.split(TOKEN_EXPIRY_DIVIDER); - Long expiry = Long.valueOf(tokenAndExpiry[1]); - String token = tokenAndExpiry[0]; - revokedTokens.add(token); - expiryQueue.offer(Map.entry(expiry, token)); - } catch (Exception e) { - logger.error("Error while processing the token message in the redis " + - "subscriber. Exception: ", e); - } - } - - @Override - public void onUnsubscribe(String channel, int subscribedChannels) { - logger.info("Unsubscribed Channel: {} subscribed channels: {}", channel, subscribedChannels); - } - - @Override - public void onSubscribe(String channel, int subscribedChannels) { - logger.info("Subscribed Channel: {} subscribed channels: {}", channel, subscribedChannels); - } - }; - jedis.subscribe(jedisPubSub, this.redisRevokedTokensChannel); - } catch (Exception e) { - logger.error("Error occured in the subscription connection trying to connect again."+ e); - try { - Thread.sleep(1000); - } catch (InterruptedException ex) { - logger.error("Exception while sleeping. Exception: " + ex); - } - run(); - } - - } - } - - public static Set getRevokedTokens() { - return revokedTokensStatic; - } - - public static void setRevokedTokens(SetrevokedTokensSet) { - revokedTokensStatic = revokedTokensSet; - } - - private static SSLSocketFactory createSslSocketFactory(String redisCaCertPath) throws EnforcerException { - try { - KeyStore trustStore = TLSUtils.getDefaultCertTrustStore(); - TLSUtils.addCertsToTruststore(trustStore, redisCaCertPath); - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("X509"); - trustManagerFactory.init(trustStore); - Certificate cert = TLSUtils.getCertificateFromFile(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()); - Key key = JWTUtils.getPrivateKey(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()); - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, null); - keyStore.setKeyEntry("client-keys", key, null, new Certificate[]{cert}); - KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - keyManagerFactory.init(keyStore, null); - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null); - return sslContext.getSocketFactory(); - } catch (Exception e) { - throw new EnforcerException("Error while creating SSL socket factory.", e); - } - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/WebSocketHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/WebSocketHandler.java deleted file mode 100644 index 74b818e2a9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/WebSocketHandler.java +++ /dev/null @@ -1,169 +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.server; -// -//import io.opentelemetry.context.Scope; -//import org.apache.commons.lang3.StringUtils; -//import org.apache.logging.log4j.LogManager; -//import org.apache.logging.log4j.Logger; -//import org.apache.logging.log4j.ThreadContext; -//import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest; -//import org.wso2.apk.enforcer.api.APIFactory; -//import org.wso2.apk.enforcer.api.WebSocketAPI; -//import org.wso2.apk.enforcer.commons.model.APIConfig; -//import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -//import org.wso2.apk.enforcer.commons.model.RequestContext; -//import org.wso2.apk.enforcer.commons.model.WebSocketFrameContext; -//import org.wso2.apk.enforcer.constants.APIConstants; -//import org.wso2.apk.enforcer.tracing.TracingConstants; -//import org.wso2.apk.enforcer.tracing.TracingSpan; -//import org.wso2.apk.enforcer.tracing.TracingTracer; -//import org.wso2.apk.enforcer.tracing.Utils; -//import org.wso2.apk.enforcer.websocket.MetadataConstants; -//import org.wso2.apk.enforcer.websocket.WebSocketThrottleResponse; -// -//import java.net.URI; -//import java.net.URISyntaxException; -//import java.util.Map; -// -///** -// * WebSocketHandler handles requests coming through websocket frame service. -// */ -//public class WebSocketHandler implements RequestHandler { -// private static final Logger logger = LogManager.getLogger(WebSocketHandler.class); -// -// /** -// * -// * @param webSocketFrameRequest - WebSocketFrameRequest received from WebSocketFrameRequest -// * @return WebSocketResponseObject - Response sent via WebSocketFrameService -// */ -// @Override -// public WebSocketThrottleResponse process(WebSocketFrameRequest webSocketFrameRequest) { -// TracingSpan webSocketHandlerSpan = null; -// Scope webSocketHandlerSpanScope = null; -// if (Utils.tracingEnabled()) { -// TracingTracer tracer = Utils.getGlobalTracer(); -// webSocketHandlerSpan = Utils.startSpan(TracingConstants.WS_HANDLER_SPAN, tracer); -// webSocketHandlerSpanScope = webSocketHandlerSpan.getSpan().makeCurrent(); -// Utils.setTag(webSocketHandlerSpan, APIConstants.LOG_TRACE_ID, ThreadContext.get(APIConstants.LOG_TRACE_ID)); -// } -// try { -// WebSocketAPI matchedAPI = APIFactory.getInstance().getMatchedAPI(webSocketFrameRequest); -// if (matchedAPI == null) { -// WebSocketThrottleResponse webSocketThrottleResponse = new WebSocketThrottleResponse(); -// webSocketThrottleResponse.setUnknownState(); -// String basePath = webSocketFrameRequest.getMetadata().getExtAuthzMetadataMap() -// .get(APIConstants.GW_BASE_PATH_PARAM); -// String version = webSocketFrameRequest.getMetadata().getExtAuthzMetadataMap() -// .get(APIConstants.GW_VERSION_PARAM); -// logger.info("API {}/{} not found in the cache", basePath, version); -// return webSocketThrottleResponse; -// } else if (logger.isDebugEnabled()) { -// APIConfig api = matchedAPI.getAPIConfig(); -// logger.info("API {}/{} found in the cache", api.getBasePath(), api.getVersion()); -// } -// RequestContext requestContext = buildRequestContext(matchedAPI, webSocketFrameRequest); -// return matchedAPI.processFramedata(requestContext); -// } finally { -// if (Utils.tracingEnabled()) { -// webSocketHandlerSpanScope.close(); -// Utils.finishSpan(webSocketHandlerSpan); -// } -// } -// } -// -// /** -// * @param api - Matched WebSocket API -// * @param webSocketFrameRequest - WebSocketFrameRequest received from WebSocketFrameRequest -// * @return RequestContext - Build RequestContext by populating relevant fields from api and webSocketFrameRequest -// */ -// private RequestContext buildRequestContext(WebSocketAPI api, WebSocketFrameRequest webSocketFrameRequest) { -// Map extAuthMetadata = webSocketFrameRequest.getMetadata().getExtAuthzMetadataMap(); -// // Extracting ext_authz metadata from WebSocketFrameRequest -// String apiName = extAuthMetadata.get(APIConstants.GW_API_NAME_PARAM); -// String apiVersion = extAuthMetadata.get(APIConstants.GW_VERSION_PARAM); -// String apiBasePath = extAuthMetadata.get(APIConstants.GW_BASE_PATH_PARAM); -// String username = extAuthMetadata.get(MetadataConstants.USERNAME); -// String appTier = extAuthMetadata.get(MetadataConstants.APP_TIER); -// String tier = extAuthMetadata.get(MetadataConstants.TIER); -// boolean isContentAwareTierPresent = Boolean.parseBoolean(extAuthMetadata -// .get(MetadataConstants.CONTENT_AWARE_TIER_PRESENT)); -// String apiKey = extAuthMetadata.get(MetadataConstants.API_KEY); -// String keyType = extAuthMetadata.get(MetadataConstants.KEY_TYPE); -// String callerToken = extAuthMetadata.get(MetadataConstants.CALLER_TOKEN); -// int applicationId = -1; -// if (!StringUtils.isEmpty(extAuthMetadata.get(MetadataConstants.APP_ID))) { -// applicationId = Integer.parseInt(extAuthMetadata.get(MetadataConstants.APP_ID)); -// } -// -// String applicationName = extAuthMetadata.get(MetadataConstants.APP_NAME); -// String consumerKey = extAuthMetadata.get(MetadataConstants.CONSUMER_KEY); -// String subscriber = extAuthMetadata.get(MetadataConstants.SUBSCRIBER); -// int spikeArrestLimit = Integer.parseInt(extAuthMetadata.get(MetadataConstants.SPIKE_ARREST_LIMIT)); -// String subscriberTenantDomain = extAuthMetadata.get(MetadataConstants.SUBSCRIBER_TENANT_DOMAIN); -// String spikeArrestUnit = extAuthMetadata.get(MetadataConstants.SPIKE_ARREST_UNIT); -// boolean stopOnQuota = Boolean.parseBoolean(extAuthMetadata.get(MetadataConstants.STOP_ON_QUOTA)); -// String productName = extAuthMetadata.get(MetadataConstants.PRODUCT_NAME); -// String productProvider = extAuthMetadata.get(MetadataConstants.PRODUCT_PROVIDER); -// String apiPublisher = extAuthMetadata.get(MetadataConstants.API_PUBLISHER); -// String requestId = extAuthMetadata.get(MetadataConstants.REQUEST_ID); -// -// // Extracting mgw_wasm_websocket filter metadata -// int frameLength = webSocketFrameRequest.getFrameLength(); -// String remoteIp = webSocketFrameRequest.getRemoteIp(); -// String streamId = extAuthMetadata.get(MetadataConstants.GRPC_STREAM_ID); -// -// WebSocketFrameContext webSocketFrameContext = new WebSocketFrameContext(streamId, frameLength, remoteIp); -// -// AuthenticationContext authenticationContext = new AuthenticationContext(); -// authenticationContext.setApiName(apiName); -// authenticationContext.setApiVersion(apiVersion); -// authenticationContext.setUsername(username); -// authenticationContext.setApplicationTier(appTier); -// authenticationContext.setTier(tier); -// authenticationContext.setIsContentAware(isContentAwareTierPresent); -// authenticationContext.setApiKey(apiKey); -// authenticationContext.setKeyType(keyType); -// authenticationContext.setCallerToken(callerToken); -// authenticationContext.setApplicationId(applicationId); -// authenticationContext.setApplicationName(applicationName); -// authenticationContext.setConsumerKey(consumerKey); -// authenticationContext.setSubscriber(subscriber); -// authenticationContext.setSpikeArrestLimit(spikeArrestLimit); -// authenticationContext.setSubscriberTenantDomain(subscriberTenantDomain); -// authenticationContext.setSpikeArrestUnit(spikeArrestUnit); -// authenticationContext.setStopOnQuotaReach(stopOnQuota); -// authenticationContext.setProductName(productName); -// authenticationContext.setProductProvider(productProvider); -// authenticationContext.setApiPublisher(apiPublisher); -// -// return new RequestContext.Builder(apiBasePath).authenticationContext(authenticationContext). -// webSocketFrameContext(webSocketFrameContext).matchedAPI(api.getAPIConfig()) -// .requestID(requestId).address(extractIpAddress(remoteIp)).build(); -// } -// -// private String extractIpAddress(String remoteIpStringWithPort) { -// try { -// URI uri = new URI("ws://" + remoteIpStringWithPort); -// return uri.getHost(); -// } catch (URISyntaxException e) { -// logger.error(e); -// return null; -// } -// } -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/APIDefinitionUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/APIDefinitionUtils.java deleted file mode 100644 index 5f320de8aa..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/APIDefinitionUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.wso2.apk.enforcer.server.swagger; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.zip.GZIPInputStream; -import org.wso2.apk.enforcer.models.ResponsePayload; - -public class APIDefinitionUtils { - 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 String ReadGzip(byte[] gzip) throws IOException { - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(gzip); - GZIPInputStream gzipInputStream = new GZIPInputStream(byteArrayInputStream); - InputStreamReader inputStreamReader = new InputStreamReader(gzipInputStream); - BufferedReader bufferedReader = new BufferedReader(inputStreamReader); - String line; - StringBuilder stringBuilder = new StringBuilder(); - - while ((line = bufferedReader.readLine()) != null) { - stringBuilder.append(line).append("\n"); - } - return new String(stringBuilder); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/SwaggerServerHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/SwaggerServerHandler.java deleted file mode 100644 index 9bdc520a53..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/SwaggerServerHandler.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.wso2.apk.enforcer.server.swagger; - -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.SimpleChannelInboundHandler; -import io.grpc.netty.shaded.io.netty.handler.codec.http.DefaultFullHttpResponse; -import io.grpc.netty.shaded.io.netty.handler.codec.http.FullHttpResponse; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpObject; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpRequest; -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.api.APIFactory; -import org.wso2.apk.enforcer.constants.APIDefinitionConstants; -import org.wso2.apk.enforcer.constants.AdminConstants; -import org.wso2.apk.enforcer.constants.HttpConstants; -import org.wso2.apk.enforcer.models.ResponsePayload; -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class SwaggerServerHandler extends SimpleChannelInboundHandler { - -// final SubscriptionDataStore dataStore = SubscriptionDataHolder.getInstance().getTenantSubscriptionStore(); - private final static APIFactory apiFactory = APIFactory.getInstance(); - - @Override - public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception { - HttpRequest request; - ResponsePayload responsePayload; - - if(msg instanceof HttpRequest) { - request = (HttpRequest) msg; - } else { - 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; - } - - boolean isSwagger = false; - - //check if it's GRPC request using the header - String header = request.headers().get("ApiType"); - String[] params = request.uri().split("/"); - final String basePath; - final String vHost; - final String queryParam; - final String version; - //if len params is 3, then it's a GRPC request else other - final String type = params.length == 3 ? "GRPC" : "REST"; - if (type.equals("GRPC")) { - basePath = "/" + params[1]; - vHost = params[2].split("\\?")[0]; - queryParam = params[2].split("\\?")[1]; - version = extractVersionFromGrpcBasePath(params[1]); - } else { - basePath = "/" + params[1] + "/" + params[2]; - vHost = params[3].split("\\?")[0]; - queryParam = params[3].split("\\?")[1]; - version = params[2]; - } - - if (APIDefinitionConstants.SWAGGER_DEFINITION.equalsIgnoreCase(queryParam)) { - isSwagger = true; - } - if(isSwagger){ - // load the corresponding swagger definition from the API name - byte[] apiDefinition = apiFactory.getAPIDefinition(basePath, version, vHost); - if (apiDefinition == null || apiDefinition.length == 0) { - String error = AdminConstants.ErrorMessages.NOT_FOUND; - responsePayload = new ResponsePayload(); - responsePayload.setError(true); - responsePayload.setStatus(HttpResponseStatus.NOT_FOUND); - responsePayload.setContent(error); - buildAndSendResponse(ctx, responsePayload); - return; - } - Map map = new HashMap<>(); - map.put("apiDefinition", APIDefinitionUtils.ReadGzip(apiDefinition)); - responsePayload = APIDefinitionUtils.buildResponsePayload(map, HttpResponseStatus.OK, false); - buildAndSendResponse(ctx, responsePayload); - } - - // If the request is not for swagger definition, then send a bad request - String error = AdminConstants.ErrorMessages.BAD_REQUEST; - responsePayload = new ResponsePayload(); - responsePayload.setError(true); - responsePayload.setStatus(HttpResponseStatus.BAD_REQUEST); - responsePayload.setContent(error); - 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); - } - - private static String extractVersionFromGrpcBasePath(String input) { - // Pattern to match '.v' followed by digits and optional periods followed by more digits - Pattern pattern = Pattern.compile("\\.v\\d+(\\.\\d+)*"); - Matcher matcher = pattern.matcher(input); - - if (matcher.find()) { - return matcher.group().substring(1); // Returns the matched version - } - return ""; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/SwaggerServerInitializer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/SwaggerServerInitializer.java deleted file mode 100644 index 920641301c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/swagger/SwaggerServerInitializer.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.wso2.apk.enforcer.server.swagger; - -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; - -public class SwaggerServerInitializer extends ChannelInitializer { - private final SslContext sslCtx; - public SwaggerServerInitializer(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 SwaggerServerHandler()); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationDto.java deleted file mode 100644 index 59aafe9db1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationDto.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.io.Serializable; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Entity for keeping Application related information. Represents an Application in APK. - */ -public class ApplicationDto implements Serializable { - - private static final long serialVersionUID = 1L; - - private String uuid; - private String name; - private String owner; - private Map attributes = new ConcurrentHashMap<>(); - - private String organizationId; - - public String getUuid() { - - return uuid; - } - - public void setUuid(String uuid) { - - this.uuid = uuid; - } - - public String getName() { - - return name; - } - - public void setName(String name) { - - this.name = name; - } - - public String getOwner() { - - return owner; - } - - public void setOwner(String owner) { - - this.owner = owner; - } - - public Map getAttributes() { - - return attributes; - } - - public void setAttributes(Map attributes) { - - this.attributes = attributes; - } - - public String getOrganizationId() { - - return organizationId; - } - - public void setOrganizationId(String organizationId) { - - this.organizationId = organizationId; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDTO.java deleted file mode 100644 index 439a3d9794..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDTO.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.io.Serializable; - -public class ApplicationKeyMappingDTO implements Serializable { - - public String getApplicationUUID() { - - return applicationUUID; - } - - public void setApplicationUUID(String applicationUUID) { - - this.applicationUUID = applicationUUID; - } - - public String getSecurityScheme() { - - return securityScheme; - } - - public void setSecurityScheme(String securityScheme) { - - this.securityScheme = securityScheme; - } - - public String getApplicationIdentifier() { - - return applicationIdentifier; - } - - public void setApplicationIdentifier(String applicationIdentifier) { - - this.applicationIdentifier = applicationIdentifier; - } - - public String getKeyType() { - - return keyType; - } - - public void setKeyType(String keyType) { - - this.keyType = keyType; - } - - public String getEnvID() { - - return envID; - } - - public void setEnvID(String envID) { - - this.envID = envID; - } - - private String applicationUUID; - private String securityScheme; - private String applicationIdentifier; - private String keyType; - private String envID; - - public String getOrganizationId() { - - return organizationId; - } - - public void setOrganizationId(String organizationId) { - - this.organizationId = organizationId; - } - - private String organizationId; - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDtoList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDtoList.java deleted file mode 100644 index 36ab9cba7a..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDtoList.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.util.ArrayList; -import java.util.List; - -public class ApplicationKeyMappingDtoList { -private List list = new ArrayList<>(); - - public List getList() { - - return list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationListDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationListDto.java deleted file mode 100644 index 333c3ad325..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationListDto.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -public class ApplicationListDto implements Serializable { -private List list = new ArrayList<>(); - - public List getList() { - - return list; - } - - public void setList(List list) { - - this.list = list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDto.java deleted file mode 100644 index 3b2e7235f8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDto.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.io.Serializable; - -public class ApplicationMappingDto implements Serializable { - private String uuid; - - public String getUuid() { - - return uuid; - } - - public void setUuid(String uuid) { - - this.uuid = uuid; - } - - public String getApplicationRef() { - - return applicationRef; - } - - public void setApplicationRef(String applicationRef) { - - this.applicationRef = applicationRef; - } - - public String getSubscriptionRef() { - - return subscriptionRef; - } - - public void setSubscriptionRef(String subscriptionRef) { - - this.subscriptionRef = subscriptionRef; - } - - private String applicationRef; - private String subscriptionRef; - private String organizationId; - - public String getOrganizationId() { - - return organizationId; - } - - public void setOrganizationId(String organizationId) { - - this.organizationId = organizationId; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDtoList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDtoList.java deleted file mode 100644 index 8b310b93ae..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDtoList.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.util.ArrayList; -import java.util.List; - -public class ApplicationMappingDtoList { -private List list = new ArrayList<>(); - - public List getList() { - - return list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java deleted file mode 100644 index 2083cc1418..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java +++ /dev/null @@ -1,176 +0,0 @@ -package org.wso2.apk.enforcer.subscription; -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import io.grpc.ClientInterceptor; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.Metadata; -import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; -import io.grpc.stub.MetadataUtils; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.discovery.service.apkmgt.EventStreamServiceGrpc; -import org.wso2.apk.enforcer.discovery.service.apkmgt.Request; -import org.wso2.apk.enforcer.discovery.subscription.Application; -import org.wso2.apk.enforcer.discovery.subscription.Event; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with JWTIssuer discovery service at the adapter. - */ -public class EventingGrpcClient implements Runnable { - - private static final Logger logger = LogManager.getLogger(EventingGrpcClient.class); - private static EventingGrpcClient instance; - private ManagedChannel channel; - private EventStreamServiceGrpc.EventStreamServiceStub stub; - private final String host; - private final String hostname; - private final int port; - - private EventingGrpcClient(String host, String hostname, int port) { - - this.host = host; - this.hostname = hostname; - this.port = port; - initConnection(); - } - - private void initConnection() { - - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("JWTIssuer discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - Metadata metadata = new Metadata(); - String connectionId = UUID.randomUUID().toString(); - metadata.put(Metadata.Key.of("enforcer-uuid", Metadata.ASCII_STRING_MARSHALLER), - connectionId); - logger.info("Enforcer UUID: " + connectionId); - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - ClientInterceptor metadataInterceptor = MetadataUtils.newAttachHeadersInterceptor(metadata); - - this.stub = EventStreamServiceGrpc.newStub(channel).withInterceptors(metadataInterceptor); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopEventStreamScheduling(); - } - } - - public static EventingGrpcClient getInstance() { - - if (instance == null) { - String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); - String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); - int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerXdsPort()); - instance = new EventingGrpcClient(sdsHost, sdsHostname, sdsPort); - } - return instance; - } - - public void run() { - - initConnection(); - watchEvents(); - } - - public void watchEvents() { - - Request request = Request.newBuilder().setEvent("event").build(); - - stub.streamEvents(request, new StreamObserver<>() { - @Override - public void onNext(Event event) { - - handleNotificationEvent(event); - XdsSchedulerManager.getInstance().stopEventStreamScheduling(); - } - - @Override - public void onError(Throwable t) { - - logger.error("Event error", t); - XdsSchedulerManager.getInstance().startEventScheduling(); - - } - - @Override - public void onCompleted() { - - logger.info("Completed===="); - } - }); - } - private void handleNotificationEvent(Event event) { - - switch (event.getType()) { - case "ALL_EVENTS": - logger.info("Received all events from the server"); - SubscriptionDataStoreUtil.getInstance().loadStartupArtifacts(); - break; - case "APPLICATION_CREATED": - Application application = event.getApplication(); - SubscriptionDataStoreUtil.addApplication(application); - break; - case "SUBSCRIPTION_CREATED": - case "SUBSCRIPTION_UPDATED": - SubscriptionDataStoreUtil.addSubscription(event.getSubscription()); - - break; - case "APPLICATION_MAPPING_CREATED": - case "APPLICATION_MAPPING_UPDATED": - SubscriptionDataStoreUtil.addApplicationMapping(event.getApplicationMapping()); - break; - case "APPLICATION_KEY_MAPPING_CREATED": - case "APPLICATION_KEY_MAPPING_UPDATED": - SubscriptionDataStoreUtil.addApplicationKeyMapping(event.getApplicationKeyMapping()); - break; - case "APPLICATION_UPDATED": - SubscriptionDataStoreUtil.addApplication(event.getApplication()); - break; - case "APPLICATION_MAPPING_DELETED": - SubscriptionDataStoreUtil.removeApplicationMapping(event.getApplicationMapping()); - break; - case "APPLICATION_KEY_MAPPING_DELETED": - SubscriptionDataStoreUtil.removeApplicationKeyMapping(event.getApplicationKeyMapping()); - break; - case "SUBSCRIPTION_DELETED": - SubscriptionDataStoreUtil.removeSubscription(event.getSubscription()); - break; - case "APPLICATION_DELETED": - SubscriptionDataStoreUtil.removeApplication(event.getApplication()); - break; - default: - logger.error("Unknown event type received from the server"); - break; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscribedAPIDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscribedAPIDto.java deleted file mode 100644 index 0d35afa202..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscribedAPIDto.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.io.Serializable; - -public class SubscribedAPIDto implements Serializable { - - public String getName() { - - return name; - } - - public void setName(String name) { - - this.name = name; - } - - public String getVersion() { - - return version; - } - - public void setVersion(String version) { - - this.version = version; - } - - private String name; - private String version; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataHolder.java deleted file mode 100644 index c90bdcf146..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataHolder.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.subscription; - -import java.util.HashMap; -import java.util.Map; - -/** - * This class holds tenant wise subscription data stores. - */ -public class SubscriptionDataHolder { - - private static final SubscriptionDataHolder instance = new SubscriptionDataHolder(); - Map subscriptionDataStoreMap = new HashMap<>(); - - public static SubscriptionDataHolder getInstance() { - return instance; - } - - public SubscriptionDataStore getSubscriptionDataStore(String organization) { - return subscriptionDataStoreMap.get(organization); - } - - public SubscriptionDataStore initializeSubscriptionDataStore(String organization) { - SubscriptionDataStore subscriptionDataStore = new SubscriptionDataStoreImpl(); - subscriptionDataStoreMap.put(organization, subscriptionDataStore); - return subscriptionDataStore; - } - - public int getTotalSubscriptionCount() { - int totalSubCount = 0; - for (SubscriptionDataStore store : subscriptionDataStoreMap.values()) { - totalSubCount += store.getSubscriptionCount(); - } - return totalSubCount; - } - - public int getTotalJWTIssuerCount() { - int totalJWTIssuerCount = 0; - for (SubscriptionDataStore store : subscriptionDataStoreMap.values()) { - totalJWTIssuerCount += store.getJWTIssuerCount(); - } - return totalJWTIssuerCount; - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java deleted file mode 100644 index 3fca55d2d2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2020, 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.subscription; - -import org.wso2.apk.enforcer.discovery.subscription.JWTIssuer; -import org.wso2.apk.enforcer.models.*; -import org.wso2.apk.enforcer.security.jwt.validator.JWTValidator; - -import java.util.List; -import java.util.Set; - -/** - * A Facade for obtaining Subscription related Data. - */ -public interface SubscriptionDataStore { - - /** - * Gets an {@link Application} by appUUID. - * - * @param appUUID of the Application - * @return {@link Application} with the appId - */ - Application getApplicationById(String appUUID); - - /** - * Gets Subscription by ID. - * - * @param appUUID Application associated with the Subscription (uuid) - * @param apiUUID Api associated with the Subscription (uuid) - * @return {@link Subscription} - */ - Subscription getSubscriptionById(String appUUID, String apiUUID); - - void addSubscriptions(List subscriptionList); - - void addApplications(List applicationList); - - void addApplicationKeyMappings( - List applicationKeyMappingList); - - /** - * Filter the applicationMapping map based on the provided application UUID. - * - * @param uuid Application UUID - * @return ApplicationMapping which match the given UUID - */ - Set getMatchingApplicationMappings(String uuid); - - /** - * Filter the application key mapping map based on provided parameters - * - * @param applicationIdentifier Application identifier - * @param keyType Key type, i.e. PRODUCTION or SANDBOX - * @param securityScheme Security scheme - * @param envType - * @return ApplicationKeyMapping which match the given parameters - */ - ApplicationKeyMapping getMatchingApplicationKeyMapping(String applicationIdentifier, String keyType, - String securityScheme, String envType); - - /** - * Filter the applications map based on the provided parameters. - * - * @param uuid UUID of the application - * @return Application which match the given UUID - */ - Application getMatchingApplication(String uuid); - - /** - * Filter the subscriptions map based on the provided parameters. - * - * @param uuid UUID of the subscription - * @return Subscription which matches the given UUID - */ - Subscription getMatchingSubscription(String uuid); - - void addJWTIssuers(List jwtIssuers); - - /** - * Returns the JWTValidator based on Issuer - * - * @param issuer issuer in JWT - * @param environment environment of the Issuer - * @return JWTValidator Implementation - */ - JWTValidator getJWTValidatorByIssuer(String issuer, String environment); - - void addApplication(org.wso2.apk.enforcer.discovery.subscription.Application application); - - void addSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription); - - void addApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping); - - void addApplicationKeyMapping( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping); - - void removeApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping); - - void removeApplicationKeyMapping( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping); - - void removeSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription); - - void removeApplication(org.wso2.apk.enforcer.discovery.subscription.Application application); - - public void addApplicationMappings(List applicationMappingList); - - int getSubscriptionCount(); - - int getJWTIssuerCount(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java deleted file mode 100644 index 5f8a3ccad4..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright (c) 2020, 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.subscription; - -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.dto.ClaimMappingDto; -import org.wso2.apk.enforcer.commons.dto.JWKSConfigurationDTO; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.config.dto.ExtendedTokenIssuerDto; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.subscription.Certificate; -import org.wso2.apk.enforcer.discovery.subscription.JWTIssuer; -import org.wso2.apk.enforcer.models.Application; -import org.wso2.apk.enforcer.models.ApplicationKeyMapping; -import org.wso2.apk.enforcer.models.ApplicationMapping; -import org.wso2.apk.enforcer.models.SubscribedAPI; -import org.wso2.apk.enforcer.models.Subscription; -import org.wso2.apk.enforcer.security.jwt.validator.JWTValidator; -import org.wso2.apk.enforcer.util.TLSUtils; - -import java.io.IOException; -import java.security.cert.CertificateException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Implementation of the subscription data store. - */ -public class SubscriptionDataStoreImpl implements SubscriptionDataStore { - - private static final Logger log = LogManager.getLogger(SubscriptionDataStoreImpl.class); - private static final SubscriptionDataStoreImpl instance = new SubscriptionDataStoreImpl(); - - public static final String DELEM_PERIOD = ":"; - - // Maps for keeping Subscription related details. - private Map applicationKeyMappingMap = new ConcurrentHashMap<>(); - private Map> applicationMappingMap = new ConcurrentHashMap<>(); - private Map applicationMap = new ConcurrentHashMap<>(); - private Map subscriptionMap = new ConcurrentHashMap<>(); - private Map jwtValidatorMap = new ConcurrentHashMap<>(); - - SubscriptionDataStoreImpl() { - - } - - public static SubscriptionDataStoreImpl getInstance() { - - return instance; - } - - @Override - public Application getApplicationById(String appUUID) { - - return applicationMap.get(appUUID); - } - - @Override - public Subscription getSubscriptionById(String appId, String apiId) { - - return subscriptionMap.get(SubscriptionDataStoreUtil.getSubscriptionCacheKey(appId, apiId)); - } - - public void addSubscriptions(List subscriptionList) { - - Map newSubscriptionMap = new ConcurrentHashMap<>(); - - for (SubscriptionDto subscription : subscriptionList) { - SubscribedAPI subscribedAPI = new SubscribedAPI(subscription.getSubscribedApi()); - subscribedAPI.setName(subscription.getSubscribedApi().getName()); - subscribedAPI.setVersion(subscription.getSubscribedApi().getVersion()); - Subscription newSubscription = new Subscription(); - newSubscription.setSubscriptionId(subscription.getUuid()); - newSubscription.setSubscriptionStatus(subscription.getSubStatus()); - newSubscription.setOrganization(subscription.getOrganization()); - newSubscription.setSubscribedApi(subscribedAPI); - newSubscriptionMap.put(newSubscription.getCacheKey(), newSubscription); - newSubscription.setRatelimitTier(subscription.getRatelimitTier()); - } - - if (log.isDebugEnabled()) { - log.debug("Total Subscriptions in new cache: {}", newSubscriptionMap.size()); - } - this.subscriptionMap = newSubscriptionMap; - } - - public void addApplications(List applicationList) { - - Map newApplicationMap = new ConcurrentHashMap<>(); - - for (ApplicationDto application : applicationList) { - Application newApplication = new Application(); - newApplication.setUUID(application.getUuid()); - newApplication.setName(application.getName()); - newApplication.setOwner(application.getOwner()); - application.getAttributes().forEach(newApplication::addAttribute); - - newApplicationMap.put(newApplication.getCacheKey(), newApplication); - } - if (log.isDebugEnabled()) { - log.debug("Total Applications in new cache: {}", newApplicationMap.size()); - } - this.applicationMap = newApplicationMap; - } - - public void addApplicationKeyMappings(List applicationKeyMappingList) { - - Map newApplicationKeyMappingMap = new ConcurrentHashMap<>(); - - for (ApplicationKeyMappingDTO applicationKeyMapping : applicationKeyMappingList) { - ApplicationKeyMapping mapping = new ApplicationKeyMapping(); - mapping.setApplicationUUID(applicationKeyMapping.getApplicationUUID()); - mapping.setSecurityScheme(applicationKeyMapping.getSecurityScheme()); - mapping.setApplicationIdentifier(applicationKeyMapping.getApplicationIdentifier()); - mapping.setKeyType(applicationKeyMapping.getKeyType()); - mapping.setEnvId(applicationKeyMapping.getEnvID()); - newApplicationKeyMappingMap.put(mapping.getCacheKey(), mapping); - } - if (log.isDebugEnabled()) { - log.debug("Total Application Key Mappings in new cache: {}", newApplicationKeyMappingMap.size()); - } - this.applicationKeyMappingMap = newApplicationKeyMappingMap; - } - - public void addApplicationMappings(List applicationMappingList) { - - Map> newApplicationMappingMap = new ConcurrentHashMap<>(); - for (ApplicationMappingDto applicationMapping : applicationMappingList) { - ApplicationMapping appMapping = new ApplicationMapping(); - appMapping.setUuid(applicationMapping.getUuid()); - appMapping.setApplicationUUID(applicationMapping.getApplicationRef()); - appMapping.setSubscriptionUUID(applicationMapping.getSubscriptionRef()); - appMapping.setOrganization(applicationMapping.getOrganizationId()); - Map applicationMappings = new HashMap<>(); - if (newApplicationMappingMap.containsKey(appMapping.getApplicationUUID())) { - applicationMappings = newApplicationMappingMap.get(appMapping.getApplicationUUID()); - } - applicationMappings.put(appMapping.getCacheKey(), appMapping); - newApplicationMappingMap.put(appMapping.getApplicationUUID(), applicationMappings); - } - if (log.isDebugEnabled()) { - log.debug("Total Application Mappings in new cache: {}", newApplicationMappingMap.size()); - } - this.applicationMappingMap = newApplicationMappingMap; - } - - @Override - public ApplicationKeyMapping getMatchingApplicationKeyMapping(String applicationIdentifier, String keyType, - String securityScheme, String envType) { - - String cacheKey = SubscriptionDataStoreUtil.getApplicationKeyMappingCacheKey(applicationIdentifier, keyType, - securityScheme, envType); - return applicationKeyMappingMap.get(cacheKey); - } - - @Override - public Set getMatchingApplicationMappings(String uuid) { - - if (StringUtils.isNotEmpty(uuid)) { - if (applicationMappingMap.containsKey(uuid)) { - return new HashSet<>(applicationMappingMap.get(uuid).values()); - } - } - return new HashSet<>(); - } - - @Override - public Application getMatchingApplication(String uuid) { - - for (Application application : applicationMap.values()) { - if (StringUtils.isNotEmpty(uuid)) { - if (application.getUUID().equals(uuid)) { - return application; - } - } - } - return null; - } - - @Override - public Subscription getMatchingSubscription(String uuid) { - - if (StringUtils.isNotEmpty(uuid)) { - return subscriptionMap.get(uuid); - } - return null; - } - - @Override - public void addJWTIssuers(List jwtIssuers) { - - Map jwtValidatorMap = new ConcurrentHashMap<>(); - for (JWTIssuer jwtIssuer : jwtIssuers) { - try { - ExtendedTokenIssuerDto tokenIssuerDto = new ExtendedTokenIssuerDto(jwtIssuer.getIssuer()); - tokenIssuerDto.setName(jwtIssuer.getName()); - tokenIssuerDto.setConsumerKeyClaim(jwtIssuer.getConsumerKeyClaim()); - tokenIssuerDto.setScopesClaim(jwtIssuer.getScopesClaim()); - Certificate certificate = jwtIssuer.getCertificate(); - if (StringUtils.isNotEmpty(certificate.getJwks().getUrl())) { - JWKSConfigurationDTO jwksConfigurationDTO = new JWKSConfigurationDTO(); - if (StringUtils.isNotEmpty(certificate.getJwks().getTls())) { - java.security.cert.Certificate tlsCertificate = - TLSUtils.getCertificateFromContent(certificate.getJwks().getTls()); - jwksConfigurationDTO.setCertificate(tlsCertificate); - } - jwksConfigurationDTO.setUrl(certificate.getJwks().getUrl()); - jwksConfigurationDTO.setEnabled(true); - tokenIssuerDto.setJwksConfigurationDTO(jwksConfigurationDTO); - } - if (StringUtils.isNotEmpty(certificate.getCertificate())) { - java.security.cert.Certificate signingCertificate = - TLSUtils.getCertificateFromContent(certificate.getCertificate()); - tokenIssuerDto.setCertificate(signingCertificate); - } - Map claimMappingMap = jwtIssuer.getClaimMappingMap(); - Map claimMappingDtos = new HashMap<>(); - claimMappingMap.forEach((remoteClaim, localClaim) -> claimMappingDtos.put(remoteClaim, - new ClaimMappingDto(remoteClaim, localClaim))); - tokenIssuerDto.setClaimMappings(claimMappingDtos); - JWTValidator jwtValidator = new JWTValidator(tokenIssuerDto); - List environments = getEnvironments(jwtIssuer); - for (String environment : environments) { - String mapKey = getMapKey(environment, jwtIssuer.getIssuer()); - jwtValidatorMap.put(mapKey, jwtValidator); - } - this.jwtValidatorMap = jwtValidatorMap; - } catch (EnforcerException | CertificateException | IOException e) { - log.error("Error occurred while configuring JWT Validator for issuer " + jwtIssuer.getIssuer(), e); - } - } - } - - @Override - public JWTValidator getJWTValidatorByIssuer(String issuer, String environment) { - - String mapKey = getMapKey(Constants.DEFAULT_ALL_ENVIRONMENTS_TOKEN_ISSUER, issuer); - JWTValidator jwtValidator = jwtValidatorMap.get(mapKey); - if (jwtValidator != null) { - return jwtValidator; - } - mapKey = getMapKey(environment, issuer); - return jwtValidatorMap.get(mapKey); - } - - @Override - public void addApplication(org.wso2.apk.enforcer.discovery.subscription.Application application) { - - Application resolvedApplication = new Application(); - resolvedApplication.setName(application.getName()); - resolvedApplication.setOwner(application.getOwner()); - resolvedApplication.setUUID(application.getUuid()); - resolvedApplication.setOrganization(application.getOrganization()); - resolvedApplication.setAttributes(application.getAttributesMap()); - if (applicationMap.containsKey(resolvedApplication.getUuid())) { - applicationMap.replace(resolvedApplication.getUuid(), resolvedApplication); - } else { - applicationMap.put(resolvedApplication.getUuid(), resolvedApplication); - } - } - - @Override - public void addSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription) { - - Subscription resolvedSubscription = new Subscription(); - resolvedSubscription.setSubscriptionId(subscription.getUuid()); - resolvedSubscription.setSubscriptionStatus(subscription.getSubStatus()); - resolvedSubscription.setOrganization(subscription.getOrganization()); - resolvedSubscription.setSubscribedApi(new SubscribedAPI(subscription.getSubscribedApi())); - resolvedSubscription.setRatelimitTier(subscription.getRatelimitTier()); - if (subscriptionMap.containsKey(resolvedSubscription.getSubscriptionId())) { - subscriptionMap.replace(resolvedSubscription.getSubscriptionId(), resolvedSubscription); - } else { - subscriptionMap.put(resolvedSubscription.getSubscriptionId(), resolvedSubscription); - } - } - - @Override - public void addApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping) { - - ApplicationMapping resolvedApplicationMapping = new ApplicationMapping(); - resolvedApplicationMapping.setUuid(applicationMapping.getUuid()); - resolvedApplicationMapping.setApplicationUUID(applicationMapping.getApplicationRef()); - resolvedApplicationMapping.setSubscriptionUUID(applicationMapping.getSubscriptionRef()); - resolvedApplicationMapping.setOrganization(applicationMapping.getOrganization()); - Map applicationMappings = new HashMap<>(); - if (applicationMappingMap.containsKey(resolvedApplicationMapping.getApplicationUUID())) { - applicationMappings = applicationMappingMap.get(resolvedApplicationMapping.getApplicationUUID()); - } - applicationMappings.put(resolvedApplicationMapping.getCacheKey(), resolvedApplicationMapping); - applicationMappingMap.put(resolvedApplicationMapping.getApplicationUUID(), applicationMappings); - } - - @Override - public void addApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping) { - - ApplicationKeyMapping resolvedApplicationKeyMapping = new ApplicationKeyMapping(); - resolvedApplicationKeyMapping.setApplicationUUID(applicationKeyMapping.getApplicationUUID()); - resolvedApplicationKeyMapping.setSecurityScheme(applicationKeyMapping.getSecurityScheme()); - resolvedApplicationKeyMapping.setApplicationIdentifier(applicationKeyMapping.getApplicationIdentifier()); - resolvedApplicationKeyMapping.setKeyType(applicationKeyMapping.getKeyType()); - resolvedApplicationKeyMapping.setEnvId(applicationKeyMapping.getEnvID()); - Iterator> iterator = applicationKeyMappingMap.entrySet().iterator(); - while (iterator.hasNext()) { - Map.Entry cachedApplicationKeyMapping = iterator.next(); - ApplicationKeyMapping value = cachedApplicationKeyMapping.getValue(); - if (value.getApplicationIdentifier().equals(resolvedApplicationKeyMapping.getApplicationIdentifier()) && value.getSecurityScheme().equals(resolvedApplicationKeyMapping.getSecurityScheme()) && value.getKeyType().equals(resolvedApplicationKeyMapping.getKeyType()) && value.getEnvId().equals(resolvedApplicationKeyMapping.getEnvId()) && value.getApplicationUUID().equals(resolvedApplicationKeyMapping.getApplicationUUID())) { - iterator.remove(); - } - } - applicationKeyMappingMap.put(resolvedApplicationKeyMapping.getCacheKey(), resolvedApplicationKeyMapping); - } - - @Override - public void removeApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping) { - - ApplicationMapping resolvedApplicationMapping = new ApplicationMapping(); - resolvedApplicationMapping.setUuid(applicationMapping.getUuid()); - resolvedApplicationMapping.setApplicationUUID(applicationMapping.getApplicationRef()); - resolvedApplicationMapping.setSubscriptionUUID(applicationMapping.getSubscriptionRef()); - resolvedApplicationMapping.setOrganization(applicationMapping.getOrganization()); - Map applicationMappings = - applicationMappingMap.get(applicationMapping.getApplicationRef()); - if (applicationMappings != null) { - applicationMappings.remove(resolvedApplicationMapping.getCacheKey()); - } - } - - @Override - public void removeApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping) { - - ApplicationKeyMapping resolvedApplicationKeyMapping = new ApplicationKeyMapping(); - resolvedApplicationKeyMapping.setApplicationUUID(applicationKeyMapping.getApplicationUUID()); - resolvedApplicationKeyMapping.setSecurityScheme(applicationKeyMapping.getSecurityScheme()); - resolvedApplicationKeyMapping.setApplicationIdentifier(applicationKeyMapping.getApplicationIdentifier()); - resolvedApplicationKeyMapping.setKeyType(applicationKeyMapping.getKeyType()); - resolvedApplicationKeyMapping.setEnvId(applicationKeyMapping.getEnvID()); - Iterator> iterator = applicationKeyMappingMap.entrySet().iterator(); - while (iterator.hasNext()) { - Map.Entry cachedApplicationKeyMapping = iterator.next(); - ApplicationKeyMapping value = cachedApplicationKeyMapping.getValue(); - if (value.getApplicationIdentifier().equals(resolvedApplicationKeyMapping.getApplicationIdentifier()) && value.getSecurityScheme().equals(resolvedApplicationKeyMapping.getSecurityScheme()) && value.getKeyType().equals(resolvedApplicationKeyMapping.getKeyType()) && value.getEnvId().equals(resolvedApplicationKeyMapping.getEnvId()) && value.getApplicationUUID().equals(resolvedApplicationKeyMapping.getApplicationUUID())) { - iterator.remove(); - } - } - } - - @Override - public void removeSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription) { - - subscriptionMap.remove(subscription.getUuid()); - - } - - @Override - public void removeApplication(org.wso2.apk.enforcer.discovery.subscription.Application application) { - - applicationMap.remove(application.getUuid()); - } - - private List getEnvironments(JWTIssuer jwtIssuer) { - - List environmentsList = new ArrayList<>(); - int environmentCount = jwtIssuer.getEnvironmentsCount(); - - if (environmentCount > 0) { - for (int i = 0; i < environmentCount; i++) { - environmentsList.add(jwtIssuer.getEnvironments(i)); - } - } else { - environmentsList.add(Constants.DEFAULT_ALL_ENVIRONMENTS_TOKEN_ISSUER); - } - return environmentsList; - } - - private String getMapKey(String environment, String issuer) { - - return environment + DELEM_PERIOD + issuer; - } - - @Override - public int getSubscriptionCount() { - - return subscriptionMap.size(); - } - - @Override - public int getJWTIssuerCount() { - - return jwtValidatorMap.size(); - } - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreUtil.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreUtil.java deleted file mode 100644 index de2aa497dc..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreUtil.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2020, 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.subscription; - -import feign.Feign; -import feign.gson.GsonDecoder; -import feign.gson.GsonEncoder; -import feign.slf4j.Slf4jLogger; -import org.wso2.apk.enforcer.common.CacheableEntity; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.discovery.JWTIssuerDiscoveryClient; -import org.wso2.apk.enforcer.discovery.subscription.Application; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping; -import org.wso2.apk.enforcer.discovery.subscription.Subscription; -import org.wso2.apk.enforcer.jmx.JMXUtils; -import org.wso2.apk.enforcer.metrics.jmx.impl.ExtAuthMetrics; -import org.wso2.apk.enforcer.util.ApacheFeignHttpClient; -import org.wso2.apk.enforcer.util.FilterUtils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Utility methods related to subscription data store functionalities. - */ -public class SubscriptionDataStoreUtil { - - private static SubscriptionValidationDataRetrievalRestClient subscriptionValidationDataRetrievalRestClient; - private static SubscriptionDataStoreUtil Instance; - - private SubscriptionDataStoreUtil() { - - String commonControllerHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); - String commonControllerHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); - int commonControllerRestPort = - Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerRestPort()); - subscriptionValidationDataRetrievalRestClient = - Feign.builder().encoder(new GsonEncoder()).decoder(new GsonDecoder()).logger(new Slf4jLogger()).client(new ApacheFeignHttpClient(FilterUtils.getMutualSSLHttpClient("https", Arrays.asList(commonControllerHost, commonControllerHostname)))).target(SubscriptionValidationDataRetrievalRestClient.class, "https://" + commonControllerHost + ":" + commonControllerRestPort); - } - - public static final String DELEM_PERIOD = "."; - - public static String getAPICacheKey(String context, String version) { - - return context + DELEM_PERIOD + version; - } - - public static String getSubscriptionCacheKey(String appId, String apiId) { - - return appId + DELEM_PERIOD + apiId; - } - - public static String getPolicyCacheKey(String tierName) { - - return tierName; - } - - public static SubscriptionDataStoreUtil getInstance() { - - if (Instance == null) { - synchronized (SubscriptionDataStoreUtil.class) { - if (Instance == null) { - Instance = new SubscriptionDataStoreUtil(); - } - return Instance; - } - } - return Instance; - } - - private static void loadApplicationKeyMappings() { - - new Thread(() -> { - ApplicationKeyMappingDtoList applicationKeyMappings = - subscriptionValidationDataRetrievalRestClient.getAllApplicationKeyMappings(); - List list = applicationKeyMappings.getList(); - Map> orgWizeMAp = new HashMap<>(); - for (ApplicationKeyMappingDTO applicationKeyMappingDTO : list) { - String organization = applicationKeyMappingDTO.getOrganizationId(); - List applicationKeyMappingDTOS = orgWizeMAp.computeIfAbsent(organization, - k -> new ArrayList<>()); - applicationKeyMappingDTOS.add(applicationKeyMappingDTO); - } - orgWizeMAp.forEach((k, v) -> { - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(k); - subscriptionDataStore.addApplicationKeyMappings(v); - }); - }).start(); - - } - - private static void loadApplicationMappings() { - - new Thread(() -> { - ApplicationMappingDtoList applicationMappings = - subscriptionValidationDataRetrievalRestClient.getAllApplicationMappings(); - List list = applicationMappings.getList(); - Map> orgWizeMAp = new HashMap<>(); - for (ApplicationMappingDto applicationMappingDto : list) { - String organization = applicationMappingDto.getOrganizationId(); - List applicationMappingDtos = orgWizeMAp.computeIfAbsent(organization, - k -> new ArrayList<>()); - applicationMappingDtos.add(applicationMappingDto); - } - orgWizeMAp.forEach((k, v) -> { - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(k); - subscriptionDataStore.addApplicationMappings(v); - }); - }).start(); - - } - - public static void initializeLoadingTasks() { - - JWTIssuerDiscoveryClient.getInstance().watchJWTIssuers(); - EventingGrpcClient.getInstance().watchEvents(); - } - - private static void loadApplications() { - - new Thread(() -> { - ApplicationListDto applications = subscriptionValidationDataRetrievalRestClient.getAllApplications(); - List list = applications.getList(); - Map> orgWizeMAp = new HashMap<>(); - for (ApplicationDto applicationDto : list) { - String organization = applicationDto.getOrganizationId(); - List applicationDtos = orgWizeMAp.computeIfAbsent(organization, k -> new ArrayList<>()); - applicationDtos.add(applicationDto); - } - orgWizeMAp.forEach((k, v) -> { - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(k); - subscriptionDataStore.addApplications(v); - }); - }).start(); - } - - private static void loadSubscriptions() { - - new Thread(() -> { - SubscriptionListDto subscriptions = subscriptionValidationDataRetrievalRestClient.getAllSubscriptions(); - List list = subscriptions.getList(); - if (JMXUtils.isJMXMetricsEnabled()) { - ExtAuthMetrics.getInstance().recordSubscriptionMetrics(SubscriptionDataHolder.getInstance().getTotalSubscriptionCount()); - } - Map> orgWizeMAp = new HashMap<>(); - for (SubscriptionDto subscriptionDto : list) { - String organization = subscriptionDto.getOrganization(); - List subscriptionDtos = orgWizeMAp.computeIfAbsent(organization, - k -> new ArrayList<>()); - subscriptionDtos.add(subscriptionDto); - } - orgWizeMAp.forEach((k, v) -> { - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(k); - subscriptionDataStore.addSubscriptions(v); - }); - }).start(); - } - - public static String getApplicationKeyMappingCacheKey(String applicationIdentifier, String keyType, - String securityScheme, String envType) { - - return securityScheme + CacheableEntity.DELEM_PERIOD + envType + CacheableEntity.DELEM_PERIOD + keyType + CacheableEntity.DELEM_PERIOD + applicationIdentifier; - } - - public static void addApplication(Application application) { - - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(application.getOrganization()); - subscriptionDataStore.addApplication(application); - - } - - public static void addSubscription(Subscription subscription) { - - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(subscription.getOrganization()); - subscriptionDataStore.addSubscription(subscription); - if (JMXUtils.isJMXMetricsEnabled()) { - ExtAuthMetrics.getInstance().recordSubscriptionMetrics(SubscriptionDataHolder.getInstance().getTotalSubscriptionCount()); - } - - } - - public static void addApplicationMapping(ApplicationMapping applicationMapping) { - - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(applicationMapping.getOrganization()); - subscriptionDataStore.addApplicationMapping(applicationMapping); - - } - - public static void addApplicationKeyMapping(ApplicationKeyMapping applicationKeyMapping) { - - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(applicationKeyMapping.getOrganization()); - subscriptionDataStore.addApplicationKeyMapping(applicationKeyMapping); - - } - - public static void removeApplicationMapping(ApplicationMapping applicationMapping) { - - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(applicationMapping.getOrganization()); - subscriptionDataStore.removeApplicationMapping(applicationMapping); - - } - - private static SubscriptionDataStore getSubscriptionDataStore(String organization) { - - SubscriptionDataStore subscriptionDataStore = - SubscriptionDataHolder.getInstance().getSubscriptionDataStore(organization); - if (subscriptionDataStore == null) { - synchronized (organization.concat("subscriptionDataStore").intern()) { - subscriptionDataStore = SubscriptionDataHolder.getInstance().getSubscriptionDataStore(organization); - if (subscriptionDataStore != null) { - return subscriptionDataStore; - } - subscriptionDataStore = SubscriptionDataHolder.getInstance().initializeSubscriptionDataStore(organization); - return subscriptionDataStore; - } - } - return subscriptionDataStore; - } - - public static void removeApplicationKeyMapping(ApplicationKeyMapping applicationKeyMapping) { - - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(applicationKeyMapping.getOrganization()); - - subscriptionDataStore.removeApplicationKeyMapping(applicationKeyMapping); - - } - - public static void removeSubscription(Subscription subscription) { - - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(subscription.getOrganization()); - subscriptionDataStore.removeSubscription(subscription); - if (JMXUtils.isJMXMetricsEnabled()) { - ExtAuthMetrics.getInstance().recordSubscriptionMetrics(SubscriptionDataHolder.getInstance().getTotalSubscriptionCount()); - } - - } - - public static void removeApplication(Application application) { - - SubscriptionDataStore subscriptionDataStore = getSubscriptionDataStore(application.getOrganization()); - subscriptionDataStore.removeApplication(application); - - } - - public void loadStartupArtifacts() { - - loadApplications(); - loadSubscriptions(); - loadApplicationMappings(); - loadApplicationKeyMappings(); - - } -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDto.java deleted file mode 100644 index 42cb28a935..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDto.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.io.Serializable; - -/** - * Entity for keeping Application related information. Represents an Application in APK. - */ -public class SubscriptionDto implements Serializable { - - private static final long serialVersionUID = 1L; - private String uuid; - private String organization; - private String subStatus; - private SubscribedAPIDto subscribedApi; - private String ratelimitTier; - - public String getUuid() { - - return uuid; - } - - public void setUuid(String uuid) { - - this.uuid = uuid; - } - - public String getOrganization() { - - return organization; - } - - public void setOrganization(String organization) { - - this.organization = organization; - } - - public String getSubStatus() { - - return subStatus; - } - - public void setSubStatus(String subStatus) { - - this.subStatus = subStatus; - } - - public SubscribedAPIDto getSubscribedApi() { - - return subscribedApi; - } - - public void setSubscribedApi(SubscribedAPIDto subscribedApi) { - - this.subscribedApi = subscribedApi; - } - - public String getRatelimitTier() { - - return ratelimitTier; - } - - public void setRatelimitTier(String ratelimitTier) { - - this.ratelimitTier = ratelimitTier; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionListDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionListDto.java deleted file mode 100644 index e89dbc1fb5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionListDto.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.wso2.apk.enforcer.subscription; - -import java.util.ArrayList; -import java.util.List; - -public class SubscriptionListDto { - - private List list = new ArrayList<>(); - - public List getList() { - - return list; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionValidationDataRetrievalRestClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionValidationDataRetrievalRestClient.java deleted file mode 100644 index 95af008b64..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionValidationDataRetrievalRestClient.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.wso2.apk.enforcer.subscription; -import feign.Headers; -import feign.Param; -import feign.RequestLine; - -public interface SubscriptionValidationDataRetrievalRestClient { - - @RequestLine("GET /applications") - @Headers("Content-Type: application/json") - ApplicationListDto getAllApplications(); - - @RequestLine("GET /subscriptions") - @Headers("Content-Type: application/json") - SubscriptionListDto getAllSubscriptions(); - - @RequestLine("GET /applicationmappings") - @Headers("Content-Type: application/json") - ApplicationMappingDtoList getAllApplicationMappings(); - - @RequestLine("GET /applicationkeymappings") - @Headers("Content-Type: application/json") - ApplicationKeyMappingDtoList getAllApplicationKeyMappings(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/RateLimiter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/RateLimiter.java deleted file mode 100644 index b68015bef1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/RateLimiter.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.wso2.apk.enforcer.tracing; - -import io.opentelemetry.sdk.common.Clock; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * This class is copied from https://github.com/open-telemetry/opentelemetry-java/blob/v1.0.0/sdk-extensions/ - * jaeger-remote-sampler/src/main/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/RateLimiter.java. - */ -class RateLimiter { - private final Clock clock; - private final double creditsPerNanosecond; - private final long maxBalance; // max balance in nano ticks - private final AtomicLong debit; // last op nano time less remaining balance - - RateLimiter(double creditsPerSecond, double maxBalance, Clock clock) { - this.clock = clock; - this.creditsPerNanosecond = creditsPerSecond / 1.0e9; - this.maxBalance = (long) (maxBalance / creditsPerNanosecond); - this.debit = new AtomicLong(clock.nanoTime() - this.maxBalance); - } - - public boolean checkCredit(double itemCost) { - long cost = (long) (itemCost / creditsPerNanosecond); - long credit; - long currentDebit; - long balance; - do { - currentDebit = debit.get(); - credit = clock.nanoTime(); - balance = credit - currentDebit; - if (balance > maxBalance) { - balance = maxBalance; - } - balance -= cost; - if (balance < 0) { - return false; - } - } while (!debit.compareAndSet(currentDebit, credit - balance)); - return true; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/RateLimitingSampler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/RateLimitingSampler.java deleted file mode 100644 index 46ff297e23..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/RateLimitingSampler.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ -package org.wso2.apk.enforcer.tracing; - -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.api.trace.SpanContext; -import io.opentelemetry.api.trace.SpanKind; -import io.opentelemetry.context.Context; -import io.opentelemetry.sdk.common.Clock; -import io.opentelemetry.sdk.trace.data.LinkData; -import io.opentelemetry.sdk.trace.samplers.Sampler; -import io.opentelemetry.sdk.trace.samplers.SamplingDecision; -import io.opentelemetry.sdk.trace.samplers.SamplingResult; - -import java.util.List; - -/** - * This class is copied from https://github.com/open-telemetry/opentelemetry-java/blob/v1.0.0/sdk-extensions/ - * jaeger-remote-sampler/src/main/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/RateLimitingSampler.java. - * This sampler uses a leaky bucket rate limiter to ensure that traces are sampled with a certain constant rate. - */ -public class RateLimitingSampler implements Sampler { - public static final String TYPE = "ratelimiting"; - - private final double maxTracesPerSecond; - private final RateLimiter rateLimiter; - private final SamplingResult onSamplingResult; - private final SamplingResult offSamplingResult; - - /** - * Creates rate limiting sampler. - * - * @param maxTracesPerSecond the maximum number of sampled traces per second. - */ - public RateLimitingSampler(int maxTracesPerSecond) { - this.maxTracesPerSecond = maxTracesPerSecond; - double maxBalance = maxTracesPerSecond < 1.0 ? 1.0 : maxTracesPerSecond; - this.rateLimiter = new RateLimiter(maxTracesPerSecond, maxBalance, Clock.getDefault()); - Attributes attributes = Attributes.empty(); - this.onSamplingResult = SamplingResult.create(SamplingDecision.RECORD_AND_SAMPLE, attributes); - this.offSamplingResult = SamplingResult.create(SamplingDecision.DROP, attributes); - } - - @Override - public SamplingResult shouldSample( - Context parentContext, - String traceId, - String name, - SpanKind spanKind, - Attributes attributes, - List parentLinks) { - final Span parentSpan = Span.fromContext(parentContext); - final SpanContext parentSpanContext = parentSpan.getSpanContext(); - if (parentSpanContext.isValid()) { - // child span - return parentSpanContext.isSampled() ? onSamplingResult : offSamplingResult; - } - // root span - return this.rateLimiter.checkCredit(1.0) ? onSamplingResult : offSamplingResult; - } - - @Override - public String getDescription() { - return String.format("RateLimitingSampler{%.2f}", maxTracesPerSecond); - } - - @Override - public String toString() { - return getDescription(); - } - - // Visible for testing - double getMaxTracesPerSecond() { - return maxTracesPerSecond; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracerBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracerBuilder.java deleted file mode 100644 index 32697c8ef2..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracerBuilder.java +++ /dev/null @@ -1,32 +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.tracing; - -import io.opentelemetry.sdk.OpenTelemetrySdk; - -import java.util.Map; - -/** - * This is the interface to implement tracer SDK to export tracing data. - */ -public interface TracerBuilder { - - OpenTelemetrySdk initSdk(Map properties) throws TracingException; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracerFactory.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracerFactory.java deleted file mode 100644 index 4bf513dd44..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracerFactory.java +++ /dev/null @@ -1,105 +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.tracing; - -import io.opentelemetry.api.trace.Tracer; -import io.opentelemetry.context.propagation.TextMapPropagator; -import io.opentelemetry.sdk.OpenTelemetrySdk; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.dto.TracingDTO; -import org.wso2.apk.enforcer.server.AuthServer; -import org.wso2.apk.enforcer.tracing.exporters.AzureExporter; -import org.wso2.apk.enforcer.tracing.exporters.JaegerExporter; -import org.wso2.apk.enforcer.tracing.exporters.OTLPExporter; -import org.wso2.apk.enforcer.tracing.exporters.ZipkinExporter; - -import java.util.HashMap; -import java.util.Map; - -/** - * This is a factory class used to implement tracers with different exporters. - */ -public class TracerFactory { - - private static final Logger logger = LogManager.getLogger(AuthServer.class); - private Tracer tracer; - private TextMapPropagator textPropagator; - private static TracerFactory tracerFactory; - - public static TracerFactory getInstance() { - if (tracerFactory == null) { - synchronized (new Object()) { - if (tracerFactory == null) { - tracerFactory = new TracerFactory(); - } - } - } - return tracerFactory; - } - - public void init() throws TracingException { - OpenTelemetrySdk sdk = null; - TracingDTO tracingConfig = ConfigHolder.getInstance().getConfig().getTracingConfig(); - String exporterType = tracingConfig.getExporterType(); - Map properties = new HashMap<>(tracingConfig.getConfigProperties()); - String instrumentName = properties.get(TracingConstants.CONF_INSTRUMENTATION_NAME); - String instrumentationName = StringUtils.isEmpty(instrumentName) ? - TracingConstants.DEFAULT_INSTRUMENTATION_NAME : instrumentName; - - if (!properties.isEmpty()) { - properties.replaceAll((k, v) -> Utils.replaceEnvRegex(v)); - } else { - throw new TracingException("Error initializing Tracer. Missing required configuration parameters."); - } - - // Future tracer implementations can be initialized from here - if (StringUtils.isEmpty(exporterType)) { - logger.warn("Tracer exporter type not defined, defaulting to Jaeger Trace Exporter"); - exporterType = TracingConstants.JAEGER_TRACE_EXPORTER; - } - if (exporterType.equalsIgnoreCase(TracingConstants.AZURE_TRACE_EXPORTER)) { - sdk = AzureExporter.getInstance().initSdk(properties); - } else if (TracingConstants.JAEGER_TRACE_EXPORTER.equalsIgnoreCase(exporterType)) { - sdk = JaegerExporter.getInstance().initSdk(properties); - } else if (TracingConstants.ZIPKIN_TRACE_EXPORTER.equalsIgnoreCase(exporterType)) { - sdk = ZipkinExporter.getInstance().initSdk(properties); - } else if (TracingConstants.OTLP_TRACE_EXPORTER.equalsIgnoreCase(exporterType)) { - sdk = OTLPExporter.getInstance().initSdk(properties); - } else { - throw new TracingException("Tracer exporter type: " + exporterType + "not found!"); - } - - if (sdk == null) { - return; - } - this.tracer = sdk.getTracer(instrumentationName); - this.textPropagator = sdk.getPropagators().getTextMapPropagator(); - } - - public TextMapPropagator getTextPropagator() { - return textPropagator; - } - - public Tracer getTracer() { - return tracer; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingConstants.java deleted file mode 100644 index 2edb8dea7f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingConstants.java +++ /dev/null @@ -1,77 +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.tracing; - -/** - * This class contains all the constants related to the tracing implementation with azure app insights - */ -public class TracingConstants { - public static final String SERVICE_NAME_PREFIX = "apk_enforcer"; - public static final String AZURE_TRACE_EXPORTER = "azure"; - public static final String JAEGER_TRACE_EXPORTER = "jaeger"; - public static final String ZIPKIN_TRACE_EXPORTER = "zipkin"; - public static final String OTLP_TRACE_EXPORTER = "otlp"; - public static final String DO_THROTTLE_SPAN = "ThrottleFilter:doThrottle():Throttling function"; - public static final String ENFORCER_START_SPAN = "Enforcer:Starting request verification"; - public static final String PUBLISH_THROTTLE_EVENT_SPAN = "ThrottleFilter:handleRequest():Publish non " + - "throttled event"; - public static final String ANALYTICS_SPAN = "AnalyticsFilter:handleSuccessRequest():Analytics Success Flow"; - public static final String ANALYTICS_FAILURE_SPAN = "AnalyticsFilter:handleSuccessRequest():Analytics Failure Flow"; - public static final String CORS_SPAN = "CorsFilter:handleRequest():Cors request handler"; - public static final String EXT_AUTH_SERVICE_SPAN = "ExtAuthService:check()"; - public static final String DECODE_TOKEN_HEADER_SPAN = "JWTAuthenticator:authenticate():Decode token header"; - public static final String JWT_AUTHENTICATOR_SPAN = "JWTAuthenticator:authenticate():Authenticate request using " + - "JWT Authenticator"; - public static final String API_KEY_AUTHENTICATOR_SPAN = "InternalAPIKeyAuthenticator:authenticate():Authenticate" + - " request using API Key Authenticator"; - public static final String API_KEY_VALIDATE_SUBSCRIPTION_SPAN = "InternalAPIKeyAuthenticator:" + - "authenticate():Validate API subscription"; - public static final String VERIFY_TOKEN_IN_CACHE_SPAN = "InternalAPIKeyAuthenticator:authenticate():Verify " + - "internal key/token in cache"; - public static final String VERIFY_TOKEN_SPAN = "InternalAPIKeyAuthenticator:authenticate():Verify internal " + - "key/token when it is not found in cache"; - public static final String OAUTH_AUTHENTICATOR_SPAN = "OAUTHAuthenticator:authenticate():Authenticate request " - + "using OAUTH Authenticator"; - public static final String SUBSCRIPTION_VALIDATION_SPAN = "JWTAuthenticator:authenticate():Validate " + - "subscription using key manager"; - public static final String SCOPES_VALIDATION_SPAN = "JWTAuthenticator:authenticate():Validate scopes"; - public static final String UNSECURED_API_AUTHENTICATOR_SPAN = "UnsecuredAPIAuthenticator:authenticate():" + - "Authenticate request using Unsecured Api Authenticator."; - public static final String MTLS_API_AUTHENTICATOR_SPAN = "MTLSAPIAuthenticator:authenticate():" + - "Authenticate request using MTLS Api Authenticator."; -// public static final String WS_HANDLER_SPAN = "WebSocketHandler:process():Handle request coming through" + -// " websocket frame service"; -// public static final String WS_THROTTLE_SPAN = "WebSocketThrottleFilter:handleRequest():WebSocket throttling filter"; -// public static final String WS_METADATA_SPAN = "WebSocketMetaDataFilter:handleRequest():WebSocket Metadata filter"; - - // config property keys - public static final String CONF_CONNECTION_STRING = "connectionString"; - public static final String CONF_MAX_TRACES_PER_SEC = "maximumTracesPerSecond"; - public static final String CONF_INSTRUMENTATION_NAME = "instrumentationName"; - public static final String CONF_EXPORTER_TIMEOUT = "timeout"; - public static final String CONF_ENDPOINT = "endpoint"; - public static final String CONF_HOST = "host"; - public static final String CONF_PORT = "port"; - public static final String CONF_AUTH_HEADER_NAME = "authHeaderName"; - public static final String CONF_AUTH_HEADER_VALUE = "authHeaderValue"; - public static final int DEFAULT_MAX_TRACES_PER_SEC = 2; - public static final String DEFAULT_INSTRUMENTATION_NAME = "APK"; - public static final long DEFAULT_TRACING_READ_TIMEOUT = 15; -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingContextHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingContextHolder.java deleted file mode 100644 index 112ebf86a3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingContextHolder.java +++ /dev/null @@ -1,39 +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.tracing; - -import io.opentelemetry.context.Context; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Holds an instance of Tracing context per thread. - */ -public class TracingContextHolder { - private static final Map contextMap = new ConcurrentHashMap<>(); - - public static void setContext(String traceId, Context context) { - contextMap.putIfAbsent(traceId, context); - } - - public static Context getContext(String traceId) { - return contextMap.remove(traceId); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingException.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingException.java deleted file mode 100644 index 66118293b9..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingException.java +++ /dev/null @@ -1,38 +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.tracing; - -/** - * This is the custom exception class for tracing. - */ -public class TracingException extends Exception { - - - public TracingException(String msg) { - super(msg); - } - - public TracingException(String msg, Throwable e) { - super(msg, e); - } - - public TracingException(Throwable throwable) { - super(throwable); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingSpan.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingSpan.java deleted file mode 100644 index 42653a6412..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingSpan.java +++ /dev/null @@ -1,39 +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.tracing; - -import io.opentelemetry.api.trace.Span; - -/** - * A Wrapper class for io.opentelemetry.api.trace Span - */ - -public class TracingSpan { - - private Span span; - - public TracingSpan(Span span) { - this.span = span; - } - - public Span getSpan() { - return this.span; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingTracer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingTracer.java deleted file mode 100644 index 71a76871e8..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/TracingTracer.java +++ /dev/null @@ -1,39 +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.tracing; - - -import io.opentelemetry.api.trace.Tracer; - -/** - * A Wrapper class for io.opentelemetry.api.trace Tracer - */ -public class TracingTracer { - - private Tracer tracer; - - public TracingTracer(Tracer tracer) { - this.tracer = tracer; - } - - Tracer getTracingTracer() { - return this.tracer; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/Utils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/Utils.java deleted file mode 100644 index adbee8b82f..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/Utils.java +++ /dev/null @@ -1,123 +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.tracing; - -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.api.trace.SpanKind; -import io.opentelemetry.context.Context; -import org.wso2.apk.enforcer.constants.Constants; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Span utility class - */ -public class Utils { - - private static boolean isTracingEnabled = false; - - /** - * Initialize a span with parent context. Used to link the enforcer traces under - * router's trace context. - * - * @param spanName the name of the span - * @param context parent trace context - * @param tracer a tracer instance - * @return a TracingSpan object - */ - public static TracingSpan startSpan(String spanName, Context context, TracingTracer tracer) { - if (context == null) { - return startSpan(spanName, tracer); - } - Span cs = tracer.getTracingTracer().spanBuilder(spanName) - .setParent(context) - .setSpanKind(SpanKind.SERVER) - .startSpan(); - return new TracingSpan(cs); - } - - /** - * Start the tracing span - * - * @param spanName the name of the span - * @param tracer io.opentelemetry.api.trace.Span - * @return a TracingSpan object - */ - public static TracingSpan startSpan(String spanName, TracingTracer tracer) { - Span span = tracer.getTracingTracer().spanBuilder(spanName).startSpan(); - return new TracingSpan(span); - } - - /** - * Set tag to the span - * - * @param span the span tag is to be set - * @param key key - * @param value value - */ - public static void setTag(TracingSpan span, String key, String value) { - - Span sp = span.getSpan(); - if (sp != null) { - sp.setAttribute(key, value); - } - } - - /** - * Finish the span - * - * @param span span that is to be finished - */ - public static void finishSpan(TracingSpan span) { - - Span sp = span.getSpan(); - if (sp != null) { - sp.end(); - } - } - - public static void setTracingEnabled(boolean isTracingEnabled) { - - Utils.isTracingEnabled = isTracingEnabled; - } - - public static boolean tracingEnabled() { - - return isTracingEnabled; - } - - public static TracingTracer getGlobalTracer() { - - return new TracingTracer(TracerFactory.getInstance().getTracer()); - } - - public static String replaceEnvRegex(String value) { - Matcher m = Pattern.compile("\\$env\\{(.*?)\\}").matcher(value); - if (value.contains(Constants.ENV_PREFIX)) { - while (m.find()) { - String envName = value.substring(m.start() + 5, m.end() - 1); - if (System.getenv(envName) != null) { - value = value.replace(value.substring(m.start(), m.end()), System.getenv(envName)); - } - } - } - return value; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/AzureExporter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/AzureExporter.java deleted file mode 100644 index 094984f604..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/AzureExporter.java +++ /dev/null @@ -1,82 +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.tracing.exporters; - -import com.azure.monitor.opentelemetry.exporter.AzureMonitorExporterBuilder; -import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator; -import io.opentelemetry.context.propagation.ContextPropagators; -import io.opentelemetry.sdk.OpenTelemetrySdk; -import io.opentelemetry.sdk.trace.SdkTracerProvider; -import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; -import io.opentelemetry.sdk.trace.export.SpanExporter; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.tracing.RateLimitingSampler; -import org.wso2.apk.enforcer.tracing.TracerBuilder; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingException; - -import java.util.Map; - -/** - * This class is responsible for managing and exporting tracing spans. - */ -public class AzureExporter implements TracerBuilder { - - private static final Logger LOGGER = LogManager.getLogger(AzureExporter.class); - private static AzureExporter exporter; - - public static AzureExporter getInstance() { - if (exporter == null) { - synchronized (new Object()) { - if (exporter == null) { - exporter = new AzureExporter(); - } - } - } - return exporter; - } - - /** - * Initialize the tracer SDK with SpanExporter. - */ - @Override - public OpenTelemetrySdk initSdk(Map properties) throws TracingException { - String connectionString = properties.get(TracingConstants.CONF_CONNECTION_STRING); - if (StringUtils.isEmpty(connectionString)) { - throw new TracingException("Error initializing Azure Trace Exporter. ConnectionString is null or empty."); - } - String maxTracesPerSecondString = properties.get(TracingConstants.CONF_MAX_TRACES_PER_SEC); - int maxTracesPerSecond = StringUtils.isEmpty(maxTracesPerSecondString) ? - TracingConstants.DEFAULT_MAX_TRACES_PER_SEC : Integer.parseInt(maxTracesPerSecondString); - - SpanExporter exporter = new AzureMonitorExporterBuilder() - .connectionString(connectionString).buildTraceExporter(); - SdkTracerProvider tracerProvider = SdkTracerProvider.builder() - .setSampler(new RateLimitingSampler(maxTracesPerSecond)) - .addSpanProcessor(SimpleSpanProcessor.create(exporter)).build(); - - OpenTelemetrySdk ot = OpenTelemetrySdk.builder() - .setPropagators(ContextPropagators.create(W3CTraceContextPropagator.getInstance())) - .setTracerProvider(tracerProvider).buildAndRegisterGlobal(); - - LOGGER.info("Trace SDK successfully initialized with Azure Trace Exporter."); - return ot; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/JaegerExporter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/JaegerExporter.java deleted file mode 100644 index 114d3e34da..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/JaegerExporter.java +++ /dev/null @@ -1,98 +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.tracing.exporters; - -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator; -import io.opentelemetry.context.propagation.ContextPropagators; -import io.opentelemetry.exporter.jaeger.thrift.JaegerThriftSpanExporter; -import io.opentelemetry.sdk.OpenTelemetrySdk; -import io.opentelemetry.sdk.resources.Resource; -import io.opentelemetry.sdk.trace.SdkTracerProvider; -import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.tracing.RateLimitingSampler; -import org.wso2.apk.enforcer.tracing.TracerBuilder; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingException; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Map; - -/** - * This class is responsible for exporting tracing spans for jaeger. - */ -public class JaegerExporter implements TracerBuilder { - - private static final Logger LOGGER = LogManager.getLogger(JaegerExporter.class); - private static JaegerExporter exporter; - - public static JaegerExporter getInstance() { - if (exporter == null) { - synchronized (new Object()) { - if (exporter == null) { - exporter = new JaegerExporter(); - } - } - } - return exporter; - } - - /** - * Initialize the tracer SDK with {@link JaegerExporter}. - */ - @Override - public OpenTelemetrySdk initSdk(Map properties) throws TracingException { - String ep; - String host = properties.get(TracingConstants.CONF_HOST); - String path = properties.get(TracingConstants.CONF_ENDPOINT); - ConfigHolder conf = ConfigHolder.getInstance(); - try { - int port = Integer.parseInt(properties.get(TracingConstants.CONF_PORT)); - ep = new URL("http", host, port, path).toString(); - } catch (MalformedURLException | NumberFormatException e) { - throw new TracingException("Couldn't initialize the zipkin exporter. Invalid endpoint definition", e); - } - - JaegerThriftSpanExporter jaegerExporter = JaegerThriftSpanExporter.builder().setEndpoint(ep).build(); - String serviceName = TracingConstants.SERVICE_NAME_PREFIX + '-' + conf.getEnvVarConfig().getEnforcerLabel(); - Resource serviceNameResource = - Resource.create(Attributes.of(ResourceAttributes.SERVICE_NAME, serviceName)); - String maxTracesPerSecondString = properties.get(TracingConstants.CONF_MAX_TRACES_PER_SEC); - int maxTracesPerSecond = StringUtils.isEmpty(maxTracesPerSecondString) ? - TracingConstants.DEFAULT_MAX_TRACES_PER_SEC : Integer.parseInt(maxTracesPerSecondString); - - // Set to process the spans by the Jaeger Exporter - SdkTracerProvider provider = SdkTracerProvider.builder() - .addSpanProcessor(SimpleSpanProcessor.create(jaegerExporter)) - .setSampler(new RateLimitingSampler(maxTracesPerSecond)) - .setResource(Resource.getDefault().merge(serviceNameResource)) - .build(); - OpenTelemetrySdk ot = OpenTelemetrySdk.builder().setTracerProvider(provider) - .setPropagators(ContextPropagators.create(W3CTraceContextPropagator.getInstance())) - .buildAndRegisterGlobal(); - - LOGGER.info("Trace SDK successfully initialized with Jaeger Trace Exporter."); - return ot; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/OTLPExporter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/OTLPExporter.java deleted file mode 100644 index 39503d6b47..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/OTLPExporter.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.tracing.exporters; - -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator; -import io.opentelemetry.context.propagation.ContextPropagators; -import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; -import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporterBuilder; -import io.opentelemetry.sdk.OpenTelemetrySdk; -import io.opentelemetry.sdk.resources.Resource; -import io.opentelemetry.sdk.trace.SdkTracerProvider; -import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.client.utils.URIBuilder; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.tracing.RateLimitingSampler; -import org.wso2.apk.enforcer.tracing.TracerBuilder; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingException; - -import java.net.URISyntaxException; -import java.util.Map; - -/** - * Trace Exporter for Open Telemetry Protocol - */ -public class OTLPExporter implements TracerBuilder { - - private static final Logger LOGGER = LogManager.getLogger(OTLPExporter.class); - - private static OTLPExporter exporter; - - public static OTLPExporter getInstance() { - if (exporter == null) { - synchronized (new Object()) { - if (exporter == null) { - exporter = new OTLPExporter(); - } - } - } - return exporter; - } - - @Override - public OpenTelemetrySdk initSdk(Map properties) throws TracingException { - String host = properties.get(TracingConstants.CONF_HOST); - String portString = properties.get(TracingConstants.CONF_PORT); - String authHeaderName = properties.get(TracingConstants.CONF_AUTH_HEADER_NAME); - String authHeaderValue = properties.get(TracingConstants.CONF_AUTH_HEADER_VALUE); - String connectionString = properties.get(TracingConstants.CONF_CONNECTION_STRING); - ConfigHolder conf = ConfigHolder.getInstance(); - OtlpGrpcSpanExporterBuilder otlpGrpcSpanExporterBuilder = OtlpGrpcSpanExporter.builder(); - - if (connectionString != null) { - otlpGrpcSpanExporterBuilder.setEndpoint(connectionString); - } else if (host != null && portString != null) { - try { - int port = Integer.parseInt(portString); - String endpoint = new URIBuilder().setHost(host).setPort(port) - .setScheme(host.contains("https") ? "https" : "http") - .build().toString(); - otlpGrpcSpanExporterBuilder.setEndpoint(endpoint); - } catch (URISyntaxException | NumberFormatException e) { - throw new TracingException("Couldn't initialize the OTLP exporter. Invalid endpoint definition", e); - } - } else { - throw new TracingException("Invalid endpoint configuration for OTLP gRPC collector endpoint. " + - "Please provide host, port or connectionString"); - } - - // Optional auth header for Saas providers and other telemetry backends that supports token/key based - // authentication. - if (!StringUtils.isBlank(authHeaderName) && !StringUtils.isBlank(authHeaderValue)) { - otlpGrpcSpanExporterBuilder.addHeader(authHeaderName, authHeaderValue); - } - - OtlpGrpcSpanExporter otlpGrpcSpanExporter = otlpGrpcSpanExporterBuilder.build(); - String serviceName = TracingConstants.SERVICE_NAME_PREFIX + '-' + conf.getEnvVarConfig().getEnforcerLabel(); - Resource serviceNameResource = Resource.create(Attributes.of(ResourceAttributes.SERVICE_NAME, serviceName)); - String maxTracesPerSecondString = properties.get(TracingConstants.CONF_MAX_TRACES_PER_SEC); - int maxTracesPerSecond = StringUtils.isEmpty(maxTracesPerSecondString) ? - TracingConstants.DEFAULT_MAX_TRACES_PER_SEC : Integer.parseInt(maxTracesPerSecondString); - - SdkTracerProvider provider = SdkTracerProvider.builder().addSpanProcessor(SimpleSpanProcessor - .create(otlpGrpcSpanExporter)).setSampler(new RateLimitingSampler(maxTracesPerSecond)) - .setResource(Resource.getDefault().merge(serviceNameResource)).build(); - OpenTelemetrySdk openTelemetrySdk = OpenTelemetrySdk.builder().setTracerProvider(provider) - .setPropagators(ContextPropagators.create(W3CTraceContextPropagator.getInstance())) - .buildAndRegisterGlobal(); - LOGGER.info("Trace SDK successfully initialized with OTLP Trace Exporter"); - return openTelemetrySdk; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/ZipkinExporter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/ZipkinExporter.java deleted file mode 100644 index 6348fb201c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/tracing/exporters/ZipkinExporter.java +++ /dev/null @@ -1,104 +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.tracing.exporters; - -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.context.propagation.ContextPropagators; -import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter; -import io.opentelemetry.extension.trace.propagation.B3Propagator; -import io.opentelemetry.sdk.OpenTelemetrySdk; -import io.opentelemetry.sdk.resources.Resource; -import io.opentelemetry.sdk.trace.SdkTracerProvider; -import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.tracing.RateLimitingSampler; -import org.wso2.apk.enforcer.tracing.TracerBuilder; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingException; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** - * This class is responsible for exporting tracing spans for zipkin. - */ -public class ZipkinExporter implements TracerBuilder { - private static final Logger LOGGER = LogManager.getLogger(ZipkinExporter.class); - private static ZipkinExporter exporter; - - public static ZipkinExporter getInstance() { - if (exporter == null) { - synchronized (new Object()) { - if (exporter == null) { - exporter = new ZipkinExporter(); - } - } - } - return exporter; - } - - /** - * Initialize the tracer SDK with {@link ZipkinExporter}. - */ - @Override - public OpenTelemetrySdk initSdk(Map properties) throws TracingException { - String ep; - String host = properties.get(TracingConstants.CONF_HOST); - String path = properties.get(TracingConstants.CONF_ENDPOINT); - ConfigHolder conf = ConfigHolder.getInstance(); - try { - int port = Integer.parseInt(properties.get(TracingConstants.CONF_PORT)); - ep = new URL("http", host, port, path).toString(); - } catch (MalformedURLException | NumberFormatException e) { - throw new TracingException("Couldn't initialize the zipkin exporter. Invalid endpoint definition", e); - } - - String readTimeoutString = properties.get(properties.get(TracingConstants.CONF_EXPORTER_TIMEOUT)); - long readTimeout = !StringUtils.isEmpty(readTimeoutString) ? Long.parseLong(readTimeoutString) - : TracingConstants.DEFAULT_TRACING_READ_TIMEOUT; - ZipkinSpanExporter zipkinExporter = ZipkinSpanExporter.builder() - .setEndpoint(ep) - .setReadTimeout(readTimeout, TimeUnit.SECONDS) - .build(); - String serviceName = TracingConstants.SERVICE_NAME_PREFIX + '-' + conf.getEnvVarConfig().getEnforcerLabel(); - Resource serviceNameResource = - Resource.create(Attributes.of(ResourceAttributes.SERVICE_NAME, serviceName)); - String maxTracesPerSecondString = properties.get(TracingConstants.CONF_MAX_TRACES_PER_SEC); - int maxTracesPerSecond = StringUtils.isEmpty(maxTracesPerSecondString) ? - TracingConstants.DEFAULT_MAX_TRACES_PER_SEC : Integer.parseInt(maxTracesPerSecondString); - - // Set to process the spans by the zipkin Exporter - SdkTracerProvider provider = SdkTracerProvider.builder() - .addSpanProcessor(SimpleSpanProcessor.create(zipkinExporter)) - .setSampler(new RateLimitingSampler(maxTracesPerSecond)) - .setResource(Resource.getDefault().merge(serviceNameResource)) - .build(); - OpenTelemetrySdk ot = OpenTelemetrySdk.builder().setTracerProvider(provider) - .setPropagators(ContextPropagators.create(B3Propagator.injectingMultiHeaders())) - .buildAndRegisterGlobal(); - - LOGGER.info("Trace SDK successfully initialized with Zipkin Trace Exporter."); - return ot; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/ApacheFeignHttpClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/ApacheFeignHttpClient.java deleted file mode 100644 index 398fad2b2e..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/ApacheFeignHttpClient.java +++ /dev/null @@ -1,238 +0,0 @@ -package org.wso2.apk.enforcer.util;/* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -import feign.Client; -import feign.Request; -import feign.Response; -import feign.Util; -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.NameValuePair; -import org.apache.http.StatusLine; -import org.apache.http.client.HttpClient; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.Configurable; -import org.apache.http.client.methods.HttpUriRequest; -import org.apache.http.client.methods.RequestBuilder; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.client.utils.URLEncodedUtils; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.util.EntityUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static feign.Util.UTF_8; - -/*** - * This class is to be used to get HTTP Client from feign library - * TODO: Remove this once the Http Client library is updated - */ -public final class ApacheFeignHttpClient implements Client { - private static final String ACCEPT_HEADER_NAME = "Accept"; - public static final String CHARSET = "UTF-8"; - - private final HttpClient client; - - public ApacheFeignHttpClient() { - this(HttpClientBuilder.create().build()); - } - - public ApacheFeignHttpClient(HttpClient client) { - this.client = client; - } - - @Override - public Response execute(Request request, Request.Options options) throws IOException { - HttpUriRequest httpUriRequest; - try { - httpUriRequest = toHttpUriRequest(request, options); - } catch (URISyntaxException e) { - throw new IOException("URL '" + request.url() + "' couldn't be parsed into a URI", e); - } - HttpResponse httpResponse = client.execute(httpUriRequest); - return toFeignResponse(httpResponse, request); - } - - HttpUriRequest toHttpUriRequest(Request request, Request.Options options) - throws URISyntaxException { - RequestBuilder requestBuilder = RequestBuilder.create(request.httpMethod().name()); - - // per request timeouts - RequestConfig requestConfig = - (client instanceof Configurable ? RequestConfig.copy(((Configurable) client).getConfig()) - : RequestConfig.custom()) - .setConnectTimeout(options.connectTimeoutMillis()) - .setSocketTimeout(options.readTimeoutMillis()) - .build(); - requestBuilder.setConfig(requestConfig); - - URI uri = new URIBuilder(request.url()).build(); - - requestBuilder.setUri(uri.getScheme() + "://" + uri.getAuthority() + uri.getRawPath()); - - // request query params - List queryParams = - URLEncodedUtils.parse(uri,CHARSET); - for (NameValuePair queryParam : queryParams) { - requestBuilder.addParameter(queryParam); - } - - // request headers - boolean hasAcceptHeader = false; - for (Map.Entry> headerEntry : request.headers().entrySet()) { - String headerName = headerEntry.getKey(); - if (headerName.equalsIgnoreCase(ACCEPT_HEADER_NAME)) { - hasAcceptHeader = true; - } - - if (headerName.equalsIgnoreCase(Util.CONTENT_LENGTH)) { - // The 'Content-Length' header is always set by the Apache client and it - // doesn't like us to set it as well. - continue; - } - - for (String headerValue : headerEntry.getValue()) { - requestBuilder.addHeader(headerName, headerValue); - } - } - // some servers choke on the default accept string, so we'll set it to anything - if (!hasAcceptHeader) { - requestBuilder.addHeader(ACCEPT_HEADER_NAME, "*/*"); - } - - // request body - if (request.body() != null) { - HttpEntity entity = null; - if (request.charset() != null) { - ContentType contentType = getContentType(request); - String content = new String(request.body(), request.charset()); - entity = new StringEntity(content, contentType); - } else { - entity = new ByteArrayEntity(request.body()); - } - - requestBuilder.setEntity(entity); - } else { - requestBuilder.setEntity(new ByteArrayEntity(new byte[0])); - } - - return requestBuilder.build(); - } - - private ContentType getContentType(Request request) { - ContentType contentType = null; - for (Map.Entry> entry : request.headers().entrySet()) - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - Collection values = entry.getValue(); - if (values != null && !values.isEmpty()) { - contentType = ContentType.parse(values.iterator().next()); - if (contentType.getCharset() == null) { - contentType = contentType.withCharset(request.charset()); - } - break; - } - } - return contentType; - } - - Response toFeignResponse(HttpResponse httpResponse, Request request) throws IOException { - StatusLine statusLine = httpResponse.getStatusLine(); - int statusCode = statusLine.getStatusCode(); - - String reason = statusLine.getReasonPhrase(); - - Map> headers = new HashMap>(); - for (Header header : httpResponse.getAllHeaders()) { - String name = header.getName(); - String value = header.getValue(); - - Collection headerValues = headers.get(name); - if (headerValues == null) { - headerValues = new ArrayList(); - headers.put(name, headerValues); - } - headerValues.add(value); - } - - return Response.builder() - .status(statusCode) - .reason(reason) - .headers(headers) - .request(request) - .body(toFeignBody(httpResponse)) - .build(); - } - - Response.Body toFeignBody(HttpResponse httpResponse) { - final HttpEntity entity = httpResponse.getEntity(); - if (entity == null) { - return null; - } - return new Response.Body() { - - @Override - public Integer length() { - return entity.getContentLength() >= 0 && entity.getContentLength() <= Integer.MAX_VALUE - ? (int) entity.getContentLength() - : null; - } - - @Override - public boolean isRepeatable() { - return entity.isRepeatable(); - } - - @Override - public InputStream asInputStream() throws IOException { - return entity.getContent(); - } - - @SuppressWarnings("deprecation") - @Override - public Reader asReader() throws IOException { - return new InputStreamReader(asInputStream(), UTF_8); - } - - @Override - public Reader asReader(Charset charset) throws IOException { - Util.checkNotNull(charset, "charset should not be null"); - return new InputStreamReader(asInputStream(), charset); - } - - @Override - public void close() throws IOException { - EntityUtils.consume(entity); - } - }; - } -} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/BackendJwtUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/BackendJwtUtils.java deleted file mode 100644 index 024ba997f5..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/BackendJwtUtils.java +++ /dev/null @@ -1,184 +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.util; - -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.common.CacheProviderUtil; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.dto.JWTInfoDto; -import org.wso2.apk.enforcer.commons.exception.JWTGeneratorException; -import org.wso2.apk.enforcer.commons.jwtgenerator.APIMgtGatewayJWTGeneratorImpl; -import org.wso2.apk.enforcer.commons.jwtgenerator.APIMgtGatewayUrlSafeJWTGeneratorImpl; -import org.wso2.apk.enforcer.commons.jwtgenerator.AbstractAPIMgtGatewayJWTGenerator; -import org.wso2.apk.enforcer.commons.jwttransformer.JWTTransformer; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.JwtConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.security.jwt.JwtTransformerAnnotation; -import org.wso2.apk.enforcer.security.jwt.validator.JWTConstants; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Base64; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.ServiceLoader; - -/** - * Contains Util methods related to backend JWT generation. - */ -public class BackendJwtUtils { - - private static final Logger log = LogManager.getLogger(BackendJwtUtils.class); - - /** - * Generates or gets the Cached Backend JWT token. - * - * @param jwtGenerator the jwtGenerator instance to use if generating the token - * @param tokenSignature token signature to use in the cache key - * @param jwtInfoDto information to include in the jwt - * @param isGatewayTokenCacheEnabled whether gateway token cache is enabled - * @return backend jwt token - * @throws APISecurityException if an error occurs while generating the token - */ - public static String generateAndRetrieveJWTToken(AbstractAPIMgtGatewayJWTGenerator jwtGenerator, - String tokenSignature, JWTInfoDto jwtInfoDto, - boolean isGatewayTokenCacheEnabled, String organization) throws APISecurityException { - - log.debug("Inside generateAndRetrieveJWTToken"); - String endUserToken = null; - boolean valid = false; - String jwtTokenCacheKey = jwtInfoDto.getApiContext().concat(":").concat(jwtInfoDto.getVersion()).concat(":") - .concat(tokenSignature); // TODO: (suksw) Check if to add tenantName or label also - - if (jwtGenerator != null) { - if (isGatewayTokenCacheEnabled) { - try { - Object token = - CacheProviderUtil.getOrganizationCache(organization).getGatewayJWTTokenCache().get(jwtTokenCacheKey); - if (!JWTConstants.UNAVAILABLE.equals(token)) { - endUserToken = (String) token; - String[] splitToken = endUserToken.split("\\."); - org.json.JSONObject payload = new org.json.JSONObject(new String(Base64.getUrlDecoder().decode(splitToken[1]))); - long exp = payload.getLong(JwtConstants.EXP); - valid = !JWTUtils.isExpired(exp); - } - } catch (Exception e) { - log.error("Error while getting token from the cache", e); - } - - if (StringUtils.isEmpty(endUserToken) || !valid) { - endUserToken = generateToken(jwtGenerator, jwtInfoDto, true, jwtTokenCacheKey, organization); - } - } else { - endUserToken = generateToken(jwtGenerator, jwtInfoDto, false, jwtTokenCacheKey, organization); - } - } else { - log.debug("Error while loading JWTGenerator"); - } - return endUserToken; - } - - private static String generateToken(AbstractAPIMgtGatewayJWTGenerator jwtGenerator, JWTInfoDto jwtInfoDto, - boolean isGatewayTokenCacheEnabled, String jwtTokenCacheKey, - String organization) throws APISecurityException { - - String endUserToken; - JWTConfigurationDto jwtConfigurationDto = jwtGenerator.getJWTConfigurationDto(); - jwtGenerator.setJWTConfigurationDto(jwtConfigurationDto); - try { - endUserToken = jwtGenerator.generateToken(jwtInfoDto); - if (isGatewayTokenCacheEnabled) { - CacheProviderUtil.getOrganizationCache(organization).getGatewayJWTTokenCache().put(jwtTokenCacheKey, - endUserToken); - } - } catch (JWTGeneratorException e) { - log.error("Error while Generating Backend JWT", e); - throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode(), - APISecurityConstants.API_AUTH_GENERAL_ERROR, - APISecurityConstants.API_AUTH_GENERAL_ERROR_MESSAGE, e); - } - return endUserToken; - } - - /** - * Load the specified backend JWT Generator. - * - * @param jwtConfigurationDtoFromAPI jwt configuration dto from api - * @return an instance of the JWT Generator given in the config - */ - public static AbstractAPIMgtGatewayJWTGenerator getApiMgtGatewayJWTGenerator(final JWTConfigurationDto jwtConfigurationDtoFromAPI) { - - JWTConfigurationDto jwtConfigurationDto = jwtConfigurationDtoFromAPI; - AbstractAPIMgtGatewayJWTGenerator jwtGenerator = null; - if ("Base64".equals(jwtConfigurationDto.getEncoding())){ - return new APIMgtGatewayJWTGeneratorImpl(); - }else if ("Base64Url".equals(jwtConfigurationDto.getEncoding())){ - return new APIMgtGatewayUrlSafeJWTGeneratorImpl(); - } - return null; - } - - /** - * Load the specified JWT Transformers. - * - * @return a map of JWT Transformers - */ - public static Map loadJWTTransformers() { - - ServiceLoader loader = ServiceLoader.load(JWTTransformer.class); - Iterator classIterator = loader.iterator(); - Map jwtTransformersMap = new HashMap<>(); - - if (!classIterator.hasNext()) { - log.debug("No JWTTransformers found."); - return jwtTransformersMap; - } - - while (classIterator.hasNext()) { - JWTTransformer transformer = classIterator.next(); - Annotation[] annotations = transformer.getClass().getAnnotations(); - if (annotations.length == 0) { - log.debug("JWTTransformer is discarded as no annotations found : {}", - transformer.getClass().getCanonicalName()); - continue; - } - for (Annotation annotation : annotations) { - if (annotation instanceof JwtTransformerAnnotation) { - JwtTransformerAnnotation jwtTransformerAnnotation = - (JwtTransformerAnnotation) annotation; - if (jwtTransformerAnnotation.enabled()) { - log.debug("JWTTransformer for the issuer : {} is enabled.", - jwtTransformerAnnotation.issuer()); - jwtTransformersMap.put(jwtTransformerAnnotation.issuer(), transformer); - } else { - log.debug("JWTTransformer for the issuer : {} is disabled.", - jwtTransformerAnnotation.issuer()); - } - } - } - } - return jwtTransformersMap; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/EndpointUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/EndpointUtils.java deleted file mode 100644 index 975215ce5c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/EndpointUtils.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.util; - -import org.apache.commons.lang3.StringUtils; -import org.wso2.apk.enforcer.commons.model.EndpointCluster; -import org.wso2.apk.enforcer.commons.model.EndpointSecurity; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.commons.model.RetryConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.constants.APIConstants; - -import java.util.Base64; -import java.util.Map; - -import org.wso2.apk.enforcer.constants.AdapterConstants; - -/** - * Util methods related to backend endpoint security. - */ -public class EndpointUtils { - - /** - * Adds the backend endpoint security header to the given requestContext. - * - * @param requestContext requestContext instance to add the backend endpoint security header - */ - public static void addEndpointSecurity(RequestContext requestContext) { - if (requestContext.getMatchedResourcePaths() != null) { - // getting only first element as there could be only one resourcepaths for APIs except for graphQL APIs. - // For GQL APIs too would only have one endpoint for all resources. - ResourceConfig resourceConfig = requestContext.getMatchedResourcePaths().get(0); - if (resourceConfig.getEndpointSecurity() != null) { - for (EndpointSecurity securityInfo : resourceConfig.getEndpointSecurity()) { - if (securityInfo != null && securityInfo.isEnabled() && - APIConstants.AUTHORIZATION_HEADER_BASIC. - equalsIgnoreCase(securityInfo.getSecurityType())) { - requestContext.getRemoveHeaders().remove(APIConstants.AUTHORIZATION_HEADER_DEFAULT - .toLowerCase()); - requestContext.addOrModifyHeaders(APIConstants.AUTHORIZATION_HEADER_DEFAULT, - APIConstants.AUTHORIZATION_HEADER_BASIC + ' ' + - Base64.getEncoder().encodeToString((securityInfo.getUsername() + - ':' + String.valueOf(securityInfo.getPassword())).getBytes())); - } - // Add APIKey header if the security type is APIKey - if (securityInfo != null && securityInfo.isEnabled() && - "APIKey".equalsIgnoreCase(securityInfo.getSecurityType())) { - if ("Header".equalsIgnoreCase(securityInfo.getCustomParameters().get("in"))) { - requestContext.getRemoveHeaders().remove(APIConstants.AUTHORIZATION_HEADER_DEFAULT - .toLowerCase()); - requestContext.addOrModifyHeaders(securityInfo.getCustomParameters().get("key"), - securityInfo.getCustomParameters().get("value")); - } else if ("Query".equalsIgnoreCase(securityInfo.getCustomParameters().get("in"))) { - Map queryParamsToAdd = requestContext.getQueryParamsToAdd(); - queryParamsToAdd.put(securityInfo.getCustomParameters().get("key"), - securityInfo.getCustomParameters().get("value")); - } - } - } - } - } - } - - /** - * Update the cluster header based on the keyType and authenticate the token against its respective endpoint - * environment. - * - * @param requestContext request Context - */ - public static void updateClusterHeaderAndCheckEnv(RequestContext requestContext) { - EnforcerConfig enforcerConfig = ConfigHolder.getInstance().getConfig(); - if (!enforcerConfig.getEnableGatewayClassController()) { - requestContext.addOrModifyHeaders(AdapterConstants.CLUSTER_HEADER, requestContext.getClusterHeader()); - } - requestContext.getRemoveHeaders().remove(AdapterConstants.CLUSTER_HEADER); - addRouterHttpHeaders(requestContext); - addEndpointSecurity(requestContext); - } - - private static void addRouterHttpHeaders(RequestContext requestContext) { - // requestContext.getMatchedResourcePaths() will only have one element for non GraphQL APIs. - // Also, GraphQL APIs doesn't have resource level endpoint configs - ResourceConfig resourceConfig = requestContext.getMatchedResourcePaths().get(0); - // In websockets case, the endpoints object becomes null. Hence it would result - // in a NPE, if it is not checked. - if (resourceConfig.getEndpoints() != null) { - EndpointCluster endpointCluster = resourceConfig.getEndpoints(); - addRetryAndTimeoutConfigHeaders(requestContext, endpointCluster); - handleEmptyPathHeader(requestContext, endpointCluster.getBasePath()); - } - } - - private static void addRetryAndTimeoutConfigHeaders(RequestContext requestContext, EndpointCluster endpointCluster) { - RetryConfig retryConfig = endpointCluster.getRetryConfig(); - if (retryConfig != null) { - addRetryConfigHeaders(requestContext, retryConfig); - } - Integer timeout = endpointCluster.getRouteTimeoutInMillis(); - if (timeout != null) { - addTimeoutHeaders(requestContext, timeout); - } - } - - /** - * This will fix sending upstream an empty path header issue. - * - * @param requestContext request context - * @param basePath endpoint basepath - */ - private static void handleEmptyPathHeader(RequestContext requestContext, String basePath) { - if (StringUtils.isNotBlank(basePath)) { - return; - } - // remaining path after removing the context and the version from the invoked path. - String remainingPath = StringUtils.removeStartIgnoreCase(requestContext.getHeaders() - .get(APIConstants.PATH_HEADER).split("\\?")[0], requestContext.getMatchedAPI().getBasePath()); - // if the :path will be empty after applying the route's substitution, then we have to add a "/" forcefully - // to avoid :path being empty. - if (StringUtils.isBlank(remainingPath)) { - String[] splittedPath = requestContext.getHeaders().get(APIConstants.PATH_HEADER).split("\\?"); - String newPath = splittedPath.length > 1 ? splittedPath[0] + "/?" + splittedPath[1] : splittedPath[0] + "/"; - requestContext.addOrModifyHeaders(APIConstants.PATH_HEADER, newPath); - } - } - - private static void addRetryConfigHeaders(RequestContext requestContext, RetryConfig retryConfig) { - requestContext.addOrModifyHeaders(AdapterConstants.HttpRouterHeaders.RETRY_ON, - AdapterConstants.HttpRouterHeaderValues.RETRIABLE_STATUS_CODES); - requestContext.addOrModifyHeaders(AdapterConstants.HttpRouterHeaders.MAX_RETRIES, - Integer.toString(retryConfig.getCount())); - requestContext.addOrModifyHeaders(AdapterConstants.HttpRouterHeaders.RETRIABLE_STATUS_CODES, - StringUtils.join(retryConfig.getStatusCodes(), ",")); - } - - private static void addTimeoutHeaders(RequestContext requestContext, Integer routeTimeoutInMillis) { - requestContext.addOrModifyHeaders(AdapterConstants.HttpRouterHeaders.UPSTREAM_REQ_TIMEOUT_MS, - Integer.toString(routeTimeoutInMillis)); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/FilterUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/FilterUtils.java deleted file mode 100644 index 31b54907ee..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/FilterUtils.java +++ /dev/null @@ -1,639 +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.util; - -import com.nimbusds.jwt.JWTClaimsSet; -import net.minidev.json.JSONArray; -import net.minidev.json.JSONObject; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.client.HttpClient; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.config.RegistryBuilder; -import org.apache.http.conn.socket.ConnectionSocketFactory; -import org.apache.http.conn.socket.PlainConnectionSocketFactory; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.conn.ssl.SSLSocketFactory; -import org.apache.http.conn.ssl.TrustAllStrategy; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.http.ssl.SSLContextBuilder; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.constants.JWTConstants; -import org.wso2.apk.enforcer.commons.dto.JWTInfoDto; -import org.wso2.apk.enforcer.commons.dto.JWTValidationInfo; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.dto.ClientConfigDto; -import org.wso2.apk.enforcer.config.dto.MutualSSLDto; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.constants.JwtConstants; -import org.wso2.apk.enforcer.dto.APIKeyValidationInfoDTO; - -import java.io.IOException; -import java.math.BigInteger; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.nio.charset.StandardCharsets; -import java.security.Key; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; - -/** - * Common set of utility methods used by the filter core component. - */ -public class FilterUtils { - - private static final Logger log = LogManager.getLogger(FilterUtils.class); - - public static final String STRICT = "Strict"; - public static final String ALLOW_ALL = "AllowAll"; - public static final List SKIPPED_FAULT_CODES = new ArrayList<>(); - - public static String getMaskedToken(String token) { - - if (token.length() >= 10) { - return "XXXXX" + token.substring(token.length() - 10); - } else { - return "XXXXX" + token.substring(token.length() / 2); - } - } - - /** - * Return a http client instance. - * - * @param protocol - service endpoint protocol http/https - * @return HTTP client - */ - public static HttpClient getHttpClient(String protocol) { - - return getHttpClient(null, null, null); - } - - public static HttpClient getMutualSSLHttpClient(String protocol, List hostnames) { - - Map options = new HashMap<>(); - options.put("HOSTNAMES", hostnames); - return getHttpClient(ConfigHolder.getInstance().getKeyStore(), ConfigHolder.getInstance().getTrustStore(), - options); - } - - /** - * Return a http client instance. - * - * @param clientKeyStore - keystore with key and cert for client - * @param options - HTTP client options - * @return HTTP client - */ - public static HttpClient getHttpClient(KeyStore clientKeyStore, KeyStore clientTrustStore, - Map options) { - - int maxTotal = 100; //TODO : Read from config - int defaultMaxPerRoute = 10; //TODO : Read from config - ClientConfigDto httpClientConfigDto = ConfigHolder.getInstance().getConfig().getHttpClientConfigDto(); - if (options == null) { - options = new HashMap<>(); - options.put(HTTPClientOptions.CONNECT_TIMEOUT, httpClientConfigDto.getConnectionTimeout()); - options.put(HTTPClientOptions.SOCKET_TIMEOUT, httpClientConfigDto.getSocketTimeout()); - options.put(HTTPClientOptions.MAX_OPEN_CONNECTIONS, httpClientConfigDto.getMaxConnections()); - options.put(HTTPClientOptions.MAX_PER_ROUTE, httpClientConfigDto.getMaxConnectionsPerRoute()); - options.put(HTTPClientOptions.ENABLE_SSL_VERIFICATION, httpClientConfigDto.isEnableSslVerification()); - options.put(HTTPClientOptions.HOSTNAME_VERIFIER, httpClientConfigDto.getHostnameVerifier()); - } - - PoolingHttpClientConnectionManager pool = null; - try { - pool = getPoolingHttpClientConnectionManager(clientKeyStore, clientTrustStore, options); - pool.setMaxTotal((Integer) options.getOrDefault(HTTPClientOptions.MAX_OPEN_CONNECTIONS, maxTotal)); - pool.setDefaultMaxPerRoute((Integer) options.getOrDefault(HTTPClientOptions.MAX_PER_ROUTE, - defaultMaxPerRoute)); - } catch (EnforcerException e) { - log.error("Error while getting http client connection manager", e); - } - RequestConfig.Builder pramsBuilder = RequestConfig.custom(); - if (options.containsKey(HTTPClientOptions.CONNECT_TIMEOUT)) { - pramsBuilder.setConnectTimeout((Integer) options.get(HTTPClientOptions.CONNECT_TIMEOUT)); - } - if (options.containsKey(HTTPClientOptions.SOCKET_TIMEOUT)) { - pramsBuilder.setSocketTimeout((Integer) options.get(HTTPClientOptions.SOCKET_TIMEOUT)); - } - RequestConfig params = pramsBuilder.build(); - return HttpClients.custom().setConnectionManager(pool).setDefaultRequestConfig(params).build(); - } - - public static KeyStore createClientKeyStore(String certPath, String keyPath) { - - try { - Certificate cert = TLSUtils.getCertificateFromFile(certPath); - Key key = JWTUtils.getPrivateKey(keyPath); - KeyStore opaKeyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - opaKeyStore.load(null, null); - opaKeyStore.setKeyEntry("client-keys", key, null, new Certificate[]{cert}); - KeyManagerFactory keyMgrFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - keyMgrFactory.init(opaKeyStore, null); - return opaKeyStore; - } catch (KeyStoreException | IOException | NoSuchAlgorithmException | CertificateException | EnforcerException | - UnrecoverableKeyException e) { - log.error("Error creating client KeyStore by loading cert and key from file", - ErrorDetails.errorLog(LoggingConstants.Severity.MAJOR, 7100), e); - return null; - } - } - - /** - * Return a PoolingHttpClientConnectionManager instance. - * - * @return PoolManager - */ - private static PoolingHttpClientConnectionManager getPoolingHttpClientConnectionManager(KeyStore clientKeyStore, - KeyStore clientTrustStore - , Map options) throws EnforcerException { - - SSLConnectionSocketFactory socketFactory = createSocketFactory(clientKeyStore, clientTrustStore, options); - org.apache.http.config.Registry socketFactoryRegistry = - RegistryBuilder.create().register(APIConstants.HTTP_PROTOCOL, - PlainConnectionSocketFactory.getSocketFactory()).register(APIConstants.HTTPS_PROTOCOL, - socketFactory).build(); - return new PoolingHttpClientConnectionManager(socketFactoryRegistry); - } - - private static SSLConnectionSocketFactory createSocketFactory(KeyStore clientKeyStore, KeyStore clientTrustStore, - Map options) throws EnforcerException { - - SSLContext sslContext; - String hostnameVerifierOption = (String) options.getOrDefault(HTTPClientOptions.HOSTNAME_VERIFIER, null); - boolean enableSSLValidation = (boolean) options.getOrDefault(HTTPClientOptions.ENABLE_SSL_VERIFICATION, true); - try { - KeyStore trustStore = ConfigHolder.getInstance().getTrustStore(); - if (clientTrustStore != null) { - trustStore = clientTrustStore; - } - SSLContextBuilder sslContextBuilder; - if (enableSSLValidation) { - sslContextBuilder = SSLContextBuilder.create().loadTrustMaterial(trustStore, null); - } else { - sslContextBuilder = SSLContextBuilder.create().loadTrustMaterial(trustStore, new TrustAllStrategy()); - } - if (clientKeyStore != null) { - sslContextBuilder.loadKeyMaterial(clientKeyStore, null); - } - sslContext = sslContextBuilder.build(); - - HostnameVerifier hostnameVerifier; - Object hostnames = options.get("HOSTNAMES"); - if (hostnames instanceof List) { - hostnameVerifier = (hostname, session) -> { - - if (hostnames != null && ((List) hostnames).contains(hostname)) { - return true; - } - return false; - }; - } - if (ALLOW_ALL.equalsIgnoreCase(hostnameVerifierOption)) { - hostnameVerifier = SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER; - } else if (STRICT.equalsIgnoreCase(hostnameVerifierOption)) { - hostnameVerifier = SSLSocketFactory.STRICT_HOSTNAME_VERIFIER; - } else { - hostnameVerifier = SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; - } - - return new SSLConnectionSocketFactory(sslContext, hostnameVerifier); - } catch (KeyStoreException e) { - handleException("Failed to read from Key Store", e); - } catch (NoSuchAlgorithmException | KeyManagementException | UnrecoverableKeyException e) { - handleException("Failed to initialize sslContext ", e); - } - - return null; - } - - public static void handleException(String msg, Throwable t) throws EnforcerException { - - log.error(msg, t); - throw new EnforcerException(msg, t); - } - - public static String getTenantDomainFromRequestURL(String requestURI) { - - String domain = null; - if (requestURI.contains("/t/")) { - int index = requestURI.indexOf("/t/"); - int endIndex = requestURI.indexOf("/", index + 3); - domain = endIndex != -1 ? requestURI.substring(index + 3, endIndex) : requestURI.substring(index + 3); - } - - return domain; - } - - public static AuthenticationContext generateAuthenticationContextForUnsecured(RequestContext requestContext) { - - AuthenticationContext authContext = requestContext.getAuthenticationContext(); - String clientIP = requestContext.getClientIp(); - - // Create a dummy AuthenticationContext object with hard coded values for - // Tier and KeyType. This is because we cannot determine the Tier nor Key - // Type without subscription information. - authContext.setAuthenticated(true); - authContext.setTier(APIConstants.UNAUTHENTICATED_TIER); - authContext.setApiKey(clientIP); - // Setting end user as anonymous - authContext.setUsername(APIConstants.END_USER_ANONYMOUS); - // TODO: (VirajSalaka) clientIP for applicationUUID? - authContext.setApplicationUUID(clientIP); - authContext.setApplicationName(null); - authContext.setApplicationTier(APIConstants.UNLIMITED_TIER); - authContext.setSubscriber(APIConstants.END_USER_ANONYMOUS); - authContext.setStopOnQuotaReach(true); - authContext.setConsumerKey(null); - authContext.setCallerToken(null); - String apiUUID = requestContext.getMatchedAPI().getUuid(); - if (!StringUtils.isEmpty(apiUUID)) { - authContext.setApiUUID(apiUUID); - } - return authContext; - } - - public static AuthenticationContext generateAuthenticationContext(RequestContext requestContext, String jti, - JWTValidationInfo jwtValidationInfo, - APIKeyValidationInfoDTO apiKeyValidationInfoDTO - , String endUserToken, String rawToken, boolean isOauth) { - - AuthenticationContext authContext = requestContext.getAuthenticationContext(); - authContext.setAuthenticated(true); - authContext.setApiKey(jti); - authContext.setUsername(jwtValidationInfo.getUser()); - - if (apiKeyValidationInfoDTO != null) { - authContext.setApplicationUUID(apiKeyValidationInfoDTO.getApplicationUUID()); - authContext.setApplicationName(apiKeyValidationInfoDTO.getApplicationName()); - authContext.setSubscriber(apiKeyValidationInfoDTO.getSubscriber()); - authContext.setTier(apiKeyValidationInfoDTO.getTier()); - authContext.setSubscriberOrganization(apiKeyValidationInfoDTO.getSubscriberOrganization()); - authContext.setApiPublisher(apiKeyValidationInfoDTO.getApiPublisher()); - authContext.setStopOnQuotaReach(apiKeyValidationInfoDTO.isStopOnQuotaReach()); - authContext.setSpikeArrestLimit(apiKeyValidationInfoDTO.getSpikeArrestLimit()); - authContext.setSpikeArrestUnit(apiKeyValidationInfoDTO.getSpikeArrestUnit()); - authContext.setConsumerKey(apiKeyValidationInfoDTO.getConsumerKey()); - authContext.setIsContentAware(apiKeyValidationInfoDTO.isContentAware()); - authContext.setApiUUID(apiKeyValidationInfoDTO.getApiUUID()); - authContext.setRawToken(rawToken); - } - if (isOauth) { - authContext.setConsumerKey(jwtValidationInfo.getConsumerKey()); - } - // Set JWT token sent to the backend - if (StringUtils.isNotEmpty(endUserToken)) { - authContext.setCallerToken(endUserToken); - } - - return authContext; - } - - public static long ipToLong(String ipAddress) { - - long result = 0; - String[] ipAddressInArray = ipAddress.split("\\."); - for (int i = 3; i >= 0; i--) { - long ip = Long.parseLong(ipAddressInArray[3 - i]); - //left shifting 24,16,8,0 and bitwise OR - //1. 192 << 24 - //1. 168 << 16 - //1. 1 << 8 - //1. 2 << 0 - result |= ip << (i * 8); - - } - return result; - } - - /** - * This method provides the BigInteger value for the given IP address. This supports both IPv4 and IPv6 address - * - * @param ipAddress ip address - * @return BigInteger value for the given ip address. returns 0 for unknown host - */ - public static BigInteger ipToBigInteger(String ipAddress) { - - InetAddress address; - try { - address = InetAddress.getByName(ipAddress); - byte[] bytes = address.getAddress(); - return new BigInteger(1, bytes); - } catch (UnknownHostException e) { - //ignore the error and log it - log.error("Error while parsing host IP " + ipAddress, e); - } - return BigInteger.ZERO; - } - - /** - * Generates Authentication Context for the Internal Key Authenticator. - * - * @param tokenIdentifier - * @param payload - * @param api - * @param rawToken Raw token used to authenticate the request - * @return - * @throws java.text.ParseException - */ - public static AuthenticationContext generateAuthenticationContext(String tokenIdentifier, JWTClaimsSet payload, - JSONObject api, String apiUUID, - String rawToken) throws java.text.ParseException { - - AuthenticationContext authContext = new AuthenticationContext(); - authContext.setAuthenticated(true); - authContext.setApiKey(tokenIdentifier); - authContext.setRawToken(rawToken); - authContext.setUsername(payload.getSubject()); - - if (api != null) { - authContext.setTier(APIConstants.UNLIMITED_TIER); - authContext.setApiPublisher(api.getAsString(APIConstants.JwtTokenConstants.API_PUBLISHER)); - - } - if (!StringUtils.isEmpty(apiUUID)) { - authContext.setApiUUID(apiUUID); - } - authContext.setApplicationName(APIConstants.JwtTokenConstants.INTERNAL_KEY_APP_NAME); - authContext.setApplicationUUID(UUID.nameUUIDFromBytes(APIConstants.JwtTokenConstants.INTERNAL_KEY_APP_NAME.getBytes(StandardCharsets.UTF_8)).toString()); - authContext.setApplicationTier(APIConstants.UNLIMITED_TIER); - authContext.setSubscriber(APIConstants.JwtTokenConstants.INTERNAL_KEY_APP_NAME); - return authContext; - } - - public static JWTInfoDto generateJWTInfoDto(JSONObject subscribedAPI, JWTValidationInfo jwtValidationInfo, - APIKeyValidationInfoDTO apiKeyValidationInfoDTO, - RequestContext requestContext) { - - JWTInfoDto jwtInfoDto = new JWTInfoDto(); - jwtInfoDto.setJwtValidationInfo(jwtValidationInfo); - String apiContext = requestContext.getMatchedAPI().getBasePath(); - String apiVersion = requestContext.getMatchedAPI().getVersion(); - jwtInfoDto.setApiContext(apiContext); - jwtInfoDto.setVersion(apiVersion); - constructJWTContent(subscribedAPI, apiKeyValidationInfoDTO, jwtInfoDto); - return jwtInfoDto; - } - - private static void constructJWTContent(JSONObject subscribedAPI, APIKeyValidationInfoDTO apiKeyValidationInfoDTO - , JWTInfoDto jwtInfoDto) { - - Map claims = getClaimsFromJWTValidationInfo(jwtInfoDto); - if (claims != null) { - if (claims.get(JWTConstants.SUB) != null) { - String sub = (String) claims.get(JWTConstants.SUB); - jwtInfoDto.setSub(sub); - } - if (claims.get(JWTConstants.ORGANIZATIONS) != null) { - JSONArray orgArray = (JSONArray) claims.get(JWTConstants.ORGANIZATIONS); - String[] organizations = new String[orgArray.size()]; - for (int i = 0; i < orgArray.size(); i++) { - organizations[i] = orgArray.get(i).toString(); - } - jwtInfoDto.setOrganizations(organizations); - } - } - if (apiKeyValidationInfoDTO != null) { - jwtInfoDto.setApplicationId(apiKeyValidationInfoDTO.getApplicationUUID()); - jwtInfoDto.setApplicationName(apiKeyValidationInfoDTO.getApplicationName()); - jwtInfoDto.setKeyType(apiKeyValidationInfoDTO.getType()); - jwtInfoDto.setSubscriber(apiKeyValidationInfoDTO.getSubscriber()); - jwtInfoDto.setSubscriptionTier(apiKeyValidationInfoDTO.getTier()); - jwtInfoDto.setApiName(apiKeyValidationInfoDTO.getApiName()); - jwtInfoDto.setEndUserTenantId(0); - jwtInfoDto.setApplicationUUId(apiKeyValidationInfoDTO.getApplicationUUID()); - jwtInfoDto.setAppAttributes(apiKeyValidationInfoDTO.getAppAttributes()); - } else if (subscribedAPI != null) { - // If the user is subscribed to the API - String apiName = subscribedAPI.getAsString(JwtConstants.API_NAME); - jwtInfoDto.setApiName(apiName); - String subscriptionTier = subscribedAPI.getAsString(JwtConstants.SUBSCRIPTION_TIER); - String subscriptionTenantDomain = subscribedAPI.getAsString(JwtConstants.SUBSCRIBER_TENANT_DOMAIN); - jwtInfoDto.setSubscriptionTier(subscriptionTier); - jwtInfoDto.setEndUserTenantId(0); - - if (claims != null && claims.get(JwtConstants.APPLICATION) != null) { - JSONObject applicationObj = (JSONObject) claims.get(JwtConstants.APPLICATION); - jwtInfoDto.setApplicationId(String.valueOf(applicationObj.getAsNumber(JwtConstants.APPLICATION_ID))); - jwtInfoDto.setApplicationName(applicationObj.getAsString(JwtConstants.APPLICATION_NAME)); - jwtInfoDto.setApplicationTier(applicationObj.getAsString(JwtConstants.APPLICATION_TIER)); - jwtInfoDto.setSubscriber(applicationObj.getAsString(JwtConstants.APPLICATION_OWNER)); - } - } - } - - private static Map getClaimsFromJWTValidationInfo(JWTInfoDto jwtInfoDto) { - - if (jwtInfoDto.getJwtValidationInfo() != null) { - return jwtInfoDto.getJwtValidationInfo().getClaims(); - } - return null; - } - - /** - * Set the error code, message and description to the request context. The enforcer response will - * retrieve this error details from the request context. Make sure to call this method and set the proper error - * details when enforcer filters returns an error. - * - * @param requestContext - The context object holds details about the specific request. - * @param e - APISecurityException thrown when validation failure happens at filter level. - */ - public static void setErrorToContext(RequestContext requestContext, APISecurityException e) { - - Map requestContextProperties = requestContext.getProperties(); - if (!requestContextProperties.containsKey(APIConstants.MessageFormat.STATUS_CODE)) { - requestContext.getProperties().put(APIConstants.MessageFormat.STATUS_CODE, e.getStatusCode()); - } - if (!requestContextProperties.containsKey(APIConstants.MessageFormat.ERROR_CODE)) { - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, e.getErrorCode()); - } - if (!requestContextProperties.containsKey(APIConstants.MessageFormat.ERROR_MESSAGE)) { - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, - APISecurityConstants.getAuthenticationFailureMessage(e.getErrorCode())); - } - if (!requestContextProperties.containsKey(APIConstants.MessageFormat.ERROR_DESCRIPTION)) { - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - APISecurityConstants.getFailureMessageDetailDescription(e.getErrorCode(), e.getMessage())); - } - } - - /** - * Set error related details to the {@link RequestContext}. - * - * @param context request context object to set the details. - * @param errorCode internal wso2 throttle error code. - * @param statusCode HTTP status code. - * @param message message of error. - * @param desc description of error. - */ - public static void setErrorToContext(RequestContext context, int errorCode, int statusCode, String message, - String desc) { - - Map properties = context.getProperties(); - properties.putIfAbsent(APIConstants.MessageFormat.STATUS_CODE, statusCode); - properties.putIfAbsent(APIConstants.MessageFormat.ERROR_CODE, String.valueOf(errorCode)); - properties.putIfAbsent(APIConstants.MessageFormat.ERROR_MESSAGE, message); - properties.putIfAbsent(APIConstants.MessageFormat.ERROR_DESCRIPTION, - APISecurityConstants.getFailureMessageDetailDescription(errorCode, desc)); - } - - /** - * Set the unauthenticated status code(401), error code(900901), message and description to the request context. - * The enforcer response will retrieve this error details from the request context. Make sure to call - * this method and set the proper error details when enforcer filters returns an error. - * - * @param requestContext - The context object holds details about the specific request. - */ - public static void setUnauthenticatedErrorToContext(RequestContext requestContext) { - - requestContext.getProperties().put(APIConstants.MessageFormat.STATUS_CODE, - APIConstants.StatusCodes.UNAUTHENTICATED.getCode()); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, - APISecurityConstants.getAuthenticationFailureMessage(APISecurityConstants.API_AUTH_INVALID_CREDENTIALS)); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_DESCRIPTION); - } - - /** - * Generates a map out of the {@code list} provided. Key will be the {@code toString} - * value of the list item. Value will be the list item. - * - * @param list list to be converted in to a map - * @param List Item type - * @return A map of type {@code } - */ - public static Map generateMap(Collection list) { - - if (list == null) { - return new HashMap<>(); - } - Map map = new HashMap(); - - for (T el : list) { - map.put(el.toString(), el); - } - return map; - } - - /** - * Append the username with tenant domain if not appended already. - * - * @param username username - * @param tenantDomain tenant domain - * @return tenant domain appended username - */ - public static String buildUsernameWithTenant(String username, String tenantDomain) { - - if (StringUtils.isEmpty(tenantDomain)) { - tenantDomain = APIConstants.SUPER_TENANT_DOMAIN_NAME; - } - - // Check if the tenant domain is appended with userName and append if it is not there - if (!StringUtils.contains(username, tenantDomain)) { - return username + '@' + tenantDomain; - } - return username; - } - - public static String getClientIp(Map headers, String knownIp) { - - String clientIp = knownIp; - String xForwardFor = headers.get(APIConstants.X_FORWARDED_FOR); - if (!StringUtils.isEmpty(xForwardFor)) { - clientIp = xForwardFor; - int idx = xForwardFor.indexOf(','); - if (idx > -1) { - clientIp = clientIp.substring(0, idx); - } - } - - return clientIp; - } - - public static String getCertificateHeaderName() { - - MutualSSLDto mtlsInfo = ConfigHolder.getInstance().getConfig().getMtlsInfo(); - String certificateHeaderName = mtlsInfo.getCertificateHeader(); - if (StringUtils.isEmpty(certificateHeaderName)) { - certificateHeaderName = APIConstants.CLIENT_CERTIFICATE_HEADER_DEFAULT; - } - return certificateHeaderName.toLowerCase(); - } - - /** - * Check whether the fault event is a one that should be published to analytics server. - * - * @param errorCode The error code returned during the filter process - * @return whether the fault scenario should be skipped from publishing to analytics server. - */ - public static boolean isSkippedAnalyticsFaultEvent(String errorCode) { - - return SKIPPED_FAULT_CODES.contains(errorCode); - } - - public static long getTimeStampSkewInSeconds() { - //TODO : Read from config - return 5; - } - - public static void putToMapIfNotNull(Map map, K key, V value) { - - if (value != null) { - map.put(key, value); - } - } - - /** - * HTTP client option constants that is used with the util function {@link #getHttpClient(KeyStore, KeyStore, Map) - * getHttpClient} - */ - public static class HTTPClientOptions { - - public static final String CONNECT_TIMEOUT = "CONNECT_TIMEOUT"; - public static final String SOCKET_TIMEOUT = "SOCKET_TIMEOUT"; - public static final String MAX_OPEN_CONNECTIONS = "MAX_OPEN_CONNECTIONS"; - public static final String MAX_PER_ROUTE = "MAX_PER_ROUTE"; - public static final String ENABLE_SSL_VERIFICATION = "ENABLE_SSL_VERIFICATION"; - - public static final String HOSTNAME_VERIFIER = "HOSTNAME_VERIFIER"; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java deleted file mode 100644 index 0395a95134..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java +++ /dev/null @@ -1,73 +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.util; - -import io.grpc.ConnectivityState; -import io.grpc.Grpc; -import io.grpc.InsecureChannelCredentials; -import io.grpc.ManagedChannel; -import io.grpc.ManagedChannelBuilder; -import io.grpc.Metadata; -import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; -import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; -import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.config.ConfigHolder; - -import java.io.File; -import java.nio.file.Paths; -import java.util.concurrent.TimeUnit; - -import javax.net.ssl.SSLException; - -/** - * Utility functions required for gRPC Xds Clients. - */ -public class GRPCUtils { - - public static ManagedChannel createSecuredChannel(Logger logger, String host, int port, String hostname) { - - File certFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()).toFile(); - File keyFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()).toFile(); - SslContext sslContext = null; - try { - sslContext = GrpcSslContexts - .forClient() - .trustManager(ConfigHolder.getInstance().getTrustManagerFactory()) - .keyManager(certFile, keyFile) - .build(); - } catch (SSLException e) { - logger.error("Error while generating SSL Context.", e); - } - return NettyChannelBuilder.forAddress(host, port) - .useTransportSecurity() - .sslContext(sslContext) - .overrideAuthority(hostname) - .build(); - } - - public static boolean isReInitRequired(ManagedChannel channel) { - - if (channel != null && (channel.getState(true) == ConnectivityState.CONNECTING - || channel.getState(true) == ConnectivityState.READY)) { - return false; - } - return true; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/JWKSClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/JWKSClient.java deleted file mode 100644 index d133a6befe..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/JWKSClient.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.util; - -import com.nimbusds.jose.jwk.JWKSet; -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpEntity; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.config.ConfigHolder; - -import java.io.IOException; -import java.io.InputStream; -import java.security.KeyStore; -import java.security.cert.Certificate; -import java.text.ParseException; -import java.util.List; - -/** - * This class used to create JWKS Client. - */ -public class JWKSClient { - private static final Log log = LogFactory.getLog(JWKSClient.class.getName()); - private HttpClient httpClient; - private String jwksEndpoint; - - public JWKSClient(String jwksEndpoint, List certificates) throws EnforcerException { - this.jwksEndpoint = jwksEndpoint; - try { - KeyStore trustStore = ConfigHolder.getInstance().getTrustStore(); - if (certificates.size() > 0) { - trustStore = TLSUtils.getDefaultCertTrustStore(); - } - TLSUtils.convertAndAddCertificatesToTrustStore(trustStore, certificates); - httpClient = FilterUtils.getHttpClient(null, trustStore, null); - } catch (EnforcerException e) { - log.error("Error occured while inializing JWKS Client", e); - throw new EnforcerException("Error occured while inializing JWKS Client", e); - } - } - - public JWKSet getJWKSet() throws EnforcerException { - try { - HttpGet httpGet = new HttpGet(jwksEndpoint); - try (CloseableHttpResponse response = (CloseableHttpResponse) httpClient.execute(httpGet)) { - if (response.getStatusLine().getStatusCode() == 200) { - HttpEntity entity = response.getEntity(); - try (InputStream content = entity.getContent()) { - String stringContent = IOUtils.toString(content); - return JWKSet.parse(stringContent); - } - } else { - throw new EnforcerException("Error occurred when calling JWKS Endpoint"); - } - } - } catch (IOException | ParseException e) { - throw new EnforcerException("Error occurred when calling JWKS Endpoint", e); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/JWTUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/JWTUtils.java deleted file mode 100644 index ab12f5b2d0..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/JWTUtils.java +++ /dev/null @@ -1,236 +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.util; - -import com.nimbusds.jose.JOSEException; -import com.nimbusds.jose.JWSAlgorithm; -import com.nimbusds.jose.JWSVerifier; -import com.nimbusds.jose.crypto.ECDSAVerifier; -import com.nimbusds.jose.crypto.RSASSAVerifier; -import com.nimbusds.jwt.JWTClaimsSet; -import com.nimbusds.jwt.SignedJWT; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.HttpEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.dto.APIKeyValidationInfoDTO; -import org.wso2.apk.enforcer.security.jwt.SignedJWTInfo; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.security.KeyFactory; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.cert.Certificate; -import java.security.interfaces.ECPublicKey; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.PKCS8EncodedKeySpec; -import java.util.Base64; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -/** - * Utility functions used for jwt authentication. - */ -public class JWTUtils { - - private static final Logger log = LogManager.getLogger(JWTUtils.class); - - /** - * This method used to retrieve JWKS keys from endpoint. - * - * @param jwksEndpoint jwksEndpoint - * @return JwksKeys - * @throws IOException Exception while invoking the JWKS endpoint - */ - public static String retrieveJWKSConfiguration(String jwksEndpoint) throws IOException { - - URL url = new URL(jwksEndpoint); - try (CloseableHttpClient httpClient = (CloseableHttpClient) FilterUtils.getHttpClient(url.getProtocol())) { - HttpGet httpGet = new HttpGet(jwksEndpoint); - try (CloseableHttpResponse response = httpClient.execute(httpGet)) { - if (response.getStatusLine().getStatusCode() == 200) { - HttpEntity entity = response.getEntity(); - try (InputStream content = entity.getContent()) { - return IOUtils.toString(content, String.valueOf(Charset.defaultCharset())); - } - } else { - return null; - } - } - } - } - - /** - * Verify the JWT token signature. - * - * @param jwt SignedJwt Token - * @param publicKey public certificate - * @return whether the signature is verified or not - */ - private static boolean verifyTokenSignature(SignedJWT jwt, RSAPublicKey publicKey) { - - try { - JWSVerifier jwsVerifier = new RSASSAVerifier(publicKey); - return jwt.verify(jwsVerifier); - } catch (JOSEException e) { - log.error("Error while verifying JWT signature", e); - return false; - } - } - - /** - * Verify the JWT token signature. - * - * @param jwt SignedJwt Token - * @param publicKey public certificate - * @return whether the signature is verified or not - */ - public static boolean verifyTokenSignature(SignedJWT jwt, PublicKey publicKey) { - - JWSAlgorithm algorithm = jwt.getHeader().getAlgorithm(); - if ((JWSAlgorithm.RS256.equals(algorithm) || JWSAlgorithm.RS512.equals(algorithm) || JWSAlgorithm.RS384.equals(algorithm))) { - return verifyTokenSignature(jwt, (RSAPublicKey) publicKey); - } else if ((JWSAlgorithm.ES256.equals(algorithm) || JWSAlgorithm.ES384.equals(algorithm) || JWSAlgorithm.ES512.equals(algorithm) || JWSAlgorithm.ES256K.equals(algorithm))) { - return verifyTokenSignature(jwt, (ECPublicKey) publicKey); - } - log.error("Public key is not a RSA"); - return false; - } - - /** - * Verify the JWT token signature. - * - * @param jwt SignedJwt Token - * @param publicKey public certificate - * @return whether the signature is verified or not - */ - private static boolean verifyTokenSignature(SignedJWT jwt, ECPublicKey publicKey) { - - try { - JWSVerifier jwsVerifier = new ECDSAVerifier(publicKey); - return jwt.verify(jwsVerifier); - } catch (JOSEException e) { - log.error("Error while verifying JWT signature", e); - return false; - } - } - - /** - * Verify the JWT token signature. - * - * @param jwt SignedJwt Token - * @param alias public certificate alias - * @return whether the signature is verified or not - * @throws EnforcerException in case of signature verification failure - */ - public static boolean verifyTokenSignature(SignedJWT jwt, String alias) throws EnforcerException { - - Certificate publicCert; - try { - if (ConfigHolder.getInstance().getTrustStoreForJWT().containsAlias(alias)) { - publicCert = ConfigHolder.getInstance().getTrustStoreForJWT().getCertificate(alias); - } else { - throw new EnforcerException("Could not find the certificate for the token service."); - } - } catch (KeyStoreException e) { - throw new EnforcerException("Error while retrieving the certificate for JWT verification.", e); - } - - if (publicCert != null) { - return verifyTokenSignature(jwt, publicCert.getPublicKey()); - } else { - log.error("Couldn't find a public certificate to verify the signature"); - throw new EnforcerException("Couldn't find a public certificate to verify the signature"); - } - } - - public static PrivateKey getPrivateKey(String filePath) throws EnforcerException { - - try { - String strKeyPEM; - Path keyPath = Paths.get(filePath); - String key = Files.readString(keyPath, Charset.defaultCharset()); - - strKeyPEM = key.replace(Constants.BEGINING_OF_PRIVATE_KEY, "").replaceAll("\n", "").replaceAll("\r", "") - // certs could be created in a Unix/Windows platform - .replace(Constants.END_OF_PRIVATE_KEY, ""); - - byte[] encoded = Base64.getDecoder().decode(strKeyPEM); - KeyFactory kf = KeyFactory.getInstance(Constants.RSA); - PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded); - return kf.generatePrivate(keySpec); - } catch (IOException | NoSuchAlgorithmException | InvalidKeySpecException e) { - log.debug("Error obtaining private key", e); - throw new EnforcerException("Error obtaining private key"); - } - } - - /** - * Check if the JWT token is expired. - * - * @param exp JWT token expiry time - * @return true if expired - */ - public static boolean isExpired(long exp) { - long timestampSkew = FilterUtils.getTimeStampSkewInSeconds(); - return (exp - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()) < timestampSkew); - } - - /** - * Populate an empty JWT info DTO for anonymous, with no App or API info. - * - * @param apiKeyValidationInfoDTO empty JWT info DTO to be populated with anonymous details - * @param kmReference name of the token service - */ - public static void updateApplicationNameForSubscriptionDisabledFlow(APIKeyValidationInfoDTO apiKeyValidationInfoDTO, - String kmReference) { - - String applicationRef = APIConstants.ANONYMOUS_PREFIX + kmReference; - apiKeyValidationInfoDTO.setApplicationName(applicationRef); - apiKeyValidationInfoDTO.setApplicationUUID(UUID.nameUUIDFromBytes(applicationRef.getBytes(StandardCharsets.UTF_8)).toString()); - } - - public static String getJWTTokenIdentifier(SignedJWTInfo signedJWTInfo) { - - JWTClaimsSet jwtClaimsSet = signedJWTInfo.getJwtClaimsSet(); - String jwtid = jwtClaimsSet.getJWTID(); - if (StringUtils.isNotEmpty(jwtid)) { - return jwtid; - } - return signedJWTInfo.getSignedJWT().getSignature().toString(); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/MockImplUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/MockImplUtils.java deleted file mode 100644 index 3d5bcdf06c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/MockImplUtils.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org). - * - * 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.util; - -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.api.ResponseObject; -import org.wso2.apk.enforcer.commons.model.MockedApiConfig; -import org.wso2.apk.enforcer.commons.model.MockedContentExamples; -import org.wso2.apk.enforcer.commons.model.MockedHeaderConfig; -import org.wso2.apk.enforcer.commons.model.MockedResponseConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.constants.APIConstants; -import org.wso2.apk.enforcer.constants.GeneralErrorCodeConstants; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * MockImplUtils contains mock response generation related methods. - */ -public class MockImplUtils { - - private static final Logger log = LogManager.getLogger(MockImplUtils.class); - - /** - * Handles mock API call and prepares response object considering provided values in the request. - * - * @param requestContext request context - * @param responseObject response object for the mock API call - */ - public static void processMockedApiCall(RequestContext requestContext, ResponseObject responseObject) { - responseObject.setDirectResponse(true); - Map preferences = new HashMap<>(); - // only getting first operation is enough as only one resource config will be present for mock APIs. - MockedApiConfig mockedApiConfig = requestContext.getMatchedResourcePaths().get(0).getMockedApiConfig(); - Map headersMap = requestContext.getHeaders(); - String[] acceptType = new String[]{}; - if (headersMap.containsKey(APIConstants.ACCEPT_HEADER)) { - acceptType = headersMap.get(APIConstants.ACCEPT_HEADER).split(","); - } - // check prefer header for selected example - if (headersMap.containsKey(APIConstants.PREFER_HEADER)) { - preferences = processPreferHeader(headersMap.get(APIConstants.PREFER_HEADER)); - } - setMockApiResponse(responseObject, preferences, mockedApiConfig, acceptType); - } - - public static Map processPreferHeader(String headerValue) { - Map preferences = new HashMap<>(); - String[] paramMap = headerValue.split(","); - for (String param : paramMap) { - if (StringUtils.countMatches(param, "=") == 1) { - String[] keyValue = param.split("="); - String key = keyValue[0].strip().toLowerCase(); - if (APIConstants.PREFER_KEYS.contains(key)) { - preferences.put(key, keyValue[1].strip().toLowerCase()); - } - } - } - return preferences; - } - - /** - * Prepares mock API response considering the properties map and mockedApiConfig. - * - * @param responseObject Response object (represents response for the API call) - * @param preferences A map which includes values specified in headers or query parameters - * @param mockedApiConfig Holds the JSON values specified in the mock API implementation - * @param acceptTypes Denotes accepted contend type as the response - */ - private static void setMockApiResponse(ResponseObject responseObject, Map preferences, - MockedApiConfig mockedApiConfig, String[] acceptTypes) { - String preferCode = ""; - String preferExample = ""; - int statusCode = 200; - String mediaType = "application/json"; - if (preferences.containsKey(APIConstants.PREFER_CODE)) { - preferCode = preferences.get(APIConstants.PREFER_CODE); - boolean isInvalidCode = false; - try { - if (preferCode.length() == 3) { - statusCode = Integer.parseInt(preferCode); - } else { - isInvalidCode = true; - } - } catch (NumberFormatException e) { - isInvalidCode = true; - } - if (isInvalidCode) { - log.error("Mock API request contains invalid value for code preference."); - responseObject.setErrorCode(GeneralErrorCodeConstants.MockImpl.BAD_REQUEST_CODE); - responseObject.setStatusCode(APIConstants.StatusCodes.BAD_REQUEST_ERROR.getCode()); - responseObject.setErrorMessage(APIConstants.BAD_REQUEST_MESSAGE); - responseObject.setErrorDescription("Invalid format for code preference"); - return; - } - } - if (preferences.containsKey(APIConstants.PREFER_EXAMPLE)) { - preferExample = preferences.get(APIConstants.PREFER_EXAMPLE); - } - - Map responseConfigList = mockedApiConfig.getResponses(); - MockedResponseConfig responseConfig; - if (responseConfigList.isEmpty()) { - log.debug("API operation does not have mock examples configured."); - setMockApiErrorResponse(responseObject, ""); - return; - } else if (!preferCode.isEmpty()) { - if (responseConfigList.containsKey(preferCode)) { - responseConfig = responseConfigList.get(preferCode); - } else if (responseConfigList.containsKey(preferCode.substring(0, 2) + "x")) { - responseConfig = responseConfigList.get(preferCode.substring(0, 2) + "x"); - } else if (responseConfigList.containsKey(preferCode.charAt(0) + "xx")) { - responseConfig = responseConfigList.get(preferCode.charAt(0) + "xx"); - } else { - setMockApiErrorResponse(responseObject, "Preferred code " + preferCode + - " is not supported for this resource."); - return; - } - } else if (responseConfigList.containsKey(APIConstants.DEFAULT)) { - responseConfig = responseConfigList.get(APIConstants.DEFAULT); - } else { - Map.Entry firstEntry = - responseConfigList.entrySet().stream().findFirst().get(); - responseConfig = firstEntry.getValue(); - // adapter has validated this already to contain only x and integers - String mockedStatusCode = firstEntry.getKey().replace("x", "0"); - statusCode = Integer.parseInt(mockedStatusCode); - } - - MockedContentExamples contentExamples = null; - if (responseConfig.getContentMap() != null && responseConfig.getContentMap().size() > 0) { - if (acceptTypes.length < 1) { - if (responseConfig.getContentMap().containsKey(APIConstants.APPLICATION_JSON)) { - mediaType = APIConstants.APPLICATION_JSON; - contentExamples = responseConfig.getContentMap().get(APIConstants.APPLICATION_JSON); - } else { - Map.Entry firstExample = - responseConfig.getContentMap().entrySet().stream().findFirst().get(); - contentExamples = firstExample.getValue(); - mediaType = firstExample.getKey(); - } - } else { - for (String acceptType : acceptTypes) { - String[] acceptTypeValues = acceptType.split(";"); - String acceptMediaType = acceptTypeValues[0].strip(); - //todo(amali) handle q priorities - for (String mt : responseConfig.getContentMap().keySet()) { - String regex = ("\\Q" + acceptMediaType + "\\E").replace("*", "\\E.*\\Q"); - if (mt.matches(regex)) { - contentExamples = responseConfig.getContentMap().get(mt); - mediaType = mt; - break; - } - } - } - if (contentExamples == null) { - setMockApiErrorResponse(responseObject, "Accept type " + Arrays.toString(acceptTypes) + - " is not supported for this resource"); - return; - } - } - } - - // even if content is empty for the response, example headers with empty body will be sent - String content = ""; - if (!preferExample.isEmpty()) { - if (contentExamples == null || !contentExamples.getExampleMap().containsKey(preferExample)) { - setMockApiErrorResponse(responseObject, "Example preference " + preferExample + - " is not supported for this resource"); - return; - } - content = contentExamples.getExampleMap().get(preferExample); - - } else if (contentExamples != null && contentExamples.getExampleMap().size() > 0) { - content = contentExamples.getExampleMap().entrySet().stream().findFirst().get().getValue(); - } - - responseObject.setStatusCode(statusCode); - Map headerMap = responseObject.getHeaderMap(); - if (responseConfig.getHeaders() != null && !responseConfig.getHeaders().isEmpty()) { - // iterates over the headers list in the mock API JSON. - for (MockedHeaderConfig header : responseConfig.getHeaders()) { - headerMap.put(header.getName(), header.getValue()); - } - } - headerMap.put(APIConstants.CONTENT_TYPE_HEADER, mediaType); - responseObject.setHeaderMap(headerMap); - responseObject.setResponseContent(content); - } - - private static void setMockApiErrorResponse(ResponseObject responseObject, String message) { - log.error("Cannot process the mock API request. " + message); - responseObject.setStatusCode(APIConstants.StatusCodes.NOT_IMPLEMENTED_ERROR.getCode()); - responseObject.setErrorCode(GeneralErrorCodeConstants.MockImpl.NOT_IMPLEMENTED_CODE); - responseObject.setErrorMessage(APIConstants.NOT_IMPLEMENTED_MESSAGE); - responseObject.setErrorDescription(message); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/SOAPUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/SOAPUtils.java deleted file mode 100644 index be5b4eb752..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/SOAPUtils.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.util; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.logging.ErrorDetails; -import org.wso2.apk.enforcer.commons.logging.LoggingConstants; -import org.wso2.apk.enforcer.constants.APIConstants; - -import java.io.ByteArrayOutputStream; - -import javax.xml.soap.MessageFactory; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPFault; -import javax.xml.soap.SOAPMessage; -import javax.xml.soap.SOAPPart; - -/** - * SOAPUtils class provides methods required for generating soap1.1 & soap1.2 messages. - * Currently, this only provides methods for generating fault messages. - */ -public class SOAPUtils { - private static final Logger log = LogManager.getLogger(SOAPUtils.class); - - /** - * Returns a soap fault response message. - * - * @param soapProtocolVersion 'SOAP 1.1 Protocol' or 'SOAP 1.2 Protocol' - * @param message message text - * @param description description of the fault - * @param code response code - * @return xml formatted SOAP fault message as a String - */ - public static String getSoapFaultMessage(String soapProtocolVersion, - String message, String description, String code) { - try { - MessageFactory factory = MessageFactory.newInstance(soapProtocolVersion); - SOAPMessage soapMsg = factory.createMessage(); - SOAPPart part = soapMsg.getSOAPPart(); - SOAPEnvelope envelope = part.getEnvelope(); - SOAPFault soapFault = envelope.getBody().addFault(); - if (soapProtocolVersion.equals(APIConstants.SOAP11_PROTOCOL)) { - soapFault.setFaultCode("Server"); - } else if (soapProtocolVersion.equals(APIConstants.SOAP12_PROTOCOL)) { - soapFault.setFaultCode("env:Receiver"); - } - soapFault.setFaultString(message); - soapFault.addDetail().addTextNode(code + ":" + description); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - soapMsg.writeTo(out); - return out.toString(); - } catch (Exception e) { - log.error("Error while creating the SOAP fault message. {}", e.getMessage(), - ErrorDetails.errorLog(LoggingConstants.Severity.MINOR, 7101)); - return ""; - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java deleted file mode 100644 index 62ff2a6767..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java +++ /dev/null @@ -1,274 +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.util; - -import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; -import io.grpc.netty.shaded.io.netty.handler.ssl.ClientAuth; -import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.config.ConfigHolder; - -import javax.net.ssl.SSLException; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.X509TrustManager; -import java.io.*; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.security.Key; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * Utility Functions related to TLS Certificates. - */ -public class TLSUtils { - - private static final Logger log = LogManager.getLogger(TLSUtils.class); - private static final String X509 = "X.509"; - private static final String crtExtension = ".crt"; - private static final String pemExtension = ".pem"; - private static final String endCertificateDelimiter = "-----END CERTIFICATE-----"; - - /** - * Read the certificate file and return the certificate. - * - * @param filePath Filepath of the corresponding certificate - * @return Certificate - */ - public static Certificate getCertificateFromFile(String filePath) - throws CertificateException, IOException, EnforcerException { - - return getCertsFromFile(filePath, true).get(0); - } - - /** - * Read the pem encoded certificate content and generate certificate. - * - * @param certificateContent Pem Encoded certificate Content - * @return Certificate - */ - public static Certificate getCertificateFromString(String certificateContent) - throws CertificateException, IOException { - // A single certificate file is expected - try (InputStream inputStream = new ByteArrayInputStream(certificateContent.getBytes())) { - CertificateFactory fact = CertificateFactory.getInstance(X509); - return fact.generateCertificate(inputStream); - } - } - - /** - * Add the certificates to the truststore. - * - * @param filePath Filepath of the corresponding certificate or directory containing the certificates - * @param trustStore Keystore with trusted certificates - */ - public static void addCertsToTruststore(KeyStore trustStore, String filePath) throws IOException { - - if (!Files.exists(Paths.get(filePath))) { - log.error("The provided certificates directory/file path does not exist. : " + filePath); - return; - } - if (Files.isDirectory(Paths.get(filePath))) { - log.debug("Provided Path is a directory: " + filePath); - Files.walk(Paths.get(filePath)).filter(path -> { - Path fileName = path.getFileName(); - return fileName != null && (fileName.toString().endsWith(crtExtension) || - fileName.toString().endsWith(pemExtension)); - }).forEach(path -> { - updateTruststoreWithMultipleCertPem(trustStore, path.toAbsolutePath().toString()); - }); - } else { - log.debug("Provided Path is a regular File Path : " + filePath); - updateTruststoreWithMultipleCertPem(trustStore, filePath); - } - } - - public static void convertAndAddCertificatesToTrustStore(KeyStore trustStore, List certificates) { - - for (Certificate certificate : certificates) { - try { - trustStore.setCertificateEntry(RandomStringUtils.random(10, true, false), - certificate); - } catch (KeyStoreException e) { - log.error("Error while adding the trusted certificates to the trustStore.", e); - } - } - } - - private static List getCertsFromFile(String filepath, boolean restrictToOne) - throws CertificateException, IOException, EnforcerException { - - String content = new String(Files.readAllBytes(Paths.get(filepath))); - - if (!content.contains(endCertificateDelimiter)) { - throw new EnforcerException("Content Provided within the certificate file:" + filepath + "is invalid."); - } - - int endIndex = content.lastIndexOf(endCertificateDelimiter) + endCertificateDelimiter.length(); - // If there are any additional characters afterwards, - if (endIndex < content.length()) { - content = content.substring(0, endIndex); - } - - List certList = new ArrayList<>(); - CertificateFactory cf = CertificateFactory.getInstance(X509); - InputStream inputStream = new ByteArrayInputStream(content.getBytes()); - BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream); - int count = 1; - while (bufferedInputStream.available() > 0) { - if (count > 1 && restrictToOne) { - log.warn("Provided PEM file " + filepath + - "contains more than one certificate. Hence proceeding with" + - "the first certificate in the File for the JWT configuraion related certificate."); - return certList; - } - Certificate cert = cf.generateCertificate(bufferedInputStream); - certList.add(cert); - count++; - } - return certList; - } - - private static void updateTruststoreWithMultipleCertPem(KeyStore trustStore, String filePath) { - - try { - List certificateList = getCertsFromFile(filePath, false); - certificateList.forEach(certificate -> { - try { - trustStore.setCertificateEntry(RandomStringUtils.random(10, true, false), - certificate); - } catch (KeyStoreException e) { - log.error("Error while adding the trusted certificates to the trustStore.", e); - } - }); - log.debug("Certificate Added to the truststore : " + filePath); - } catch (CertificateException | IOException | EnforcerException e) { - log.error("Error while adding certificates to the truststore.", e); - } - } - - public static Certificate getCertificate(String filePath) throws CertificateException, IOException { - - try (FileInputStream fileInputStream = new FileInputStream(filePath)) { - String content = IOUtils.toString(fileInputStream); - return getCertificateFromContent(content); - } - } - - public static Certificate getCertificateFromContent(String content) throws CertificateException, IOException { - - CertificateFactory fact = CertificateFactory.getInstance(X509); - try (InputStream is = new ByteArrayInputStream(content.getBytes())) { - X509Certificate cert = (X509Certificate) fact.generateCertificate(is); - return cert; - } - } - - /** - * Generate the gRPC Server SSL Context where the mutual SSL is also enabled. - * - * @return {@code SsLContext} generated SSL Context - * @throws SSLException - */ - public static SslContext buildGRPCServerSSLContext() throws SSLException { - - File certFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()).toFile(); - File keyFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()).toFile(); - - return GrpcSslContexts.forServer(certFile, keyFile) - .trustManager(ConfigHolder.getInstance().getTrustManagerFactory()) - .clientAuth(ClientAuth.REQUIRE) - .build(); - } - - public static KeyStore getDefaultCertTrustStore() throws EnforcerException { - - try { - - KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); - trustStore.load(null); - loadDefaultCertsToTrustStore(trustStore); - return trustStore; - } catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | IOException e) { - throw new EnforcerException("Error while generating Default trustStore", e); - } - } - - public static void loadDefaultCertsToTrustStore(KeyStore trustStore) throws - NoSuchAlgorithmException, KeyStoreException { - - TrustManagerFactory tmf = TrustManagerFactory - .getInstance(TrustManagerFactory.getDefaultAlgorithm()); - // Using null here initialises the TMF with the default trust store. - tmf.init((KeyStore) null); - - // Get hold of the default trust manager - X509TrustManager defaultTm = null; - for (TrustManager tm : tmf.getTrustManagers()) { - if (tm instanceof X509TrustManager) { - defaultTm = (X509TrustManager) tm; - break; - } - } - - // Get the certs from defaultTm and add them to our trustStore - if (defaultTm != null) { - X509Certificate[] trustedCerts = defaultTm.getAcceptedIssuers(); - Arrays.stream(trustedCerts) - .forEach(cert -> { - try { - trustStore.setCertificateEntry(RandomStringUtils.random(10, true, false), - cert); - } catch (KeyStoreException e) { - log.error("Error while adding default trusted ca cert", e); - } - }); - } - } - - public static KeyStore getKeyStore(String certPath, String keyPath) { - KeyStore keyStore = null; - try { - Certificate cert = - TLSUtils.getCertificateFromFile(certPath); - Key key = JWTUtils.getPrivateKey(keyPath); - keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, null); - keyStore.setKeyEntry("client-keys", key, null, new Certificate[]{cert}); - } catch (EnforcerException | CertificateException | IOException | KeyStoreException | - NoSuchAlgorithmException e) { - log.error("Error occurred while configuring KeyStore", e); - } - return keyStore; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/MetadataConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/MetadataConstants.java deleted file mode 100644 index b915dc7411..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/MetadataConstants.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.websocket; -// -///** -// * Constant field types for web socket related metadata values -// */ -//public class MetadataConstants { -// public static final String USERNAME = "username"; -// public static final String APP_TIER = "applicationTier"; -// public static final String TIER = "tier"; -// public static final String API_TIER = "apiTier"; -// public static final String CONTENT_AWARE_TIER_PRESENT = "isContentAwareTierPresent"; -// public static final String API_KEY = "apiKey"; -// public static final String KEY_TYPE = "keyType"; -// public static final String CALLER_TOKEN = "callerToken"; -// public static final String APP_ID = "applicationId"; -// public static final String APP_UUID = "applicationUUID"; -// public static final String APP_NAME = "applicationName"; -// public static final String CONSUMER_KEY = "consumerKey"; -// public static final String SUBSCRIBER = "subscriber"; -// public static final String SPIKE_ARREST_LIMIT = "spikeArrestLimit"; -// public static final String SUBSCRIBER_TENANT_DOMAIN = "subscriberTenantDomain"; -// public static final String SPIKE_ARREST_UNIT = "spikeArrestUnit"; -// public static final String STOP_ON_QUOTA = "stopOnQuotaReach"; -// public static final String PRODUCT_NAME = "productName"; -// public static final String PRODUCT_PROVIDER = "productProvider"; -// public static final String API_PUBLISHER = "apiPublisher"; -// public static final String API_TYPE_KEY = "apiType"; -// public static final String REQUEST_ID = "requestId"; -// public static final String MESSAGE_SIZE = "messageSize"; -// public static final String GRPC_STREAM_ID = "streamId"; -// public static final String INITIAL_APIM_ERROR_CODE = "initialAPIMErrorCode"; -// public static final String IS_THROTTLED = "isThrottled"; -// public static final String THROTTLE_CONDITION_EXPIRE_TIMESTAMP = "ThrottleConditionExpireTimestamp"; -// public static final String DEFAULT_SUBSCRIBER_TENANT = "carbon.super"; -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketFrameContext.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketFrameContext.java deleted file mode 100644 index 27d4ae4295..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketFrameContext.java +++ /dev/null @@ -1,57 +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.websocket; -// -///** -// * WebSocketFrameContext contains web socket frame related information like frame length, remote ip -// */ -//public class WebSocketFrameContext { -// private String streamId; -// private int frameLength; -// private String remoteIp; -// -// public WebSocketFrameContext(String streamId, int frameLength, String remoteIp) { -// this.streamId = streamId; -// this.frameLength = frameLength; -// this.remoteIp = remoteIp; -// } -// -// public String getStreamId() { -// return streamId; -// } -// -// public void setStreamId(String streamId) { -// this.streamId = streamId; -// } -// -// public int getFrameLength() { -// return frameLength; -// } -// -// public void setFrameLength(int frameLength) { -// this.frameLength = frameLength; -// } -// -// public String getRemoteIp() { -// return remoteIp; -// } -// -// public void setRemoteIp(String remoteIp) { -// this.remoteIp = remoteIp; -// } -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketMetaDataFilter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketMetaDataFilter.java deleted file mode 100644 index 0e7fa069ea..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketMetaDataFilter.java +++ /dev/null @@ -1,139 +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.websocket; -// -//import io.opentelemetry.context.Scope; -//import org.apache.logging.log4j.LogManager; -//import org.apache.logging.log4j.Logger; -//import org.apache.logging.log4j.ThreadContext; -//import org.wso2.apk.enforcer.api.WebSocketAPI; -//import org.wso2.apk.enforcer.commons.Filter; -//import org.wso2.apk.enforcer.commons.model.APIConfig; -//import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -//import org.wso2.apk.enforcer.commons.model.RequestContext; -//import org.wso2.apk.enforcer.constants.APIConstants; -//import org.wso2.apk.enforcer.throttle.ThrottleConstants; -//import org.wso2.apk.enforcer.tracing.TracingConstants; -//import org.wso2.apk.enforcer.tracing.TracingSpan; -//import org.wso2.apk.enforcer.tracing.TracingTracer; -//import org.wso2.apk.enforcer.tracing.Utils; -// -//import java.util.Map; -//import java.util.UUID; -// -///** -// * WebSocketMetaDataFilter adds metadata from AuthenticationContext and ApiConfig, to metadata map in the -// * RequestContext. These metadata values are added to envoy connection properties as dynamic metadata and will be -// * sent back to enforcer through the WebSocketFrame service as Metadata. -// */ -//public class WebSocketMetaDataFilter implements Filter { -// -// private static final Logger logger = LogManager.getLogger(WebSocketAPI.class); -// -// private APIConfig apiConfig; -// -// @Override -// public void init(APIConfig apiConfig, Map configProperties) { -// this.apiConfig = apiConfig; -// } -// -// @Override public boolean handleRequest(RequestContext requestContext) { -// TracingSpan wsSpan = null; -// Scope wsSpanScope = null; -// try { -// if (Utils.tracingEnabled()) { -// TracingTracer tracer = Utils.getGlobalTracer(); -// wsSpan = Utils.startSpan(TracingConstants.WS_METADATA_SPAN, tracer); -// wsSpanScope = wsSpan.getSpan().makeCurrent(); -// Utils.setTag(wsSpan, APIConstants.LOG_TRACE_ID, -// ThreadContext.get(APIConstants.LOG_TRACE_ID)); -// -// } -// String apiTier = !requestContext.getMatchedAPI().getTier().isBlank() -// ? requestContext.getMatchedAPI().getTier() : ThrottleConstants.UNLIMITED_TIER; -// AuthenticationContext authenticationContext = requestContext.getAuthenticationContext(); -// requestContext.addMetadataToMap(MetadataConstants.GRPC_STREAM_ID, UUID.randomUUID().toString()); -// requestContext.addMetadataToMap(MetadataConstants.REQUEST_ID, -// getNullableStringValue(requestContext.getRequestID())); -// requestContext.addMetadataToMap(MetadataConstants.USERNAME, -// getNullableStringValue(authenticationContext.getUsername())); -// requestContext.addMetadataToMap(MetadataConstants.APP_TIER, -// getNullableStringValue(authenticationContext.getApplicationTier())); -// requestContext.addMetadataToMap(MetadataConstants.TIER, -// getNullableStringValue(authenticationContext.getTier())); -// requestContext.addMetadataToMap(MetadataConstants.API_TIER, -// getNullableStringValue(apiTier)); -// requestContext.addMetadataToMap(MetadataConstants.CONTENT_AWARE_TIER_PRESENT, -// getNullableStringValue(String.valueOf(authenticationContext.isContentAwareTierPresent()))); -// requestContext.addMetadataToMap(MetadataConstants.API_KEY, -// getNullableStringValue(authenticationContext.getApiKey())); -// requestContext.addMetadataToMap(MetadataConstants.KEY_TYPE, -// getNullableStringValue(authenticationContext.getKeyType())); -// requestContext.addMetadataToMap(MetadataConstants.CALLER_TOKEN, -// getNullableStringValue(authenticationContext.getCallerToken())); -// requestContext.addMetadataToMap(MetadataConstants.APP_ID, -// String.valueOf(authenticationContext.getApplicationId())); -// requestContext.addMetadataToMap(MetadataConstants.API_TYPE_KEY, apiConfig.getApiType()); -// // Unused but added to maintain the consistancy -// requestContext.addMetadataToMap(MetadataConstants.APP_UUID, -// String.valueOf(authenticationContext.getApplicationUUID())); -// requestContext.addMetadataToMap(MetadataConstants.APP_NAME, -// getNullableStringValue(authenticationContext.getApplicationName())); -// requestContext.addMetadataToMap(MetadataConstants.CONSUMER_KEY, -// getNullableStringValue(authenticationContext.getConsumerKey())); -// requestContext.addMetadataToMap(MetadataConstants.SUBSCRIBER, -// getNullableStringValue(authenticationContext.getSubscriber())); -// requestContext.addMetadataToMap(MetadataConstants.SPIKE_ARREST_LIMIT, -// getNullableStringValue(String.valueOf(authenticationContext.getSpikeArrestLimit()))); -// requestContext.addMetadataToMap(MetadataConstants.SUBSCRIBER_TENANT_DOMAIN, -// getNullableStringValue(authenticationContext.getSubscriberTenantDomain())); -// requestContext.addMetadataToMap(MetadataConstants.SPIKE_ARREST_UNIT, -// getNullableStringValue(authenticationContext.getSpikeArrestUnit())); -// requestContext.addMetadataToMap(MetadataConstants.STOP_ON_QUOTA, -// getNullableStringValue(String.valueOf(authenticationContext.isStopOnQuotaReach()))); -// requestContext.addMetadataToMap(MetadataConstants.PRODUCT_NAME, -// getNullableStringValue(authenticationContext.getProductName())); -// requestContext.addMetadataToMap(MetadataConstants.PRODUCT_PROVIDER, -// getNullableStringValue(authenticationContext.getProductProvider())); -// requestContext.addMetadataToMap(MetadataConstants.API_PUBLISHER, -// getNullableStringValue(authenticationContext.getApiPublisher())); -// requestContext.addMetadataToMap(APIConstants.GW_API_NAME_PARAM, -// getNullableStringValue(apiConfig.getName())); -// requestContext.addMetadataToMap(APIConstants.GW_BASE_PATH_PARAM, -// getNullableStringValue(apiConfig.getBasePath())); -// requestContext.addMetadataToMap(APIConstants.GW_VHOST_PARAM, -// getNullableStringValue(apiConfig.getVhost())); -// requestContext.addMetadataToMap(APIConstants.GW_VERSION_PARAM, -// getNullableStringValue(apiConfig.getVersion())); -// return true; -// } finally { -// if (Utils.tracingEnabled()) { -// wsSpanScope.close(); -// Utils.finishSpan(wsSpan); -// } -// } -// } -// -// private String getNullableStringValue(String value) { -// if (value != null) { -// return value; -// } else { -// return ""; -// } -// } -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketResponseObserver.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketResponseObserver.java deleted file mode 100644 index cce54ae9ac..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketResponseObserver.java +++ /dev/null @@ -1,167 +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.websocket; -// -//import com.google.protobuf.ByteString; -//import io.grpc.stub.StreamObserver; -//import org.apache.logging.log4j.LogManager; -//import org.apache.logging.log4j.Logger; -//import org.java_websocket.drafts.Draft_6455; -//import org.java_websocket.enums.Opcode; -//import org.java_websocket.exceptions.InvalidDataException; -//import org.java_websocket.framing.Framedata; -//import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameRequest; -//import org.wso2.apk.enforcer.discovery.service.websocket.WebSocketFrameResponse; -//import org.wso2.apk.enforcer.analytics.AnalyticsFilter; -//import org.wso2.apk.enforcer.config.ConfigHolder; -//import org.wso2.apk.enforcer.constants.APIConstants; -//import org.wso2.apk.enforcer.grpc.WebSocketFrameService; -//import org.wso2.apk.enforcer.server.WebSocketHandler; -// -//import java.nio.ByteBuffer; -//import java.util.List; -//import java.util.Map; -// -///** -// * Wrapper class for StreamObserver with extra fields added to identify relevant information about -// * the related API, application, subscriber etc -// */ -//public class WebSocketResponseObserver implements StreamObserver { -// -// private static final Logger logger = LogManager.getLogger(WebSocketResponseObserver.class); -// private String apiThrottleKey; -// private String subscriptionThrottleKey; -// private String applicationThrottleKey; -// private final StreamObserver responseStreamObserver; -// private final WebSocketHandler webSocketHandler = new WebSocketHandler(); -// private String streamId; -// private boolean throttleKeysInitiated; -// private Draft_6455 decoder; -// -// public WebSocketResponseObserver(StreamObserver responseStreamObserver) { -// if (ConfigHolder.getInstance().getConfig().getAnalyticsConfig().isEnabled()) { -// AnalyticsFilter.getInstance(); -// } -// this.responseStreamObserver = responseStreamObserver; -// this.decoder = new Draft_6455(); -// } -// -// @Override -// public void onNext(WebSocketFrameRequest webSocketFrameRequest) { -// logger.debug("Websocket frame received for api:basepath : {}:{}", webSocketFrameRequest.getMetadata() -// .getExtAuthzMetadataMap().get(APIConstants.GW_API_NAME_PARAM), webSocketFrameRequest.getMetadata() -// .getExtAuthzMetadataMap().get(APIConstants.GW_BASE_PATH_PARAM)); -// try { -// // In case a stream of websocket frames are intercepted by the filter, envoy will buffer them as mini -// // batches and aggregate the frames. In that case if we directly send the frames to traffic manager, the -// // frame count will be wrong. Instead we can decode the buffer into frames and then process them -// // individually for throttling. -// if (ConfigHolder.getInstance().getConfig().getAnalyticsConfig().isEnabled()) { -// AnalyticsFilter.getInstance().handleWebsocketFrameRequest(webSocketFrameRequest); -// } -// List frames = decoder.translateFrame( -// ByteBuffer.wrap(webSocketFrameRequest.getPayload().toByteArray())); -// frames.forEach((framedata -> { -// // Only consider text, binary and continous frames -// if (framedata.getOpcode() == Opcode.TEXT || framedata.getOpcode() == Opcode.BINARY -// || framedata.getOpcode() == Opcode.CONTINUOUS) { -// WebSocketFrameRequest webSocketFrameRequestClone = webSocketFrameRequest.toBuilder() -// .setFrameLength(framedata.getPayloadData().remaining()) -// .setPayload(ByteString.copyFrom(framedata.getPayloadData())) -// .build(); -// sendWebSocketFrameResponse(webSocketFrameRequestClone); -// } else { -// logger.debug("Websocket frame type not related to throttling: {}", framedata.getOpcode()); -// } -// })); -// } catch (InvalidDataException e) { -// // temp fix for https://github.com/wso2/product-microgateway/issues/2693 -// logger.error("Error {} when decoding websocket frame. Could be a batched set of " + -// "multiple compressed frames. Processing the frame in raw form.", e.getMessage()); -// sendWebSocketFrameResponse(webSocketFrameRequest); -// } -// -// if (!this.throttleKeysInitiated) { -// initializeThrottleKeys(webSocketFrameRequest); -// } -// } -// -// private void sendWebSocketFrameResponse(WebSocketFrameRequest webSocketFrameRequest) { -// WebSocketThrottleResponse webSocketThrottleResponse = webSocketHandler -// .process(webSocketFrameRequest); -// if (WebSocketThrottleState.OK == webSocketThrottleResponse.getWebSocketThrottleState()) { -// WebSocketFrameResponse response = WebSocketFrameResponse.newBuilder().setThrottleState( -// WebSocketFrameResponse.Code.OK).setApimErrorCode(0).build(); -// responseStreamObserver.onNext(response); -// } else if (WebSocketThrottleState.OVER_LIMIT == webSocketThrottleResponse -// .getWebSocketThrottleState()) { -// logger.debug("throttle out period" + webSocketThrottleResponse.getThrottlePeriod()); -// WebSocketFrameResponse response = WebSocketFrameResponse.newBuilder() -// .setThrottleState(WebSocketFrameResponse.Code.OVER_LIMIT) -// .setThrottlePeriod(webSocketThrottleResponse.getThrottlePeriod()) -// .setApimErrorCode(webSocketThrottleResponse.getApimErrorCode()) -// .build(); -// responseStreamObserver.onNext(response); -// } else { -// logger.debug("throttle state of the connection is not available in enforcer"); -// WebSocketFrameResponse webSocketFrameResponse = WebSocketFrameResponse.newBuilder() -// .setThrottleState(WebSocketFrameResponse.Code.UNKNOWN).build(); -// responseStreamObserver.onNext(webSocketFrameResponse); -// } -// } -// -// @Override -// public void onError(Throwable throwable) { -// logger.error("websocket frame service onError: " + throwable.toString()); -// WebSocketFrameService.removeObserver(streamId); -// } -// -// @Override -// public void onCompleted() { -// WebSocketFrameService.removeObserver(streamId); -// } -// -// // Not used for throttling purposes currently. Only kept as a reference -// private void initializeThrottleKeys(WebSocketFrameRequest webSocketFrameRequest) { -// Map extAuthMetadata = webSocketFrameRequest.getMetadata().getExtAuthzMetadataMap(); -// String basePath = extAuthMetadata.get(APIConstants.GW_BASE_PATH_PARAM); -// String version = extAuthMetadata.get(APIConstants.GW_VERSION_PARAM); -// String applicationId = extAuthMetadata.get(MetadataConstants.APP_ID); -// String streamId = extAuthMetadata.get(MetadataConstants.GRPC_STREAM_ID); -// String authorizedUser = extAuthMetadata.get(MetadataConstants.USERNAME); -// String apiContext = basePath + ':' + version; -// this.apiThrottleKey = apiContext; -// this.subscriptionThrottleKey = applicationId + ":" + apiContext; -// this.applicationThrottleKey = applicationId + ":" + authorizedUser; -// this.streamId = streamId; -// WebSocketFrameService.addObserver(streamId, this); -// this.throttleKeysInitiated = true; -// } -// -// public String getApiThrottleKey() { -// return apiThrottleKey; -// } -// -// public String getSubscriptionThrottleKey() { -// return subscriptionThrottleKey; -// } -// -// public String getApplicationThrottleKey() { -// return applicationThrottleKey; -// } -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketThrottleFilter.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketThrottleFilter.java deleted file mode 100644 index 5491a50828..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketThrottleFilter.java +++ /dev/null @@ -1,314 +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.websocket; -// -//import io.opentelemetry.context.Scope; -//import org.apache.logging.log4j.LogManager; -//import org.apache.logging.log4j.Logger; -//import org.apache.logging.log4j.ThreadContext; -//import org.json.JSONObject; -//import org.wso2.apk.enforcer.commons.Filter; -//import org.wso2.apk.enforcer.commons.model.APIConfig; -//import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -//import org.wso2.apk.enforcer.commons.model.RequestContext; -//import org.wso2.apk.enforcer.config.ConfigHolder; -//import org.wso2.apk.enforcer.config.dto.ThrottleConfigDto; -//import org.wso2.apk.enforcer.constants.APIConstants; -//import org.wso2.apk.enforcer.throttle.ThrottleAgent; -//import org.wso2.apk.enforcer.throttle.ThrottleConstants; -//import org.wso2.apk.enforcer.throttle.ThrottleDataHolder; -//import org.wso2.apk.enforcer.throttle.databridge.agent.util.ThrottleEventConstants; -//import org.wso2.apk.enforcer.throttle.dto.Decision; -//import org.wso2.apk.enforcer.throttle.utils.ThrottleUtils; -//import org.wso2.apk.enforcer.tracing.TracingConstants; -//import org.wso2.apk.enforcer.tracing.TracingSpan; -//import org.wso2.apk.enforcer.tracing.TracingTracer; -//import org.wso2.apk.enforcer.tracing.Utils; -//import org.wso2.apk.enforcer.util.FilterUtils; -// -//import java.net.Inet4Address; -//import java.net.Inet6Address; -//import java.net.InetAddress; -//import java.net.UnknownHostException; -//import java.util.HashMap; -//import java.util.Map; -// -///** -// * WebSocketThrottleFilter handles the throttling of web socket connections -// */ -//public class WebSocketThrottleFilter implements Filter { -// private static final Logger log = LogManager.getLogger(WebSocketThrottleFilter.class); -// -// private final boolean isGlobalThrottlingEnabled; -// private final ThrottleDataHolder dataHolder; -// -// public WebSocketThrottleFilter() { -// this.dataHolder = ThrottleDataHolder.getInstance(); -// this.isGlobalThrottlingEnabled = ConfigHolder.getInstance().getConfig().getThrottleConfig() -// .isGlobalPublishingEnabled(); -// } -// -// @Override public boolean handleRequest(RequestContext requestContext) { -// TracingSpan wsSpan = null; -// Scope wsSpanScope = null; -// try { -// if (Utils.tracingEnabled()) { -// TracingTracer tracer = Utils.getGlobalTracer(); -// wsSpan = Utils.startSpan(TracingConstants.WS_THROTTLE_SPAN, tracer); -// wsSpanScope = wsSpan.getSpan().makeCurrent(); -// Utils.setTag(wsSpan, APIConstants.LOG_TRACE_ID, -// ThreadContext.get(APIConstants.LOG_TRACE_ID)); -// -// } -// if (doThrottle(requestContext)) { -// // breaking filter chain since request is throttled -// return false; -// } -// // publish throttle event and continue the filter chain -// ThrottleAgent.publishNonThrottledEvent(getThrottleEventMap(requestContext)); -// return true; -// } finally { -// if (Utils.tracingEnabled()) { -// wsSpanScope.close(); -// Utils.finishSpan(wsSpan); -// } -// } -// -// } -// -// private boolean doThrottle(RequestContext requestContext) { -// AuthenticationContext authContext = requestContext.getAuthenticationContext(); -// if (authContext != null) { -// APIConfig api = requestContext.getMatchedAPI(); -// String apiContext = api.getBasePath(); -// String apiVersion = api.getVersion(); -// int appId = authContext.getApplicationId(); -// String apiTier = getApiTier(api); -// String resourceTier = getApiTier(api); -// String apiThrottleKey = getApiThrottleKey(apiContext, apiVersion); -// String subTier = authContext.getTier(); -// String appTier = authContext.getApplicationTier(); -// String appTenant = authContext.getSubscriberTenantDomain(); -// String clientIp = requestContext.getWebSocketFrameContext().getRemoteIp(); -// String apiTenantDomain = FilterUtils.getTenantDomainFromRequestURL(apiContext); -// String authorizedUser = FilterUtils.buildUsernameWithTenant(authContext.getUsername(), appTenant); -// if (apiTenantDomain == null) { -// apiTenantDomain = APIConstants.SUPER_TENANT_DOMAIN_NAME; -// } -// -// // Check for blocking conditions -// if (dataHolder.isBlockingConditionsPresent()) { -// String appBlockingKey = authContext.getSubscriber() + ":" + authContext.getApplicationName(); -// String subBlockingKey = apiContext + ":" + apiVersion + ":" + authContext.getSubscriber() -// + "-" + authContext.getApplicationName() + ":" + authContext.getKeyType(); -// -// if (dataHolder.isRequestBlocked(apiContext, appBlockingKey, authorizedUser, clientIp, -// subBlockingKey, apiTenantDomain)) { -// FilterUtils.setThrottleErrorToContext(requestContext, -// ThrottleConstants.BLOCKED_ERROR_CODE, -// ThrottleConstants.BLOCKING_MESSAGE, -// ThrottleConstants.BLOCKING_DESCRIPTION); -// requestContext.getProperties().put(ThrottleConstants.THROTTLE_OUT_REASON, -// ThrottleConstants.THROTTLE_OUT_REASON_REQUEST_BLOCKED); -// log.debug("Request blocked as it violates blocking conditions, for API: {}," + -// " application: {}, user: {}", apiContext, appBlockingKey, authorizedUser); -// return true; -// } -// } -// -// // Checking API level throttling. -// Decision apiDecision = checkApiThrottled(apiThrottleKey, apiTier, requestContext); -// if (apiDecision.isThrottled()) { -// log.debug("Setting api throttle out response"); -// int errorCode; -// String reason; -// errorCode = ThrottleConstants.API_THROTTLE_OUT_ERROR_CODE; -// reason = ThrottleConstants.THROTTLE_OUT_REASON_API_LIMIT_EXCEEDED; -// FilterUtils.setThrottleErrorToContext(requestContext, errorCode, ThrottleConstants.THROTTLE_OUT_MESSAGE, -// ThrottleConstants.THROTTLE_OUT_DESCRIPTION); -// requestContext.getProperties().put(ThrottleConstants.THROTTLE_OUT_REASON, reason); -// ThrottleUtils.setRetryAfterWebsocket(requestContext, apiDecision.getResetAt()); -// return true; -// } -// -// // Checking subscription level throttling. -// String subThrottleKey = getSubscriptionThrottleKey(appId, apiContext, apiVersion); -// Decision subDecision = checkSubscriptionLevelThrottled(subThrottleKey, subTier); -// if (subDecision.isThrottled()) { -// if (authContext.isStopOnQuotaReach()) { -// log.debug("Setting subscription throttle out response"); -// FilterUtils.setThrottleErrorToContext(requestContext, -// ThrottleConstants.SUBSCRIPTION_THROTTLE_OUT_ERROR_CODE, -// ThrottleConstants.THROTTLE_OUT_MESSAGE, -// ThrottleConstants.THROTTLE_OUT_DESCRIPTION); -// requestContext.getProperties().put(ThrottleConstants.THROTTLE_OUT_REASON, -// ThrottleConstants.THROTTLE_OUT_REASON_SUBSCRIPTION_LIMIT_EXCEEDED); -// ThrottleUtils.setRetryAfterWebsocket(requestContext, subDecision.getResetAt()); -// return true; -// } -// log.debug("Proceeding since stopOnQuotaReach is false"); -// } -// -// // Checking Application level throttling -// String appThrottleKey = appId + ":" + authorizedUser; -// Decision appDecision = checkAppLevelThrottled(appThrottleKey, appTier); -// if (appDecision.isThrottled()) { -// log.debug("Setting application throttle out response"); -// FilterUtils.setThrottleErrorToContext(requestContext, -// ThrottleConstants.APPLICATION_THROTTLE_OUT_ERROR_CODE, -// ThrottleConstants.THROTTLE_OUT_MESSAGE, -// ThrottleConstants.THROTTLE_OUT_DESCRIPTION); -// requestContext.getProperties().put(ThrottleConstants.THROTTLE_OUT_REASON, -// ThrottleConstants.THROTTLE_OUT_REASON_APPLICATION_LIMIT_EXCEEDED); -// ThrottleUtils.setRetryAfterWebsocket(requestContext, appDecision.getResetAt()); -// return true; -// } -// } -// return false; -// } -// -// private String getApiTier(APIConfig apiConfig) { -// if (!apiConfig.getTier().isBlank()) { -// return apiConfig.getTier(); -// } -// return ThrottleConstants.UNLIMITED_TIER; -// } -// -// private String getApiThrottleKey(String apiContext, String apiVersion) { -// String apiThrottleKey = apiContext; -// if (!apiVersion.isBlank()) { -// apiThrottleKey += ':' + apiVersion; -// } -// return apiThrottleKey; -// } -// -// private String getSubscriptionThrottleKey(int appId, String apiContext, String apiVersion) { -// String subThrottleKey = appId + ":" + apiContext; -// if (!apiVersion.isBlank()) { -// subThrottleKey += ":" + apiVersion; -// } -// return subThrottleKey; -// } -// -// private Decision checkSubscriptionLevelThrottled(String throttleKey, String tier) { -// Decision decision = dataHolder.isThrottled(throttleKey); -// log.debug("Subscription Level throttle decision is {} for key:tier {}:{}", decision.isThrottled(), -// throttleKey, tier); -// return decision; -// } -// -// private Decision checkAppLevelThrottled(String throttleKey, String tier) { -// Decision decision = dataHolder.isThrottled(throttleKey); -// log.debug("Application Level throttle decision is {} for key:tier {}:{}", decision.isThrottled(), -// throttleKey, tier); -// return decision; -// } -// -// private Map getThrottleEventMap(RequestContext requestContext) { -// AuthenticationContext authContext = requestContext.getAuthenticationContext(); -// Map throttleEvent = new HashMap<>(); -// APIConfig api = requestContext.getMatchedAPI(); -// -// String basePath = api.getBasePath(); -// String apiVersion = api.getVersion(); -// String apiContext = basePath + ':' + apiVersion; -// String apiName = api.getName(); -// String apiTier = getApiTier(api); -// String tenantDomain = FilterUtils.getTenantDomainFromRequestURL(apiContext); -// String appTenant = authContext.getSubscriberTenantDomain(); -// String authorizedUser = FilterUtils.buildUsernameWithTenant(authContext.getUsername(), appTenant); -// -// if (tenantDomain == null) { -// tenantDomain = APIConstants.SUPER_TENANT_DOMAIN_NAME; -// } -// -// throttleEvent.put(ThrottleEventConstants.MESSAGE_ID, requestContext.getRequestID()); -// throttleEvent.put(ThrottleEventConstants.APP_KEY, authContext.getApplicationId() + ":" + authorizedUser); -// throttleEvent.put(ThrottleEventConstants.APP_TIER, authContext.getApplicationTier()); -// throttleEvent.put(ThrottleEventConstants.API_KEY, apiContext); -// throttleEvent.put(ThrottleEventConstants.API_TIER, apiTier); -// throttleEvent.put(ThrottleEventConstants.RESOURCE_TIER, apiTier); -// throttleEvent.put(ThrottleEventConstants.RESOURCE_KEY, apiContext); -// throttleEvent.put(ThrottleEventConstants.SUBSCRIPTION_KEY, authContext.getApplicationId() + ":" + -// apiContext); -// throttleEvent.put(ThrottleEventConstants.SUBSCRIPTION_TIER, authContext.getTier()); -// // TODO: (Praminda) should publish with tenant domain? -// throttleEvent.put(ThrottleEventConstants.USER_ID, authorizedUser); -// throttleEvent.put(ThrottleEventConstants.API_CONTEXT, basePath); -// throttleEvent.put(ThrottleEventConstants.API_VERSION, apiVersion); -// throttleEvent.put(ThrottleEventConstants.APP_TENANT, authContext.getSubscriberTenantDomain()); -// throttleEvent.put(ThrottleEventConstants.API_TENANT, tenantDomain); -// throttleEvent.put(ThrottleEventConstants.APP_ID, String.valueOf(authContext.getApplicationId())); -// throttleEvent.put(ThrottleEventConstants.API_NAME, apiName); -// throttleEvent.put(ThrottleEventConstants.PROPERTIES, getProperties(requestContext).toString()); -// return throttleEvent; -// } -// -// private JSONObject getProperties(RequestContext requestContext) { -// String remoteIP = requestContext.getClientIp(); -// JSONObject jsonObMap = new JSONObject(); -// ThrottleConfigDto config = ConfigHolder.getInstance().getConfig().getThrottleConfig(); -// -// if (remoteIP != null && remoteIP.length() > 0) { -// try { -// InetAddress address = InetAddress.getByName(remoteIP); -// if (address instanceof Inet4Address) { -// jsonObMap.put(ThrottleConstants.IP, FilterUtils.ipToLong(remoteIP)); -// jsonObMap.put(ThrottleConstants.IPV6, 0); -// } else if (address instanceof Inet6Address) { -// jsonObMap.put(ThrottleConstants.IPV6, FilterUtils.ipToBigInteger(remoteIP)); -// jsonObMap.put(ThrottleConstants.IP, 0); -// } -// } catch (UnknownHostException e) { -// //send empty value as ip -// log.error("Error while parsing host IP {}", remoteIP, e); -// jsonObMap.put(ThrottleConstants.IPV6, 0); -// jsonObMap.put(ThrottleConstants.IP, 0); -// } -// } -// -// String callerToken = requestContext.getAuthenticationContext().getCallerToken(); -// if (config.isJwtClaimConditionsEnabled() && callerToken != null) { -// net.minidev.json.JSONObject claims = ThrottleUtils.getJWTClaims(callerToken); -// for (String key : claims.keySet()) { -// jsonObMap.put(key, claims.get(key)); -// } -// } -// -// int frameLength = requestContext.getWebSocketFrameContext().getFrameLength(); -// jsonObMap.put(MetadataConstants.MESSAGE_SIZE, frameLength); -// -// return jsonObMap; -// } -// -// private Decision checkApiThrottled(String throttleKey, String tier, RequestContext context) { -// log.debug("Checking if request is throttled at API level for tier: {}, key: {}", tier, throttleKey); -// Decision decision = new Decision(); -// -// if (ThrottleConstants.UNLIMITED_TIER.equals(tier)) { -// return decision; -// } -// -// if (isGlobalThrottlingEnabled) { -// decision = dataHolder.isAdvancedThrottled(throttleKey, context); -// log.debug("API Level throttle decision: {}", decision.isThrottled()); -// return decision; -// } -// return decision; -// } -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketThrottleResponse.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketThrottleResponse.java deleted file mode 100644 index 9844fdd4c1..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/websocket/WebSocketThrottleResponse.java +++ /dev/null @@ -1,70 +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.websocket; -// -///** -// * OK - WebSocket connection is at non-throttled state -// * OVER_LIMIT - WebSocket connection is at throttled state -// * UNKNOWN - Throttle state of the WebSocket connection is not known -// */ -//enum WebSocketThrottleState { -// UNKNOWN, -// OK, -// OVER_LIMIT -//} -// -///** -// * Represents the object that is sent through the gRPC bidirectional stream as WebSocketFrameResponse -// */ -//public class WebSocketThrottleResponse { -// private WebSocketThrottleState webSocketThrottleState; -// private long throttlePeriod; -// private int apimErrorCode = 0; -// -// public WebSocketThrottleState getWebSocketThrottleState() { -// return webSocketThrottleState; -// } -// -// public void setOkState() { -// this.webSocketThrottleState = WebSocketThrottleState.OK; -// } -// -// public void setOverLimitState() { -// this.webSocketThrottleState = WebSocketThrottleState.OVER_LIMIT; -// } -// -// public void setUnknownState() { -// this.webSocketThrottleState = WebSocketThrottleState.UNKNOWN; -// } -// -// public long getThrottlePeriod() { -// return throttlePeriod; -// } -// -// public void setThrottlePeriod(long throttlePeriod) { -// this.throttlePeriod = throttlePeriod; -// } -// -// public int getApimErrorCode() { -// return apimErrorCode; -// } -// -// public void setApimErrorCode(int apimErrorCode) { -// this.apimErrorCode = apimErrorCode; -// } -//} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/applicationinsights.json b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/applicationinsights.json deleted file mode 100644 index 6dad6504a3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/applicationinsights.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "connectionString": "", - "role": { - "name": "choreo_connect_enforcer" - }, - "sampling": { - "percentage": 50 - }, - "heartbeat": { - "intervalSeconds": 900 - }, - "preview": { - "instrumentation": { - "azureSdk": { - "enabled": false - } - }, - "metricIntervalSeconds": 60 - }, - "instrumentation": { - "logging": { - "level": "OFF" - }, - "cassandra": { - "enabled": false - }, - "jdbc": { - "enabled": false - }, - "jms": { - "enabled": false - }, - "kafka": { - "enabled": false - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/check_health.sh b/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/check_health.sh deleted file mode 100755 index cec0fb4548..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/resources/check_health.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -------------------------------------------------------------------- -# Copyright (c) 2021, WSO2 LLC. (http://wso2.com) All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ----------------------------------------------------------------------- - -ENFORCER_PORT="${ENFORCER_PORT:-8081}" -grpc_health_probe -addr "127.0.0.1:${ENFORCER_PORT}" \ - -tls \ - -tls-ca-cert "${ENFORCER_PUBLIC_CERT_PATH}" \ - -tls-client-cert "${ENFORCER_PUBLIC_CERT_PATH}" \ - -tls-client-key "${ENFORCER_PRIVATE_KEY_PATH}" \ - -connect-timeout=3s diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/jwt/Oauth2ValidatorTest.java b/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/jwt/Oauth2ValidatorTest.java deleted file mode 100644 index 55376740c3..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/jwt/Oauth2ValidatorTest.java +++ /dev/null @@ -1,677 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wso2.apk.enforcer.jwt; - -import com.google.common.cache.LoadingCache; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.MockedStatic; -import org.mockito.Mockito; -import org.wso2.apk.enforcer.common.CacheProvider; -import org.wso2.apk.enforcer.common.CacheProviderUtil; -import org.wso2.apk.enforcer.commons.dto.JWKSConfigurationDTO; -import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; -import org.wso2.apk.enforcer.commons.dto.JWTValidationInfo; -import org.wso2.apk.enforcer.commons.exception.APISecurityException; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; -import org.wso2.apk.enforcer.commons.jwtgenerator.AbstractAPIMgtGatewayJWTGenerator; -import org.wso2.apk.enforcer.commons.jwttransformer.DefaultJWTTransformer; -import org.wso2.apk.enforcer.commons.jwttransformer.JWTTransformer; -import org.wso2.apk.enforcer.commons.model.APIConfig; -import org.wso2.apk.enforcer.commons.model.AuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.AuthenticationContext; -import org.wso2.apk.enforcer.commons.model.Oauth2AuthenticationConfig; -import org.wso2.apk.enforcer.commons.model.RequestContext; -import org.wso2.apk.enforcer.commons.model.ResourceConfig; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.EnforcerConfig; -import org.wso2.apk.enforcer.config.dto.ExtendedTokenIssuerDto; -import org.wso2.apk.enforcer.constants.APISecurityConstants; -import org.wso2.apk.enforcer.security.KeyValidator; -import org.wso2.apk.enforcer.security.jwt.Oauth2Authenticator; -import org.wso2.apk.enforcer.security.jwt.validator.JWTValidator; -import org.wso2.apk.enforcer.server.RevokedTokenRedisClient; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.UUID; - -public class Oauth2ValidatorTest { - - @Before - public void setup() { - - RevokedTokenRedisClient.setRevokedTokens(new HashSet<>()); - } - - @Test - public void testJWTValidator() throws APISecurityException, EnforcerException { - - String organization = "org1"; - String environment = "development"; - String issuer = "https://localhost:9443/oauth2/token"; - String signature = "sBgeoqJn0log5EZflj_G7ADvm6B3KQ9bdfFCEFVQS1U3oY9" + - "-cqPwAPyOLLh95pdfjYjakkf1UtjPZjeIupwXnzg0SffIc704RoVlZocAx9Ns2XihjU6Imx2MbXq9ARmQxQkyGVkJUMTwZ8" + - "-SfOnprfrhX2cMQQS8m2Lp7hcsvWFRGKxAKIeyUrbY4ihRIA5vOUrMBWYUx9Di1N7qdKA4S3e8O4KQX2VaZPBzN594c9TG" + - "riiH8AuuqnrftfvidSnlRLaFJmko8-QZo8jDepwacaFhtcaPVVJFG4uYP-_-N6sqfxLw3haazPN0_xU0T1zJLPRLC5HPfZMJDMGp" + - "EuSe9w"; - String jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5UZG1aak00WkRrM05qWTBZemM1T" + - "W1abU9EZ3dNVEUzTVdZd05ERTVNV1JsWkRnNE56YzRaQT09In0" + - ".eyJhdWQiOiJodHRwOlwvXC9vcmcud3NvMi5hcGltZ3RcL2dhdGV" + - "3YXkiLCJzdWIiOiJhZG1pbkBjYXJib24uc3VwZXIiLCJhcHBsaWNhdGlvbiI6eyJvd25lciI6ImFkbWluIiwidGllclF1b3RhVHlwZ" + - "SI6InJlcXVlc3RDb3VudCIsInRpZXIiOiJVbmxpbWl0ZWQiLCJuYW1lIjoiRGVmYXVsdEFwcGxpY2F0aW9uIiwiaWQiOjEsInV1aWQ" + - "iOm51bGx9LCJzY29wZSI6ImFtX2FwcGxpY2F0aW9uX3Njb3BlIGRlZmF1bHQiLCJpc3MiOiJodHRwczpcL1wvbG9jYWxob3N0Ojk0" + - "NDNcL29hdXRoMlwvdG9rZW4iLCJ0aWVySW5mbyI6e30sImtleXR5cGUiOiJQUk9EVUNUSU9OIiwic3Vic2NyaWJlZEFQSXMiOltdL" + - "CJjb25zdW1lcktleSI6IlhnTzM5NklIRks3ZUZZeWRycVFlNEhLR3oxa2EiLCJleHAiOjE1OTAzNDIzMTMsImlhdCI6MTU5MDMzO" + - "DcxMywianRpIjoiYjg5Mzg3NjgtMjNmZC00ZGVjLThiNzAtYmVkNDVlYjdjMzNkIn0." + signature; - JWTValidationInfo jwtValidationInfo = new JWTValidationInfo(); - jwtValidationInfo.setValid(true); - jwtValidationInfo.setExpiryTime(System.currentTimeMillis() + 5000L); - jwtValidationInfo.setConsumerKey(UUID.randomUUID().toString()); - jwtValidationInfo.setUser("user1"); - jwtValidationInfo.setKeyManager("Default"); - - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - Oauth2Authenticator oauth2Authenticator = new Oauth2Authenticator(jwtConfigurationDto, true); - RequestContext requestContext = Mockito.mock(RequestContext.class); - - ArrayList resourceConfigs = new ArrayList<>(); - ResourceConfig resourceConfig = Mockito.mock(ResourceConfig.class); - AuthenticationConfig authenticationConfig = new AuthenticationConfig(); - Oauth2AuthenticationConfig oauth2AuthenticationConfig = new Oauth2AuthenticationConfig(); - oauth2AuthenticationConfig.setHeader("Authorization"); - authenticationConfig.setOauth2AuthenticationConfig(oauth2AuthenticationConfig); - Mockito.when(resourceConfig.getAuthenticationConfig()).thenReturn(authenticationConfig); - Mockito.when(resourceConfig.getMethod()).thenReturn(ResourceConfig.HttpMethods.GET); - resourceConfigs.add(resourceConfig); - Mockito.when(requestContext.getMatchedResourcePaths()).thenReturn(resourceConfigs); - Map headers = new HashMap<>(); - headers.put("Authorization", "Bearer " + jwt); - Mockito.when(requestContext.getHeaders()).thenReturn(headers); - Mockito.when(requestContext.getAuthenticationContext()).thenReturn(new AuthenticationContext()); - APIConfig apiConfig = Mockito.mock(APIConfig.class); - Mockito.when(apiConfig.getName()).thenReturn("api1"); - Mockito.when(apiConfig.getEnvironment()).thenReturn(environment); - Mockito.when(apiConfig.getOrganizationId()).thenReturn(organization); - Mockito.when(requestContext.getMatchedAPI()).thenReturn(apiConfig); - CacheProvider cacheProvider = Mockito.mock(CacheProvider.class); - LoadingCache gatewayKeyCache = Mockito.mock(LoadingCache.class); - LoadingCache invalidTokenCache = Mockito.mock(LoadingCache.class); - Mockito.when(cacheProvider.getGatewayKeyCache()).thenReturn(gatewayKeyCache); - Mockito.when(cacheProvider.getInvalidTokenCache()).thenReturn(invalidTokenCache); - try (MockedStatic logManagerDummy = Mockito.mockStatic(LogManager.class); - MockedStatic logFactoryDummy = Mockito.mockStatic(LogFactory.class); - MockedStatic cacheProviderUtilDummy = Mockito.mockStatic(CacheProviderUtil.class); - MockedStatic configHolderDummy = Mockito.mockStatic(ConfigHolder.class); - MockedStatic subscriptionDataHolderMockedStatic = - Mockito.mockStatic(SubscriptionDataHolder.class); - MockedStatic keyValidaterDummy = Mockito.mockStatic(KeyValidator.class)) { - SubscriptionDataStore subscriptionDataStore = Mockito.mock(SubscriptionDataStore.class); - SubscriptionDataHolder subscriptionDataHolder = Mockito.mock(SubscriptionDataHolder.class); - subscriptionDataHolderMockedStatic.when(SubscriptionDataHolder::getInstance).thenReturn(subscriptionDataHolder); - Mockito.when(subscriptionDataHolder.getSubscriptionDataStore(organization)).thenReturn(subscriptionDataStore); - Logger logger = Mockito.mock(Logger.class); - logManagerDummy.when(() -> LogManager.getLogger(Oauth2Authenticator.class)).thenReturn(logger); - Log logger2 = Mockito.mock(Log.class); - logFactoryDummy.when(() -> LogFactory.getLog(AbstractAPIMgtGatewayJWTGenerator.class)).thenReturn(logger2); - cacheProviderUtilDummy.when(() -> CacheProviderUtil.getOrganizationCache(organization)) - .thenReturn(cacheProvider); - ExtendedTokenIssuerDto tokenIssuerDto = Mockito.mock(ExtendedTokenIssuerDto.class); - Mockito.when(tokenIssuerDto.getIssuer()).thenReturn(issuer); - JWKSConfigurationDTO jwksConfigurationDTO = new JWKSConfigurationDTO(); - jwksConfigurationDTO.setEnabled(true); - Mockito.when(tokenIssuerDto.getJwksConfigurationDTO()).thenReturn(jwksConfigurationDTO); - - EnforcerConfig enforcerConfig = Mockito.mock(EnforcerConfig.class); - ConfigHolder configHolder = Mockito.mock(ConfigHolder.class); - configHolderDummy.when(ConfigHolder::getInstance).thenReturn(configHolder); - Mockito.when(configHolder.getConfig()).thenReturn(enforcerConfig); - JWTTransformer jwtTransformer = new DefaultJWTTransformer(); - Mockito.when(enforcerConfig.getJwtTransformer(issuer)).thenReturn(jwtTransformer); - JWTValidator jwtValidator = Mockito.mock(JWTValidator.class); - - Mockito.when(subscriptionDataStore.getJWTValidatorByIssuer(issuer, environment)).thenReturn(jwtValidator); - Mockito.when(jwtValidator.validateToken(Mockito.eq(jwt), Mockito.any())).thenReturn(jwtValidationInfo); - keyValidaterDummy.when(() -> KeyValidator.validateScopes(Mockito.any())).thenReturn(true); - AuthenticationContext authenticate = oauth2Authenticator.authenticate(requestContext); - Assert.assertNotNull(authenticate); - Mockito.verify(gatewayKeyCache, Mockito.atLeast(1)).put(signature, jwtValidationInfo); - } - } - - @Test - public void testRevokedToken() throws APISecurityException, EnforcerException { - HashSet revokedTokens = new HashSet<>(); - String revokedTokenJTI = "b8938768-23fd-4dec-8b70-bed45eb7c33d"; - revokedTokens.add(revokedTokenJTI); - RevokedTokenRedisClient.setRevokedTokens(revokedTokens); - String organization = "org1"; - String environment = "development"; - String issuer = "https://localhost:9443/oauth2/token"; - String signature = "sBgeoqJn0log5EZflj_G7ADvm6B3KQ9bdfFCEFVQS1U3oY9" + - "-cqPwAPyOLLh95pdfjYjakkf1UtjPZjeIupwXnzg0SffIc704RoVlZocAx9Ns2XihjU6Imx2MbXq9ARmQxQkyGVkJUMTwZ8" + - "-SfOnprfrhX2cMQQS8m2Lp7hcsvWFRGKxAKIeyUrbY4ihRIA5vOUrMBWYUx9Di1N7qdKA4S3e8O4KQX2VaZPBzN594c9TG" + - "riiH8AuuqnrftfvidSnlRLaFJmko8-QZo8jDepwacaFhtcaPVVJFG4uYP-_-N6sqfxLw3haazPN0_xU0T1zJLPRLC5HPfZMJDMGp" + - "EuSe9w"; - String jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5UZG1aak00WkRrM05qWTBZemM1T" + - "W1abU9EZ3dNVEUzTVdZd05ERTVNV1JsWkRnNE56YzRaQT09In0" + - ".eyJhdWQiOiJodHRwOlwvXC9vcmcud3NvMi5hcGltZ3RcL2dhdGV" + - "3YXkiLCJzdWIiOiJhZG1pbkBjYXJib24uc3VwZXIiLCJhcHBsaWNhdGlvbiI6eyJvd25lciI6ImFkbWluIiwidGllclF1b3RhVHlwZ" + - "SI6InJlcXVlc3RDb3VudCIsInRpZXIiOiJVbmxpbWl0ZWQiLCJuYW1lIjoiRGVmYXVsdEFwcGxpY2F0aW9uIiwiaWQiOjEsInV1aWQ" + - "iOm51bGx9LCJzY29wZSI6ImFtX2FwcGxpY2F0aW9uX3Njb3BlIGRlZmF1bHQiLCJpc3MiOiJodHRwczpcL1wvbG9jYWxob3N0Ojk0" + - "NDNcL29hdXRoMlwvdG9rZW4iLCJ0aWVySW5mbyI6e30sImtleXR5cGUiOiJQUk9EVUNUSU9OIiwic3Vic2NyaWJlZEFQSXMiOltdL" + - "CJjb25zdW1lcktleSI6IlhnTzM5NklIRks3ZUZZeWRycVFlNEhLR3oxa2EiLCJleHAiOjE1OTAzNDIzMTMsImlhdCI6MTU5MDMzO" + - "DcxMywianRpIjoiYjg5Mzg3NjgtMjNmZC00ZGVjLThiNzAtYmVkNDVlYjdjMzNkIn0." + signature; - JWTValidationInfo jwtValidationInfo = new JWTValidationInfo(); - jwtValidationInfo.setValid(true); - jwtValidationInfo.setExpiryTime(System.currentTimeMillis() + 5000L); - jwtValidationInfo.setConsumerKey(UUID.randomUUID().toString()); - jwtValidationInfo.setUser("user1"); - jwtValidationInfo.setKeyManager("Default"); - jwtValidationInfo.setIdentifier(revokedTokenJTI); - - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - Oauth2Authenticator oauth2Authenticator = new Oauth2Authenticator(jwtConfigurationDto, true); - RequestContext requestContext = Mockito.mock(RequestContext.class); - - ArrayList resourceConfigs = new ArrayList<>(); - ResourceConfig resourceConfig = Mockito.mock(ResourceConfig.class); - AuthenticationConfig authenticationConfig = new AuthenticationConfig(); - Oauth2AuthenticationConfig oauth2AuthenticationConfig = new Oauth2AuthenticationConfig(); - oauth2AuthenticationConfig.setHeader("Authorization"); - authenticationConfig.setOauth2AuthenticationConfig(oauth2AuthenticationConfig); - Mockito.when(resourceConfig.getAuthenticationConfig()).thenReturn(authenticationConfig); - Mockito.when(resourceConfig.getMethod()).thenReturn(ResourceConfig.HttpMethods.GET); - resourceConfigs.add(resourceConfig); - Mockito.when(requestContext.getMatchedResourcePaths()).thenReturn(resourceConfigs); - Map headers = new HashMap<>(); - headers.put("Authorization", "Bearer " + jwt); - Mockito.when(requestContext.getHeaders()).thenReturn(headers); - Mockito.when(requestContext.getAuthenticationContext()).thenReturn(new AuthenticationContext()); - APIConfig apiConfig = Mockito.mock(APIConfig.class); - Mockito.when(apiConfig.getName()).thenReturn("api1"); - Mockito.when(apiConfig.getEnvironment()).thenReturn(environment); - Mockito.when(apiConfig.getOrganizationId()).thenReturn(organization); - Mockito.when(requestContext.getMatchedAPI()).thenReturn(apiConfig); - CacheProvider cacheProvider = Mockito.mock(CacheProvider.class); - LoadingCache gatewayKeyCache = Mockito.mock(LoadingCache.class); - LoadingCache invalidTokenCache = Mockito.mock(LoadingCache.class); - Mockito.when(cacheProvider.getGatewayKeyCache()).thenReturn(gatewayKeyCache); - Mockito.when(cacheProvider.getInvalidTokenCache()).thenReturn(invalidTokenCache); - - try (MockedStatic logManagerDummy = Mockito.mockStatic(LogManager.class); - MockedStatic logFactoryDummy = Mockito.mockStatic(LogFactory.class); - MockedStatic cacheProviderUtilDummy = Mockito.mockStatic(CacheProviderUtil.class); - MockedStatic configHolderDummy = Mockito.mockStatic(ConfigHolder.class); - MockedStatic keyValidaterDummy = Mockito.mockStatic(KeyValidator.class); - MockedStatic subscriptionDataHolderMockedStatic = - Mockito.mockStatic(SubscriptionDataHolder.class);) { - SubscriptionDataStore subscriptionDataStore = Mockito.mock(SubscriptionDataStore.class); - SubscriptionDataHolder subscriptionDataHolder = Mockito.mock(SubscriptionDataHolder.class); - subscriptionDataHolderMockedStatic.when(SubscriptionDataHolder::getInstance).thenReturn(subscriptionDataHolder); - Mockito.when(subscriptionDataHolder.getSubscriptionDataStore(organization)).thenReturn(subscriptionDataStore); - Logger logger = Mockito.mock(Logger.class); - logManagerDummy.when(() -> LogManager.getLogger(Oauth2Authenticator.class)).thenReturn(logger); - Log logger2 = Mockito.mock(Log.class); - logFactoryDummy.when(() -> LogFactory.getLog(AbstractAPIMgtGatewayJWTGenerator.class)).thenReturn(logger2); - cacheProviderUtilDummy.when(() -> CacheProviderUtil.getOrganizationCache(organization)) - .thenReturn(cacheProvider); - ExtendedTokenIssuerDto tokenIssuerDto = Mockito.mock(ExtendedTokenIssuerDto.class); - Mockito.when(tokenIssuerDto.getIssuer()).thenReturn(issuer); - JWKSConfigurationDTO jwksConfigurationDTO = new JWKSConfigurationDTO(); - jwksConfigurationDTO.setEnabled(true); - Mockito.when(tokenIssuerDto.getJwksConfigurationDTO()).thenReturn(jwksConfigurationDTO); - - EnforcerConfig enforcerConfig = Mockito.mock(EnforcerConfig.class); - ConfigHolder configHolder = Mockito.mock(ConfigHolder.class); - configHolderDummy.when(ConfigHolder::getInstance).thenReturn(configHolder); - Mockito.when(configHolder.getConfig()).thenReturn(enforcerConfig); - JWTTransformer jwtTransformer = new DefaultJWTTransformer(); - Mockito.when(enforcerConfig.getJwtTransformer(issuer)).thenReturn(jwtTransformer); - JWTValidator jwtValidator = Mockito.mock(JWTValidator.class); - Mockito.when(jwtValidator.validateToken(Mockito.eq(jwt), Mockito.any())).thenReturn(jwtValidationInfo); - keyValidaterDummy.when(() -> KeyValidator.validateScopes(Mockito.any())).thenReturn(true); - try { - oauth2Authenticator.authenticate(requestContext); - Assert.fail("Authentication should fail for revoked tokens"); - } catch (APISecurityException e) { - Assert.assertEquals(e.getMessage(), e.getMessage(), - APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_MESSAGE); - } - } finally { - RevokedTokenRedisClient.setRevokedTokens(new HashSet<>()); - } - } - - @Test - public void testCachedJWTValidator() throws APISecurityException, EnforcerException { - - String organization = "org1"; - String environment = "development"; - String issuer = "https://localhost:9443/oauth2/token"; - String signature = "sBgeoqJn0log5EZflj_G7ADvm6B3KQ9bdfF" + - "CEFVQS1U3oY9" + - "-cqPwAPyOLLh95pdfjYjakkf1UtjPZjeIupwXnzg0SffIc704RoVlZocAx9Ns2XihjU6Imx2MbXq9ARmQxQkyGVkJ" + - "UMTwZ8" + - "-SfOnprfrhX2cMQQS8m2Lp7hcsvWFRGKxAKIeyUrbY4ihRIA5vOUrMBWYUx9Di1N7qdKA4S3e8O4KQX2VaZPBzN594c9TG" + - "riiH8AuuqnrftfvidSnlRLaFJmko8-QZo8jDepwacaFhtcaPVVJFG4uYP-_" + - "-N6sqfxLw3haazPN0_xU0T1zJLPRLC5HPfZMJDMGp" + - "EuSe9w"; - String jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5UZG1aak00WkRrM05qWTBZemM1T" + - "W1abU9EZ3dNVEUzTVdZd05ERTVNV1JsWkRnNE56YzRaQT09In0" + - ".eyJhdWQiOiJodHRwOlwvXC9vcmcud3NvMi5hcGltZ3RcL2dhdGV" + - "3YXkiLCJzdWIiOiJhZG1pbkBjYXJib24uc3VwZXIiLCJhcHBsaWNhdGlvbiI6eyJvd25lciI6ImFkbWluIiwidGllclF1b3RhVHlwZ" + - "SI6InJlcXVlc3RDb3VudCIsInRpZXIiOiJVbmxpbWl0ZWQiLCJuYW1lIjoiRGVmYXVsdEFwcGxpY2F0aW9uIiwiaWQiOjEsInV1aWQ" + - "iOm51bGx9LCJzY29wZSI6ImFtX2FwcGxpY2F0aW9uX3Njb3BlIGRlZmF1bHQiLCJpc3MiOiJodHRwczpcL1wvbG9jYWxob3N0Ojk0" + - "NDNcL29hdXRoMlwvdG9rZW4iLCJ0aWVySW5mbyI6e30sImtleXR5cGUiOiJQUk9EVUNUSU9OIiwic3Vic2NyaWJlZEFQSXMiOltdL" + - "CJjb25zdW1lcktleSI6IlhnTzM5NklIRks3ZUZZeWRycVFlNEhLR3oxa2EiLCJleHAiOjE1OTAzNDIzMTMsImlhdCI6MTU5MDMzO" + - "DcxMywianRpIjoiYjg5Mzg3NjgtMjNmZC00ZGVjLThiNzAtYmVkNDVlYjdjMzNkIn0." + signature; - JWTValidationInfo jwtValidationInfo = new JWTValidationInfo(); - jwtValidationInfo.setValid(true); - jwtValidationInfo.setExpiryTime(System.currentTimeMillis() + 5000L); - jwtValidationInfo.setConsumerKey(UUID.randomUUID().toString()); - jwtValidationInfo.setUser("user1"); - jwtValidationInfo.setKeyManager("Default"); - jwtValidationInfo.setToken(jwt); - jwtValidationInfo.setIdentifier(signature); - - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - Oauth2Authenticator oauth2Authenticator = new Oauth2Authenticator(jwtConfigurationDto, true); - RequestContext requestContext = Mockito.mock(RequestContext.class); - - ArrayList resourceConfigs = new ArrayList<>(); - ResourceConfig resourceConfig = Mockito.mock(ResourceConfig.class); - AuthenticationConfig authenticationConfig = new AuthenticationConfig(); - Oauth2AuthenticationConfig oauth2AuthenticationConfig = new Oauth2AuthenticationConfig(); - oauth2AuthenticationConfig.setHeader("Authorization"); - authenticationConfig.setOauth2AuthenticationConfig(oauth2AuthenticationConfig); - Mockito.when(resourceConfig.getAuthenticationConfig()).thenReturn(authenticationConfig); - Mockito.when(resourceConfig.getMethod()).thenReturn(ResourceConfig.HttpMethods.GET); - resourceConfigs.add(resourceConfig); - Mockito.when(requestContext.getMatchedResourcePaths()).thenReturn(resourceConfigs); - Map headers = new HashMap<>(); - headers.put("Authorization", "Bearer " + jwt); - Mockito.when(requestContext.getHeaders()).thenReturn(headers); - Mockito.when(requestContext.getAuthenticationContext()).thenReturn(new AuthenticationContext()); - APIConfig apiConfig = Mockito.mock(APIConfig.class); - Mockito.when(apiConfig.getName()).thenReturn("api1"); - Mockito.when(apiConfig.getEnvironment()).thenReturn(environment); - Mockito.when(apiConfig.getOrganizationId()).thenReturn(organization); - Mockito.when(requestContext.getMatchedAPI()).thenReturn(apiConfig); - CacheProvider cacheProvider = Mockito.mock(CacheProvider.class); - LoadingCache gatewayKeyCache = Mockito.mock(LoadingCache.class); - Mockito.when(cacheProvider.getGatewayKeyCache()).thenReturn(gatewayKeyCache); - Mockito.when(gatewayKeyCache.getIfPresent(signature)).thenReturn(jwtValidationInfo); - try (MockedStatic cacheProviderUtilDummy = Mockito.mockStatic(CacheProviderUtil.class); - MockedStatic keyValidatorDummy = Mockito.mockStatic(KeyValidator.class); - MockedStatic subscriptionDataHolderMockedStatic = - Mockito.mockStatic(SubscriptionDataHolder.class);) { - SubscriptionDataStore subscriptionDataStore = Mockito.mock(SubscriptionDataStore.class); - SubscriptionDataHolder subscriptionDataHolder = Mockito.mock(SubscriptionDataHolder.class); - subscriptionDataHolderMockedStatic.when(SubscriptionDataHolder::getInstance).thenReturn(subscriptionDataHolder); - Mockito.when(subscriptionDataHolder.getSubscriptionDataStore(organization)).thenReturn(subscriptionDataStore); - cacheProviderUtilDummy.when(() -> CacheProviderUtil.getOrganizationCache(organization)).thenReturn(cacheProvider); - JWTValidator jwtValidator = Mockito.mock(JWTValidator.class); - Mockito.when(subscriptionDataStore.getJWTValidatorByIssuer(issuer, environment)).thenReturn(jwtValidator); - Mockito.when(jwtValidator.validateToken(Mockito.eq(jwt), Mockito.any())).thenReturn(jwtValidationInfo); - keyValidatorDummy.when(() -> KeyValidator.validateScopes(Mockito.any())).thenReturn(true); - AuthenticationContext authenticate = oauth2Authenticator.authenticate(requestContext); - Assert.assertNotNull(authenticate); - Assert.assertEquals(authenticate.getConsumerKey(), jwtValidationInfo.getConsumerKey()); - Mockito.verify(gatewayKeyCache, Mockito.atLeast(1)).getIfPresent(signature); - } - } - - @Test - public void testNonJTIJWTValidator() throws APISecurityException, EnforcerException { - - String organization = "org1"; - String environment = "development"; - String issuer = "https://localhost:9443/oauth2/token"; - String signature = "SSQyg_VTxF5drIogztn2SyEK2wRE07wG6OW3tufD3vo"; - String jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9" + - ".eyJpc3MiOiJodHRwczovL2xvY2FsaG9zdCIsImlhdCI6MTU5OTU0ODE3NCwiZXhwIjoxNjMxMDg0MTc0LC" + - "JhdWQiOiJ3d3cuZXhhbXBsZS5jb20iLCJzdWIiOiJqcm9ja2V0QGV4YW1wbGUuY29tIiwiR2l2ZW5OYW1l" + - "IjoiSm9obm55IiwiU3VybmFtZSI6IlJvY2tldCIsIkVtYWlsIjoianJvY2tldEBleGFtcGxlLmNvbSIsIl" + - "JvbGUiOlsiTWFuYWdlciIsIlByb2plY3QgQWRtaW5pc3RyYXRvciJdfQ." + signature; - JWTValidationInfo jwtValidationInfo = new JWTValidationInfo(); - jwtValidationInfo.setValid(true); - jwtValidationInfo.setExpiryTime(System.currentTimeMillis() + 5000L); - jwtValidationInfo.setConsumerKey(UUID.randomUUID().toString()); - jwtValidationInfo.setUser("user1"); - jwtValidationInfo.setKeyManager("Default"); - jwtValidationInfo.setToken(jwt); - jwtValidationInfo.setIdentifier(signature); - - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - Oauth2Authenticator oauth2Authenticator = new Oauth2Authenticator(jwtConfigurationDto, true); - RequestContext requestContext = Mockito.mock(RequestContext.class); - - ArrayList resourceConfigs = new ArrayList<>(); - ResourceConfig resourceConfig = Mockito.mock(ResourceConfig.class); - AuthenticationConfig authenticationConfig = new AuthenticationConfig(); - Oauth2AuthenticationConfig oauth2AuthenticationConfig = new Oauth2AuthenticationConfig(); - oauth2AuthenticationConfig.setHeader("Authorization"); - authenticationConfig.setOauth2AuthenticationConfig(oauth2AuthenticationConfig); - Mockito.when(resourceConfig.getAuthenticationConfig()).thenReturn(authenticationConfig); - Mockito.when(resourceConfig.getMethod()).thenReturn(ResourceConfig.HttpMethods.GET); - resourceConfigs.add(resourceConfig); - Mockito.when(requestContext.getMatchedResourcePaths()).thenReturn(resourceConfigs); - Map headers = new HashMap<>(); - headers.put("Authorization", "Bearer " + jwt); - Mockito.when(requestContext.getHeaders()).thenReturn(headers); - Mockito.when(requestContext.getAuthenticationContext()).thenReturn(new AuthenticationContext()); - APIConfig apiConfig = Mockito.mock(APIConfig.class); - Mockito.when(apiConfig.getName()).thenReturn("api1"); - Mockito.when(apiConfig.getEnvironment()).thenReturn(environment); - Mockito.when(apiConfig.getOrganizationId()).thenReturn(organization); - Mockito.when(requestContext.getMatchedAPI()).thenReturn(apiConfig); - CacheProvider cacheProvider = Mockito.mock(CacheProvider.class); - LoadingCache gatewayKeyCache = Mockito.mock(LoadingCache.class); - Mockito.when(cacheProvider.getGatewayKeyCache()).thenReturn(gatewayKeyCache); - Mockito.when(gatewayKeyCache.getIfPresent(signature)).thenReturn(jwtValidationInfo); - try (MockedStatic cacheProviderUtilDummy = Mockito.mockStatic(CacheProviderUtil.class); - MockedStatic keyValidatorDummy = Mockito.mockStatic(KeyValidator.class); - MockedStatic subscriptionDataHolderMockedStatic = - Mockito.mockStatic(SubscriptionDataHolder.class);) { - SubscriptionDataStore subscriptionDataStore = Mockito.mock(SubscriptionDataStore.class); - SubscriptionDataHolder subscriptionDataHolder = Mockito.mock(SubscriptionDataHolder.class); - subscriptionDataHolderMockedStatic.when(SubscriptionDataHolder::getInstance).thenReturn(subscriptionDataHolder); - Mockito.when(subscriptionDataHolder.getSubscriptionDataStore(organization)).thenReturn(subscriptionDataStore); - cacheProviderUtilDummy.when(() -> CacheProviderUtil.getOrganizationCache(organization)).thenReturn(cacheProvider); - JWTValidator jwtValidator = Mockito.mock(JWTValidator.class); - Mockito.when(subscriptionDataStore.getJWTValidatorByIssuer(issuer, environment)) - .thenReturn(jwtValidator); - Mockito.when(jwtValidator.validateToken(Mockito.eq(jwt), Mockito.any())).thenReturn(jwtValidationInfo); - keyValidatorDummy.when(() -> KeyValidator.validateScopes(Mockito.any())).thenReturn(true); - AuthenticationContext authenticate = oauth2Authenticator.authenticate(requestContext); - Assert.assertNotNull(authenticate); - Assert.assertEquals(authenticate.getConsumerKey(), jwtValidationInfo.getConsumerKey()); - Mockito.verify(gatewayKeyCache, Mockito.atLeast(1)).getIfPresent(signature); - } - } - - @Test - public void testExpiredJWTValidator() { - - String organization = "org1"; - String signature = "sBgeoqJn0log5EZflj_G7ADvm6B3KQ9bdfFCEFVQS1U3oY9" + - "-cqPwAPyOLLh95pdfjYjakkf1UtjPZjeIupwXnzg0SffIc704RoVlZocAx9Ns2XihjU6Imx2MbXq9ARmQxQkyGVkJUMTwZ8" + - "-SfOnprfrhX2cMQQS8m2Lp7hcsvWFRGKxAKIeyUrbY4ihRIA5vOUrMBWYUx9Di1N7qdKA4S3e8O4KQX2VaZPBzN594c9TG" + - "riiH8AuuqnrftfvidSnlRLaFJmko8-QZo8jDepwacaFhtcaPVVJFG4uYP-_-N6sqfxLw3haazPN0_xU0T1zJLPRLC5HPfZMJDMGp" + - "EuSe9w"; - String jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5UZG1aak00WkRrM05qWTBZemM1T" + - "W1abU9EZ3dNVEUzTVdZd05ERTVNV1JsWkRnNE56YzRaQT09In0" + - ".eyJhdWQiOiJodHRwOlwvXC9vcmcud3NvMi5hcGltZ3RcL2dhdGV" + - "3YXkiLCJzdWIiOiJhZG1pbkBjYXJib24uc3VwZXIiLCJhcHBsaWNhdGlvbiI6eyJvd25lciI6ImFkbWluIiwidGllclF1b3RhVHlwZ" + - "SI6InJlcXVlc3RDb3VudCIsInRpZXIiOiJVbmxpbWl0ZWQiLCJuYW1lIjoiRGVmYXVsdEFwcGxpY2F0aW9uIiwiaWQiOjEsInV1aWQ" + - "iOm51bGx9LCJzY29wZSI6ImFtX2FwcGxpY2F0aW9uX3Njb3BlIGRlZmF1bHQiLCJpc3MiOiJodHRwczpcL1wvbG9jYWxob3N0Ojk0" + - "NDNcL29hdXRoMlwvdG9rZW4iLCJ0aWVySW5mbyI6e30sImtleXR5cGUiOiJQUk9EVUNUSU9OIiwic3Vic2NyaWJlZEFQSXMiOltdL" + - "CJjb25zdW1lcktleSI6IlhnTzM5NklIRks3ZUZZeWRycVFlNEhLR3oxa2EiLCJleHAiOjE1OTAzNDIzMTMsImlhdCI6MTU5MDMzO" + - "DcxMywianRpIjoiYjg5Mzg3NjgtMjNmZC00ZGVjLThiNzAtYmVkNDVlYjdjMzNkIn0." + signature; - JWTValidationInfo jwtValidationInfo = new JWTValidationInfo(); - jwtValidationInfo.setValid(true); - jwtValidationInfo.setExpiryTime(System.currentTimeMillis() - 5000L); - jwtValidationInfo.setConsumerKey(UUID.randomUUID().toString()); - jwtValidationInfo.setUser("user1"); - jwtValidationInfo.setKeyManager("Default"); - jwtValidationInfo.setToken(jwt); - jwtValidationInfo.setIdentifier(signature); - - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - Oauth2Authenticator oauth2Authenticator = new Oauth2Authenticator(jwtConfigurationDto, true); - RequestContext requestContext = Mockito.mock(RequestContext.class); - - ArrayList resourceConfigs = new ArrayList<>(); - ResourceConfig resourceConfig = Mockito.mock(ResourceConfig.class); - AuthenticationConfig authenticationConfig = new AuthenticationConfig(); - Oauth2AuthenticationConfig oauth2AuthenticationConfig = new Oauth2AuthenticationConfig(); - oauth2AuthenticationConfig.setHeader("Authorization"); - authenticationConfig.setOauth2AuthenticationConfig(oauth2AuthenticationConfig); - Mockito.when(resourceConfig.getAuthenticationConfig()).thenReturn(authenticationConfig); - Mockito.when(resourceConfig.getMethod()).thenReturn(ResourceConfig.HttpMethods.GET); - resourceConfigs.add(resourceConfig); - Mockito.when(requestContext.getMatchedResourcePaths()).thenReturn(resourceConfigs); - Map headers = new HashMap<>(); - headers.put("Authorization", "Bearer " + jwt); - Mockito.when(requestContext.getHeaders()).thenReturn(headers); - Mockito.when(requestContext.getAuthenticationContext()).thenReturn(new AuthenticationContext()); - APIConfig apiConfig = Mockito.mock(APIConfig.class); - Mockito.when(apiConfig.getName()).thenReturn("api1"); - Mockito.when(apiConfig.getOrganizationId()).thenReturn(organization); - Mockito.when(requestContext.getMatchedAPI()).thenReturn(apiConfig); - CacheProvider cacheProvider = Mockito.mock(CacheProvider.class); - LoadingCache gatewayKeyCache = Mockito.mock(LoadingCache.class); - LoadingCache invalidTokenCache = Mockito.mock(LoadingCache.class); - Mockito.when(cacheProvider.getGatewayKeyCache()).thenReturn(gatewayKeyCache); - Mockito.when(cacheProvider.getInvalidTokenCache()).thenReturn(invalidTokenCache); - Mockito.when(gatewayKeyCache.getIfPresent(signature)).thenReturn(jwtValidationInfo); - Mockito.when(invalidTokenCache.getIfPresent(signature)).thenReturn(null); - try (MockedStatic cacheProviderUtilDummy = Mockito.mockStatic(CacheProviderUtil.class); - MockedStatic keyValidatorDummy = Mockito.mockStatic(KeyValidator.class)) { - cacheProviderUtilDummy.when(() -> CacheProviderUtil.getOrganizationCache(organization)).thenReturn(cacheProvider); - keyValidatorDummy.when(() -> KeyValidator.validateScopes(Mockito.any())).thenReturn(true); - try { - oauth2Authenticator.authenticate(requestContext); - Assert.fail("Authentication should fail for expired tokens"); - } catch (APISecurityException e) { - Assert.assertEquals(e.getMessage(), e.getMessage(), - APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED_MESSAGE); - Mockito.verify(gatewayKeyCache, Mockito.atLeast(1)).getIfPresent(signature); - Mockito.verify(invalidTokenCache, Mockito.atLeast(1)).put(signature, true); - } - } - } - - @Test - public void testNoCacheExpiredJWTValidator() throws EnforcerException { - - String organization = "org1"; - String environment = "development"; - String issuer = "https://localhost:9443/oauth2/token"; - String signature = "sBgeoqJn0log5EZflj_G7ADvm6B3KQ9bdfFCEFVQS1U3oY9" + - "-cqPwAPyOLLh95pdfjYjakkf1UtjPZjeIupwXnzg0SffIc704RoVlZocAx9Ns2XihjU6Imx2MbXq9ARmQxQkyGVkJUMTwZ8" + - "-SfOnprfrhX2cMQQS8m2Lp7hcsvWFRGKxAKIeyUrbY4ihRIA5vOUrMBWYUx9Di1N7qdKA4S3e8O4KQX2VaZPBzN594c9TG" + - "riiH8AuuqnrftfvidSnlRLaFJmko8-QZo8jDepwacaFhtcaPVVJFG4uYP-_-N6sqfxLw3haazPN0_xU0T1zJLPRLC5HPfZMJDMGp" + - "EuSe9w"; - String jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5UZG1aak00WkRrM05qWTBZemM1T" + - "W1abU9EZ3dNVEUzTVdZd05ERTVNV1JsWkRnNE56YzRaQT09In0" + - ".eyJhdWQiOiJodHRwOlwvXC9vcmcud3NvMi5hcGltZ3RcL2dhdGV" + - "3YXkiLCJzdWIiOiJhZG1pbkBjYXJib24uc3VwZXIiLCJhcHBsaWNhdGlvbiI6eyJvd25lciI6ImFkbWluIiwidGllclF1b3RhVHlwZ" + - "SI6InJlcXVlc3RDb3VudCIsInRpZXIiOiJVbmxpbWl0ZWQiLCJuYW1lIjoiRGVmYXVsdEFwcGxpY2F0aW9uIiwiaWQiOjEsInV1aWQ" + - "iOm51bGx9LCJzY29wZSI6ImFtX2FwcGxpY2F0aW9uX3Njb3BlIGRlZmF1bHQiLCJpc3MiOiJodHRwczpcL1wvbG9jYWxob3N0Ojk0" + - "NDNcL29hdXRoMlwvdG9rZW4iLCJ0aWVySW5mbyI6e30sImtleXR5cGUiOiJQUk9EVUNUSU9OIiwic3Vic2NyaWJlZEFQSXMiOltdL" + - "CJjb25zdW1lcktleSI6IlhnTzM5NklIRks3ZUZZeWRycVFlNEhLR3oxa2EiLCJleHAiOjE1OTAzNDIzMTMsImlhdCI6MTU5MDMzO" + - "DcxMywianRpIjoiYjg5Mzg3NjgtMjNmZC00ZGVjLThiNzAtYmVkNDVlYjdjMzNkIn0." + signature; - JWTValidationInfo jwtValidationInfo = new JWTValidationInfo(); - jwtValidationInfo.setValid(false); - jwtValidationInfo.setExpiryTime(System.currentTimeMillis() - 100); - jwtValidationInfo.setConsumerKey(UUID.randomUUID().toString()); - jwtValidationInfo.setValidationCode(APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED); - jwtValidationInfo.setUser("user1"); - jwtValidationInfo.setKeyManager("Default"); - jwtValidationInfo.setToken(jwt); - jwtValidationInfo.setIdentifier(signature); - - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - Oauth2Authenticator oauth2Authenticator = new Oauth2Authenticator(jwtConfigurationDto, true); - RequestContext requestContext = Mockito.mock(RequestContext.class); - - ArrayList resourceConfigs = new ArrayList<>(); - ResourceConfig resourceConfig = Mockito.mock(ResourceConfig.class); - AuthenticationConfig authenticationConfig = new AuthenticationConfig(); - Oauth2AuthenticationConfig oauth2AuthenticationConfig = new Oauth2AuthenticationConfig(); - oauth2AuthenticationConfig.setHeader("Authorization"); - authenticationConfig.setOauth2AuthenticationConfig(oauth2AuthenticationConfig); - Mockito.when(resourceConfig.getAuthenticationConfig()).thenReturn(authenticationConfig); - Mockito.when(resourceConfig.getMethod()).thenReturn(ResourceConfig.HttpMethods.GET); - resourceConfigs.add(resourceConfig); - Mockito.when(requestContext.getMatchedResourcePaths()).thenReturn(resourceConfigs); - Map headers = new HashMap<>(); - headers.put("Authorization", "Bearer " + jwt); - Mockito.when(requestContext.getHeaders()).thenReturn(headers); - Mockito.when(requestContext.getAuthenticationContext()).thenReturn(new AuthenticationContext()); - APIConfig apiConfig = Mockito.mock(APIConfig.class); - Mockito.when(apiConfig.getName()).thenReturn("api1"); - Mockito.when(apiConfig.getEnvironment()).thenReturn(environment); - Mockito.when(apiConfig.getOrganizationId()).thenReturn(organization); - Mockito.when(requestContext.getMatchedAPI()).thenReturn(apiConfig); - CacheProvider cacheProvider = Mockito.mock(CacheProvider.class); - LoadingCache gatewayKeyCache = Mockito.mock(LoadingCache.class); - LoadingCache invalidTokenCache = Mockito.mock(LoadingCache.class); - Mockito.when(cacheProvider.getGatewayKeyCache()).thenReturn(gatewayKeyCache); - Mockito.when(cacheProvider.getInvalidTokenCache()).thenReturn(invalidTokenCache); - Mockito.when(gatewayKeyCache.getIfPresent(signature)).thenReturn(null); - Mockito.when(invalidTokenCache.getIfPresent(signature)).thenReturn(null); - try (MockedStatic cacheProviderUtilDummy = Mockito.mockStatic(CacheProviderUtil.class); - MockedStatic keyValidatorDummy = Mockito.mockStatic(KeyValidator.class); - MockedStatic subscriptionDataHolderMockedStatic = - Mockito.mockStatic(SubscriptionDataHolder.class); - ) { - SubscriptionDataStore subscriptionDataStore = Mockito.mock(SubscriptionDataStore.class); - SubscriptionDataHolder subscriptionDataHolder = Mockito.mock(SubscriptionDataHolder.class); - subscriptionDataHolderMockedStatic.when(SubscriptionDataHolder::getInstance).thenReturn(subscriptionDataHolder); - Mockito.when(subscriptionDataHolder.getSubscriptionDataStore(organization)).thenReturn(subscriptionDataStore); - cacheProviderUtilDummy.when(() -> CacheProviderUtil.getOrganizationCache(organization)). - thenReturn(cacheProvider); - JWTValidator jwtValidator = Mockito.mock(JWTValidator.class); - Mockito.when(subscriptionDataStore.getJWTValidatorByIssuer(issuer, environment)).thenReturn(jwtValidator); - Mockito.when(jwtValidator.validateToken(Mockito.eq(jwt), Mockito.any())).thenReturn(jwtValidationInfo); - keyValidatorDummy.when(() -> KeyValidator.validateScopes(Mockito.any())).thenReturn(true); - - try { - oauth2Authenticator.authenticate(requestContext); - Assert.fail("Authentication should fail for expired tokens"); - } catch (APISecurityException e) { - Assert.assertEquals(e.getMessage(), APISecurityConstants.API_AUTH_ACCESS_TOKEN_EXPIRED_MESSAGE); - Mockito.verify(invalidTokenCache, Mockito.atLeast(1)).put(signature, true); - } - } - - } - - @Test - public void testTamperedPayloadJWTValidator() throws EnforcerException { - - String organization = "org2"; - String environment = "development"; - String issuer = "https://localhost:9443/oauth2/token"; - String signature = "sBgeoqJn0log5EZflj_G7ADvm6B3KQ9bdfFCEFVQS1U3oY9" + - "-cqPwAPyOLLh95pdfjYjakkf1UtjPZjeIupwXnzg0SffIc704RoVlZocAx9Ns2XihjU6Imx2MbXq9ARmQxQkyGVkJUMTwZ8" + - "-SfOnprfrhX2cMQQS8m2Lp7hcsvWFRGKxAKIeyUrbY4ihRIA5vOUrMBWYUx9Di1N7qdKA4S3e8O4KQX2VaZPBzN594c9TG" + - "riiH8AuuqnrftfvidSnlRLaFJmko8-QZo8jDepwacaFhtcaPVVJFG4uYP-_-N6sqfxLw3haazPN0_xU0T1zJLPRLC5HPfZMJDMGp" + - "EuSe9w"; - String jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5UZG1aak00WkRrM05qWTBZemM1T" + - "W1abU9EZ3dNVEUzTVdZd05ERTVNV1JsWkRnNE56YzRaQT09In0" + - ".ewogICJhdWQiOiAiaHR0cDovL29yZy53c28yLmFwaW1ndC9nYXRld2F5IiwKICAic3ViIjogImFkbWluQGNhcmJ" + - "vbi5zdXBlciIsCiAgImFwcGxpY2F0aW9uIjogewogICAgIm93bmVyIjogImFkbWluIiwKICAgICJ0aWVyUXVvdGFU" + - "eXBlIjogInJlcXVlc3RDb3VudCIsCiAgICAidGllciI6ICJVbmxpbWl0ZWQiLAogICAgIm5hbWUiOiAiRGVmYXVsd" + - "EFwcGxpY2F0aW9uIiwKICAgICJpZCI6IDEsCiAgICAidXVpZCI6IG51bGwKICB9LAogICJzY29wZSI6ICJhbV9hcHB" + - "saWNhdGlvbl9zY29wZSBkZWZhdWx0IiwKICAiaXNzIjogImh0dHBzOi8vbG9jYWxob3N0Ojk0NDMvb2F1dGgyL3Rva" + - "2VuIiwKICAidGllckluZm8iOiB7fSwKICAia2V5dHlwZSI6ICJQUk9EVUNUSU9OIiwKICAic3Vic2NyaWJlZEFQSXM" + - "iOiBbXSwKICAiY29uc3VtZXJLZXkiOiAiWGdPMzk2SUhGSzdlRll5ZHJxUWU0SEtHejFrYSIsCiAgImV4cCI6IDQxMz" + - "IzODM0NzcsCiAgImlhdCI6IDE1OTAzMzg3MTMsCiAgImp0aSI6ICJiODkzODc2OC0yM2ZkLTRkZWMtOGI3MC1iZWQ0N" + - "WViN2MzM2QiCn0=." + signature; - String tamperedJWT = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5UZG1aak00WkRrM05qWTBZemM1T" + - "W1abU9EZ3dNVEUzTVdZd05ERTVNV1JsWkRnNE56YzRaQT09In0" + - ".ewogICJhdWQiOiAiaHR0cDovL29yZy53c28yLmFwaW1ndC9nYXRld2F5IiwKICAic3ViIjogImFkbWluQGNhcmJvbi5" + - "zdXBlciIsCiAgImFwcGxpY2F0aW9uIjogewogICAgIm93bmVyIjogImFkbWluIiwKICAgICJ0aWVyUXVvdGFUeXBlIjo" + - "gInJlcXVlc3RDb3VudCIsCiAgICAidGllciI6ICJVbmxpbWl0ZWQiLAogICAgIm5hbWUiOiAiRGVmYXVsdEFwcGxpY2F" + - "0aW9uMiIsCiAgICAiaWQiOiAyLAogICAgInV1aWQiOiBudWxsCiAgfSwKICAic2NvcGUiOiAiYW1fYXBwbGljYXRpb25" + - "fc2NvcGUgZGVmYXVsdCIsCiAgImlzcyI6ICJodHRwczovL2xvY2FsaG9zdDo5NDQzL29hdXRoMi90b2tlbiIsCiAgInR" + - "pZXJJbmZvIjoge30sCiAgImtleXR5cGUiOiAiUFJPRFVDVElPTiIsCiAgInN1YnNjcmliZWRBUElzIjogW10sCiAgImN" + - "vbnN1bWVyS2V5IjogIlhnTzM5NklIRks3ZUZZeWRycVFlNEhLR3oxa2EiLAogICJleHAiOiA0MTMyMzgzNDc3LAogICJ" + - "pYXQiOiAxNTkwMzM4NzEzLAogICJqdGkiOiAiYjg5Mzg3NjgtMjNmZC00ZGVjLThiNzAtYmVkNDVlYjdjMzNkIgp9." + - signature; - - JWTValidationInfo jwtValidationInfo = new JWTValidationInfo(); - jwtValidationInfo.setValid(false); - jwtValidationInfo.setExpiryTime(System.currentTimeMillis() + 120000); - jwtValidationInfo.setConsumerKey(UUID.randomUUID().toString()); - jwtValidationInfo.setUser("user1"); - jwtValidationInfo.setKeyManager("Default"); - jwtValidationInfo.setToken(jwt); - jwtValidationInfo.setIdentifier(signature); - - JWTConfigurationDto jwtConfigurationDto = new JWTConfigurationDto(); - Oauth2Authenticator oauth2Authenticator = new Oauth2Authenticator(jwtConfigurationDto, true); - RequestContext requestContext = Mockito.mock(RequestContext.class); - - ArrayList resourceConfigs = new ArrayList<>(); - ResourceConfig resourceConfig = Mockito.mock(ResourceConfig.class); - AuthenticationConfig authenticationConfig = new AuthenticationConfig(); - Oauth2AuthenticationConfig oauth2AuthenticationConfig = new Oauth2AuthenticationConfig(); - oauth2AuthenticationConfig.setHeader("Authorization"); - authenticationConfig.setOauth2AuthenticationConfig(oauth2AuthenticationConfig); - Mockito.when(resourceConfig.getAuthenticationConfig()).thenReturn(authenticationConfig); - Mockito.when(resourceConfig.getMethod()).thenReturn(ResourceConfig.HttpMethods.GET); - resourceConfigs.add(resourceConfig); - Mockito.when(requestContext.getMatchedResourcePaths()).thenReturn(resourceConfigs); - Map headers = new HashMap<>(); - headers.put("Authorization", "Bearer " + tamperedJWT); - Mockito.when(requestContext.getHeaders()).thenReturn(headers); - Mockito.when(requestContext.getAuthenticationContext()).thenReturn(new AuthenticationContext()); - APIConfig apiConfig = Mockito.mock(APIConfig.class); - Mockito.when(apiConfig.getName()).thenReturn("api1"); - Mockito.when(apiConfig.getEnvironment()).thenReturn(environment); - Mockito.when(apiConfig.getOrganizationId()).thenReturn(organization); - Mockito.when(requestContext.getMatchedAPI()).thenReturn(apiConfig); - try (MockedStatic cacheProviderUtilDummy = Mockito.mockStatic(CacheProviderUtil.class); - MockedStatic keyValidatorDummy = Mockito.mockStatic(KeyValidator.class); - MockedStatic subscriptionDataHolderMockedStatic = - Mockito.mockStatic(SubscriptionDataHolder.class); - ) { - CacheProvider cacheProvider = Mockito.mock(CacheProvider.class); - SubscriptionDataStore subscriptionDataStore = Mockito.mock(SubscriptionDataStore.class); - SubscriptionDataHolder subscriptionDataHolder = Mockito.mock(SubscriptionDataHolder.class); - subscriptionDataHolderMockedStatic.when(SubscriptionDataHolder::getInstance).thenReturn(subscriptionDataHolder); - Mockito.when(subscriptionDataHolder.getSubscriptionDataStore(organization)).thenReturn(subscriptionDataStore); - cacheProviderUtilDummy.when(() -> CacheProviderUtil.getOrganizationCache(organization)). - thenReturn(cacheProvider); - LoadingCache gatewayKeyCache = Mockito.mock(LoadingCache.class); - LoadingCache invalidTokenCache = Mockito.mock(LoadingCache.class); - Mockito.when(gatewayKeyCache.getIfPresent(signature)).thenReturn(jwtValidationInfo); - Mockito.when(invalidTokenCache.getIfPresent(signature)).thenReturn(null); - Mockito.when(cacheProvider.getGatewayKeyCache()).thenReturn(gatewayKeyCache); - Mockito.when(cacheProvider.getInvalidTokenCache()).thenReturn(invalidTokenCache); - cacheProviderUtilDummy.when(() -> CacheProviderUtil.getOrganizationCache(organization)) - .thenReturn(cacheProvider); - JWTValidator jwtValidator = Mockito.mock(JWTValidator.class); - Mockito.when(subscriptionDataStore.getJWTValidatorByIssuer(issuer, environment)).thenReturn(jwtValidator); - Mockito.when(jwtValidator.validateToken(Mockito.eq(jwt), Mockito.any())).thenReturn(jwtValidationInfo); - keyValidatorDummy.when(() -> KeyValidator.validateScopes(Mockito.any())).thenReturn(true); - try { - oauth2Authenticator.authenticate(requestContext); - Assert.fail("Authentication should fail for tampered tokens"); - } catch (APISecurityException e) { - Assert.assertEquals(e.getMessage(), "Invalid JWT token"); - Mockito.verify(invalidTokenCache, Mockito.never()).put(signature, true); - Mockito.verify(gatewayKeyCache, Mockito.never()).put(signature, true); - Mockito.verify(gatewayKeyCache, Mockito.never()).invalidate(signature); - } - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/tracing/exporters/JaegerExporterTest.java b/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/tracing/exporters/JaegerExporterTest.java deleted file mode 100644 index b47ccaec2c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/tracing/exporters/JaegerExporterTest.java +++ /dev/null @@ -1,71 +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.tracing.exporters; - -import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.api.trace.Tracer; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingException; - -import java.util.HashMap; -import java.util.Map; - -public class JaegerExporterTest { - private static final String instrumentation = "CC"; - private static Map okProps; - private static Map badProps; - - @BeforeClass - public static void setup() { - okProps = new HashMap<>(); - badProps = new HashMap<>(); - okProps.put(TracingConstants.CONF_HOST, "localhost"); - okProps.put(TracingConstants.CONF_PORT, "14268"); - okProps.put(TracingConstants.CONF_ENDPOINT, "/api/traces"); - okProps.put(TracingConstants.CONF_MAX_TRACES_PER_SEC, "3"); - okProps.put(TracingConstants.CONF_EXPORTER_TIMEOUT, "15"); - okProps.put(TracingConstants.CONF_INSTRUMENTATION_NAME, instrumentation); - badProps.put(TracingConstants.CONF_HOST, "localhost"); - badProps.put(TracingConstants.CONF_PORT, ""); - badProps.put(TracingConstants.CONF_ENDPOINT, ""); - GlobalOpenTelemetry.resetForTest(); - } - - @Test - public void testSuccessExporterInit() throws TracingException { - Tracer t = JaegerExporter.getInstance().initSdk(okProps).getTracer(instrumentation); - Assert.assertNotNull("Tracer can't be null", t); - } - - @Test - public void testInitWithInvalidPort() { - Assert.assertThrows("Incorrect exception was thrown", TracingException.class, () -> - JaegerExporter.getInstance().initSdk(badProps)); - } - - @Test - public void testInitWithoutEP() { - badProps.put(TracingConstants.CONF_HOST, ""); - Assert.assertThrows("Incorrect exception was thrown", TracingException.class, () -> - JaegerExporter.getInstance().initSdk(badProps)); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/tracing/exporters/ZipkinExporterTest.java b/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/tracing/exporters/ZipkinExporterTest.java deleted file mode 100644 index c8cb91a7e6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/tracing/exporters/ZipkinExporterTest.java +++ /dev/null @@ -1,71 +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.tracing.exporters; - -import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.api.trace.Tracer; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.wso2.apk.enforcer.tracing.TracingConstants; -import org.wso2.apk.enforcer.tracing.TracingException; - -import java.util.HashMap; -import java.util.Map; - -public class ZipkinExporterTest { - private static final String instrumentation = "CC"; - private static Map okProps; - private static Map badProps; - - @BeforeClass - public static void setup() { - okProps = new HashMap<>(); - badProps = new HashMap<>(); - okProps.put(TracingConstants.CONF_HOST, "localhost"); - okProps.put(TracingConstants.CONF_PORT, "9411"); - okProps.put(TracingConstants.CONF_ENDPOINT, "/api/v2/span"); - okProps.put(TracingConstants.CONF_MAX_TRACES_PER_SEC, "3"); - okProps.put(TracingConstants.CONF_EXPORTER_TIMEOUT, "15"); - okProps.put(TracingConstants.CONF_INSTRUMENTATION_NAME, instrumentation); - badProps.put(TracingConstants.CONF_HOST, "localhost"); - badProps.put(TracingConstants.CONF_PORT, ""); - badProps.put(TracingConstants.CONF_ENDPOINT, ""); - GlobalOpenTelemetry.resetForTest(); - } - - @Test - public void testSuccessExporterInit() throws TracingException { - Tracer t = ZipkinExporter.getInstance().initSdk(okProps).getTracer(instrumentation); - Assert.assertNotNull("Tracer can't be null", t); - } - - @Test - public void testInitWithInvalidPort() { - Assert.assertThrows("Incorrect exception was thrown", TracingException.class, () -> - ZipkinExporter.getInstance().initSdk(badProps)); - } - - @Test - public void testInitWithoutEP() { - badProps.put(TracingConstants.CONF_HOST, ""); - Assert.assertThrows("Incorrect exception was thrown", TracingException.class, () -> - ZipkinExporter.getInstance().initSdk(badProps)); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/util/TLSUtilsTest.java b/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/util/TLSUtilsTest.java deleted file mode 100644 index 61e160ec03..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/java/org/wso2/apk/enforcer/util/TLSUtilsTest.java +++ /dev/null @@ -1,116 +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.util; - -import java.util.Objects; -import org.junit.Assert; -import org.junit.Test; -import org.wso2.apk.enforcer.commons.exception.EnforcerException; - -import java.io.File; -import java.io.IOException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.Iterator; - -public class TLSUtilsTest { - private static final String certsDir = "certs"; - private static final String trustStoreWithSingleFile = "truststoreSingle"; - private static final String trustStoreWithSeparateCerts = "truststoreSeparate"; - private static final String certWithAdditionalNewLine = "mg.pem"; - private static final String certWithTwoCerts = "certWithTwoCerts.pem"; - - @Test - public void testGetCertificateWithAdditionalNewLine() { - String pemFilePath = TLSUtilsTest.class.getProtectionDomain().getCodeSource(). - getLocation().getPath() + certsDir + File.separator + certWithAdditionalNewLine; - try { - X509Certificate cert = (X509Certificate) TLSUtils.getCertificateFromFile(pemFilePath); - Assert.assertNotNull(cert); - Assert.assertEquals("13677610512757128594", cert.getSerialNumber().toString()); - } catch (CertificateException | IOException | EnforcerException e) { - e.printStackTrace(); - } - } - - @Test - public void testGetCertificateWithPemHavingTwo() { - String pemFilePath = TLSUtilsTest.class.getProtectionDomain().getCodeSource(). - getLocation().getPath() + certsDir + File.separator + certWithTwoCerts; - try { - X509Certificate cert = (X509Certificate) TLSUtils.getCertificateFromFile(pemFilePath); - Assert.assertNotNull(cert); - Assert.assertEquals("13677610512757128594", cert.getSerialNumber().toString()); - } catch (CertificateException | IOException | EnforcerException e) { - e.printStackTrace(); - } - } - - @Test - public void testAddCertificatesToTruststoreMultipleCertsInSingleFile() throws KeyStoreException, - CertificateException, IOException, NoSuchAlgorithmException { - String trustStoreLocation = Objects.requireNonNull(this.getClass().getResource(File.separator + certsDir + File.separator + - trustStoreWithSingleFile)).getPath(); - KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); - trustStore.load(null); - Assert.assertEquals(0, trustStore.size()); - TLSUtils.addCertsToTruststore(trustStore, trustStoreLocation); - Assert.assertEquals(2, trustStore.size()); - - ArrayList serialNumList = new ArrayList<>(); - serialNumList.add("1571815843"); - serialNumList.add("13677610512757128594"); - Iterator aliases = trustStore.aliases().asIterator(); - while (aliases.hasNext()) { - String alias = aliases.next(); - X509Certificate cert = (X509Certificate)trustStore.getCertificate(alias); - String serialNum = cert.getSerialNumber().toString(); - Assert.assertTrue(serialNumList.contains(serialNum)); - serialNumList.remove(serialNum); - } - } - - @Test - public void testAddCertificatesToTruststoreCertsInSeparateFiles() throws KeyStoreException, - CertificateException, IOException, NoSuchAlgorithmException { - String trustStoreLocation = Objects.requireNonNull(this.getClass().getResource(File.separator + certsDir + File.separator + - trustStoreWithSeparateCerts)).getPath(); - KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); - trustStore.load(null); - Assert.assertEquals(0, trustStore.size()); - TLSUtils.addCertsToTruststore(trustStore, trustStoreLocation); - Assert.assertEquals(2, trustStore.size()); - - ArrayList serialNumList = new ArrayList<>(); - serialNumList.add("1571815843"); - serialNumList.add("13677610512757128594"); - Iterator aliases = trustStore.aliases().asIterator(); - while (aliases.hasNext()) { - String alias = aliases.next(); - X509Certificate cert = (X509Certificate)trustStore.getCertificate(alias); - String serialNum = cert.getSerialNumber().toString(); - Assert.assertTrue(serialNumList.contains(serialNum)); - serialNumList.remove(serialNum); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/certWithAdditionalNewLine.pem b/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/certWithAdditionalNewLine.pem deleted file mode 100644 index feecfd78a6..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/certWithAdditionalNewLine.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDfjCCAmagAwIBAgIJAL3QoktVCX2SMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV -BAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsG -A1UECgwEV1NPMjENMAsGA1UECwwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MB4X -DTIxMDEzMTE3NTIzNVoXDTMxMDEyOTE3NTIzNVowZDELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MQ0wCwYDVQQKDARXU08y -MQ0wCwYDVQQLDARXU08yMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQDy+N4fNGG+l8zKy2dw+csFbL+3kXd4LFtwtt26 -BafN+ciBpXpNaeo8FRqAkEqnNFmzgD1CNr9mtJUmNixsBHMJL+qJanQJ3CSqfpkJ -emZul+Nico5Grw3wz7NZpJlhs29YnmhI7iQf4spbM4NoV5vBMkGmxHW8KEcf3l2j -EW5SOJlqKxVpCBQnp2tF2UO0ian2v0QBffphE65gU+gQly+wfj+64BHoKUnXZETc -z5g3g1OLXBpU28ZvPjeg2uk/LtJeCmLOKeDFIYyojpZTbKxGaT9/0AuCI8ikUOm5 -+IJNhohxFP5hxTKn2cwOVNGyQy4P51DWx0k5rXU//Iyz6CV9AgMBAAGjMzAxMC8G -A1UdEQQoMCaCB2FkYXB0ZXKCCGVuZm9yY2VyggZyb3V0ZXKCCWxvY2FsaG9zdDAN -BgkqhkiG9w0BAQsFAAOCAQEAkiyYt+0fp8cs9oa2HVU/NfImlzQMBV0S+M3DFlp6 -4egLWbDXM9k5GecrlU2bY3uO2uMT9jzWJ7GU1fuJtAIDQpURruhoXqiuQf3z0Q6O -XlJUWNRiUaYyhMBCK3ekmxrTKkgwTdzHZPeE3w2DH8p6n57aPE6BcarKO7BXBDD0 -vlwjkC6ns9+Ppje2bYxR2BPA6LkqZeyfyZcpPNy4NTN66LA+UQEizUMetGahpSph -5NQeIFg8S49blFVlucXKFLtAJQX2UbDuLLjhCdHuop00lY7sbrK6vrywtrt12hzu -zwNdwKMiCUw14oC7A2ZfhA5PEiObEtR0J+mPhnLGGVMG4w== ------END CERTIFICATE----- - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/certWithTwoCerts.pem b/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/certWithTwoCerts.pem deleted file mode 100644 index bdfb16c48c..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/certWithTwoCerts.pem +++ /dev/null @@ -1,44 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDfjCCAmagAwIBAgIJAL3QoktVCX2SMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV -BAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsG -A1UECgwEV1NPMjENMAsGA1UECwwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MB4X -DTIxMDEzMTE3NTIzNVoXDTMxMDEyOTE3NTIzNVowZDELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MQ0wCwYDVQQKDARXU08y -MQ0wCwYDVQQLDARXU08yMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQDy+N4fNGG+l8zKy2dw+csFbL+3kXd4LFtwtt26 -BafN+ciBpXpNaeo8FRqAkEqnNFmzgD1CNr9mtJUmNixsBHMJL+qJanQJ3CSqfpkJ -emZul+Nico5Grw3wz7NZpJlhs29YnmhI7iQf4spbM4NoV5vBMkGmxHW8KEcf3l2j -EW5SOJlqKxVpCBQnp2tF2UO0ian2v0QBffphE65gU+gQly+wfj+64BHoKUnXZETc -z5g3g1OLXBpU28ZvPjeg2uk/LtJeCmLOKeDFIYyojpZTbKxGaT9/0AuCI8ikUOm5 -+IJNhohxFP5hxTKn2cwOVNGyQy4P51DWx0k5rXU//Iyz6CV9AgMBAAGjMzAxMC8G -A1UdEQQoMCaCB2FkYXB0ZXKCCGVuZm9yY2VyggZyb3V0ZXKCCWxvY2FsaG9zdDAN -BgkqhkiG9w0BAQsFAAOCAQEAkiyYt+0fp8cs9oa2HVU/NfImlzQMBV0S+M3DFlp6 -4egLWbDXM9k5GecrlU2bY3uO2uMT9jzWJ7GU1fuJtAIDQpURruhoXqiuQf3z0Q6O -XlJUWNRiUaYyhMBCK3ekmxrTKkgwTdzHZPeE3w2DH8p6n57aPE6BcarKO7BXBDD0 -vlwjkC6ns9+Ppje2bYxR2BPA6LkqZeyfyZcpPNy4NTN66LA+UQEizUMetGahpSph -5NQeIFg8S49blFVlucXKFLtAJQX2UbDuLLjhCdHuop00lY7sbrK6vrywtrt12hzu -zwNdwKMiCUw14oC7A2ZfhA5PEiObEtR0J+mPhnLGGVMG4w== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDqTCCApGgAwIBAgIEXbABozANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV -UzELMAkGA1UECAwCQ0ExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxDTALBgNVBAoM -BFdTTzIxDTALBgNVBAsMBFdTTzIxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xOTEw -MjMwNzMwNDNaFw0yMjAxMjUwNzMwNDNaMGQxCzAJBgNVBAYTAlVTMQswCQYDVQQI -DAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsGA1UECgwEV1NPMjENMAsG -A1UECwwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAxeqoZYbQ/Sr8DOFQ+/qbEbCp6Vzb5hzH7oa3hf2FZxRK -F0H6b8COMzz8+0mvEdYVvb/31jMEL2CIQhkQRol1IruD6nBOmkjuXJSBficklMaJ -ZORhuCrB4roHxzoG19aWmscA0gnfBKo2oGXSjJmnZxIh+2X6syHCfyMZZ00LzDyr -goXWQXyFvCA2ax54s7sKiHOM3P4A9W4QUwmoEi4HQmPgJjIM4eGVPh0GtIANN+BO -Q1KkUI7OzteHCTLu3VjxM0sw8QRayZdhniPF+U9n3fa1mO4KLBsW4mDLjg8R/JuA -GTX/SEEGj0B5HWQAP6myxKFz2xwDaCGvT+rdvkktOwIDAQABo2MwYTAUBgNVHREE -DTALgglsb2NhbGhvc3QwHQYDVR0OBBYEFEDpLB4PDgzsdxD2FV3rVnOr/A0DMB0G -A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjALBgNVHQ8EBAMCBPAwDQYJKoZI -hvcNAQELBQADggEBAE8H/axAgXjt93HGCYGumULW2lKkgqEvXryP2QkRpbyQSsTY -cL7ZLSVB7MVVHtIsHh8f1C4Xq6Qu8NUrqu5ZLC1pUByaqR2ZIzcj/OWLGYRjSTHS -VmVIq9QqBq1j7r6f3BWqaOIiknmTzEuqIVlOTY0gO+SHdS62vr2FCz4yOrBEulGA -vomsU8sqg4PhFnkhxI4M912Ly+2RgN9L7AkhzK+EzXY1/QtlI/VysNfS6zrHasKz -6CrKKCGqQnBnSvSTyF9OR5KFHnkAwE995IZrcSQicMxsLhTMUHDLQ/gRyy7V/ZpD -MfAWR+5OeQiNAp/bG4fjJoTdoqkul51+2bHHVrU= ------END CERTIFICATE----- diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSeparate/mg.pem b/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSeparate/mg.pem deleted file mode 100644 index 379bbfb610..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSeparate/mg.pem +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDfjCCAmagAwIBAgIJAL3QoktVCX2SMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV -BAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsG -A1UECgwEV1NPMjENMAsGA1UECwwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MB4X -DTIxMDEzMTE3NTIzNVoXDTMxMDEyOTE3NTIzNVowZDELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MQ0wCwYDVQQKDARXU08y -MQ0wCwYDVQQLDARXU08yMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQDy+N4fNGG+l8zKy2dw+csFbL+3kXd4LFtwtt26 -BafN+ciBpXpNaeo8FRqAkEqnNFmzgD1CNr9mtJUmNixsBHMJL+qJanQJ3CSqfpkJ -emZul+Nico5Grw3wz7NZpJlhs29YnmhI7iQf4spbM4NoV5vBMkGmxHW8KEcf3l2j -EW5SOJlqKxVpCBQnp2tF2UO0ian2v0QBffphE65gU+gQly+wfj+64BHoKUnXZETc -z5g3g1OLXBpU28ZvPjeg2uk/LtJeCmLOKeDFIYyojpZTbKxGaT9/0AuCI8ikUOm5 -+IJNhohxFP5hxTKn2cwOVNGyQy4P51DWx0k5rXU//Iyz6CV9AgMBAAGjMzAxMC8G -A1UdEQQoMCaCB2FkYXB0ZXKCCGVuZm9yY2VyggZyb3V0ZXKCCWxvY2FsaG9zdDAN -BgkqhkiG9w0BAQsFAAOCAQEAkiyYt+0fp8cs9oa2HVU/NfImlzQMBV0S+M3DFlp6 -4egLWbDXM9k5GecrlU2bY3uO2uMT9jzWJ7GU1fuJtAIDQpURruhoXqiuQf3z0Q6O -XlJUWNRiUaYyhMBCK3ekmxrTKkgwTdzHZPeE3w2DH8p6n57aPE6BcarKO7BXBDD0 -vlwjkC6ns9+Ppje2bYxR2BPA6LkqZeyfyZcpPNy4NTN66LA+UQEizUMetGahpSph -5NQeIFg8S49blFVlucXKFLtAJQX2UbDuLLjhCdHuop00lY7sbrK6vrywtrt12hzu -zwNdwKMiCUw14oC7A2ZfhA5PEiObEtR0J+mPhnLGGVMG4w== ------END CERTIFICATE----- diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSeparate/wso2carbon.pem b/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSeparate/wso2carbon.pem deleted file mode 100644 index 1a3926cf18..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSeparate/wso2carbon.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDqTCCApGgAwIBAgIEXbABozANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV -UzELMAkGA1UECAwCQ0ExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxDTALBgNVBAoM -BFdTTzIxDTALBgNVBAsMBFdTTzIxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xOTEw -MjMwNzMwNDNaFw0yMjAxMjUwNzMwNDNaMGQxCzAJBgNVBAYTAlVTMQswCQYDVQQI -DAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsGA1UECgwEV1NPMjENMAsG -A1UECwwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAxeqoZYbQ/Sr8DOFQ+/qbEbCp6Vzb5hzH7oa3hf2FZxRK -F0H6b8COMzz8+0mvEdYVvb/31jMEL2CIQhkQRol1IruD6nBOmkjuXJSBficklMaJ -ZORhuCrB4roHxzoG19aWmscA0gnfBKo2oGXSjJmnZxIh+2X6syHCfyMZZ00LzDyr -goXWQXyFvCA2ax54s7sKiHOM3P4A9W4QUwmoEi4HQmPgJjIM4eGVPh0GtIANN+BO -Q1KkUI7OzteHCTLu3VjxM0sw8QRayZdhniPF+U9n3fa1mO4KLBsW4mDLjg8R/JuA -GTX/SEEGj0B5HWQAP6myxKFz2xwDaCGvT+rdvkktOwIDAQABo2MwYTAUBgNVHREE -DTALgglsb2NhbGhvc3QwHQYDVR0OBBYEFEDpLB4PDgzsdxD2FV3rVnOr/A0DMB0G -A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjALBgNVHQ8EBAMCBPAwDQYJKoZI -hvcNAQELBQADggEBAE8H/axAgXjt93HGCYGumULW2lKkgqEvXryP2QkRpbyQSsTY -cL7ZLSVB7MVVHtIsHh8f1C4Xq6Qu8NUrqu5ZLC1pUByaqR2ZIzcj/OWLGYRjSTHS -VmVIq9QqBq1j7r6f3BWqaOIiknmTzEuqIVlOTY0gO+SHdS62vr2FCz4yOrBEulGA -vomsU8sqg4PhFnkhxI4M912Ly+2RgN9L7AkhzK+EzXY1/QtlI/VysNfS6zrHasKz -6CrKKCGqQnBnSvSTyF9OR5KFHnkAwE995IZrcSQicMxsLhTMUHDLQ/gRyy7V/ZpD -MfAWR+5OeQiNAp/bG4fjJoTdoqkul51+2bHHVrU= ------END CERTIFICATE----- diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSingle/certWithAdditionalNewLine.pem b/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSingle/certWithAdditionalNewLine.pem deleted file mode 100644 index dc69a176bd..0000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/test/resources/certs/truststoreSingle/certWithAdditionalNewLine.pem +++ /dev/null @@ -1,46 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDfjCCAmagAwIBAgIJAL3QoktVCX2SMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV -BAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsG -A1UECgwEV1NPMjENMAsGA1UECwwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MB4X -DTIxMDEzMTE3NTIzNVoXDTMxMDEyOTE3NTIzNVowZDELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MQ0wCwYDVQQKDARXU08y -MQ0wCwYDVQQLDARXU08yMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQDy+N4fNGG+l8zKy2dw+csFbL+3kXd4LFtwtt26 -BafN+ciBpXpNaeo8FRqAkEqnNFmzgD1CNr9mtJUmNixsBHMJL+qJanQJ3CSqfpkJ -emZul+Nico5Grw3wz7NZpJlhs29YnmhI7iQf4spbM4NoV5vBMkGmxHW8KEcf3l2j -EW5SOJlqKxVpCBQnp2tF2UO0ian2v0QBffphE65gU+gQly+wfj+64BHoKUnXZETc -z5g3g1OLXBpU28ZvPjeg2uk/LtJeCmLOKeDFIYyojpZTbKxGaT9/0AuCI8ikUOm5 -+IJNhohxFP5hxTKn2cwOVNGyQy4P51DWx0k5rXU//Iyz6CV9AgMBAAGjMzAxMC8G -A1UdEQQoMCaCB2FkYXB0ZXKCCGVuZm9yY2VyggZyb3V0ZXKCCWxvY2FsaG9zdDAN -BgkqhkiG9w0BAQsFAAOCAQEAkiyYt+0fp8cs9oa2HVU/NfImlzQMBV0S+M3DFlp6 -4egLWbDXM9k5GecrlU2bY3uO2uMT9jzWJ7GU1fuJtAIDQpURruhoXqiuQf3z0Q6O -XlJUWNRiUaYyhMBCK3ekmxrTKkgwTdzHZPeE3w2DH8p6n57aPE6BcarKO7BXBDD0 -vlwjkC6ns9+Ppje2bYxR2BPA6LkqZeyfyZcpPNy4NTN66LA+UQEizUMetGahpSph -5NQeIFg8S49blFVlucXKFLtAJQX2UbDuLLjhCdHuop00lY7sbrK6vrywtrt12hzu -zwNdwKMiCUw14oC7A2ZfhA5PEiObEtR0J+mPhnLGGVMG4w== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDqTCCApGgAwIBAgIEXbABozANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJV -UzELMAkGA1UECAwCQ0ExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxDTALBgNVBAoM -BFdTTzIxDTALBgNVBAsMBFdTTzIxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xOTEw -MjMwNzMwNDNaFw0yMjAxMjUwNzMwNDNaMGQxCzAJBgNVBAYTAlVTMQswCQYDVQQI -DAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsGA1UECgwEV1NPMjENMAsG -A1UECwwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAxeqoZYbQ/Sr8DOFQ+/qbEbCp6Vzb5hzH7oa3hf2FZxRK -F0H6b8COMzz8+0mvEdYVvb/31jMEL2CIQhkQRol1IruD6nBOmkjuXJSBficklMaJ -ZORhuCrB4roHxzoG19aWmscA0gnfBKo2oGXSjJmnZxIh+2X6syHCfyMZZ00LzDyr -goXWQXyFvCA2ax54s7sKiHOM3P4A9W4QUwmoEi4HQmPgJjIM4eGVPh0GtIANN+BO -Q1KkUI7OzteHCTLu3VjxM0sw8QRayZdhniPF+U9n3fa1mO4KLBsW4mDLjg8R/JuA -GTX/SEEGj0B5HWQAP6myxKFz2xwDaCGvT+rdvkktOwIDAQABo2MwYTAUBgNVHREE -DTALgglsb2NhbGhvc3QwHQYDVR0OBBYEFEDpLB4PDgzsdxD2FV3rVnOr/A0DMB0G -A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjALBgNVHQ8EBAMCBPAwDQYJKoZI -hvcNAQELBQADggEBAE8H/axAgXjt93HGCYGumULW2lKkgqEvXryP2QkRpbyQSsTY -cL7ZLSVB7MVVHtIsHh8f1C4Xq6Qu8NUrqu5ZLC1pUByaqR2ZIzcj/OWLGYRjSTHS -VmVIq9QqBq1j7r6f3BWqaOIiknmTzEuqIVlOTY0gO+SHdS62vr2FCz4yOrBEulGA -vomsU8sqg4PhFnkhxI4M912Ly+2RgN9L7AkhzK+EzXY1/QtlI/VysNfS6zrHasKz -6CrKKCGqQnBnSvSTyF9OR5KFHnkAwE995IZrcSQicMxsLhTMUHDLQ/gRyy7V/ZpD -MfAWR+5OeQiNAp/bG4fjJoTdoqkul51+2bHHVrU= ------END CERTIFICATE----- - - diff --git a/gateway/enforcer/resources/build.gradle b/gateway/enforcer/resources/build.gradle deleted file mode 100644 index 5eff7d1496..0000000000 --- a/gateway/enforcer/resources/build.gradle +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -description = 'WSO2 Enforcer Distribution Resources' - -dependencies { - implementation project(':org.wso2.apk.enforcer') - implementation project(':org.wso2.apk.enforcer.commons') -} -tasks.register('copy_dependencies', Copy) { - dependsOn create_lib - from configurations.default - into "$projectDir/lib" - finalizedBy build -} - -tasks.register('create_lib') { - dependsOn delete_lib - finalizedBy copy_dependencies -} - -tasks.register('delete_lib', Delete) { - delete "$projectDir/lib" - finalizedBy create_lib -} - -tasks.named('build').configure { - dependsOn copy_dependencies -} - -configurations.implementation { - exclude group: 'jline' - exclude group: 'org.slf4j', module: 'slf4j-log4j12' - exclude group: 'org.apache.logging' - exclude group: 'log4j' - exclude group: 'org.ops4j.pax.logging' -} \ No newline at end of file diff --git a/gateway/enforcer/resources/check_health.sh b/gateway/enforcer/resources/check_health.sh deleted file mode 100755 index 797ef52233..0000000000 --- a/gateway/enforcer/resources/check_health.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -------------------------------------------------------------------- -# Copyright (c) 2021, WSO2 LLC. (http://wso2.com) All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ----------------------------------------------------------------------- - -ENFORCER_PORT="${ENFORCER_PORT:-8081}" -ENFORCER_SERVER_NAME="${ENFORCER_SERVER_NAME:-enforcer}" -grpc_health_probe -addr "127.0.0.1:${ENFORCER_PORT}" \ - -tls \ - -tls-ca-cert "${ENFORCER_PUBLIC_CERT_PATH}" \ - -tls-client-cert "${ENFORCER_PUBLIC_CERT_PATH}" \ - -tls-client-key "${ENFORCER_PRIVATE_KEY_PATH}" \ - -tls-server-name ${ENFORCER_SERVER_NAME} \ - -connect-timeout=3s diff --git a/gateway/enforcer/resources/conf/log4j2.properties b/gateway/enforcer/resources/conf/log4j2.properties deleted file mode 100644 index 7a8f789847..0000000000 --- a/gateway/enforcer/resources/conf/log4j2.properties +++ /dev/null @@ -1,72 +0,0 @@ -monitorInterval=20 - -appenders = ENFORCER_CONSOLE, ENFORCER_LOGFILE, ENFORCER_ACCESS_LOG - -appender.ENFORCER_CONSOLE.type = Console -appender.ENFORCER_CONSOLE.name = ENFORCER_CONSOLE -appender.ENFORCER_CONSOLE.layout.type = PatternLayout -appender.ENFORCER_CONSOLE.layout.pattern = [%d{DEFAULT}][TRACE_ID: %X{traceId}][API_UUID: %X{API_UUID}]%x %5p - {%c} - \ - %m [%errorDetails]%n -appender.ENFORCER_CONSOLE.filter.threshold.type = ThresholdFilter -appender.ENFORCER_CONSOLE.filter.threshold.level = DEBUG - -appender.ENFORCER_LOGFILE.type = RollingFile -appender.ENFORCER_LOGFILE.name = ENFORCER_LOGFILE -appender.ENFORCER_LOGFILE.fileName = logs/enforcer.log -appender.ENFORCER_LOGFILE.filePattern = /logs/enforcer-%d{MM-dd-yyyy}.log -appender.ENFORCER_LOGFILE.layout.type = PatternLayout -appender.ENFORCER_LOGFILE.layout.pattern = [%d][%X{traceId}]%x %5p {%c} - %m%ex%n -appender.ENFORCER_LOGFILE.policies.type = Policies -appender.ENFORCER_LOGFILE.policies.time.type = TimeBasedTriggeringPolicy -appender.ENFORCER_LOGFILE.policies.time.interval = 1 -appender.ENFORCER_LOGFILE.policies.time.modulate = true -appender.ENFORCER_LOGFILE.policies.size.type = SizeBasedTriggeringPolicy -appender.ENFORCER_LOGFILE.policies.size.size=10MB -appender.ENFORCER_LOGFILE.strategy.type = DefaultRolloverStrategy -appender.ENFORCER_LOGFILE.strategy.max = 20 -appender.ENFORCER_LOGFILE.filter.threshold.type = ThresholdFilter -appender.ENFORCER_LOGFILE.filter.threshold.level = DEBUG - -appender.ENFORCER_ACCESS_LOG.type = RollingFile -appender.ENFORCER_ACCESS_LOG.name = ENFORCER_ACCESS_LOG -appender.ENFORCER_ACCESS_LOG.fileName = logs/enforcer_access.log -appender.ENFORCER_ACCESS_LOG.filePattern = /logs/enforcer_access-%d{MM-dd-yyyy}.log -appender.ENFORCER_ACCESS_LOG.layout.type = PatternLayout -appender.ENFORCER_ACCESS_LOG.layout.pattern = [%d] - %m%ex%n -appender.ENFORCER_ACCESS_LOG.policies.type = Policies -appender.ENFORCER_ACCESS_LOG.policies.time.type = TimeBasedTriggeringPolicy -appender.ENFORCER_ACCESS_LOG.policies.time.interval = 1 -appender.ENFORCER_ACCESS_LOG.policies.time.modulate = true -appender.ENFORCER_ACCESS_LOG.policies.size.type = SizeBasedTriggeringPolicy -appender.ENFORCER_ACCESS_LOG.policies.size.size=10MB -appender.ENFORCER_ACCESS_LOG.strategy.type = DefaultRolloverStrategy -appender.ENFORCER_ACCESS_LOG.strategy.max = 20 -appender.ENFORCER_ACCESS_LOG.filter.threshold.type = ThresholdFilter -appender.ENFORCER_ACCESS_LOG.filter.threshold.level = DEBUG - -loggers = enforcer, io-swagger-v3, enforcer-interceptors - -# Log to access log file -logger.enforcer-interceptors.name = org.wso2.apk.enforcer.grpc.interceptors -# Change the log level into DEBUG to view the access logs. -logger.enforcer-interceptors.level = INFO -logger.enforcer-interceptors.additivity = false -logger.enforcer-interceptors.appenderRef.rolling.ref = ENFORCER_ACCESS_LOG - -# Log to console and rolling file -logger.enforcer.name = org.wso2.apk.enforcer -logger.enforcer.level = INFO -logger.enforcer.additivity = false -logger.enforcer.appenderRef.rolling.ref = ENFORCER_LOGFILE -logger.enforcer.appenderRef.console.ref = ENFORCER_CONSOLE - -logger.io-swagger-v3.name = io.swagger.v3.parser -logger.io-swagger-v3.level = ERROR -logger.io-swagger-v3.additivity = false -logger.io-swagger-v3.appenderRef.rolling.ref = ENFORCER_LOGFILE -logger.io-swagger-v3.appenderRef.console.ref = ENFORCER_CONSOLE - -rootLogger.level = ERROR -rootLogger.appenderRef.ENFORCER_CONSOLE.ref = ENFORCER_CONSOLE -rootLogger.appenderRef.ENFORCER_LOGFILE.ref = ENFORCER_LOGFILE -rootLogger.appenderRef.ENFORCER_ACCESS_LOG.ref = ENFORCER_ACCESS_LOG diff --git a/gateway/enforcer/resources/metrics/prometheus-jmx-config.yml b/gateway/enforcer/resources/metrics/prometheus-jmx-config.yml deleted file mode 100644 index 5771c00273..0000000000 --- a/gateway/enforcer/resources/metrics/prometheus-jmx-config.yml +++ /dev/null @@ -1,44 +0,0 @@ -# -------------------------------------------------------------------- -# Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). -# -# 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. -# ----------------------------------------------------------------------- - -# Config options: https://github.com/prometheus/jmx_exporter/blob/main/README.md -lowercaseOutputName: true -lowercaseOutputLabelNames: true -rules: - # WSO2 APK related metrics - - pattern: "org.wso2.apk.enforcer<>total_request_count: (.*)" - name: org_wso2_apk_enforcer_request_count_total - help: "WSO2 APK enforcer total request count." - attrNameSnakeCase: true - type: COUNTER - - pattern: "org.wso2.apk.enforcer<>(average_response_time_millis|max_response_time_millis|min_response_time_millis|request_count_in_last_five_minute_window|request_count_window_start_time_millis|token_issuer_count|subscription_count): (.*)" - name: org_wso2_apk_enforcer_$1 - help: "WSO2 APK enforcer $1." - attrNameSnakeCase: true - type: GAUGE - - pattern: 'org.wso2.apk.enforcer<>(\w+): (.*)' - name: org_wso2_apk_enforcer_thread_pool_$1 - help: "WSO2 APK enforcer thread pool $1." - attrNameSnakeCase: true - type: GAUGE - # OS related metrics - - pattern: 'java.lang<>(\w+): (.*)' - name: os_$1 - help: Operating System $1 - attrNameSnakeCase: true - type: GAUGE diff --git a/gateway/enforcer/resources/security/ca-certificates.crt b/gateway/enforcer/resources/security/ca-certificates.crt deleted file mode 100644 index f071addfd7..0000000000 --- a/gateway/enforcer/resources/security/ca-certificates.crt +++ /dev/null @@ -1,3628 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE -AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQsw -CQYDVQQGEwJFUzAeFw0xMTA1MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQ -BgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwHUEtJQUNDVjENMAsGA1UECgwEQUND -VjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCb -qau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gMjmoY -HtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWo -G2ioPej0RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpA -lHPrzg5XPAOBOp0KoVdDaaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhr -IA8wKFSVf+DuzgpmndFALW4ir50awQUZ0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/ -0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDGWuzndN9wrqODJerWx5eH -k6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs78yM2x/47 -4KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMO -m3WR5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpa -cXpkatcnYGMN285J9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPl -uUsXQA+xtrn13k/c4LOsOxFwYIRKQ26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYI -KwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRwOi8vd3d3LmFjY3YuZXMvZmls -ZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEuY3J0MB8GCCsG -AQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 -VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeT -VfZW6oHlNsyMHj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIG -CCsGAQUFBwICMIIBFB6CARAAQQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUA -cgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBhAO0AegAgAGQAZQAgAGwAYQAgAEEA -QwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUAYwBuAG8AbABvAGcA -7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBjAHQA -cgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAA -QwBQAFMAIABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUA -czAwBggrBgEFBQcCARYkaHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2Mu -aHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRt -aW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2MV9kZXIuY3JsMA4GA1Ud -DwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZIhvcNAQEF -BQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdp -D70ER9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gU -JyCpZET/LtZ1qmxNYEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+m -AM/EKXMRNt6GGT6d7hmKG9Ww7Y49nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepD -vV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJTS+xJlsndQAJxGJ3KQhfnlms -tn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3sCPdK6jT2iWH -7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h -I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szA -h1xA2syVP1XgNce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xF -d3+YJ5oyXSrjhO7FmGYvliAd3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2H -pPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3pEfbRD0tVNEYqi4Y7 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsx -CzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJ -WiBGTk1ULVJDTTAeFw0wODEwMjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJ -BgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBG -Tk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALpxgHpMhm5/ -yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcfqQgf -BBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAz -WHFctPVrbtQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxF -tBDXaEAUwED653cXeuYLj2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z -374jNUUeAlz+taibmSXaXvMiwzn15Cou08YfxGyqxRxqAQVKL9LFwag0Jl1mpdIC -IfkYtwb1TplvqKtMUejPUBjFd8g5CSxJkjKZqLsXF3mwWsXmo8RZZUc1g16p6DUL -mbvkzSDGm0oGObVo/CK67lWMK07q87Hj/LaZmtVC+nFNCM+HHmpxffnTtOmlcYF7 -wk5HlqX2doWjKI/pgG6BU6VtX7hI+cL5NqYuSf+4lsKMB7ObiFj86xsc3i1w4peS -MKGJ47xVqCfWS+2QrYv6YyVZLag13cqXM7zlzced0ezvXg5KkAYmY6252TUtB7p2 -ZSysV4999AeU14ECll2jB0nVetBX+RvnU0Z1qrB5QstocQjpYL05ac70r8NWQMet -UqIJ5G+GR4of6ygnXYMgrwTJbFaai0b1AgMBAAGjgYMwgYAwDwYDVR0TAQH/BAUw -AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFPd9xf3E6Jobd2Sn9R2gzL+H -YJptMD4GA1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1odHRwOi8vd3d3 -LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD -nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1 -RXxlDPiyN8+sD8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYM -LVN0V2Ue1bLdI4E7pWYjJ2cJj+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf -77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrTQfv6MooqtyuGC2mDOL7Nii4LcK2N -JpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW+YJF1DngoABd15jm -fZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7Ixjp -6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp -1txyM/1d8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B -9kiABdcPUXmsEKvU7ANm5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wok -RqEIr9baRRmW1FMdW4R58MD3R++Lj8UGrp1MYp3/RgT408m2ECVAdf4WqslKYIYv -uu8wd+RU4riEmViAqhOLUTpPSPaLtrM= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE -BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w -MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 -IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC -SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1 -ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv -UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX -4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9 -KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/ -gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb -rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ -51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F -be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe -KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F -v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn -fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7 -jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz -ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt -ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL -e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70 -jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz -WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V -SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j -pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX -X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok -fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R -K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU -ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU -LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT -LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz -dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL -MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp -cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP -Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr -ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL -MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 -yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr -VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ -nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ -KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG -XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj -vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt -Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g -N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC -nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz -dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL -MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp -cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y -YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua -kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL -QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp -6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG -yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i -QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ -KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO -tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu -QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ -Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u -olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 -x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE -BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz -dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG -A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U -cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf -qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ -JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ -+jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS -s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 -HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 -70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG -V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S -qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S -5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia -C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX -OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE -FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ -BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 -KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg -Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B -8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ -MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc -0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ -u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF -u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH -YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 -GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO -RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e -KeC2uAloGRwYQw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC -VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ -cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ -BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt -VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D -0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 -ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G -A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G -A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs -aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I -flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF -ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 -b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL -MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv -b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj -ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM -9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw -IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6 -VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L -93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm -jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA -A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI -U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs -N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv -o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU -5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy -rqXRfboQnoZsG4q5WTP468SQvvG5 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwF -ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 -b24gUm9vdCBDQSAyMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTEL -MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv -b3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK2Wny2cSkxK -gXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4kHbZ -W0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg -1dKmSYXpN+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K -8nu+NQWpEjTj82R0Yiw9AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r -2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvdfLC6HM783k81ds8P+HgfajZRRidhW+me -z/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAExkv8LV/SasrlX6avvDXbR -8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSSbtqDT6Zj -mUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz -7Mt0Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6 -+XUyo05f7O0oYtlNc/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI -0u1ufm8/0i2BWSlmy5A5lREedCf+3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMB -Af8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSwDPBMMPQFWAJI/TPlUq9LhONm -UjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oAA7CXDpO8Wqj2 -LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY -+gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kS -k5Nrp+gvU5LEYFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl -7uxMMne0nxrpS10gxdr9HIcWxkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygm -btmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQgj9sAq+uEjonljYE1x2igGOpm/Hl -urR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbWaQbLU8uz/mtBzUF+ -fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoVYh63 -n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE -76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H -9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT -4PsJYGw= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5 -MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g -Um9vdCBDQSAzMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG -A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg -Q0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKl -ui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjrZt6j -QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSr -ttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkr -BqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM -YyRIHN8wfdVoOw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5 -MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g -Um9vdCBDQSA0MB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG -A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg -Q0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN/sGKe0uoe0ZLY7Bi -9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri83Bk -M6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB -/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WB -MAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw -CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW -1KyLa2tJElMzrdfkviT8tQp21KW8EA== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UE -AwwVQXRvcyBUcnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQG -EwJERTAeFw0xMTA3MDcxNDU4MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMM -FUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsGA1UECgwEQXRvczELMAkGA1UEBhMC -REUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCVhTuXbyo7LjvPpvMp -Nb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr54rM -VD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+ -SZFhyBH+DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ -4J7sVaE3IqKHBAUsR320HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0L -cp2AMBYHlT8oDv3FdU9T1nSatCQujgKRz3bFmx5VdJx4IbHwLfELn8LVlhgf8FQi -eowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7Rl+lwrrw7GWzbITAPBgNV -HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZbNshMBgG -A1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3 -DQEBCwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8j -vZfza1zv7v1Apt+hk6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kP -DpFrdRbhIfzYJsdHt6bPWHJxfrrhTZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pc -maHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a961qn8FYiqTxlVMYVqL2Gns2D -lmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G3mB/ufNPRJLv -KrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE -BhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h -cHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy -MzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg -Q2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBBNjI2MzQwNjgwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDDUtd9 -thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQM -cas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefG -L9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i -NA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/h -X68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9amML9ZMWGxmPsu2b -m8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctXMbScyJCy -Z/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirja -EbsXLZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/T -KI8xWVvTyQKmtFLKbpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF -6NkBiDkal4ZkQdU7hwxu+g/GvUgUvzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVh -OSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYD -VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNHDhpkLzCBpgYD -VR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp -cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBv -ACAAZABlACAAbABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBl -AGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF -661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9 -am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1 -ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481 -PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS -3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k -SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF -3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM -ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g -StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz -Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB -jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ -RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD -VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX -DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y -ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy -VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr -mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr -IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK -mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu -XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy -dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye -jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 -BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 -DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 -9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx -jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 -Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz -ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS -R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd -MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg -Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow -TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw -HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB -BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr -6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV -L4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91 -1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx -MlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ -QmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB -arcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr -Us3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi -FRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS -P/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN -9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP -AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz -uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h -9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s -A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t -OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo -+fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7 -KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2 -DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us -H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ -I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7 -5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h -3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz -Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd -MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg -Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow -TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw -HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB -BQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y -ZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E -N3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9 -tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX -0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c -/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X -KhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY -zIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS -O1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D -34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP -K9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3 -AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv -Tg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj -QTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV -cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS -IGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2 -HJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa -O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv -033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u -dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE -kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41 -3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD -u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq -4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV -BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu -MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy -MDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx -EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw -ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe -NcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH -PWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I -x2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe -QTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR -yyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO -QG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa5Beny912 -H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJ -QfYEkoopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUD -i/ZnWejBBhG93c+AAk9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORs -nLMOPReisjQS1n6yqEm70XooQL6iFh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1 -rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud -DwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI -hvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM -tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqf -GopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb -lvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka -+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal -TFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i -nSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3 -gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr -G5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os -zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x -L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJD -TjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y -aXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkx -MjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5j -aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJP -T1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnVBU03 -sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpL -TIpTUnrD7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5 -/ZOkVIBMUtRSqy5J35DNuF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp -7hZZLDRJGqgG16iI0gNyejLi6mhNbiyWZXvKWfry4t3uMCz7zEasxGPrb382KzRz -EpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7xzbh72fROdOXW3NiGUgt -hxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9fpy25IGvP -a931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqot -aK8KgWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNg -TnYGmE69g60dWIolhdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfV -PKPtl8MeNPo4+QgO48BdK4PRVmrJtqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hv -cWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAfBgNVHSMEGDAWgBTj/i39KNAL -tbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAd -BgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB -ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObT -ej/tUxPQ4i9qecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdL -jOztUmCypAbqTuv0axn96/Ua4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBS -ESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sGE5uPhnEFtC+NiWYzKXZUmhH4J/qy -P5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfXBDrDMlI1Dlb4pd19 -xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjnaH9d -Ci77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN -5mydLIhyPDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe -/v5WOaHIz16eGWRGENoXkbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+Z -AAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3CekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ -5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB -gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV -BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw -MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl -YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P -RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 -UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI -2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 -Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp -+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ -DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O -nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW -/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g -PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u -QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY -SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv -IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ -RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 -zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd -BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB -ZQ== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL -MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE -BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT -IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw -MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy -ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N -T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR -FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J -cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW -BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm -fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv -GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB -hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV -BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5 -MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT -EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR -Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR -6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X -pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC -9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV -/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf -Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z -+pUX2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7w -qP/0uK3pN/u6uPQLOvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZah -SL0896+1DSJMwBGB7FY79tOi4lu3sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVIC -u9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf -Fobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq -crxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E -FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB -/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl -wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM -4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV -2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna -FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ -CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK -boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke -jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL -S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb -QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl -0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB -NVOFBkpdn627G190 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV -BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X -DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ -BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4 -QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny -gQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw -zBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q -130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2 -JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw -DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw -ZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT -AkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj -AQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG -9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h -bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc -fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu -HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w -t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw -WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIGWzCCBEOgAwIBAgIRAMrpG4nxVQMNo+ZBbcTjpuEwDQYJKoZIhvcNAQELBQAw -WjELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECwwTMDAw -MiA0ODE0NjMwODEwMDAzNjEZMBcGA1UEAwwQQ2VydGlnbmEgUm9vdCBDQTAeFw0x -MzEwMDEwODMyMjdaFw0zMzEwMDEwODMyMjdaMFoxCzAJBgNVBAYTAkZSMRIwEAYD -VQQKDAlEaGlteW90aXMxHDAaBgNVBAsMEzAwMDIgNDgxNDYzMDgxMDAwMzYxGTAX -BgNVBAMMEENlcnRpZ25hIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw -ggIKAoICAQDNGDllGlmx6mQWDoyUJJV8g9PFOSbcDO8WV43X2KyjQn+Cyu3NW9sO -ty3tRQgXstmzy9YXUnIo245Onoq2C/mehJpNdt4iKVzSs9IGPjA5qXSjklYcoW9M -CiBtnyN6tMbaLOQdLNyzKNAT8kxOAkmhVECe5uUFoC2EyP+YbNDrihqECB63aCPu -I9Vwzm1RaRDuoXrC0SIxwoKF0vJVdlB8JXrJhFwLrN1CTivngqIkicuQstDuI7pm -TLtipPlTWmR7fJj6o0ieD5Wupxj0auwuA0Wv8HT4Ks16XdG+RCYyKfHx9WzMfgIh -C59vpD++nVPiz32pLHxYGpfhPTc3GGYo0kDFUYqMwy3OU4gkWGQwFsWq4NYKpkDf -ePb1BHxpE4S80dGnBs8B92jAqFe7OmGtBIyT46388NtEbVncSVmurJqZNjBBe3Yz -IoejwpKGbvlw7q6Hh5UbxHq9MfPU0uWZ/75I7HX1eBYdpnDBfzwboZL7z8g81sWT -Co/1VTp2lc5ZmIoJlXcymoO6LAQ6l73UL77XbJuiyn1tJslV1c/DeVIICZkHJC1k -JWumIWmbat10TWuXekG9qxf5kBdIjzb5LdXF2+6qhUVB+s06RbFo5jZMm5BX7CO5 -hwjCxAnxl4YqKE3idMDaxIzb3+KhF1nOJFl0Mdp//TBt2dzhauH8XwIDAQABo4IB -GjCCARYwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE -FBiHVuBud+4kNTxOc5of1uHieX4rMB8GA1UdIwQYMBaAFBiHVuBud+4kNTxOc5of -1uHieX4rMEQGA1UdIAQ9MDswOQYEVR0gADAxMC8GCCsGAQUFBwIBFiNodHRwczov -L3d3d3cuY2VydGlnbmEuZnIvYXV0b3JpdGVzLzBtBgNVHR8EZjBkMC+gLaArhilo -dHRwOi8vY3JsLmNlcnRpZ25hLmZyL2NlcnRpZ25hcm9vdGNhLmNybDAxoC+gLYYr -aHR0cDovL2NybC5kaGlteW90aXMuY29tL2NlcnRpZ25hcm9vdGNhLmNybDANBgkq -hkiG9w0BAQsFAAOCAgEAlLieT/DjlQgi581oQfccVdV8AOItOoldaDgvUSILSo3L -6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxPTGRG -HVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH6 -0BGM+RFq7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncB -lA2c5uk5jR+mUYyZDDl34bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdi -o2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1 -gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS6Cvu5zHbugRqh5jnxV/v -faci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaYtlu3zM63 -Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayh -jWZSaX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw -3kAP+HwV96LOPNdeE4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM -MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D -ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU -cnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3 -WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg -Uy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw -IAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH -UV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM -TXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU -BBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM -kUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x -AcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV -HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y -sHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL -I9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8 -J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY -VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI -03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCB -gDELMAkGA1UEBhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMu -QS4xJzAlBgNVBAsTHkNlcnR1bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIG -A1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29yayBDQSAyMCIYDzIwMTExMDA2MDgz -OTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQTDEiMCAGA1UEChMZ -VW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3 -b3JrIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWA -DGSdhhuWZGc/IjoedQF97/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn -0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+oCgCXhVqqndwpyeI1B+twTUrWwbNWuKFB -OJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40bRr5HMNUuctHFY9rnY3lE -fktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2puTRZCr+E -Sv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYmhFV+SQgkK7QtbwYeDBoz1m -o130GO6IyY0XRSmZMnUCMe4pJshrAua1YkV/NxVaI2iJ1D7eTiew8EAMvE0Xy02i -sx7QBlrd9pPPV3WZ9fqGGmd4s7+W/jTcvedSVuWz5XV710GRBdxdaeOVDUO5/IOW -OZV7bIBaTxNyxtd9KXpEulKkKtVBRgkg/iKgtlswjbyJDNXXcPiHUv3a76xRLgez -Tv7QCdpw75j6VuZt27VXS9zlLCUVyJ4ueE742pyehizKV/Ma5ciSixqClnrDvFAS -adgOWkaLOusm+iPJtrCBvkIApPjW/jAux9JG9uWOdf3yzLnQh1vMBhBgu4M1t15n -3kfsmUjxpKEV/q2MYo45VU85FrmxY53/twIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMC -AQYwDQYJKoZIhvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQ -F/xlhMcQSZDe28cmk4gmb3DWAl45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTf -CVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuAL55MYIR4PSFk1vtBHxgP58l1cb29 -XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMoclm2q8KMZiYcdywm -djWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tMpkT/ -WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jb -AoJnwTnbw3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksq -P/ujmv5zMnHCnsZy4YpoJ/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Ko -b7a6bINDd82Kkhehnlt4Fj1F4jNy3eFmypnTycUm/Q1oBEauttmbjL4ZvrHG8hnj -XALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLXis7VmFxWlgPF7ncGNf/P -5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7zAYspsbi -DrW5viSP ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD -VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 -IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 -MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz -IG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz -MTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj -dXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw -EAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp -MCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G -CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9 -28sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKAXuFixrYp4YFs8r/lfTJq -VKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorjh40G072Q -DuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR -5gN/ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfL -ZEFHcpOrUMPrCXZkNNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05a -Sd+pZgvMPMZ4fKecHePOjlO+Bd5gD2vlGts/4+EhySnB8esHnFIbAURRPHsl18Tl -UlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331lubKgdaX8ZSD6e2wsWsSaR6s -+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ0wlf2eOKNcx5 -Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj -ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAx -hduub+84Mxh2EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNV -HQ4EFgQU+SSsD7K1+HnA+mCIG8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1 -+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpN -YWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t -L2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVy -ZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAt -IDIwMDiCCQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV -HSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w -DQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW -PJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF -5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1 -glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH -FoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2 -pSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD -xvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG -tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq -jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De -fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg -OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ -d0jQ ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj -YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL -MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE -BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM -GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua -BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe -3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 -YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR -rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm -ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU -oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF -MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v -QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t -b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF -AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q -GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 -G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi -l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 -smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG -A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh -bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE -ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS -b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5 -7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS -J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y -HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP -t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz -FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY -XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ -MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw -hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js -MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA -A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj -Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx -XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o -omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc -A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW -WL1WMRJOEcgh4LMRkWXbtKaIOM5V ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF -MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD -bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha -ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM -HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03 -UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42 -tSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R -ySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM -lFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp -/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G -A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G -A1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj -dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy -MENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl -cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js -L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL -BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni -acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 -o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K -zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8 -PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y -Johw1+qRzT65ysCQblrGXnRl11z+o+I= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF -MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD -bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw -NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV -BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn -ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0 -3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z -qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR -p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8 -HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw -ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea -HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw -Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh -c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E -RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt -dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku -Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp -3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 -nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF -CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na -xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX -KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv -b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl -cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c -JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP -mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+ -wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4 -VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/ -AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB -AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW -BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun -pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC -dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf -fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm -NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx -H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe -+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBl -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv -b3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl -cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSA -n61UQbVH35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4Htecc -biJVMWWXvdMX0h5i89vqbFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9Hp -EgjAALAcKxHad3A2m67OeYfcgnDmCXRwVWmvo2ifv922ebPynXApVfSr/5Vh88lA -bx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OPYLfykqGxvYmJHzDNw6Yu -YjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+RnlTGNAgMB -AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQW -BBTOw0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPI -QW5pJ6d1Ee88hjZv0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I -0jJmwYrA8y8678Dj1JGG0VDjA9tzd29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4Gni -lmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAWhsI6yLETcDbYz+70CjTVW0z9 -B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0MjomZmWzwPDCv -ON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo -IhNzbM8m9Yop5w== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQsw -CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu -ZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3Qg -RzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQGEwJV -UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu -Y29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQBgcq -hkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJf -Zn4f5dwbRXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17Q -RSAPWXYQ1qAk8C3eNvJsKTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ -BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgFUaFNN6KDec6NHSrkhDAKBggqhkjOPQQD -AwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5FyYZ5eEJJZVrmDxxDnOOlY -JjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy1vUhZscv -6pZjamVFkpUBtA== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD -QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT -MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j -b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB -CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 -nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt -43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P -T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 -gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO -BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR -TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw -DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr -hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg -06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF -PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls -YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk -CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH -MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT -MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j -b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI -2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx -1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ -q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz -tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ -vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP -BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV -5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY -1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4 -NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG -Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91 -8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe -pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl -MrY= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQsw -CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu -ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAe -Fw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUw -EwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20x -IDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0CAQYF -K4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FG -fp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPO -Z9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd -BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIx -AK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y3maTD/HMsQmP3Wyr+mt/ -oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34VOKa5Vt8 -sycX ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j -ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 -LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug -RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm -+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW -PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM -xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB -Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 -hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg -EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA -FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec -nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z -eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF -hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 -Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe -vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep -+OkuE6N36B9K ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBi -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3Qg -RzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBiMQswCQYDVQQGEwJV -UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu -Y29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3y -ithZwuEppz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1If -xp4VpX6+n6lXFllVcq9ok3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDV -ySAdYyktzuxeTsiT+CFhmzTrBcZe7FsavOvJz82sNEBfsXpm7nfISKhmV1efVFiO -DCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGYQJB5w3jHtrHEtWoYOAMQ -jdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6MUSaM0C/ -CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCi -EhtmmnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADM -fRyVw4/3IbKyEbe7f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QY -uKZ3AeEPlAwhHbJUKSWJbOUOUlFHdL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXK -chYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8oR7FwI+isX4KJpn15GkvmB0t -9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB -hjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD -ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2 -SV1EY+CtnJYYZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd -+SeuMIW59mdNOj6PWTkiU0TryF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWc -fFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy7zBZLq7gcfJW5GqXb5JQbZaNaHqa -sjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iahixTXTBmyUEFxPT9N -cCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN5r5N -0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie -4u1Ki7wb/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mI -r/OSmbaz5mEP0oUA51Aa5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1 -/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tKG48BtieVU+i2iW1bvGjUI+iLUaJW+fCm -gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+ ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNV -BAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBC -aWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNV -BAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1 -Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMwNTEyMDk0OFoXDTIz -MDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+ -BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhp -em1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN -ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4vU/kwVRHoViVF56C/UY -B4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vdhQd2h8y/L5VMzH2nPbxH -D5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5KCKpbknSF -Q9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEo -q1+gElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3D -k14opz8n8Y4e0ypQBaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcH -fC425lAcP9tDJMW/hkd5s3kc91r0E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsut -dEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gzrt48Ue7LE3wBf4QOXVGUnhMM -ti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAqjqFGOjGY5RH8 -zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn -rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUX -U8u3Zg5mTPj5dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6 -Jyr+zE7S6E5UMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5 -XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAF -Nzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAKkEh47U6YA5n+KGCR -HTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jOXKqY -GwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c -77NCR807VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3 -+GbHeJAAFS6LrVE1Uweoa2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WK -vJUawSg5TB9D0pH0clmKuVb8P7Sd2nCcdlqMQ1DujjByTd//SffGqWfZbawCEeI6 -FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEVKV0jq9BgoRJP3vQXzTLl -yb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2P -AJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpD -y4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8d -NL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB -8zELMAkGA1UEBhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2Vy -dGlmaWNhY2lvIChOSUYgUS0wODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1 -YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYDVQQLEyxWZWdldSBodHRwczovL3d3 -dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UECxMsSmVyYXJxdWlh -IEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMTBkVD -LUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQG -EwJFUzE7MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8g -KE5JRiBRLTA4MDExNzYtSSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBD -ZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZlZ2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQu -bmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJhcnF1aWEgRW50aXRhdHMg -ZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUNDMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R -85iKw5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm -4CgPukLjbo73FCeTae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaV -HMf5NLWUhdWZXqBIoH7nF2W4onW4HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNd -QlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0aE9jD2z3Il3rucO2n5nzbcc8t -lGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw0JDnJwIDAQAB -o4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4 -opvpXY0wfwYDVR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBo -dHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidW -ZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAwDQYJKoZIhvcN -AQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJlF7W2u++AVtd0x7Y -/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNaAl6k -SBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhy -Rp/7SNVel+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOS -Agu+TGbrIP65y7WZf+a2E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xl -nJ2lYJU6Un/10asIbvPuW/mIPX64b24D5EI= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1 -MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1 -czEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG -CSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEy -MTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNl -ZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBS -b290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUy -euuOF0+W2Ap7kaJjbMeMTC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvO -bntl8jixwKIy72KyaOBhU8E2lf/slLo2rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIw -WFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw93X2PaRka9ZP585ArQ/d -MtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtNP2MbRMNE -1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYD -VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/ -zQas8fElyalL1BSZMEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYB -BQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEF -BQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+RjxY6hUFaTlrg4wCQiZrxTFGGV -v9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG -E5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u -uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW -iAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v -GVCJYMzpJJUPwssd8m92kMfMdcGWxZ0= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML -RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp -bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 -IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3 -MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 -LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp -YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG -A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq -K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe -sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX -MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT -XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ -HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH -4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV -HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub -j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo -U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf -zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b -u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+ -bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er -fF6adulZkMV8gzURZVE= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 -Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW -KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl -cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw -NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw -NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy -ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV -BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo -Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4 -4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9 -KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI -rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi -94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB -sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi -gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo -kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE -vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA -A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t -O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua -AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP -9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/ -eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m -0vdXcDazv/wor3ElhVsT/h5/WrQ8 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkG -A1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3 -d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVu -dHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UEAxMq -RW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4XDTEy -MTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYwFAYD -VQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0 -L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0g -Zm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEVDMTB2MBAGByqGSM49AgEGBSuBBAAi -A2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHyAsWfoPZb1YsGGYZPUxBt -ByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef9eNi1KlH -Bz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O -BBYEFLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVC -R98crlOZF7ZvHH3hvxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nX -hTcGtXsI/esni0qU+eH6p44mCOh8kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50 -cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs -IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz -dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy -NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu -dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwt -dGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0 -aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK -AoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/T -RU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWN -cCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hW -wcKUs/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1 -U1+cPvQXLOZprE4yTGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0 -jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2fkBJmqzAN -BgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/ -jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ -Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v -1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R -nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH -VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9g== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAw -gb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL -Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg -MjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAw -BgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0 -MB4XDTE1MDUyNzExMTExNloXDTM3MTIyNzExNDExNlowgb4xCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1 -c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJ -bmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3Qg -Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0MIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEAsewsQu7i0TD/pZJH4i3DumSXbcr3DbVZwbPLqGgZ -2K+EbTBwXX7zLtJTmeH+H17ZSK9dE43b/2MzTdMAArzE+NEGCJR5WIoV3imz/f3E -T+iq4qA7ec2/a0My3dl0ELn39GjUu9CH1apLiipvKgS1sqbHoHrmSKvS0VnM1n4j -5pds8ELl3FFLFUHtSUrJ3hCX1nbB76W1NhSXNdh4IjVS70O92yfbYVaCNNzLiGAM -C1rlLAHGVK/XqsEQe9IFWrhAnoanw5CGAlZSCXqc0ieCU0plUmr1POeo8pyvi73T -DtTUXm6Hnmo9RR3RXRv06QqsYJn7ibT/mCzPfB3pAqoEmh643IhuJbNsZvc8kPNX -wbMv9W3y+8qh+CmdRouzavbmZwe+LGcKKh9asj5XxNMhIWNlUpEbsZmOeX7m640A -2Vqq6nPopIICR5b+W45UYaPrL0swsIsjdXJ8ITzI9vF01Bx7owVV7rtNOzK+mndm -nqxpkCIHH2E6lr7lmk/MBTwoWdPBDFSoWWG9yHJM6Nyfh3+9nEg2XpWjDrk4JFX8 -dWbrAuMINClKxuMrLzOg2qOGpRKX/YAr2hRC45K9PvJdXmd0LhyIRyk0X+IyqJwl -N4y6mACXi0mWHv0liqzc2thddG5msP9E36EYxr5ILzeUePiVSj9/E15dWf10hkNj -c0kCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD -VR0OBBYEFJ84xFYjwznooHFs6FRM5Og6sb9nMA0GCSqGSIb3DQEBCwUAA4ICAQAS -5UKme4sPDORGpbZgQIeMJX6tuGguW8ZAdjwD+MlZ9POrYs4QjbRaZIxowLByQzTS -Gwv2LFPSypBLhmb8qoMi9IsabyZIrHZ3CL/FmFz0Jomee8O5ZDIBf9PD3Vht7LGr -hFV0d4QEJ1JrhkzO3bll/9bGXp+aEJlLdWr+aumXIOTkdnrG0CSqkM0gkLpHZPt/ -B7NTeLUKYvJzQ85BK4FqLoUWlFPUa19yIqtRLULVAJyZv967lDtX/Zr1hstWO1uI -AeV8KEsD+UmDfLJ/fOPtjqF/YFOOVZ1QNBIPt5d7bIdKROf1beyAN/BYGW5KaHbw -H5Lk6rWS02FREAutp9lfx1/cH6NcjKF+m7ee01ZvZl4HliDtC3T7Zk6LERXpgUl+ -b7DUUH8i119lAg2m9IUe2K4GS0qn0jFmwvjO5QimpAKWRGhXxNUzzxkvFMSUHHuk -2fCfDrGA4tGeEWSpiBE6doLlYsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjAJOgc47Ol -IQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuIjnDrnBdSqEGULoe256YSxXXfW8AKbnuk -5F6G+TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh7DE9ZapD8j3fcEThuk0mEDuY -n/PIjhs4ViFqUZPTkcpG2om3PVODLAgfi49T3f+sHw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UE -BhMCQ04xMjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZ -IENPLixMVEQuMR8wHQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0 -MTEyNjA1MTMxNVoXDTQwMTIzMTE1NTk1OVowYjELMAkGA1UEBhMCQ04xMjAwBgNV -BAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8w -HQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMIICIjANBgkqhkiG9w0BAQEF -AAOCAg8AMIICCgKCAgEA2aMW8Mh0dHeb7zMNOwZ+Vfy1YI92hhJCfVZmPoiC7XJj -Dp6L3TQsAlFRwxn9WVSEyfFrs0yw6ehGXTjGoqcuEVe6ghWinI9tsJlKCvLriXBj -TnnEt1u9ol2x8kECK62pOqPseQrsXzrj/e+APK00mxqriCZ7VqKChh/rNYmDf1+u -KU49tm7srsHwJ5uu4/Ts765/94Y9cnrrpftZTqfrlYwiOXnhLQiPzLyRuEH3FMEj -qcOtmkVEs7LXLM3GKeJQEK5cy4KOFxg2fZfmiJqwTTQJ9Cy5WmYqsBebnh52nUpm -MUHfP/vFBu8btn4aRjb3ZGM74zkYI+dndRTVdVeSN72+ahsmUPI2JgaQxXABZG12 -ZuGR224HwGGALrIuL4xwp9E7PLOR5G62xDtw8mySlwnNR30YwPO7ng/Wi64HtloP -zgsMR6flPri9fcebNaBhlzpBdRfMK5Z3KpIhHtmVdiBnaM8Nvd/WHwlqmuLMc3Gk -L30SgLdTMEZeS1SZD2fJpcjyIMGC7J0R38IC+xo70e0gmu9lZJIQDSri3nDxGGeC -jGHeuLzRL5z7D9Ar7Rt2ueQ5Vfj4oR24qoAATILnsn8JuLwwoC8N9VKejveSswoA -HQBUlwbgsQfZxw9cZX08bVlX5O2ljelAU58VS6Bx9hoh49pwBiFYFIeFd3mqgnkC -AwEAAaNCMEAwHQYDVR0OBBYEFOLJQJ9NzuiaoXzPDj9lxSmIahlRMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQDRSVfg -p8xoWLoBDysZzY2wYUWsEe1jUGn4H3++Fo/9nesLqjJHdtJnJO29fDMylyrHBYZm -DRd9FBUb1Ov9H5r2XpdptxolpAqzkT9fNqyL7FeoPueBihhXOYV0GkLH6VsTX4/5 -COmSdI31R9KrO9b7eGZONn356ZLpBN79SWP8bfsUcZNnL0dKt7n/HipzcEYwv1ry -L3ml4Y0M2fmyYzeMN2WFcGpcWwlyua1jPLHd+PwyvzeG5LuOmCd+uh8W4XAR8gPf -JWIyJyYYMoSf/wA6E7qaTfRPuBRwIrHKK5DOKcFw9C+df/KQHtZa37dG/OaG+svg -IHZ6uqbL9XzeYqWxi+7egmaKTjowHz+Ay60nugxe19CxVsp3cbK1daFQqUBDF8Io -2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV -09tL7ECQ8s1uV9JiDnxXk7Gnbc2dg7sq5+W2O3FYrf3RRbxake5TFW/TRQl1brqQ -XR4EzzffHqhmsYzmIGrv/EhOdJhCrylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrq -T8p+ck0LcIymSLumoRT2+1hEmRSuqguTaaApJUqlyyvdimYHFngVV3Eb7PVHhPOe -MTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBH -MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM -QzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIy -MDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNl -cnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEB -AQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaM -f/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vX -mX7wCl7raKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7 -zUjwTcLCeoiKu7rPWRnWr4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0P -fyblqAj+lug8aJRT7oM6iCsVlgmy4HqMLnXWnOunVmSPlk9orj2XwoSPwLxAwAtc -vfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk9+aCEI3oncKKiPo4 -Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr06zqkUsp -zBmkMiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOO -Rc92wO1AK/1TD7Cn1TsNsYqiA94xrcx36m97PtbfkSIS5r762DL8EGMUUXLeXdYW -k70paDPvOmbsB4om3xPXV2V4J95eSRQAogB/mqghtqmxlbCluQ0WEdrHbEg8QOB+ -DVrNVjzRlwW5y0vtOUucxD/SVRNuJLDWcfr0wbrM7Rv1/oFB2ACYPTrIrnqYNxgF -lQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV -HQ4EFgQU5K8rJnEaK0gnhS9SZizv8IkTcT4wDQYJKoZIhvcNAQEMBQADggIBADiW -Cu49tJYeX++dnAsznyvgyv3SjgofQXSlfKqE1OXyHuY3UjKcC9FhHb8owbZEKTV1 -d5iyfNm9dKyKaOOpMQkpAWBz40d8U6iQSifvS9efk+eCNs6aaAyC58/UEBZvXw6Z -XPYfcX3v73svfuo21pdwCxXu11xWajOl40k4DLh9+42FpLFZXvRq4d2h9mREruZR -gyFmxhE+885H7pwoHyXa/6xmld01D1zvICxi/ZG6qcz8WpyTgYMpl0p8WnK0OdC3 -d8t5/Wk6kjftbjhlRn7pYL15iJdfOBL07q9bgsiG1eGZbYwE8na6SfZu6W0eX6Dv -J4J2QPim01hcDyxC2kLGe4g0x8HYRZvBPsVhHdljUEn2NIVq4BjFbkerQUIpm/Zg -DdIx02OYI5NaAIFItO/Nis3Jz5nu2Z6qNuFoS3FJFDYoOj0dzpqPJeaAcWErtXvM -+SUWgeExX6GjfhaknBZqlxi9dnKlC54dNuYvoS++cJEPqOba+MSSQGwlfnuzCdyy -F62ARPBopY+Udf90WuioAnwMCeKpSwughQtiue+hMZL77/ZRBIls6Kl0obsXs7X9 -SQ98POyDGCBDTtWTurQ0sR8WNh8M5mQ5Fkzc4P4dyKliPUDqysU0ArSuiYgzNdws -E3PYJ/HQcu51OyLemGhmW/HGY0dVHLqlCFF1pkgl ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBH -MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM -QzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIy -MDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNl -cnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEB -AQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTukk3Lv -CvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3Kg -GjSY6Dlo7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9Bu -XvAuMC6C/Pq8tBcKSOWIm8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOd -re7kRXuJVfeKH2JShBKzwkCX44ofR5GmdFrS+LFjKBC4swm4VndAoiaYecb+3yXu -PuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbuak7MkogwTZq9TwtImoS1 -mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscszcTJGr61K -8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqj -x5RWIr9qS34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsR -nTKaG73VululycslaVNVJ1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0 -kzCqgc7dGtxRcw1PcOnlthYhGXmy5okLdWTK1au8CcEYof/UVKGFPP0UJAOyh9Ok -twIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV -HQ4EFgQUu//KjiOfT5nK2+JopqUVJxce2Q4wDQYJKoZIhvcNAQEMBQADggIBALZp -8KZ3/p7uC4Gt4cCpx/k1HUCCq+YEtN/L9x0Pg/B+E02NjO7jMyLDOfxA325BS0JT -vhaI8dI4XsRomRyYUpOM52jtG2pzegVATX9lO9ZY8c6DR2Dj/5epnGB3GFW1fgiT -z9D2PGcDFWEJ+YF59exTpJ/JjwGLc8R3dtyDovUMSRqodt6Sm2T4syzFJ9MHwAiA -pJiS4wGWAqoC7o87xdFtCjMwc3i5T1QWvwsHoaRc5svJXISPD+AVdyx+Jn7axEvb -pxZ3B7DNdehyQtaVhJ2Gg/LkkM0JR9SLA3DaWsYDQvTtN6LwG1BUSw7YhN4ZKJmB -R64JGz9I0cNv4rBgF/XuIwKl2gBbbZCr7qLpGzvpx0QnRY5rn/WkhLx3+WuXrD5R -RaIRpsyF7gpo8j5QOHokYh4XIDdtak23CZvJ/KRY9bb7nE4Yu5UC56GtmwfuNmsk -0jmGwZODUNKBRqhfYlcsu2xkiAhu7xNUX90txGdj08+JN7+dIPT7eoOboB6BAFDC -5AwiWVIQ7UNWhwD4FFKnHYuTjKJNRn8nxnGbJN7k2oaLDX5rIMHAnuFl2GqjpuiF -izoHCBy69Y9Vmhh1fuXsgWbRIXOhNUQLgD1bnF5vKheW0YMjiGZt5obicDIvUiLn -yOd/xCxgXS/Dr55FBcOEArf9LAhST4Ldo/DUhgkC ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICDDCCAZGgAwIBAgIQbkepx2ypcyRAiQ8DVd2NHTAKBggqhkjOPQQDAzBHMQsw -CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU -MBIGA1UEAxMLR1RTIFJvb3QgUjMwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw -MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp -Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMwdjAQBgcqhkjOPQIBBgUrgQQA -IgNiAAQfTzOHMymKoYTey8chWEGJ6ladK0uFxh1MJ7x/JlFyb+Kf1qPKzEUURout -736GjOyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx1WyRRK2EE46ajA2A -DDL24CejQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud -DgQWBBTB8Sa6oC2uhYHP0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFuk -fCPAlaUs3L6JbyO5o91lAFJekazInXJ0glMLfalAvWhgxeG4VDvBNhcl2MG9AjEA -njWSdIUlUfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOaKaqW04MjyaR7YbPMAuhd ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQsw -CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU -MBIGA1UEAxMLR1RTIFJvb3QgUjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw -MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp -Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcqhkjOPQIBBgUrgQQA -IgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa6zzu -hXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/l -xKvRHYqjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud -DgQWBBSATNbrdP9JNqPV2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0 -CMRw3J5QdCHojXohw0+WbhXRIjVhLfoIN+4Zba3bssx9BzT1YBkstTTZbyACMANx -sbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11xzPKwTdb+mciUqXWi4w== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg -R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 -9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq -fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv -iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU -1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ -bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW -MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA -ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l -uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn -Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS -tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF -PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un -hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV -5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo -R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx -MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK -Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 -AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA -ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 -7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W -kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI -mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G -A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ -KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 -6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl -4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K -oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj -UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU -AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL -MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj -KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 -MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV -BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw -NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV -BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH -MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL -So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal -tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG -CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT -qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz -rD6ogRLQy7rQkgu2npaqBA+K ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB -mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT -MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s -eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv -cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ -BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg -MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0 -BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz -+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm -hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn -5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W -JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL -DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC -huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw -HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB -AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB -zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN -kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD -AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH -SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G -spki4cErx5z481+oghLrGREt ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy -c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE -BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0 -IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV -VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8 -cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT -QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh -F7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v -c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w -mZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd -VHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX -teGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ -f9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe -Bi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+ -nhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB -/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY -MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG -9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc -aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX -IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn -ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z -uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN -Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja -QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW -koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9 -ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt -DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm -bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW -MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy -c2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD -VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1 -c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0DE81 -WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUG -FF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdq -XbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL -se4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwb -KNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8Fd -IgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP20gaXT73 -y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRt -hAAnZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgoc -QIgfksILAAX/8sgCSqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4 -Lt1ZrtmhN79UNdxzMk+MBB4zsslG8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAfBgNV -HSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8EBAMCAYYwDQYJ -KoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z -dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQ -L1EuxBRa3ugZ4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgr -Fg5fNuH8KrUwJM/gYwx7WBr+mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSo -ag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY -T1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz -GDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m -1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV -OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH -6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX -QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEk -MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpH -bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX -DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD -QSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu -MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprlOQcJ -FspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAw -DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61F -uOJAf/sKbvu+M8k8o4TVMAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX -kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTs -ewv4n4Q= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEk -MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpH -bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX -DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD -QSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu -MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6SFkc -8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8ke -hOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD -VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI -KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg -515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnO -xwy8p2Fp8fc74SrL+SvzZpA3 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw -MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT -aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ -jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp -xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp -1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG -snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ -U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 -9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E -BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B -AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz -yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE -38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP -AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad -DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME -HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 -MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL -v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 -eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq -tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd -C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa -zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB -mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH -V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n -bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG -3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs -J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO -291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS -ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd -AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 -TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 -MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 -RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT -gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm -KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd -QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ -XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw -DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o -LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU -RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp -jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK -6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX -mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs -Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH -WD9f ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEg -MB4GA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2Jh -bFNpZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQx -MjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSNjET -MBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCAiIwDQYJ -KoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQssgrRI -xutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7ErdG1rG1ofuTToVBu1k -ZguSgMpE3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSKvGRMIRxD -aNc9PIrFsmbVkJq3MQbFvuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJw -LnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqMPKq0pPbzlUoSB239jLKJz9CgYXfIWHSw -1CM69106yqLbnQneXUQtkPGBzVeS+n68UARjNN9rkxi+azayOeSsJDa38O+2HBNX -k7besvjihbdzorg1qkXy4J02oW9UivFyVm4uiMVRQkQVlO6jxTiWm05OWgtH8wY2 -SXcwvHE35absIQh1/OZhFj931dmRl4QKbNQCTXTAFO39OfuD8l4UoQSwC+n+7o/h -bguyCLNhZglqsQY6ZZZZwPA1/cnaKI0aEYdwgQqomnUdnjqGBQCe24DWJfncBZ4n -WUx2OVvq+aWh2IMP0f/fMBH5hc8zSPXKbWQULHpYT9NLCEnFlWQaYw55PfWzjMpY -rZxCRXluDocZXFSxZba/jJvcE+kNb7gu3GduyYsRtYQUigAZcIN5kZeR1Bonvzce -MgfYFGM8KEyvAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTAD -AQH/MB0GA1UdDgQWBBSubAWjkxPioufi1xzWx/B/yGdToDAfBgNVHSMEGDAWgBSu -bAWjkxPioufi1xzWx/B/yGdToDANBgkqhkiG9w0BAQwFAAOCAgEAgyXt6NH9lVLN -nsAEoJFp5lzQhN7craJP6Ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGt -Ixg93eFyRJa0lV7Ae46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr61 -55wsTLxDKZmOMNOsIeDjHfrYBzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLj -vUYAGm0CuiVdjaExUd1URhxN25mW7xocBFymFe944Hn+Xds+qkxV/ZoVqW/hpvvf -cDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr3TsTjxKM4kEaSHpz -oHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB10jZp -nOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfs -pA9MRf/TuTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+v -JJUEeKgDu+6B5dpffItKoZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R -8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+tJDfLRVpOoERIyNiwmcUVhAn21klJwGW4 -5hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD -VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 -IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 -MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD -aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx -MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy -cmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAG -A1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAl -BgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI -hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xed -KYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7 -G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2 -zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4 -ddPB/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyG -HoiMvvKRhI9lNNgATH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2 -Id3UwD2ln58fQ1DJu7xsepeY7s2MH/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3V -yJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfeOx2YItaswTXbo6Al/3K1dh3e -beksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSFHTynyQbehP9r -6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh -wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsog -zCtLkykPAgMBAAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQW -BBS5CcqcHtvTbDprru1U8VuTBjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDpr -ru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UEBhMCRVUxQzBBBgNVBAcTOk1hZHJp -ZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJmaXJtYS5jb20vYWRk -cmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJmaXJt -YSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiC -CQDJzdPp1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCow -KAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZI -hvcNAQEFBQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZ -UohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXoz -X1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x -fxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz -a2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd -Yhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd -SqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O -AP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso -M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge -v8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z -09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh -MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE -YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 -MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo -ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg -MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN -ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA -PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w -wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi -EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY -avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ -YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE -sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h -/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 -IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD -ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy -OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P -TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER -dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf -ReYNnyicsbkqWletNw+vHX/bvZ8= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT -EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp -ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz -NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH -EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE -AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD -E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH -/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy -DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh -GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR -tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA -AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE -FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX -WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu -9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr -gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo -2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO -LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI -4uJEvlz36hz1 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzAN -BgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl -c2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hl -bGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgRUNDIFJv -b3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEwMzcxMlowgaoxCzAJ -BgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmljIEFj -YWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5 -MUQwQgYDVQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0 -dXRpb25zIEVDQyBSb290Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKg -QehLgoRc4vgxEZmGZE4JJS+dQS8KrjVPdJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJa -jq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoKVlp8aQuqgAkkbH7BRqNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLQi -C4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaep -lSTAGiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7Sof -TUwJCA3sS61kFyjndc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix -RDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 -dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p -YyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw -NjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK -EztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIENl -cnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl -c2VhcmNoIEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPz -dYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJ -fel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa71HFK9+WXesyHgLacEns -bgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u8yBRQlqD -75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSP -FEDH3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNV -HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp -5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu -b3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA -A4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p -6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 -TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7 -dIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys -Nnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI -l7WdmplNsDz4SgCbZN2fOUvRJ9e4 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1Ix -DzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5k -IFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMT -N0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9v -dENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAxMTIxWjCBpjELMAkG -A1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNh -ZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkx -QDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 -dGlvbnMgUm9vdENBIDIwMTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQDC+Kk/G4n8PDwEXT2QNrCROnk8ZlrvbTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA -4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+ehiGsxr/CL0BgzuNtFajT0 -AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+6PAQZe10 -4S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06C -ojXdFPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV -9Cz82XBST3i4vTwri5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrD -gfgXy5I2XdGj2HUb4Ysn6npIQf1FGQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjMZ6 -Y5ZLKTBOhE5iGV48zpeQpX8B653g+IuJ3SWYPZK2fu/Z8VFRfS0myGlZYeCsargq -NhEEelC9MoS+L9xy1dcdFkfkR2YgP/SWxa+OAXqlD3pk9Q0Yh9muiNX6hME6wGko -LfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc -Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNV -HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVd -ctA4GGqd83EkVAswDQYJKoZIhvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0I -XtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+D1hYc2Ryx+hFjtyp8iY/xnmMsVMI -M4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrMd/K4kPFox/la/vot -9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+yd+2V -Z5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/ea -j8GsGsVn82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnh -X9izjFk0WaSrT2y7HxjbdavYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQ -l033DlZdwJVqwjbDG2jJ9SrcR5q+ss7FJej6A7na+RZukYT1HCjI/CbM1xyQVqdf -bzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVtJ94Cj8rDtSvK6evIIVM4 -pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGaJI7ZjnHK -e7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0 -vm9qp/UsQu0yrbYhnr68 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx -FjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3Qg -Um9vdCBDQSAxMB4XDTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkG -A1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdr -b25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1ApzQ -jVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEn -PzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjh -ZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9 -nnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/h -q5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgED -MA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsC -mEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI3 -7piol7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clB -oiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJs -EhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpO -fMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4JxHYB0yvbi -AmvZWg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQEL -BQAwbzELMAkGA1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJ -SG9uZyBLb25nMRYwFAYDVQQKEw1Ib25na29uZyBQb3N0MSAwHgYDVQQDExdIb25n -a29uZyBQb3N0IFJvb3QgQ0EgMzAeFw0xNzA2MDMwMjI5NDZaFw00MjA2MDMwMjI5 -NDZaMG8xCzAJBgNVBAYTAkhLMRIwEAYDVQQIEwlIb25nIEtvbmcxEjAQBgNVBAcT -CUhvbmcgS29uZzEWMBQGA1UEChMNSG9uZ2tvbmcgUG9zdDEgMB4GA1UEAxMXSG9u -Z2tvbmcgUG9zdCBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK -AoICAQCziNfqzg8gTr7m1gNt7ln8wlffKWihgw4+aMdoWJwcYEuJQwy51BWy7sFO -dem1p+/l6TWZ5Mwc50tfjTMwIDNT2aa71T4Tjukfh0mtUC1Qyhi+AViiE3CWu4mI -VoBc+L0sPOFMV4i707mV78vH9toxdCim5lSJ9UExyuUmGs2C4HDaOym71QP1mbpV -9WTRYA6ziUm4ii8F0oRFKHyPaFASePwLtVPLwpgchKOesL4jpNrcyCse2m5FHomY -2vkALgbpDDtw1VAliJnLzXNg99X/NWfFobxeq81KuEXryGgeDQ0URhLj0mRiikKY -vLTGCAj4/ahMZJx2Ab0vqWwzD9g/KLg8aQFChn5pwckGyuV6RmXpwtZQQS4/t+Tt -bNe/JgERohYpSms0BpDsE9K2+2p20jzt8NYt3eEV7KObLyzJPivkaTv/ciWxNoZb -x39ri1UbSsUgYT2uy1DhCDq+sI9jQVMwCFk8mB13umOResoQUGC/8Ne8lYePl8X+ -l2oBlKN8W4UdKjk60FSh0Tlxnf0h+bV78OLgAo9uliQlLKAeLKjEiafv7ZkGL7YK -TE/bosw3Gq9HhS2KX8Q0NEwA/RiTZxPRN+ZItIsGxVd7GYYKecsAyVKvQv83j+Gj -Hno9UKtjBucVtT+2RTeUN7F+8kjDf8V1/peNRY8apxpyKBpADwIDAQABo2MwYTAP -BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQXnc0e -i9Y5K3DTXNSguB+wAPzFYTAdBgNVHQ4EFgQUF53NHovWOStw01zUoLgfsAD8xWEw -DQYJKoZIhvcNAQELBQADggIBAFbVe27mIgHSQpsY1Q7XZiNc4/6gx5LS6ZStS6LG -7BJ8dNVI0lkUmcDrudHr9EgwW62nV3OZqdPlt9EuWSRY3GguLmLYauRwCy0gUCCk -MpXRAJi70/33MvJJrsZ64Ee+bs7Lo3I6LWldy8joRTnU+kLBEUx3XZL7av9YROXr -gZ6voJmtvqkBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov+BS5gLNdTaqX4fnk -GMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDceqFS -3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJm -Ozj/2ZQw9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+ -l6mc1X5VTMbeRRAc6uk7nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6c -JfTzPV4e0hz5sy229zdcxsshTrD3mUcYhcErulWuBurQB7Lcq9CClnXO0lD+mefP -L5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB60PZ2Pierc+xYw5F9KBa -LJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fqdBb9HxEG -mpv0 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw -TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh -cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 -WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu -ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY -MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc -h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ -0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U -A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW -T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH -B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC -B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv -KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn -OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn -jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw -qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI -rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq -hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL -ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ -3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK -NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 -ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur -TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC -jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc -oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq -4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA -mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d -emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBK -MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVu -VHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQw -MTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScw -JQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ldhNlT -3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU -+ehcCuz/mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gp -S0l4PJNgiCL8mdo2yMKi1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1 -bVoE/c40yiTcdCMbXTMTEl3EASX2MN0CXZ/g1Ue9tOsbobtJSdifWwLziuQkkORi -T0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl3ZBWzvurpWCdxJ35UrCL -vYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzyNeVJSQjK -Vsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZK -dHzVWYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHT -c+XvvqDtMwt0viAgxGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hv -l7yTmvmcEpB4eoCHFddydJxVdHixuuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5N -iGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB -/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZIhvcNAQELBQAD -ggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH -6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwt -LRvM7Kqas6pgghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93 -nAbowacYXVKV7cndJZ5t+qntozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3 -+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmVYjzlVYA211QC//G5Xc7UI2/YRYRK -W2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUXfeu+h1sXIFRRk0pT -AwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/rokTLq -l1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG -4iZZRHUe2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZ -mUlO+KWA2yUPHGNiiskzZ2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A -7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7RcGzM7vRX+Bi6hG6H ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBN -MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVu -VHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcN -MzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0 -MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTyP4o7 -ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGy -RBb06tD6Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlS -bdsHyo+1W/CD80/HLaXIrcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF -/YTLNiCBWS2ab21ISGHKTN9T0a9SvESfqy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R -3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoSmJxZZoY+rfGwyj4GD3vw -EUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFnol57plzy -9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9V -GxyhLrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ -2fjXctscvG29ZV/viDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsV -WaFHVCkugyhfHMKiq3IXAAaOReyL4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gD -W/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMwDQYJKoZIhvcN -AQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj -t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHV -DRDtfULAj+7AmgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9 -TaDKQGXSc3z1i9kKlT/YPyNtGtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8G -lwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFtm6/n6J91eEyrRjuazr8FGF1NFTwW -mhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMxNRF4eKLg6TCMf4Df -WN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4Mhn5 -+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJ -tshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA -GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv -8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4 -MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6 -ZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD -VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j -b20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq -scIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO -xdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H -LmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFX -uaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQD -yCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxTOTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+ -JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbKF7jJeodWLBoBHmy+E60Q -rLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK0GqfvEyN -BjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8L -hij+0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIB -QFqNeb+Lz0vPqhbBleStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+ -HMh3/1uaD7euBUbl8agW7EekFwIDAQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2lu -Zm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+SVpFTlBFIFMuQS4gLSBDSUYg -QTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBGNjIgUzgxQzBB -BgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx -MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwHQYDVR0OBBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUA -A4ICAQB4pgwWSp9MiDrAyw6lFn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWb -laQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbgakEyrkgPH7UIBzg/YsfqikuFgba56 -awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo -JNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw -LDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT -VyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk -LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb -UjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/ -QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+ -naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls -QyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQEL -BQAwRjELMAkGA1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNV -BAMMFkx1eFRydXN0IEdsb2JhbCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUw -MzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEWMBQGA1UECgwNTHV4VHJ1c3QgUy5B -LjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCCAiIwDQYJKoZIhvcN -AQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wmKb3F -ibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTem -hfY7RBi2xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy95iJMHZP1 -EMShduxq3sVs35a0VkBCwGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsn -Xpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm1Z3aLQdjAsZy6ZS8TEmVT4hSyNvoaYL4 -zDRbIvCGp4m9SAptZoFtyMhk+wHh9OHe2Z7d21vUKpkmFRseTJIpgp7VkoGSQXAZ -96Tlk0u8d2cx3Rz9MXANF5kM+Qw5GSoXtTBxVdUPrljhPS80m8+f9niFwpN6cj5m -j5wWEWCPnolvZ77gR1o7DJpni89Gxq44o/KnvObWhWszJHAiS8sIm7vI+AIpHb4g -DEa/a4ebsypmQjVGbKq6rfmYe+lQVRQxv7HaLe2ArWgk+2mr2HETMOZns4dA/Yl+ -8kPREd8vZS9kzl8UubG/Mb2HeFpZZYiq/FkySIbWTLkpS5XTdvN3JW1CHDiDTf2j -X5t/Lax5Gw5CMZdjpPuKadUiDTSQMC6otOBttpSsvItO13D8xTiOZCXhTTmQzsmH -hFhxAgMBAAGjgagwgaUwDwYDVR0TAQH/BAUwAwEB/zBCBgNVHSAEOzA5MDcGByuB -KwEBAQowLDAqBggrBgEFBQcCARYeaHR0cHM6Ly9yZXBvc2l0b3J5Lmx1eHRydXN0 -Lmx1MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBT/GCh2+UgFLKGu8SsbK7JT -+Et8szAdBgNVHQ4EFgQU/xgodvlIBSyhrvErGyuyU/hLfLMwDQYJKoZIhvcNAQEL -BQADggIBAGoZFO1uecEsh9QNcH7X9njJCwROxLHOk3D+sFTAMs2ZMGQXvw/l4jP9 -BzZAcg4atmpZ1gDlaCDdLnINH2pkMSCEfUmmWjfrRcmF9dTHF5kH5ptV5AzoqbTO -jFu1EVzPig4N1qx3gf4ynCSecs5U89BvolbW7MM3LGVYvlcAGvI1+ut7MV3CwRI9 -loGIlonBWVx65n9wNOeD4rHh4bhY79SV5GCc8JaXcozrhAIuZY+kt9J/Z93I055c -qqmkoCUUBpvsT34tC38ddfEz2O3OuHVtPlu5mB0xDVbYQw8wkbIEa91WvpWAVWe+ -2M2D2RjuLg+GLZKecBPs3lHJQ3gCpU3I+V/EkVhGFndadKpAvAefMLmx9xIX3eP/ -JEAdemrRTxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKre -zrnK+T+Tb/mjuuqlPpmt/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQf -LSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+ -x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31IiyBMz2TWuJdGsE7RKlY6 -oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD -VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0 -ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G -CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y -OTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx -FjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp -Z25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o -dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP -kd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc -cbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U -fIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7 -N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC -xkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1 -+rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G -A1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM -Pcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG -SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h -mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk -ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 -tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c -2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t -HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQG -EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3 -MDUGA1UECwwuVGFuw7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNl -cnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWR -dGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgxMjA2MTUwODIxWjCB -pzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxOZXRM -b2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlm -aWNhdGlvbiBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNz -IEdvbGQpIEbFkXRhbsO6c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAxCRec75LbRTDofTjl5Bu0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrT -lF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw/HpYzY6b7cNGbIRwXdrz -AZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAkH3B5r9s5 -VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRG -ILdwfzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2 -BJtr+UBdADTHLpl1neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAG -AQH/AgEEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2M -U9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwWqZw8UQCgwBEIBaeZ5m8BiFRh -bvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C -+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC -bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F -uLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2 -XjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi -MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu -MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp -dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV -UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO -ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz -c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP -OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl -mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF -BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4 -qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw -gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB -BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu -bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp -dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8 -6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/ -h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH -/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv -wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN -pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB -ijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly -aWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl -ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0w -NTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4G -A1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIwIAYD -VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBX -SVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR -VVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2 -w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsF -mQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg -4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t9 -4B3RLoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYw -DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQw -EAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx -SPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2 -ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8 -vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa -hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi -Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ -/L7fCg0= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBt -MQswCQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUg -Rm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9i -YWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAwMzJaFw0zOTEyMDExNTEwMzFaMG0x -CzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQLExlPSVNURSBG -b3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh -bCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3 -HEokKtaXscriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGx -WuR51jIjK+FTzJlFXHtPrby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX -1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNk -u7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4oQnc/nSMbsrY9gBQHTC5P -99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvgGUpuuy9r -M2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUB -BAMCAQAwDQYJKoZIhvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrgh -cViXfa43FK8+5/ea4n32cZiZBKpDdHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5 -gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0VQreUGdNZtGn//3ZwLWoo4rO -ZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEuiHZeeevJuQHHf -aPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic -Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQsw -CQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91 -bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwg -Um9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRaFw00MjA1MDkwOTU4MzNaMG0xCzAJ -BgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQLExlPSVNURSBGb3Vu -ZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2JhbCBS -b290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQwMYPchi82PG6s4ni -eUqjFqdrVCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQmqJLIX4W -p2OQ0jnUsYd4XxiWD1AbNTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUSIcUrOPDnpBgOtfKie7T -rYy0UGYwEAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0EAwMDaAAwZQIwJsdpW9zV -57LnyAyMjMPdeYwbY9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtkAjEA2zQg -Mgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC -TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0 -aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0 -aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz -MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw -IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR -dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp -li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D -rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ -WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug -F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU -xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC -Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv -dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw -ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl -IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh -c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy -ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh -Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI -KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T -KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq -y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p -dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD -VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL -MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk -fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8 -7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R -cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y -mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW -xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK -SnQ2+Q== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQEL -BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc -BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00 -MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEgRzMwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakEPBtV -wedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWe -rNrwU8lmPNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF341 -68Xfuw6cwI2H44g4hWf6Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh -4Pw5qlPafX7PGglTvF0FBM+hSo+LdoINofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXp -UhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/lg6AnhF4EwfWQvTA9xO+o -abw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV7qJZjqlc -3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/G -KubX9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSt -hfbZxbGL0eUQMk1fiyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KO -Tk0k+17kBL5yG6YnLUlamXrXXAkgt3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOt -zCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB -BjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZIhvcNAQELBQAD -ggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC -MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2 -cDMT/uFPpiN3GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUN -qXsCHKnQO18LwIE6PWThv6ctTr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5 -YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP+V04ikkwj+3x6xn0dxoxGE1nVGwv -b2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh3jRJjehZrJ3ydlo2 -8hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fawx/k -NSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNj -ZgKAvQU6O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhp -q1467HxpvMc7hU6eFbm0FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFt -nh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOVhMJKzRwuJIczYOXD ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x -GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv -b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV -BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W -YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa -GMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg -Fyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J -WpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB -rrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp -+ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1 -ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i -Ucw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz -PtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og -/zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH -oycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI -yV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud -EwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2 -A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL -MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT -ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f -BluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn -g/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl -fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K -WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha -B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc -hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR -TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD -mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z -ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y -4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza -8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL -BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc -BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00 -MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIgRzMwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFhZiFf -qq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMW -n4rjyduYNM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ym -c5GQYaYDFCDy54ejiK2toIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+ -O7q414AB+6XrW7PFXmAqMaCvN+ggOp+oMiwMzAkd056OXbxMmO7FGmh77FOm6RQ1 -o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+lV0POKa2Mq1W/xPtbAd0j -IaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZoL1NesNKq -IcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz -8eQQsSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43eh -vNURG3YBZwjgQQvD6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l -7ZizlWNof/k19N+IxWA1ksB8aRxhlRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALG -cC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB -BjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZIhvcNAQELBQAD -ggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 -AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RC -roijQ1h5fq7KpVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0Ga -W/ZZGYjeVYg3UQt4XAoeo0L9x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4n -lv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgzdWqTHBLmYF5vHX/JHyPLhGGfHoJE -+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6XU/IyAgkwo1jwDQHV -csaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+NwmNtd -dbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNg -KCLjsZWDzYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeM -HVOyToV7BjjHLPj4sHKNJeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4 -WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x -GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv -b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV -BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W -YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM -V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB -4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr -H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd -8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv -vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT -mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe -btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc -T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt -WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ -c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A -4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD -VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG -CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0 -aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 -aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu -dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw -czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G -A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC -TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg -Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0 -7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem -d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd -+LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B -4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN -t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x -DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57 -k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s -zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j -Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT -mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK -4SVhM7JZG+Ju1zdXtg2pEto= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQEL -BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc -BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00 -MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMgRzMwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286IxSR -/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNu -FoM7pmRLMon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXR -U7Ox7sWTaYI+FrUoRqHe6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+c -ra1AdHkrAj80//ogaX3T7mH1urPnMNA3I4ZyYUUpSFlob3emLoG+B01vr87ERROR -FHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3UVDmrJqMz6nWB2i3ND0/k -A9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f75li59wzw -eyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634Ryl -sSqiMd5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBp -VzgeAVuNVejH38DMdyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0Q -A4XN8f+MFrXBsj6IbGB/kE+V9/YtrQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+ -ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB -BjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZIhvcNAQELBQAD -ggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px -KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnI -FUBhynLWcKzSt/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5Wvv -oxXqA/4Ti2Tk08HS6IT7SdEQTXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFg -u/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9DuDcpmvJRPpq3t/O5jrFc/ZSXPsoaP -0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGibIh6BJpsQBJFxwAYf -3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmDhPbl -8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+ -DhcI00iX0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HN -PlopNLk9hM6xZdRZkZFWdSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ -ywaZWWDYWGWVjUTR939+J399roD1B0y2PpxxVJkES/1Y+Zj0 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMC -VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T -U0wgQ29ycG9yYXRpb24xNDAyBgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNTIzWhcNNDEwMjEyMTgx -NTIzWjB/MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv -dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE0MDIGA1UEAwwrU1NMLmNv -bSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49 -AgEGBSuBBAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjKAMTH6kMA -VIbc/R/fALhBYlzccBYy3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1Kthku -WnBaBu2+8KGwytAJKaNjMGEwHQYDVR0OBBYEFFvKXuXe0oGqzagtZFG22XKbl+ZP -MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe5d7SgarNqC1kUbbZcpuX -5k8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJN+vp1RPZ -ytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZg -h5Mmm7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNV -BAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UE -CgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2Vy -dGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMB4XDTE3MDUzMTE4MTQzN1oXDTQy -MDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4G -A1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQD -DC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvq -M0fNTPl9fb69LT3w23jhhqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssuf -OePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7wcXHswxzpY6IXFJ3vG2fThVUCAtZJycxa -4bH3bzKfydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTOZw+oz12WGQvE43LrrdF9 -HSfvkusQv1vrO6/PgN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+B6KjBSYR -aZfqhbcPlgtLyEDhULouisv3D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcA -b9ZhCBHqurj26bNg5U257J8UZslXWNvNh2n4ioYSA0e/ZhN2rHd9NCSFg83XqpyQ -Gp8hLH94t2S42Oim9HizVcuE0jLEeK6jj2HdzghTreyI/BXkmg3mnxp3zkyPuBQV -PWKchjgGAGYS5Fl2WlPAApiiECtoRHuOec4zSnaqW4EWG7WK2NAAe15itAnWhmMO -pgWVSbooi4iTsjQc2KRVbrcc0N6ZVTsj9CLg+SlmJuwgUHfbSguPvuUCYHBBXtSu -UDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48+qvWBkofZ6aY -MBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV -HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa4 -9QaAJadz20ZpqJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBW -s47LCp1Jjr+kxJG7ZhcFUZh1++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5 -Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nxY/hoLVUE0fKNsKTPvDxeH3jnpaAg -cLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2GguDKBAdRUNf/ktUM -79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDzOFSz -/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXt -ll9ldDz7CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEm -Kf7GUmG6sXP/wwyc5WxqlD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKK -QbNmC1r7fSOl8hqw/96bg5Qu0T/fkreRrwU7ZcegbLHNYhLDkBvjJc40vG93drEQ -w/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1hlMYegouCRw2n5H9gooi -S9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX9hwJ1C07 -mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMC -VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T -U0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0 -aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNDAzWhcNNDEwMjEyMTgxNDAz -WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0 -b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNvbSBS -b290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB -BAAiA2IABEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI -7Z4INcgn64mMU1jrYor+8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPg -CemB+vNH06NjMGEwHQYDVR0OBBYEFILRhXMw5zUE044CkvvlpNHEIejNMA8GA1Ud -EwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTTjgKS++Wk0cQh6M0wDgYD -VR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCWe+0F+S8T -kdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+ -gA0z5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE -BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK -DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTczOTM5WhcNNDEwMjEyMTcz -OTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv -dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv -bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcN -AQEBBQADggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2R -xFdHaxh3a3by/ZPkPQ/CFp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aX -qhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcC -C52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/geoeOy3ZExqysdBP+lSgQ3 -6YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkpk8zruFvh -/l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrF -YD3ZfBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93E -JNyAKoFBbZQ+yODJgUEAnl6/f8UImKIYLEJAs/lvOCdLToD0PYFH4Ih86hzOtXVc -US4cK38acijnALXRdMbX5J+tB5O2UzU1/Dfkw/ZdFr4hc96SCvigY2q8lpJqPvi8 -ZVWb3vUNiSYE/CUapiVpy8JtynziWV+XrOvvLsi81xtZPCvM8hnIk2snYxnP/Okm -+Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4sbE6x/c+cCbqi -M+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV -HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4G -A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGV -cpNxJK1ok1iOMq8bs3AD/CUrdIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBc -Hadm47GUBwwyOabqG7B52B2ccETjit3E+ZUfijhDPwGFpUenPUayvOUiaPd7nNgs -PgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAslu1OJD7OAUN5F7kR/ -q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjqerQ0 -cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jr -a6x+3uxjMxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90I -H37hVZkLId6Tngr75qNJvTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/Y -K9f1JmzJBjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtu -nLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktuf -oYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShY -Ic2wBlX7Jz9TkHCpBB5XJ7k= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQEL -BQAwUTELMAkGA1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd2EgSXpiYSBSb3psaWN6 -ZW5pb3dhIFMuQS4xGDAWBgNVBAMMD1NaQUZJUiBST09UIENBMjAeFw0xNTEwMTkw -NzQzMzBaFw0zNTEwMTkwNzQzMzBaMFExCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9L -cmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRgwFgYDVQQDDA9TWkFGSVIg -Uk9PVCBDQTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5QqEvN -QLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT -3PSQ1hNKDJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw -3gAeqDRHu5rr/gsUvTaE2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr6 -3fE9biCloBK0TXC5ztdyO4mTp4CEHCdJckm1/zuVnsHMyAHs6A6KCpbns6aH5db5 -BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwiieDhZNRnvDF5YTy7ykHN -XGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD -AgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsF -AAOCAQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw -8PRBEew/R40/cof5O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOG -nXkZ7/e7DDWQw4rtTw/1zBLZpD67oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCP -oky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul4+vJhaAlIDf7js4MNIThPIGy -d05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6+/NNIxuZMzSg -LvWpCz/UXeHPhJ/iGcJfitYgHuNztw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr -MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG -A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0 -MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp -Y2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD -QTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz -i1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8 -h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV -MdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9 -UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni -8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC -h8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD -VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB -AKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm -KbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ -X5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr -QbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5 -pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN -QSdJQO7e5iNEOdyhIta6A/I= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI -MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x -FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz -MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv -cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz -Zum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO -0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao -wW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj -7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS -8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT -BgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB -/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg -JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC -NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3 -6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/ -3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm -D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS -CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR -3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK -MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x -GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx -MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg -Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ -iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa -/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ -jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI -HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7 -sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w -gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw -KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG -AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L -URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO -H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm -I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY -iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc -f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl -MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe -U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX -DTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy -dXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj -YXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV -OVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr -zbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM -VAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ -hNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO -ojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw -awNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs -OPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 -DQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF -coJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc -okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8 -t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy -1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/ -SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY -MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t -dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5 -WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD -VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8 -9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ -DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9 -Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N -QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ -xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G -A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T -AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG -kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr -Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5 -Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU -JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot -RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP -MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx -MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV -BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o -Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt -5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s -3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej -vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu -8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw -DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG -MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil -zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/ -3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD -FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6 -Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2 -ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJO -TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFh -dCBkZXIgTmVkZXJsYW5kZW4gRVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0y -MjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIg -TmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRlcmxhbmRlbiBFViBS -b290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkkSzrS -M4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nC -UiY4iKTWO0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3d -Z//BYY1jTw+bbRcwJu+r0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46p -rfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13l -pJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gVXJrm0w912fxBmJc+qiXb -j5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr08C+eKxC -KFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS -/ZbV0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0X -cgOPvZuM5l5Tnrmd74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH -1vI4gnPah1vlPNOePqc7nvQDs/nxfRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrP -px9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB -/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwaivsnuL8wbqg7 -MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI -eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u -2dfOWBfoqSmuc0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHS -v4ilf0X8rLiltTMMgsT7B/Zq5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTC -wPTxGfARKbalGAKb12NMcIxHowNDXLldRqANb/9Zjr7dn3LDWyvfjFvO5QxGbJKy -CqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tNf1zuacpzEPuKqf2e -vTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi5Dp6 -Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIa -Gl6I6lD4WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeL -eG9QgkRQP2YGiqtDhFZKDyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8 -FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGyeUN51q1veieQA6TqJIc/2b3Z6fJfUEkc -7uzXLg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO -TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh -dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oX -DTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl -ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv -b3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ5291 -qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8Sp -uOUfiUtnvWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPU -Z5uW6M7XxgpT0GtJlvOjCwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvE -pMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiile7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp -5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCROME4HYYEhLoaJXhena/M -UGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpICT0ugpTN -GmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy -5V6548r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv -6q012iDTiIJh8BIitrzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEK -eN5KzlW/HdXZt1bv8Hb/C3m1r737qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6 -B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMBAAGjgZcwgZQwDwYDVR0TAQH/ -BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcCARYxaHR0cDov -L3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqG -SIb3DQEBCwUAA4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLyS -CZa59sCrI2AGeYwRTlHSeYAz+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen -5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwjf/ST7ZwaUb7dRUG/kSS0H4zpX897 -IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaNkqbG9AclVMwWVxJK -gnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfkCpYL -+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxL -vJxxcypFURmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkm -bEgeqmiSBeGCc1qb3AdbCG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvk -N1trSt8sV4pAWja63XVECDdCcAz+3F4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FC -Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z -ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO -TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh -dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloX -DTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl -ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv -b3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4yolQP -cPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WW -IkYFsO2tx1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqX -xz8ecAgwoNzFs21v0IJyEavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFy -KJLZWyNtZrVtB0LrpjPOktvA9mxjeM3KTj215VKb8b475lRgsGYeCasH/lSJEULR -9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUurmkVLoR9BvUhTFXFkC4az -5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU51nus6+N8 -6U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7 -Ngzp07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHP -bMk7ccHViLVlvMDoFxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXt -BznaqB16nzaeErAMZRKQFWDZJkBE41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTt -XUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMBAAGjQjBAMA8GA1UdEwEB/wQF -MAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleuyjWcLhL75Lpd -INyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD -U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwp -LiniyMMB8jPqKqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8 -Ipf3YF3qKS9Ysr1YvY2WTxB1v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixp -gZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA8KCWAg8zxXHzniN9lLf9OtMJgwYh -/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b8KKaa8MFSu1BYBQw -0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0rmj1A -fsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq -4BZ+Extq1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR -1VmiiXTTn74eS9fGbbeIJG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/ -QFH1T/U67cjF68IeHRaVesd+QnGTbksVtzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM -94B7IWcnMFk= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl -MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp -U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw -NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE -ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp -ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 -DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf -8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN -+lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 -X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa -K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA -1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G -A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR -zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 -YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD -bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w -DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 -L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D -eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp -VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY -WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT -HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs -ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw -MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 -b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj -aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp -Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg -nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1 -HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N -Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN -dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0 -HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO -BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G -CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU -sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3 -4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg -8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K -pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1 -mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx -EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT -HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs -ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 -MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD -VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy -ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy -dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p -OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2 -8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K -Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe -hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk -6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw -DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q -AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI -bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB -ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z -qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd -iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn -0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN -sSi6 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV -BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln -biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF -MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT -d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC -CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8 -76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+ -bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c -6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE -emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd -MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt -MDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y -MszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y -FGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi -aG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM -gI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB -qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7 -lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn -8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov -L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6 -45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO -UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5 -O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC -bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv -GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a -77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC -hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3 -92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp -Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w -ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt -Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE -BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu -IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow -RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY -U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv -Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br -YT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF -nbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH -6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt -eJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/ -c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ -MoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH -HTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf -jNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6 -5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB -rDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU -F6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c -wpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 -cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB -AHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp -WJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9 -xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ -2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ -IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8 -aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X -em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR -dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/ -OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+ -hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy -tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx -KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd -BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl -YyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgxMDAxMTA0MDE0WhcNMzMxMDAxMjM1 -OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy -aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 -ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUd -AqSzm1nzHoqvNK38DcLZSBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiC -FoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/FvudocP05l03Sx5iRUKrERLMjfTlH6VJi -1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx9702cu+fjOlbpSD8DT6Iavq -jnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGVWOHAD3bZ -wI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGj -QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/ -WSA2AHmgoCJrjNXyYdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhy -NsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPAC -uvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joifsFvHZVw -IEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6 -g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN -9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlP -BSeOE6Fuwg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx -KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd -BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl -YyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1 -OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy -aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 -ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN -8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/ -RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4 -hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5 -ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM -EnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj -QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1 -A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy -WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ -1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30 -6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT -91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml -e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p -TpPDpFQUWw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIx -GDAWBgNVBAcTD0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxp -bXNlbCB2ZSBUZWtub2xvamlrIEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0w -KwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24gTWVya2V6aSAtIEthbXUgU00xNjA0 -BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRpZmlrYXNpIC0gU3Vy -dW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYDVQQG -EwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXll -IEJpbGltc2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklU -QUsxLTArBgNVBAsTJEthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBT -TTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11IFNNIFNTTCBLb2sgU2VydGlmaWthc2kg -LSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr3UwM6q7 -a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y86Ij5iySr -LqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INr -N3wcwv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2X -YacQuFWQfw4tJzh03+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/ -iSIzL+aFCr2lqBs23tPcLG07xxO9WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4f -AJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQUZT/HiobGPN08VFw1+DrtUgxH -V8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL -BQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh -AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPf -IPP54+M638yclNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4 -lzwDGrpDxpa5RXI4s6ehlj2Re37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c -8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0jq5Rm+K37DwhuJi1/FwcJsoz7UMCf -lo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcx -EjAQBgNVBAoTCVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMT -VFdDQSBHbG9iYWwgUm9vdCBDQTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5 -NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQKEwlUQUlXQU4tQ0ExEDAOBgNVBAsT -B1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3QgQ0EwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2CnJfF -10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz -0ALfUPZVr2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfCh -MBwqoJimFb3u/Rk28OKRQ4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbH -zIh1HrtsBv+baz4X7GGqcXzGHaL3SekVtTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc -46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1WKKD+u4ZqyPpcC1jcxkt2 -yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99sy2sbZCi -laLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYP -oA/pyJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQA -BDzfuBSO6N+pjWxnkjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcE -qYSjMq+u7msXi7Kx/mzhkIyIqJdIzshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm -4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB -/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6gcFGn90xHNcgL -1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn -LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WF -H6vPNOw/KP4M8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNo -RI2T9GRwoD2dKAXDOXC4Ynsg/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+ -nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlglPx4mI88k1HtQJAH32RjJMtOcQWh -15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryPA9gK8kxkRr05YuWW -6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3mi4TW -nsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5j -wa19hAM8EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWz -aGHQRiapIVJpLesux+t3zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmy -KwbQBM0= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES -MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU -V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz -WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO -LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm -aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE -AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH -K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX -RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z -rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx -3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq -hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC -MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls -XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D -lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn -aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ -YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/ -MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow -PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB -AJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR -IePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q -gQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy -yhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts -F/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2 -jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx -ls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC -VGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHK -YS1tB6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoH -EgKXTiCQ8P8NHuJBO9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThN -Xo+EHWbNxWCWtFJaBYmOlXqYwZE8lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1Ud -DgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNVHRMEBTADAQH/MDkGBGcqBwAE -MTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg209yewDL7MTqK -UWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ -TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyf -qzvS/3WXy6TjZwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK -ZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE -JPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7 -hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1 -EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm -nD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX -udpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz -ssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe -LMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl -pYYsfPQS ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw -NzEUMBIGA1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJv -b3QgQ0EgdjEwHhcNMDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYD -VQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2 -MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+6yfwIaPzaSZVfp3F -VRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA3GV1 -7CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+X -Z75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+ -/jXh7VB7qTCNGdMJjmhnXb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs -81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxHoLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkm -dtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3F0fUTPHSiXk+TT2YqGHe -Oh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJoWjiUIMu -sDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4 -pgd7gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fs -slESl1MpWtTwEhDcTwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQ -arMCpgKIv7NHfirZ1fpoeDVNAgMBAAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYD -VR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qWDNXr+nuqF+gTEjANBgkqhkiG -9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNmzqjMDfz1mgbl -dxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx -0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1Tj -TQpgcmLNkQfWpb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBed -Y2gea+zDTYa4EzAvXUYNR0PVG6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7 -Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpcc41teyWRyu5FrgZLAMzTsVlQ2jqI -OylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOTJsjrDNYmiLbAJM+7 -vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2qReW -t88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn -HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx -SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIJAISCLF8cYtBAMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYD -VQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEk -MCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U -cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxFzAVBgNVBAMMDlRydXN0Q29y -IEVDQS0xMB4XDTE2MDIwNDEyMzIzM1oXDTI5MTIzMTE3MjgwN1owgZwxCzAJBgNV -BAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQw -IgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRy -dXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0eTEXMBUGA1UEAwwOVHJ1c3RDb3Ig -RUNBLTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPj+ARtZ+odnbb -3w9U73NjKYKtR8aja+3+XzP4Q1HpGjORMRegdMTUpwHmspI+ap3tDvl0mEDTPwOA -BoJA6LHip1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23xFUfJ3zSCNV2HykVh0A5 -3ThFEXXQmqc04L/NyFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmcp0yJF4Ou -owReUoCLHhIlERnXDH19MURB6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/ -wZ0+fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZF -ZtS6mFjBAgMBAAGjYzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAf -BgNVHSMEGDAWgBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/ -MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAQEABT41XBVwm8nHc2Fv -civUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u/ukZMjgDfxT2 -AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F -hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50 -soIipX1TH0XsJ5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BI -WJZpTdwHjFGTot+fDz2LYLSCjaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1Wi -tJ/X5g== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYD -VQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEk -MCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U -cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRydXN0Q29y -IFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkxMjMxMTcyMzE2WjCB -pDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFuYW1h -IENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUG -A1UECwweVHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZU -cnVzdENvciBSb290Q2VydCBDQS0xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAv463leLCJhJrMxnHQFgKq1mqjQCj/IDHUHuO1CAmujIS2CNUSSUQIpid -RtLByZ5OGy4sDjjzGiVoHKZaBeYei0i/mJZ0PmnK6bV4pQa81QBeCQryJ3pS/C3V -seq0iWEk8xoT26nPUu0MJLq5nux+AHT6k61sKZKuUbS701e/s/OojZz0JEsq1pme -9J7+wH5COucLlVPat2gOkEz7cD+PSiyU8ybdY2mplNgQTsVHCJCZGxdNuWxu72CV -EY4hgLW9oHPY0LJ3xEXqWib7ZnZ2+AYfYW0PVcWDtxBWcgYHpfOxGgMFZA6dWorW -hnAbJN7+KIor0Gqw/Hqi3LJ5DotlDwIDAQABo2MwYTAdBgNVHQ4EFgQU7mtJPHo/ -DeOxCbeKyKsZn3MzUOcwHwYDVR0jBBgwFoAU7mtJPHo/DeOxCbeKyKsZn3MzUOcw -DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQAD -ggEBACUY1JGPE+6PHh0RU9otRCkZoB5rMZ5NDp6tPVxBb5UrJKF5mDo4Nvu7Zp5I -/5CQ7z3UuJu0h3U/IJvOcs+hVcFNZKIZBqEHMwwLKeXx6quj7LUKdJDHfXLy11yf -ke+Ri7fc7Waiz45mO7yfOgLgJ90WmMCV1Aqk5IGadZQ1nJBfiDcGrVmVCrDRZ9MZ -yonnMlo2HD6CqFqTvsbQZJG2z9m2GM/bftJlo6bEjhcxwft+dtvTheNYsnd6djts -L1Ac59v2Z3kf9YKVmgenFK+P3CghZwnS1k1aHBkcjndcw5QkPTJrS37UeJSDvjdN -zl/HHk484IkzlQsPpTLWPFp5LBk= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIGLzCCBBegAwIBAgIIJaHfyjPLWQIwDQYJKoZIhvcNAQELBQAwgaQxCzAJBgNV -BAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQw -IgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRy -dXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0eTEfMB0GA1UEAwwWVHJ1c3RDb3Ig -Um9vdENlcnQgQ0EtMjAeFw0xNjAyMDQxMjMyMjNaFw0zNDEyMzExNzI2MzlaMIGk -MQswCQYDVQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEg -Q2l0eTEkMCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYD -VQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRy -dXN0Q29yIFJvb3RDZXJ0IENBLTIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK -AoICAQCnIG7CKqJiJJWQdsg4foDSq8GbZQWU9MEKENUCrO2fk8eHyLAnK0IMPQo+ -QVqedd2NyuCb7GgypGmSaIwLgQ5WoD4a3SwlFIIvl9NkRvRUqdw6VC0xK5mC8tkq -1+9xALgxpL56JAfDQiDyitSSBBtlVkxs1Pu2YVpHI7TYabS3OtB0PAx1oYxOdqHp -2yqlO/rOsP9+aij9JxzIsekp8VduZLTQwRVtDr4uDkbIXvRR/u8OYzo7cbrPb1nK -DOObXUm4TOJXsZiKQlecdu/vvdFoqNL0Cbt3Nb4lggjEFixEIFapRBF37120Hape -az6LMvYHL1cEksr1/p3C6eizjkxLAjHZ5DxIgif3GIJ2SDpxsROhOdUuxTTCHWKF -3wP+TfSvPd9cW436cOGlfifHhi5qjxLGhF5DUVCcGZt45vz27Ud+ez1m7xMTiF88 -oWP7+ayHNZ/zgp6kPwqcMWmLmaSISo5uZk3vFsQPeSghYA2FFn3XVDjxklb9tTNM -g9zXEJ9L/cb4Qr26fHMC4P99zVvh1Kxhe1fVSntb1IVYJ12/+CtgrKAmrhQhJ8Z3 -mjOAPF5GP/fDsaOGM8boXg25NSyqRsGFAnWAoOsk+xWq5Gd/bnc/9ASKL3x74xdh -8N0JqSDIvgmk0H5Ew7IwSjiqqewYmgeCK9u4nBit2uBGF6zPXQIDAQABo2MwYTAd -BgNVHQ4EFgQU2f4hQG6UnrybPZx9mCAZ5YwwYrIwHwYDVR0jBBgwFoAU2f4hQG6U -nrybPZx9mCAZ5YwwYrIwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYw -DQYJKoZIhvcNAQELBQADggIBAJ5Fngw7tu/hOsh80QA9z+LqBrWyOrsGS2h60COX -dKcs8AjYeVrXWoSK2BKaG9l9XE1wxaX5q+WjiYndAfrs3fnpkpfbsEZC89NiqpX+ -MWcUaViQCqoL7jcjx1BRtPV+nuN79+TMQjItSQzL/0kMmx40/W5ulop5A7Zv2wnL -/V9lFDfhOPXzYRZY5LVtDQsEGz9QLX+zx3oaFoBg+Iof6Rsqxvm6ARppv9JYx1RX -CI/hOWB3S6xZhBqI8d3LT3jX5+EzLfzuQfogsL7L9ziUwOHQhQ+77Sxzq+3+knYa -ZH9bDTMJBzN7Bj8RpFxwPIXAz+OQqIN3+tvmxYxoZxBnpVIt8MSZj3+/0WvitUfW -2dCFmU2Umw9Lje4AWkcdEQOsQRivh7dvDDqPys/cA8GiCcjl/YBeyGBCARsaU1q7 -N6a3vLqE6R5sGtRk2tRD/pOLS/IseRYQ1JMLiI+h2IYURpFHmygk71dSTlxCnKr3 -Sewn6EAes6aJInKc9Q0ztFijMDvd1GpUk74aTfOTlPf8hAs/hCBcNANExdqtvArB -As8e5ZTZ845b2EzwnexhF7sUMlQMAimTHpKG9n/v55IFDlndmQguLvqcAFLTxWYp -5KeXRKQOKIETNcX2b2TmQcTVL8w0RSXPQQCWPUouwpaYT05KnJe32x+SMsj/D1Fu -1uwJ ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBF -MQswCQYDVQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQL -ExNUcnVzdGlzIEZQUyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTEx -MzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEc -MBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQRUN+ -AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihH -iTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjj -vSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA -0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlB -OrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/ -BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4E -FgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01 -GX2cGE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmW -zaD+vkAMXBJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4 -1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE -f1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F -jZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN -ZetX2fNXlrtIzYE= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBH -MQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBF -eHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMx -MDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNV -BAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIiMA0GCSqGSIb3DQEB -AQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrsiWog -D4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvS -sPGP2KxFRv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aop -O2z6+I9tTcg1367r3CTueUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dk -sHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR59mzLC52LqGj3n5qiAno8geK+LLNEOfi -c0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH0mK1lTnj8/FtDw5lhIpj -VMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KRel7sFsLz -KuZi2irbWWIQJUoqgQtHB0MGcIfS+pMRKXpITeuUx3BNr2fVUbGAIAEBtHoIppB/ -TuDvB0GHr2qlXov7z1CymlSvw4m6WC31MJixNnI5fkkE/SmnTHnkBVfblLkWU41G -sx2VYVdWf6/wFlthWG82UBEL2KwrlRYaDh8IzTY0ZRBiZtWAXxQgXy0MoHgKaNYs -1+lvK9JKBZP8nm9rZ/+I8U6laUpSNwXqxhaN0sSZ0YIrO7o1dfdRUVjzyAfd5LQD -fwIDAQABo0IwQDAdBgNVHQ4EFgQU2XQ65DA9DfcS3H5aBZ8eNJr34RQwDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBADaN -l8xCFWQpN5smLNb7rhVpLGsaGvdftvkHTFnq88nIua7Mui563MD1sC3AO6+fcAUR -ap8lTwEpcOPlDOHqWnzcSbvBHiqB9RZLcpHIojG5qtr8nR/zXUACE/xOHAbKsxSQ -VBcZEhrxH9cMaVr2cXj0lH2RC47skFSOvG+hTKv8dGT9cZr4QQehzZHkPJrgmzI5 -c6sq1WnIeJEmMX3ixzDx/BR4dxIOE/TdFpS/S2d7cFOFyrC78zhNLJA5wA3CXWvp -4uXViI3WLL+rG761KIcSF3Ru/H38j9CHJrAb+7lsq+KePRXBOy5nAliRn+/4Qh8s -t2j1da3Ptfb/EX3C8CSlrdP6oDyp+l3cpaDvRKS+1ujl5BOWF3sGPjLtx7dCvHaj -2GU4Kzg1USEODm8uNBNA4StnDG1KQTAYI1oyVZnJF+A83vbsea0rWBmirSwiGpWO -vpaQXUJXxPkUAzUrHC1RVwinOt4/5Mi0A3PCwSaAuwtCH60NryZy2sy+s6ODWA2C -xR9GUeOcGMyNm43sSet1UNWMKFnKdDTajAshqx7qG+XH/RU+wBeq+yNuJkbL+vmx -cmtpzyKEC2IPrNkZAJSidjzULZrtBJ4tBmIQN1IchXIbJ+XMxjHsN+xjWZsLHXbM -fjKaiJUINlK73nZfdklJrX+9ZSCyycErdhh2n1ax ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9 -MQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBH -bG9iYWwgRzIgUm9vdDAeFw0xNjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0x -CzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlUcnVzdDEbMBkGA1UEAwwSVUNBIEds -b2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxeYr -b3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmToni9 -kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzm -VHqUwCoV8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/R -VogvGjqNO7uCEeBHANBSh6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDc -C/Vkw85DvG1xudLeJ1uK6NjGruFZfc8oLTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIj -tm+3SJUIsUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/R+zvWr9LesGtOxdQXGLY -D0tK3Cv6brxzks3sx1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBeKW4bHAyv -j5OJrdu9o54hyokZ7N+1wxrrFv54NkzWbtA+FxyQF2smuvt6L78RHBgOLXMDj6Dl -NaBa4kx1HXHhOThTeEDMg5PXCp6dW4+K5OXgSORIskfNTip1KnvyIvbJvgmRlld6 -iIis7nCs+dwp4wwcOxJORNanTrAmyPPZGpeRaOrvjUYG0lZFWJo8DA+DuAUlwznP -O6Q0ibd5Ei9Hxeepl2n8pndntd978XplFeRhVmUCAwEAAaNCMEAwDgYDVR0PAQH/ -BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFIHEjMz15DD/pQwIX4wV -ZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo5sOASD0Ee/oj -L3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg5 -1eRfB70VVJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl -1qnN3e92mI0ADs0b+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oU -b3n09tDh05S60FdRvScFDcH9yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LV -PtateJLbXDzz2K36uGt/xDYotgIVilQsnLAXc47QN6MUPJiVAAwpBVueSUmxX8fj -y88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67XhJ/UQqAHojhJi6IjMtX9Gl8Cb -EGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWkoaY/X5V+tBIZkbxqg -DMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI -+Vg7RE+xygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGy -YiGqhkCyLmTTX8jjfhFnRR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bX -UB+K+wb1whnw0A== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDEL -MAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNl -eSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMT -JVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMjAx -MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT -Ck5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVUaGUg -VVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlm -aWNhdGlvbiBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqflo -I+d61SRvU8Za2EurxtW20eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinng -o4N+LZfQYcTxmdwlkWOrfzCjtHDix6EznPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0G -A1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNVHQ8BAf8EBAMCAQYwDwYD -VR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBBHU6+4WMB -zzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbW -RNZu9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB -iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl -cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV -BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw -MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV -BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU -aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy -dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK -AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B -3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY -tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/ -Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O+T23LLb2 -VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT -79uq/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6 -c0Plfg6lZrEpfDKEY1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmT -Yo61Zs8liM2EuLE/pDkP2QKe6xJMlXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97l -c6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8yexDJtC/QV9AqURE9JnnV4ee -UB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+eLf8ZxXhyVeE -Hg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd -BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8G -A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPF -Up/L+M+ZBn8b2kMVn54CVVeWFPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KO -VWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ7l8wXEskEVX/JJpuXior7gtNn3/3 -ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQEg9zKC7F4iRO/Fjs -8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR -iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze -Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ -XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/ -qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB -VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB -L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG -jjxDah2nGN59PRbxYvnKkKj9 ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp -U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y -aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp -U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg -SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln -biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm -GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve -fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw -AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ -aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj -aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW -kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC -4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga -FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW -ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW -ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp -U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y -aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 -nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex -t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz -SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG -BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ -rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ -NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E -BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH -BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv -MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE -p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y -5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK -WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ -4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N -hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB -vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL -ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp -U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W -ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe -Fw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX -MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0 -IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y -IGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh -bCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF -9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH -H26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H -LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN -/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT -rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw -WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs -exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud -DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4 -sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+ -seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz -4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+ -BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR -lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3 -7M2CYfE45k+XmCpajQ== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl -cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu -LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT -aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD -VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT -aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ -bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu -IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b -N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t -KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu -kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm -CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ -Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu -imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te -2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe -DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p -F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt -TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB -gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk -MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY -UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx -NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 -dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy -dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 -38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP -KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q -DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 -qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa -JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi -PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P -BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs -jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 -eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD -ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR -vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa -IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy -i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ -O+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT -AlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD -QTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP -MREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC -ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do -0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ -UySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d -RdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ -OA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv -JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C -AwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O -BBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ -LjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY -MnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ -44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I -Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw -i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN -9u6wWk5JRFRYX0KD ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe -MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0 -ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe -Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw -IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL -SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF -AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH -SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh -ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X -DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1 -TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ -fzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA -sgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU -WH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS -nT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH -dmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip -NiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC -AwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF -MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH -ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB -uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl -PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP -JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/ -gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2 -j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6 -5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB -o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS -/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z -Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE -W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D -hNQ+IIX3Sj0rnP0qCglN6oH4EZw= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQG -EwJVUzETMBEGA1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMx -IDAeBgNVBAMTF2VtU2lnbiBFQ0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAw -MFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UEBhMCVVMxEzARBgNVBAsTCmVtU2ln -biBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQDExdlbVNpZ24gRUND -IFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd6bci -MK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4Ojavti -sIGJAnB9SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0O -BBYEFPtaSNCAIEDyqOkAB2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB -Af8EBTADAQH/MAoGCCqGSM49BAMDA2gAMGUCMQC02C8Cif22TGK6Q04ThHK1rt0c -3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwUZOR8loMRnLDRWmFLpg9J -0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQG -EwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNo -bm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g -RzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBrMQswCQYDVQQGEwJJ -TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s -b2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMw -djAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0 -WXTsuwYc58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xyS -fvalY8L1X44uT6EYGQIrMgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuB -zhccLikenEhjQjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggq -hkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+DCBeQyh+KTOgNG3qxrdWB -CUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7jHvrZQnD -+JbNR6iC8hZVdyR+EhCVBCyj ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkG -A1UEBhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEg -SW5jMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEMxMB4XDTE4MDIxODE4MzAw -MFoXDTQzMDIxODE4MzAwMFowVjELMAkGA1UEBhMCVVMxEzARBgNVBAsTCmVtU2ln -biBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQDExNlbVNpZ24gUm9v -dCBDQSAtIEMxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+upufGZ -BczYKCFK83M0UYRWEPWgTywS4/oTmifQz/l5GnRfHXk5/Fv4cI7gklL35CX5VIPZ -HdPIWoU/Xse2B+4+wM6ar6xWQio5JXDWv7V7Nq2s9nPczdcdioOl+yuQFTdrHCZH -3DspVpNqs8FqOp099cGXOFgFixwR4+S0uF2FHYP+eF8LRWgYSKVGczQ7/g/IdrvH -GPMF0Ybzhe3nudkyrVWIzqa2kbBPrH4VI5b2P/AgNBbeCsbEBEV5f6f9vtKppa+c -xSMq9zwhbL2vj07FOrLzNBL834AaSaTUqZX3noleoomslMuoaJuvimUnzYnu3Yy1 -aylwQ6BpC+S5DwIDAQABo0IwQDAdBgNVHQ4EFgQU/qHgcB4qAzlSWkK+XJGFehiq -TbUwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL -BQADggEBAMJKVvoVIXsoounlHfv4LcQ5lkFMOycsxGwYFYDGrK9HWS8mC+M2sO87 -/kOXSTKZEhVb3xEp/6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4 -kqNPEjE2NuLe/gDEo2APJ62gsIq1NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrG -YQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9wC68AivTxEDkigcxHpvOJpkT -+xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQBmIMMMAVSKeo -WXzhriKi4gp6D/piq1JM4fHfyr6DDUI= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYD -VQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBU -ZWNobm9sb2dpZXMgTGltaXRlZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBH -MTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgxODMwMDBaMGcxCzAJBgNVBAYTAklO -MRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVkaHJhIFRlY2hub2xv -Z2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQz -f2N4aLTNLnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO -8oG0x5ZOrRkVUkr+PHB1cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aq -d7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHWDV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhM -tTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ6DqS0hdW5TUaQBw+jSzt -Od9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrHhQIDAQAB -o0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQD -AgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31x -PaOfG1vR2vjTnGs2vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjM -wiI/aTvFthUvozXGaCocV685743QNcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6d -GNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q+Mri/Tm3R7nrft8EI6/6nAYH -6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeihU80Bv2noWgby -RQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx -iN66zB+Afko= ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB -qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf -Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw -MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV -BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw -NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j -LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG -A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs -W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta -3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk -6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6 -Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J -NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA -MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP -r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU -DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz -YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX -xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2 -/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ -LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 -jVaMaA== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp -IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi -BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw -MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh -d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig -YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v -dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/ -BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6 -papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K -DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3 -KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox -XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB -rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf -Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw -MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV -BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa -Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl -LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u -MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl -ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm -gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8 -YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf -b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9 -9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S -zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk -OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV -HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA -2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW -oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu -t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c -KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM -m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu -MdRAGmI0Nj81Aa6sY6A= ------END CERTIFICATE----- - diff --git a/gateway/enforcer/resources/security/mg.key b/gateway/enforcer/resources/security/mg.key deleted file mode 100644 index 9b50e3d692..0000000000 --- a/gateway/enforcer/resources/security/mg.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDy+N4fNGG+l8zK -y2dw+csFbL+3kXd4LFtwtt26BafN+ciBpXpNaeo8FRqAkEqnNFmzgD1CNr9mtJUm -NixsBHMJL+qJanQJ3CSqfpkJemZul+Nico5Grw3wz7NZpJlhs29YnmhI7iQf4spb -M4NoV5vBMkGmxHW8KEcf3l2jEW5SOJlqKxVpCBQnp2tF2UO0ian2v0QBffphE65g -U+gQly+wfj+64BHoKUnXZETcz5g3g1OLXBpU28ZvPjeg2uk/LtJeCmLOKeDFIYyo -jpZTbKxGaT9/0AuCI8ikUOm5+IJNhohxFP5hxTKn2cwOVNGyQy4P51DWx0k5rXU/ -/Iyz6CV9AgMBAAECggEARjUFMe0X5VPFuD+IF0wGjv26dBeTduUSUwJ0FUF3GHx5 -pISlT2MwbMYIT2fiOmhVFxoSGWTqb4n0owL6WQf8GYZ/9c8N0p+K9Lz6CZQVrxUy -fgrt85y3oYLSpy95ppKLtQaoyZIOXCxTHoFHEkpmVi/oaoDQKFtXGe1OD0WFJDpo -bRkAHfgGLPfhINiuN6VKzTmIDBKIqnMQa95BOJxDJD2S3Swcco8dDFkVuOz5SGvf -Nk66Lk76bUYMw5FMCAVcaEFNntCmyyPeZc0uNlyM6rfEDi86lMmNmgiId1yvHx++ -YS8azL6i+H8r6+FQ+Ek907eVmLSTh8oUXP0DZgrbYQKBgQD8v08nsybyRwu50v/Y -VMg7gp7UlkctIE/znwGlgSNecGr95WLOrBj/h5WQpPUmshHlVNRDOPtLGTIHkCVY -HuR1mPOaq5ndIHa1CTy++JI0U93tVwUMhZfYAZimXpXvOibG5zFr1SQIPFvYX2s0 -21Vv9Wa+tk6zWsuuK/42QLXyhQKBgQD2GVqGx+y6sNHK/SH473o8qHBW5s5SHPUr -HzY1OCueTkYEi2GU9V4mD/ijL0ljFAHXFlEcWaeBPYTCQnTfa8k6UP72vsddQp9G -1H5icINkXnd+CoVrYLCfu6Hv8v47zYMgjDUkszEkRGUBLIzkJ7LsCjvhB8wj4Kvx -4+qmRqmkmQKBgQCSLtBIZO0EuiTFEI3bgIXjLZRR3q1CI2s6u9/G6t8bEyg+uzqf -0JgQy0mtREtqWxnQq3StgLqPX/44s511z0BR5+oVrmSqqckewj35MmnVjCBS0r7f -1DDTxXCV4SUVHWwqJLPH65oQjWCNz/qAss9ClwwbB/SS9dPSZC1/EYRqxQKBgQCF -lpesaCQZ51fKf4QMdDp/aNOqaJmAu1Vedg/f7cDHqyeY2ew7hsH3mV3XfxiwHrEt -B2E6KXSi1DkXlimJCiJudH8ig8cG2d5J/ZkpaHf6aMkmcyGfexoFaz3pWZcl8VYH -ufQzGs5HKJVHgN5uDxqxxJBig/ANXa0YnibG4b6+qQKBgQDipgZwO3GnCWcsPxCn -QAiSHAHl75XrCQBSqOMQQtltGkdcQOiY/6+tkv3Wur2vId++WfpwVgJDeMZuq+65 -eS9Epx2zxaD683CMrClNksMZngwesd0NQK7N47md+Y5FxkSp/uFr1caNWFs2KTEb -QNWf4hw/EgLoXoiMtwcVkl/VIA== ------END PRIVATE KEY----- diff --git a/gateway/enforcer/resources/security/mg.pem b/gateway/enforcer/resources/security/mg.pem deleted file mode 100644 index 379bbfb610..0000000000 --- a/gateway/enforcer/resources/security/mg.pem +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDfjCCAmagAwIBAgIJAL3QoktVCX2SMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV -BAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsG -A1UECgwEV1NPMjENMAsGA1UECwwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MB4X -DTIxMDEzMTE3NTIzNVoXDTMxMDEyOTE3NTIzNVowZDELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MQ0wCwYDVQQKDARXU08y -MQ0wCwYDVQQLDARXU08yMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQDy+N4fNGG+l8zKy2dw+csFbL+3kXd4LFtwtt26 -BafN+ciBpXpNaeo8FRqAkEqnNFmzgD1CNr9mtJUmNixsBHMJL+qJanQJ3CSqfpkJ -emZul+Nico5Grw3wz7NZpJlhs29YnmhI7iQf4spbM4NoV5vBMkGmxHW8KEcf3l2j -EW5SOJlqKxVpCBQnp2tF2UO0ian2v0QBffphE65gU+gQly+wfj+64BHoKUnXZETc -z5g3g1OLXBpU28ZvPjeg2uk/LtJeCmLOKeDFIYyojpZTbKxGaT9/0AuCI8ikUOm5 -+IJNhohxFP5hxTKn2cwOVNGyQy4P51DWx0k5rXU//Iyz6CV9AgMBAAGjMzAxMC8G -A1UdEQQoMCaCB2FkYXB0ZXKCCGVuZm9yY2VyggZyb3V0ZXKCCWxvY2FsaG9zdDAN -BgkqhkiG9w0BAQsFAAOCAQEAkiyYt+0fp8cs9oa2HVU/NfImlzQMBV0S+M3DFlp6 -4egLWbDXM9k5GecrlU2bY3uO2uMT9jzWJ7GU1fuJtAIDQpURruhoXqiuQf3z0Q6O -XlJUWNRiUaYyhMBCK3ekmxrTKkgwTdzHZPeE3w2DH8p6n57aPE6BcarKO7BXBDD0 -vlwjkC6ns9+Ppje2bYxR2BPA6LkqZeyfyZcpPNy4NTN66LA+UQEizUMetGahpSph -5NQeIFg8S49blFVlucXKFLtAJQX2UbDuLLjhCdHuop00lY7sbrK6vrywtrt12hzu -zwNdwKMiCUw14oC7A2ZfhA5PEiObEtR0J+mPhnLGGVMG4w== ------END CERTIFICATE----- diff --git a/gateway/enforcer/settings.gradle b/gateway/enforcer/settings.gradle deleted file mode 100644 index f838896316..0000000000 --- a/gateway/enforcer/settings.gradle +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -rootProject.name = 'enforcer-parent' - include(':org.wso2.apk.enforcer') - include(':org.wso2.apk.enforcer.commons') - include(':resources') - include(':org.wso2.apk.enforcer.analytics.publishers') - -dependencyResolutionManagement { - versionCatalogs { - libs { - from(files("$rootDir/../../libs.versions.toml")) - } - } -}