From a2f03c60dabcb06b8d1769a7ac51c06798822ba4 Mon Sep 17 00:00:00 2001 From: akshay196-rafay <93963751+akshay196-rafay@users.noreply.github.com> Date: Wed, 23 Feb 2022 11:18:49 +0530 Subject: [PATCH] Authentication interceptor (#14) Changes in this PR include - Authenticate gRPC requests - Initial file structure for authentication and authorization service - Use Auth middleware and interceptor service in usermgmt component - Authenticate HTTP request based on Kratos API token - Add Auth middleware to adminsrv component - Name the Grpc metadata fields - Maintain session data after authentication - Removed http middleware as it is not necessary - Exclude rpc methods from authentication - Handle error in auth interceptor - Revert to with cancel context - Log authentication failed requests and New function in authv3 - Initiate authContext struct in authv3 package using new public - function NewAuthContext. --- components/adminsrv/go.mod | 179 +- components/adminsrv/go.sum | 76 +- components/adminsrv/main.go | 18 +- components/common/buf.gen.yaml | 2 + .../gen/openapi/pkg/auth/v3/auth.swagger.json | 63 +- .../openapi/proto/rpc/v3/auth.swagger.json | 224 +++ .../proto/types/commonpb/v3/auth.swagger.json | 43 + components/common/go.mod | 53 +- components/common/go.sum | 80 +- .../common/pkg/auth/interceptors/auth.go | 356 ---- .../common/pkg/auth/interceptors/auth_test.go | 19 - components/common/pkg/auth/v3/auth.go | 51 + components/common/pkg/auth/v3/auth.pb.go | 1645 ----------------- components/common/pkg/auth/v3/auth.proto | 140 -- components/common/pkg/auth/v3/auth_grpc.pb.go | 175 -- components/common/pkg/auth/v3/interceptor.go | 72 + components/common/pkg/auth/v3/middleware.go | 43 + components/common/pkg/auth/v3/pool.go | 7 +- components/common/pkg/auth/v3/service.go | 66 + components/common/pkg/auth/v3/session.go | 20 + components/common/pkg/gateway/annotator.go | 40 +- components/common/pkg/gateway/gateway.go | 2 - components/common/proto/rpc/v3/auth.pb.go | 91 + components/common/proto/rpc/v3/auth.proto | 10 + .../common/proto/rpc/v3/auth_grpc.pb.go | 104 ++ .../common/proto/types/commonpb/v3/auth.pb.go | 1041 +++++++++++ .../common/proto/types/commonpb/v3/auth.proto | 78 + components/usermgmt/go.mod | 38 +- components/usermgmt/go.sum | 87 +- components/usermgmt/main.go | 27 +- 30 files changed, 2146 insertions(+), 2704 deletions(-) create mode 100644 components/common/gen/openapi/proto/rpc/v3/auth.swagger.json create mode 100644 components/common/gen/openapi/proto/types/commonpb/v3/auth.swagger.json delete mode 100644 components/common/pkg/auth/interceptors/auth.go delete mode 100644 components/common/pkg/auth/interceptors/auth_test.go create mode 100644 components/common/pkg/auth/v3/auth.go delete mode 100644 components/common/pkg/auth/v3/auth.pb.go delete mode 100644 components/common/pkg/auth/v3/auth.proto delete mode 100644 components/common/pkg/auth/v3/auth_grpc.pb.go create mode 100644 components/common/pkg/auth/v3/interceptor.go create mode 100644 components/common/pkg/auth/v3/middleware.go create mode 100644 components/common/pkg/auth/v3/service.go create mode 100644 components/common/pkg/auth/v3/session.go create mode 100644 components/common/proto/rpc/v3/auth.pb.go create mode 100644 components/common/proto/rpc/v3/auth.proto create mode 100644 components/common/proto/rpc/v3/auth_grpc.pb.go create mode 100644 components/common/proto/types/commonpb/v3/auth.pb.go create mode 100644 components/common/proto/types/commonpb/v3/auth.proto diff --git a/components/adminsrv/go.mod b/components/adminsrv/go.mod index 5d12805..f623fb4 100644 --- a/components/adminsrv/go.mod +++ b/components/adminsrv/go.mod @@ -4,126 +4,125 @@ go 1.17 require ( github.com/RafaySystems/rcloud-base/components/common v0.0.0-unpublished + github.com/dgraph-io/ristretto v0.1.0 github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.3.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 + github.com/pkg/errors v0.9.1 + github.com/rs/xid v1.3.0 + github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 + github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 github.com/spf13/viper v1.10.1 - github.com/uptrace/bun v1.0.21 + github.com/uptrace/bun v1.0.20 github.com/uptrace/bun/dialect/pgdialect v1.0.20 github.com/uptrace/bun/driver/pgdriver v1.0.20 github.com/uptrace/bun/extra/bundebug v1.0.20 - google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 + google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 - sigs.k8s.io/controller-runtime v0.11.0 -) - -require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/fatih/color v1.13.0 // indirect - github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/go-logr/logr v1.2.0 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.5.7 // indirect - github.com/google/gofuzz v1.1.0 // indirect - github.com/googleapis/gnostic v0.5.5 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/julienschmidt/httprouter v1.3.0 // indirect - github.com/magiconair/properties v1.8.5 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml v1.9.4 // indirect - github.com/processout/grpc-go-pool v1.2.1 // indirect - github.com/prometheus/client_golang v1.11.0 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.28.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect - github.com/rs/xid v1.3.0 - github.com/segmentio/asm v1.1.3 // indirect - github.com/segmentio/encoding v0.3.3 // indirect - github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 - github.com/speps/go-hashids v2.0.0+incompatible // indirect - github.com/spf13/afero v1.6.0 // indirect - github.com/spf13/cast v1.4.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.2.0 // indirect - github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect - github.com/valyala/fastjson v1.6.3 // indirect - github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect - github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.20.0 // indirect - golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect - golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect - golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.66.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/apiextensions-apiserver v0.23.2 // indirect - k8s.io/apimachinery v0.23.2 // indirect - k8s.io/component-base v0.23.2 // indirect - k8s.io/klog v1.0.0 // indirect - k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26 // indirect - k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect - mellium.im/sasl v0.2.1 // indirect - sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect - sigs.k8s.io/kustomize/pseudo/k8s v0.1.0 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect -) - -require ( - github.com/dgraph-io/ristretto v0.1.0 - github.com/pkg/errors v0.9.1 - github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 - k8s.io/api v0.23.2 - k8s.io/client-go v0.23.2 - sigs.k8s.io/yaml v1.3.0 + k8s.io/api v0.23.4 + k8s.io/client-go v0.23.4 + sigs.k8s.io/controller-runtime v0.11.1 ) require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/dustin/go-humanize v1.0.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/go-logr/logr v1.2.0 // indirect github.com/go-openapi/analysis v0.20.1 // indirect github.com/go-openapi/errors v0.20.2 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.6 // indirect github.com/go-openapi/loads v0.21.0 // indirect - github.com/go-openapi/runtime v0.21.1 // indirect + github.com/go-openapi/runtime v0.23.0 // indirect github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/strfmt v0.21.1 // indirect + github.com/go-openapi/strfmt v0.21.2 // indirect github.com/go-openapi/swag v0.19.15 // indirect github.com/go-openapi/validate v0.20.3 // indirect github.com/go-stack/stack v1.8.0 // indirect github.com/golang/glog v1.0.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/google/go-cmp v0.5.6 // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/googleapis/gnostic v0.5.5 // indirect + github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/mailru/easyjson v0.7.6 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.28.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/speps/go-hashids v2.0.0+incompatible // indirect + github.com/valyala/fastjson v1.6.3 // indirect go.mongodb.org/mongo-driver v1.7.5 // indirect + golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect + golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect + gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + k8s.io/apiextensions-apiserver v0.23.4 // indirect + k8s.io/apimachinery v0.23.4 // indirect + k8s.io/component-base v0.23.4 // indirect + k8s.io/klog v1.0.0 // indirect + k8s.io/klog/v2 v2.30.0 // indirect + k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect + k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect + sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect + sigs.k8s.io/kustomize/pseudo/k8s v0.1.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect +) + +require ( + github.com/fatih/color v1.13.0 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/klauspost/cpuid/v2 v2.0.6 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/ory/kratos-client-go v0.8.2-alpha.1 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/processout/grpc-go-pool v1.2.1 // indirect + github.com/segmentio/asm v1.1.0 // indirect + github.com/segmentio/encoding v0.3.2 // indirect + github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect + github.com/urfave/negroni v1.0.0 // indirect + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + go.uber.org/zap v1.19.1 // indirect + golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect + golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect + golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/appengine v1.6.7 // indirect + gopkg.in/ini.v1 v1.66.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + mellium.im/sasl v0.2.1 // indirect + sigs.k8s.io/yaml v1.3.0 ) replace github.com/RafaySystems/rcloud-base/components/common v0.0.0-unpublished => ../common/ diff --git a/components/adminsrv/go.sum b/components/adminsrv/go.sum index d565f01..7906a80 100644 --- a/components/adminsrv/go.sum +++ b/components/adminsrv/go.sum @@ -272,8 +272,8 @@ github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29g github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/runtime v0.21.1 h1:/KIG00BzA2x2HRStX2tnhbqbQdPcFlkgsYCiNY20FZs= -github.com/go-openapi/runtime v0.21.1/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= +github.com/go-openapi/runtime v0.23.0 h1:HX6ET2sHCIvaKeDDQoU01CtO1ekg5EkekHSkLTtWXH0= +github.com/go-openapi/runtime v0.23.0/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= @@ -298,8 +298,8 @@ github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLs github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/strfmt v0.20.2/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1 h1:G6s2t5V5kGCHLVbSdZ/6lI8Wm4OzoPFkc3/cjAsKQrM= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= +github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= @@ -411,9 +411,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -462,8 +461,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 h1:I8MsauTJQXZ8df8qJvEln0kYNc3bSapuaSsEsnFdEFU= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3/go.mod h1:lZdb/YAJUSj9OqrCHs2ihjtoO3+xK3G53wTYXFWRGDo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 h1:I/pwhnUln5wbMnTyRbzswA0/JxpK8sZj0aUfI3TV1So= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2/go.mod h1:lsuH8kb4GlMdSlI4alNIBBSAt5CHJtg3i+0WuN9J5YM= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -531,7 +530,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -541,6 +539,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI= +github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -639,6 +639,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/ory/kratos-client-go v0.8.2-alpha.1 h1:YlKhGOSZjounlB9iY4xSWlqHbyLYkeLzlLk8ZL7/nEM= +github.com/ory/kratos-client-go v0.8.2-alpha.1/go.mod h1:dOQIsar76K07wMPJD/6aMhrWyY+sFGEagLDLso1CpsA= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -702,10 +704,10 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/asm v1.1.3 h1:WM03sfUOENvvKexOLp+pCqgb/WDjsi7EK8gIsICtzhc= -github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg= -github.com/segmentio/encoding v0.3.3 h1:VG1HceOLwHkSDdkxshlu9pD4FftWkScmHc8RDQ+w9uM= -github.com/segmentio/encoding v0.3.3/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM= +github.com/segmentio/asm v1.1.0 h1:fkVr8k5J4sKoFjTGVD6r1yKvDKqmvrEh3K7iyVxgBs8= +github.com/segmentio/asm v1.1.0/go.mod h1:4EUJGaKsB8ImLUwOGORVsNd9vTRDeh44JGsY4aKp5I4= +github.com/segmentio/encoding v0.3.2 h1:gkXXteOfNaPPlrXTEf/e5tWvaQGVJWnvT3LqMzUeH7U= +github.com/segmentio/encoding v0.3.2/go.mod h1:waft2p6XI4z2pk07M0YzZV4wEiqaRvsBSyWNHxVx4gU= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= @@ -770,15 +772,16 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1 github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/uptrace/bun v1.0.20 h1:/T4p9C9tEN75U3cFMBr5njlP+rBfs4An8BmlQQPbcfE= github.com/uptrace/bun v1.0.20/go.mod h1:Uv7z0z+7dXnUS9P5hMF0hdiM/4M+xOUHQCrZpyDrpRc= -github.com/uptrace/bun v1.0.21 h1:5ek4bnrEmZo6wvY/RHt1dJNXzOPOnrfJeZMoZfZt9Io= -github.com/uptrace/bun v1.0.21/go.mod h1:u+QsgCgjGFwshy3euGAN1CLEO9RMf42lga5jQ/ezYsc= github.com/uptrace/bun/dialect/pgdialect v1.0.20 h1:1Yajz0M2AhOzvxFEQSAQ8TpqzSRFxYOg+saksIQ0dmU= github.com/uptrace/bun/dialect/pgdialect v1.0.20/go.mod h1:Z2UoOgTKHXgFOuInXsJKkNQJiFIaPkCvsj0EayOI2yk= github.com/uptrace/bun/driver/pgdriver v1.0.20 h1:CEWHL5NS5FQIJAJxY40t0llwe8XxVlsblbgi9Upm0fA= github.com/uptrace/bun/driver/pgdriver v1.0.20/go.mod h1:KAONvCIiI4A6HdMTZ8zCdGxh7P6+23Todz+bL8HRzV4= github.com/uptrace/bun/extra/bundebug v1.0.20 h1:lwuGUMiqujR3NuGDKgJu1j7XL3LsULSv1MDFHlYBAGs= github.com/uptrace/bun/extra/bundebug v1.0.20/go.mod h1:tDoi/zmjHkumthaCujwfI2+mni0G41HfJD4HC2oMdpk= +github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= +github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/fastjson v1.6.3 h1:tAKFnnwmeMGPbwJ7IwxcTPCNr3uIzoIj3/Fh90ra4xc= github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= @@ -846,7 +849,6 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -855,9 +857,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= -go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -985,6 +986,7 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -1092,7 +1094,6 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1301,9 +1302,8 @@ google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q= -google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1391,24 +1391,24 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg= -k8s.io/api v0.23.2 h1:62cpzreV3dCuj0hqPi8r4dyWh48ogMcyh+ga9jEGij4= -k8s.io/api v0.23.2/go.mod h1:sYuDb3flCtRPI8ghn6qFrcK5ZBu2mhbElxRE95qpwlI= +k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= +k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= k8s.io/apiextensions-apiserver v0.23.0/go.mod h1:xIFAEEDlAZgpVBl/1VSjGDmLoXAWRG40+GsWhKhAxY4= -k8s.io/apiextensions-apiserver v0.23.2 h1:N6CIVAhmF0ahgFKUMDdV/AUyckhUb4nIyVPohPtdUPk= -k8s.io/apiextensions-apiserver v0.23.2/go.mod h1:9cs7avT6+GfzbB0pambTvH11wcaR85QQg4ovl9s15UU= +k8s.io/apiextensions-apiserver v0.23.4 h1:AFDUEu/yEf0YnuZhqhIFhPLPhhcQQVuR1u3WCh0rveU= +k8s.io/apiextensions-apiserver v0.23.4/go.mod h1:TWYAKymJx7nLMxWCgWm2RYGXHrGlVZnxIlGnvtfYu+g= k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc= -k8s.io/apimachinery v0.23.2 h1:dBmjCOeYBdg2ibcQxMuUq+OopZ9fjfLIR5taP/XKeTs= -k8s.io/apimachinery v0.23.2/go.mod h1:zDqeV0AK62LbCI0CI7KbWCAYdLg+E+8UXJ0rIz5gmS8= +k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= +k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.23.0/go.mod h1:Cec35u/9zAepDPPFyT+UMrgqOCjgJ5qtfVJDxjZYmt4= -k8s.io/apiserver v0.23.2/go.mod h1:Kdt8gafkPev9Gfh+H6lCPbmRu42f7BfhOfHKKa3dtyU= +k8s.io/apiserver v0.23.4/go.mod h1:A6l/ZcNtxGfPSqbFDoxxOjEjSKBaQmE+UTveOmMkpNc= k8s.io/client-go v0.23.0/go.mod h1:hrDnpnK1mSr65lHHcUuIZIXDgEbzc7/683c6hyG4jTA= -k8s.io/client-go v0.23.2 h1:BNbOcxa99jxHH8mM1cPKGIrrKRnCSAfAtyonYGsbFtE= -k8s.io/client-go v0.23.2/go.mod h1:k3YbsWg6GWdHF1THHTQP88X9RhB1DWPo3Dq7KfU/D1c= +k8s.io/client-go v0.23.4 h1:YVWvPeerA2gpUudLelvsolzH7c2sFoXXR5wM/sWqNFU= +k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= k8s.io/code-generator v0.23.0/go.mod h1:vQvOhDXhuzqiVfM/YHp+dmg10WDZCchJVObc9MvowsE= -k8s.io/code-generator v0.23.2/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= +k8s.io/code-generator v0.23.4/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= k8s.io/component-base v0.23.0/go.mod h1:DHH5uiFvLC1edCpvcTDV++NKULdYYU6pR9Tt3HIKMKI= -k8s.io/component-base v0.23.2 h1:dAYmUhWIBWO762etTjBEEKtYYHi5CoQInSLtK6LM1Zs= -k8s.io/component-base v0.23.2/go.mod h1:wS9Z03MO3oJ0RU8bB/dbXTiluGju+SC/F5i660gxB8c= +k8s.io/component-base v0.23.4 h1:SziYh48+QKxK+ykJ3Ejqd98XdZIseVBG7sBaNLPqy6M= +k8s.io/component-base v0.23.4/go.mod h1:8o3Gg8i2vnUXGPOwciiYlkSaZT+p+7gA9Scoz8y4W4E= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -1420,13 +1420,13 @@ k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26 h1:2G24ndYyfk0l23ZrGutxb0s9TRe4m1ZjFlcu4cEU1zA= -k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= +k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= @@ -1434,8 +1434,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.25/go.mod h1:Mlj9PNLmG9bZ6BHFwFKDo5afkpWyUISkb9Me0GnK66I= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.27/go.mod h1:tq2nT0Kx7W+/f2JVE+zxYtUhdjuELJkVpNz+x/QN5R4= -sigs.k8s.io/controller-runtime v0.11.0 h1:DqO+c8mywcZLFJWILq4iktoECTyn30Bkj0CwgqMpZWQ= -sigs.k8s.io/controller-runtime v0.11.0/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= +sigs.k8s.io/controller-runtime v0.11.1 h1:7YIHT2QnHJArj/dk9aUkYhfqfK5cIxPOX5gPECfdZLU= +sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/kustomize/pseudo/k8s v0.1.0 h1:otg4dLFc03c3gzl+2CV8GPGcd1kk8wjXwD+UhhcCn5I= diff --git a/components/adminsrv/main.go b/components/adminsrv/main.go index 8cb2bf3..fcc5ab8 100644 --- a/components/adminsrv/main.go +++ b/components/adminsrv/main.go @@ -16,7 +16,6 @@ import ( "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/service" adminrpc "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/rpc" "github.com/RafaySystems/rcloud-base/components/adminsrv/server" - "github.com/RafaySystems/rcloud-base/components/common/pkg/auth/interceptors" authv3 "github.com/RafaySystems/rcloud-base/components/common/pkg/auth/v3" "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" "github.com/RafaySystems/rcloud-base/components/common/pkg/grpc" @@ -164,6 +163,7 @@ func setup() { rpcRelayPeeringPort = rpcPort + 1 + // DB setup dsn := "postgres://" + dbUser + ":" + dbPassword + "@" + dbAddr + "/" + dbName + "?sslmode=disable" sqldb := sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(dsn))) db = bun.NewDB(sqldb, pgdialect.New()) @@ -231,6 +231,7 @@ func runAPI(wg *sync.WaitGroup, ctx context.Context) { defer wg.Done() ctx, cancel := context.WithCancel(ctx) defer cancel() + mux := http.NewServeMux() gwHandler, err := gateway.NewGateway( @@ -248,7 +249,6 @@ func runAPI(wg *sync.WaitGroup, ctx context.Context) { if err != nil { _log.Fatalw("unable to create gateway", "error", err) } - mux.Handle("/", gwHandler) s := http.Server{ @@ -261,7 +261,6 @@ func runAPI(wg *sync.WaitGroup, ctx context.Context) { }() _log.Infow("starting gateway server", "port", apiPort) - err = s.ListenAndServe() if err != nil { _log.Fatalw("unable to start gateway", "error", err) @@ -343,18 +342,11 @@ func runRPC(wg *sync.WaitGroup, ctx context.Context) { var opts []_grpc.ServerOption if !dev { + ac := authv3.NewAuthContext() + o := authv3.Option{} opts = append(opts, _grpc.UnaryInterceptor( - interceptors.NewAuthInterceptorWithOptions( - interceptors.WithLogRequest(), - interceptors.WithAuthPool(authPool), - interceptors.WithExclude("POST", "/v2/sentry/bootstrap/:templateToken/register"), - ), + ac.NewAuthUnaryInterceptor(o), )) - defer authPool.Close() - } else { - opts = append(opts, _grpc.UnaryInterceptor( - interceptors.NewAuthInterceptorWithOptions(interceptors.WithDummy())), - ) } s, err := grpc.NewServer(opts...) if err != nil { diff --git a/components/common/buf.gen.yaml b/components/common/buf.gen.yaml index 5d369b7..1753233 100644 --- a/components/common/buf.gen.yaml +++ b/components/common/buf.gen.yaml @@ -8,6 +8,8 @@ managed: - buf.build/grpc-ecosystem/grpc-gateway - buf.build/gogo/protobuf - buf.build/rafay/k8s + override: + buf.build/rafay/common: github.com/RafaySystems/rcloud-base/components/common plugins: - name: go out: . diff --git a/components/common/gen/openapi/pkg/auth/v3/auth.swagger.json b/components/common/gen/openapi/pkg/auth/v3/auth.swagger.json index 1037366..8c471ab 100644 --- a/components/common/gen/openapi/pkg/auth/v3/auth.swagger.json +++ b/components/common/gen/openapi/pkg/auth/v3/auth.swagger.json @@ -44,14 +44,6 @@ } } }, - "v3APIKeyStatus": { - "type": "string", - "enum": [ - "APIKeyNotFound", - "APIKeyExists" - ], - "default": "APIKeyNotFound" - }, "v3AuthType": { "type": "string", "enum": [ @@ -70,37 +62,6 @@ ], "default": "ClientTypeNotSet" }, - "v3GetAPIKeyResponse": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/v3APIKeyStatus" - }, - "reason": { - "type": "string" - }, - "secret": { - "type": "string" - }, - "data": { - "$ref": "#/definitions/v3SessionData" - } - } - }, - "v3GetSessionResponse": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/v3SessionStatus" - }, - "reason": { - "type": "string" - }, - "data": { - "$ref": "#/definitions/v3SessionData" - } - } - }, "v3IsRequestAllowedResponse": { "type": "object", "properties": { @@ -157,11 +118,12 @@ "v3RequestStatus": { "type": "string", "enum": [ - "RequestAllowed", + "Unknown", "RequestNotAuthenticated", - "RequestMethodOrURLNotAllowed" + "RequestMethodOrURLNotAllowed", + "RequestAllowed" ], - "default": "RequestAllowed" + "default": "Unknown" }, "v3ResourceURLMethods": { "type": "object", @@ -172,7 +134,8 @@ "type": "string" } } - } + }, + "title": "Remove unnecessary fields" }, "v3SessionData": { "type": "object", @@ -254,22 +217,8 @@ }, "project": { "$ref": "#/definitions/v3ProjectData" - }, - "isReadonlyOrgAdmin": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } } } - }, - "v3SessionStatus": { - "type": "string", - "enum": [ - "SessionNotFound", - "SessionExists" - ], - "default": "SessionNotFound" } } } diff --git a/components/common/gen/openapi/proto/rpc/v3/auth.swagger.json b/components/common/gen/openapi/proto/rpc/v3/auth.swagger.json new file mode 100644 index 0000000..a5d7b67 --- /dev/null +++ b/components/common/gen/openapi/proto/rpc/v3/auth.swagger.json @@ -0,0 +1,224 @@ +{ + "swagger": "2.0", + "info": { + "title": "proto/rpc/v3/auth.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "Auth" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v3AuthType": { + "type": "string", + "enum": [ + "AuthTypeNotSet", + "SessionLogin", + "APIKey" + ], + "default": "AuthTypeNotSet" + }, + "v3ClientType": { + "type": "string", + "enum": [ + "ClientTypeNotSet", + "BROWSER", + "CLI" + ], + "default": "ClientTypeNotSet" + }, + "v3IsRequestAllowedResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/v3RequestStatus" + }, + "reason": { + "type": "string" + }, + "sessionData": { + "$ref": "#/definitions/v3SessionData" + } + } + }, + "v3NamespaceData": { + "type": "object", + "properties": { + "projectId": { + "type": "string" + }, + "namespaceId": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "v3ProjectData": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/v3ProjectRole" + } + } + } + }, + "v3ProjectRole": { + "type": "object", + "properties": { + "projectId": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "v3RequestStatus": { + "type": "string", + "enum": [ + "Unknown", + "RequestNotAuthenticated", + "RequestMethodOrURLNotAllowed", + "RequestAllowed" + ], + "default": "Unknown" + }, + "v3ResourceURLMethods": { + "type": "object", + "properties": { + "methods": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "Remove unnecessary fields" + }, + "v3SessionData": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "organization": { + "type": "string" + }, + "partner": { + "type": "string" + }, + "role": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "partnerDomain": { + "type": "string" + }, + "username": { + "type": "string" + }, + "isSuperAdmin": { + "type": "boolean" + }, + "isPartnerAdmin": { + "type": "boolean" + }, + "isSsoUser": { + "type": "boolean" + }, + "resourceUrls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v3ResourceURLMethods" + } + }, + "ttl": { + "type": "string" + }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "authType": { + "$ref": "#/definitions/v3AuthType" + }, + "idp": { + "type": "string" + }, + "isOrgAdmin": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "clientType": { + "$ref": "#/definitions/v3ClientType" + }, + "isAllNsAccess": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "namespaces": { + "type": "array", + "items": { + "$ref": "#/definitions/v3NamespaceData" + } + }, + "project": { + "$ref": "#/definitions/v3ProjectData" + } + } + } + } +} diff --git a/components/common/gen/openapi/proto/types/commonpb/v3/auth.swagger.json b/components/common/gen/openapi/proto/types/commonpb/v3/auth.swagger.json new file mode 100644 index 0000000..301055f --- /dev/null +++ b/components/common/gen/openapi/proto/types/commonpb/v3/auth.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "proto/types/commonpb/v3/auth.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/components/common/go.mod b/components/common/go.mod index 1819996..c7220aa 100644 --- a/components/common/go.mod +++ b/components/common/go.mod @@ -2,36 +2,38 @@ module github.com/RafaySystems/rcloud-base/components/common go 1.17 -replace github.com/RafaySystems/rcloud-base/components/common => ./ - require ( + github.com/dgraph-io/ristretto v0.1.0 github.com/evanphx/json-patch v4.12.0+incompatible github.com/go-openapi/errors v0.20.2 - github.com/go-openapi/runtime v0.21.1 - github.com/go-openapi/strfmt v0.21.1 + github.com/go-openapi/runtime v0.23.0 + github.com/go-openapi/strfmt v0.21.2 github.com/go-openapi/swag v0.19.15 github.com/go-openapi/validate v0.20.3 github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.3.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 github.com/json-iterator/go v1.1.12 - github.com/julienschmidt/httprouter v1.3.0 + github.com/ory/kratos-client-go v0.8.2-alpha.1 + github.com/pkg/errors v0.9.1 github.com/processout/grpc-go-pool v1.2.1 - github.com/segmentio/encoding v0.3.3 + github.com/rs/xid v1.3.0 + github.com/segmentio/encoding v0.3.2 github.com/speps/go-hashids v2.0.0+incompatible - github.com/uptrace/bun v1.0.21 + github.com/uptrace/bun v1.0.20 + github.com/urfave/negroni v1.0.0 github.com/valyala/fastjson v1.6.3 - go.uber.org/zap v1.20.0 - google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 + go.uber.org/zap v1.19.1 + google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 - k8s.io/api v0.23.2 - k8s.io/apiextensions-apiserver v0.23.2 - k8s.io/apimachinery v0.23.2 - k8s.io/client-go v0.23.2 - k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26 - sigs.k8s.io/controller-runtime v0.11.0 + k8s.io/api v0.23.4 + k8s.io/apiextensions-apiserver v0.23.4 + k8s.io/apimachinery v0.23.4 + k8s.io/client-go v0.23.4 + k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 + sigs.k8s.io/controller-runtime v0.11.1 sigs.k8s.io/kustomize/pseudo/k8s v0.1.0 sigs.k8s.io/yaml v1.3.0 ) @@ -43,7 +45,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgraph-io/ristretto v0.1.0 + github.com/dustin/go-humanize v1.0.0 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-logr/logr v1.2.0 // indirect github.com/go-openapi/analysis v0.20.1 // indirect @@ -52,14 +54,16 @@ require ( github.com/go-openapi/loads v0.21.0 // indirect github.com/go-openapi/spec v0.20.4 // indirect github.com/go-stack/stack v1.8.0 // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.5.7 // indirect + github.com/google/go-cmp v0.5.6 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/googleapis/gnostic v0.5.5 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect + github.com/klauspost/cpuid/v2 v2.0.6 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect @@ -67,12 +71,11 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.11.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.28.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect - github.com/segmentio/asm v1.1.3 // indirect + github.com/segmentio/asm v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect @@ -91,16 +94,12 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/component-base v0.23.2 // indirect + k8s.io/component-base v0.23.4 // indirect k8s.io/klog v1.0.0 // indirect k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect + k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect ) -require ( - github.com/dustin/go-humanize v1.0.0 // indirect - github.com/golang/glog v1.0.0 // indirect - github.com/rs/xid v1.3.0 -) +replace github.com/RafaySystems/rcloud-base/components/common => ./ diff --git a/components/common/go.sum b/components/common/go.sum index d3153d1..78db7b4 100644 --- a/components/common/go.sum +++ b/components/common/go.sum @@ -138,6 +138,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -248,8 +249,8 @@ github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29g github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/runtime v0.21.1 h1:/KIG00BzA2x2HRStX2tnhbqbQdPcFlkgsYCiNY20FZs= -github.com/go-openapi/runtime v0.21.1/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= +github.com/go-openapi/runtime v0.23.0 h1:HX6ET2sHCIvaKeDDQoU01CtO1ekg5EkekHSkLTtWXH0= +github.com/go-openapi/runtime v0.23.0/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= @@ -274,8 +275,8 @@ github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLs github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/strfmt v0.20.2/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1 h1:G6s2t5V5kGCHLVbSdZ/6lI8Wm4OzoPFkc3/cjAsKQrM= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= +github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= @@ -385,8 +386,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -429,8 +430,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 h1:I8MsauTJQXZ8df8qJvEln0kYNc3bSapuaSsEsnFdEFU= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3/go.mod h1:lZdb/YAJUSj9OqrCHs2ihjtoO3+xK3G53wTYXFWRGDo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 h1:I/pwhnUln5wbMnTyRbzswA0/JxpK8sZj0aUfI3TV1So= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2/go.mod h1:lsuH8kb4GlMdSlI4alNIBBSAt5CHJtg3i+0WuN9J5YM= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -481,7 +482,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -491,6 +491,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI= +github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -572,6 +574,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/ory/kratos-client-go v0.8.2-alpha.1 h1:YlKhGOSZjounlB9iY4xSWlqHbyLYkeLzlLk8ZL7/nEM= +github.com/ory/kratos-client-go v0.8.2-alpha.1/go.mod h1:dOQIsar76K07wMPJD/6aMhrWyY+sFGEagLDLso1CpsA= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -627,10 +631,10 @@ github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/asm v1.1.3 h1:WM03sfUOENvvKexOLp+pCqgb/WDjsi7EK8gIsICtzhc= -github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg= -github.com/segmentio/encoding v0.3.3 h1:VG1HceOLwHkSDdkxshlu9pD4FftWkScmHc8RDQ+w9uM= -github.com/segmentio/encoding v0.3.3/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM= +github.com/segmentio/asm v1.1.0 h1:fkVr8k5J4sKoFjTGVD6r1yKvDKqmvrEh3K7iyVxgBs8= +github.com/segmentio/asm v1.1.0/go.mod h1:4EUJGaKsB8ImLUwOGORVsNd9vTRDeh44JGsY4aKp5I4= +github.com/segmentio/encoding v0.3.2 h1:gkXXteOfNaPPlrXTEf/e5tWvaQGVJWnvT3LqMzUeH7U= +github.com/segmentio/encoding v0.3.2/go.mod h1:waft2p6XI4z2pk07M0YzZV4wEiqaRvsBSyWNHxVx4gU= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -682,8 +686,10 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= -github.com/uptrace/bun v1.0.21 h1:5ek4bnrEmZo6wvY/RHt1dJNXzOPOnrfJeZMoZfZt9Io= -github.com/uptrace/bun v1.0.21/go.mod h1:u+QsgCgjGFwshy3euGAN1CLEO9RMf42lga5jQ/ezYsc= +github.com/uptrace/bun v1.0.20 h1:/T4p9C9tEN75U3cFMBr5njlP+rBfs4An8BmlQQPbcfE= +github.com/uptrace/bun v1.0.20/go.mod h1:Uv7z0z+7dXnUS9P5hMF0hdiM/4M+xOUHQCrZpyDrpRc= +github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= +github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/fastjson v1.6.3 h1:tAKFnnwmeMGPbwJ7IwxcTPCNr3uIzoIj3/Fh90ra4xc= github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= @@ -748,7 +754,6 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -757,9 +762,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= -go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -877,6 +881,7 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -966,7 +971,6 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab h1:rfJ1bsoJQQIAoAxTxB7bme+vHrNkRw8CqfsYh9w54cw= golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1138,8 +1142,8 @@ google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q= -google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1220,24 +1224,24 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg= -k8s.io/api v0.23.2 h1:62cpzreV3dCuj0hqPi8r4dyWh48ogMcyh+ga9jEGij4= -k8s.io/api v0.23.2/go.mod h1:sYuDb3flCtRPI8ghn6qFrcK5ZBu2mhbElxRE95qpwlI= +k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= +k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= k8s.io/apiextensions-apiserver v0.23.0/go.mod h1:xIFAEEDlAZgpVBl/1VSjGDmLoXAWRG40+GsWhKhAxY4= -k8s.io/apiextensions-apiserver v0.23.2 h1:N6CIVAhmF0ahgFKUMDdV/AUyckhUb4nIyVPohPtdUPk= -k8s.io/apiextensions-apiserver v0.23.2/go.mod h1:9cs7avT6+GfzbB0pambTvH11wcaR85QQg4ovl9s15UU= +k8s.io/apiextensions-apiserver v0.23.4 h1:AFDUEu/yEf0YnuZhqhIFhPLPhhcQQVuR1u3WCh0rveU= +k8s.io/apiextensions-apiserver v0.23.4/go.mod h1:TWYAKymJx7nLMxWCgWm2RYGXHrGlVZnxIlGnvtfYu+g= k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc= -k8s.io/apimachinery v0.23.2 h1:dBmjCOeYBdg2ibcQxMuUq+OopZ9fjfLIR5taP/XKeTs= -k8s.io/apimachinery v0.23.2/go.mod h1:zDqeV0AK62LbCI0CI7KbWCAYdLg+E+8UXJ0rIz5gmS8= +k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= +k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.23.0/go.mod h1:Cec35u/9zAepDPPFyT+UMrgqOCjgJ5qtfVJDxjZYmt4= -k8s.io/apiserver v0.23.2/go.mod h1:Kdt8gafkPev9Gfh+H6lCPbmRu42f7BfhOfHKKa3dtyU= +k8s.io/apiserver v0.23.4/go.mod h1:A6l/ZcNtxGfPSqbFDoxxOjEjSKBaQmE+UTveOmMkpNc= k8s.io/client-go v0.23.0/go.mod h1:hrDnpnK1mSr65lHHcUuIZIXDgEbzc7/683c6hyG4jTA= -k8s.io/client-go v0.23.2 h1:BNbOcxa99jxHH8mM1cPKGIrrKRnCSAfAtyonYGsbFtE= -k8s.io/client-go v0.23.2/go.mod h1:k3YbsWg6GWdHF1THHTQP88X9RhB1DWPo3Dq7KfU/D1c= +k8s.io/client-go v0.23.4 h1:YVWvPeerA2gpUudLelvsolzH7c2sFoXXR5wM/sWqNFU= +k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= k8s.io/code-generator v0.23.0/go.mod h1:vQvOhDXhuzqiVfM/YHp+dmg10WDZCchJVObc9MvowsE= -k8s.io/code-generator v0.23.2/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= +k8s.io/code-generator v0.23.4/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= k8s.io/component-base v0.23.0/go.mod h1:DHH5uiFvLC1edCpvcTDV++NKULdYYU6pR9Tt3HIKMKI= -k8s.io/component-base v0.23.2 h1:dAYmUhWIBWO762etTjBEEKtYYHi5CoQInSLtK6LM1Zs= -k8s.io/component-base v0.23.2/go.mod h1:wS9Z03MO3oJ0RU8bB/dbXTiluGju+SC/F5i660gxB8c= +k8s.io/component-base v0.23.4 h1:SziYh48+QKxK+ykJ3Ejqd98XdZIseVBG7sBaNLPqy6M= +k8s.io/component-base v0.23.4/go.mod h1:8o3Gg8i2vnUXGPOwciiYlkSaZT+p+7gA9Scoz8y4W4E= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -1249,20 +1253,20 @@ k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26 h1:2G24ndYyfk0l23ZrGutxb0s9TRe4m1ZjFlcu4cEU1zA= -k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= +k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.25/go.mod h1:Mlj9PNLmG9bZ6BHFwFKDo5afkpWyUISkb9Me0GnK66I= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.27/go.mod h1:tq2nT0Kx7W+/f2JVE+zxYtUhdjuELJkVpNz+x/QN5R4= -sigs.k8s.io/controller-runtime v0.11.0 h1:DqO+c8mywcZLFJWILq4iktoECTyn30Bkj0CwgqMpZWQ= -sigs.k8s.io/controller-runtime v0.11.0/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= +sigs.k8s.io/controller-runtime v0.11.1 h1:7YIHT2QnHJArj/dk9aUkYhfqfK5cIxPOX5gPECfdZLU= +sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/kustomize/pseudo/k8s v0.1.0 h1:otg4dLFc03c3gzl+2CV8GPGcd1kk8wjXwD+UhhcCn5I= diff --git a/components/common/pkg/auth/interceptors/auth.go b/components/common/pkg/auth/interceptors/auth.go deleted file mode 100644 index 766e924..0000000 --- a/components/common/pkg/auth/interceptors/auth.go +++ /dev/null @@ -1,356 +0,0 @@ -package interceptors - -import ( - "context" - "errors" - "fmt" - "net/http" - "strings" - "time" - - authv3 "github.com/RafaySystems/rcloud-base/components/common/pkg/auth/v3" - "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" - "github.com/RafaySystems/rcloud-base/components/common/pkg/hasher" - "github.com/RafaySystems/rcloud-base/components/common/pkg/log" - commonv3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" - "github.com/julienschmidt/httprouter" - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" -) - -var _log = log.GetLogger() - -var _dummyHandler = func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {} - -const ( - cookieHeader = "cookie" - apiKeyHeader = "x-rafay-api-keyid" - rafaySession = "rsid" -) - -func getAPIKey(ctx context.Context) string { - md, ok := metadata.FromIncomingContext(ctx) - if !ok { - return "" - } - apiKeys, ok := md[apiKeyHeader] - if !ok { - return "" - } - return apiKeys[0] -} - -func getRsid(ctx context.Context) string { - //If rsid is present in the header, use it directly - md, ok := metadata.FromIncomingContext(ctx) - if !ok { - return "" - } - _log.Debugw("incoming metadta", "md", md) - //rsid is part of Cookies - cookies, ok := md[cookieHeader] - if !ok { - return "" - } - return readCookies(cookies[0], rafaySession) -} - -func readCookies(cookies, filter string) string { - parts := strings.Split(strings.TrimSpace(cookies), ";") - // Per-line attributes - for i := 0; i < len(parts); i++ { - parts[i] = strings.TrimSpace(parts[i]) - if len(parts[i]) == 0 { - continue - } - name, val := parts[i], "" - if j := strings.Index(name, "="); j >= 0 { - name, val = name[:j], name[j+1:] - } - if filter != "" && filter != name { - continue - } - return val - } - return "" -} - -func allowRequest(ctx context.Context, opts *options, req interface{}) error { - if md, ok := metadata.FromIncomingContext(ctx); ok { - isGateway := func() bool { - if vals := md.Get(gateway.GatewayRequest); vals != nil { - return true - } - return false - } - - url := func() string { - if urls, ok := md[gateway.GatewayURL]; ok { - return urls[0] - } - return "" - } - - rsid := func() string { - if rsids, ok := md[gateway.GatewayRSID]; ok { - return rsids[0] - } - return "" - } - - apiKey := func() string { - if apiKeys, ok := md[gateway.GatewayAPIKey]; ok { - return apiKeys[0] - } - return "" - } - - method := func() string { - if methods, ok := md[gateway.GatewayMethod]; ok { - return methods[0] - } - return "" - } - - excluded := func() bool { - if opts.exclude == nil { - return false - } - - if h, _, _ := opts.exclude.Lookup(method(), url()); h != nil { - return true - } - return false - } - - if opts.logRequest { - _log.Infow("allowRequest", "url", url(), "isGateway", isGateway(), "rsid", rsid(), "apiKey", apiKey(), "method", method(), "excluded", excluded()) - } - - // if request originates from gateway and method and path are not in excluded - if isGateway() && !excluded() { - allowed := func() error { - aCtx, cancel := context.WithTimeout(ctx, time.Second*10) - defer cancel() - - client, err := opts.pool.NewClient(aCtx) - if err != nil { - _log.Infow("unable to get new auth client", "error", err.Error()) - return err - } - defer client.Close() - - resp, err := client.IsRequestAllowed(aCtx, func() *authv3.IsRequestAllowedRequest { - return &authv3.IsRequestAllowedRequest{ - Url: url(), - Method: method(), - Rsid: rsid(), - ApiKey: apiKey(), - } - }()) - if err != nil { - return err - } - - if resp.GetStatus() != authv3.RequestStatus_RequestAllowed { - err = fmt.Errorf("%s", resp.Reason) - return err - } - - if resp.SessionData != nil { - - var partnerID int64 - var organizationID int64 - - if _, ok := req.(commonv3.Metadata); ok { - _log.Debugw("adding request meta") - _, err := hasher.IDFromString(resp.SessionData.Account) - if err != nil { - _log.Infow("unable to convert account id", "accountID", resp.SessionData.Account, "error", err.Error()) - return err - } - partnerID, err = hasher.IDFromString(resp.SessionData.Partner) - if err != nil { - _log.Infow("unable to convert partner id", "partnerID", resp.SessionData.Partner, "error", err.Error()) - return err - } - organizationID, err = hasher.IDFromString(resp.SessionData.Organization) - if err != nil { - _log.Infow("unable to convert organization id", "organizationID", resp.SessionData.Organization, "error", err.Error()) - return err - } - fmt.Println(partnerID) - fmt.Println(organizationID) - /*rmo.SetAccountID(accountID) - rmo.SetPartnerID(partnerID) - rmo.SetOrganizationID(organizationID) - rmo.SetIsSSOUser(resp.SessionData.IsSsoUser) - rmo.SetGroups(resp.SessionData.Groups) - rmo.SetUsername(resp.SessionData.Username) - rmo.SetAuthType(resp.SessionData.AuthType.String()) - rmo.SetClientType(resp.SessionData.ClientType.String()) - rmo.SetIdp(resp.SessionData.Idp) - rmo.SetIsAllNsAccess(resp.SessionData.IsAllNsAccess) - rmo.SetIsOrgAdmin(resp.SessionData.IsOrgAdmin) - rmo.SetIsPartnerAdmin(resp.SessionData.IsPartnerAdmin) - rmo.SetIsSuperAdmin(resp.SessionData.IsSuperAdmin) - rmo.SetNamespaces(authv3.ConvertFromAuthNamespaces(resp.SessionData.Namespaces)) - rmo.SetProject(authv3.ConvertFormAuthProject(resp.SessionData.Project)) - rmo.SetIsReadonlyOrgAdmin(resp.SessionData.IsReadonlyOrgAdmin)*/ - } - } - - return nil - } - - if err := allowed(); err != nil { - return err - } - return nil - } - - } - return nil - -} - -func addRequestMeta(ctx context.Context, pool authv3.AuthPool, req interface{}, validateSession bool) error { - _log.Debugw("adding request meta") - aCtx, cancel := context.WithTimeout(ctx, time.Second*10) - defer cancel() - - client, err := pool.NewClient(aCtx) - if err != nil { - _log.Infow("unable to get new auth client", "error", err.Error()) - return err - } - defer client.Close() - - rsid := getRsid(ctx) - apiKey := getAPIKey(ctx) - - var data *authv3.SessionData - - if rsid != "" { - _log.Debugw("found session", "rsid", rsid) - resp, err := client.GetSession(ctx, &authv3.GetSessionRequest{ - SessionId: rsid, - }) - if err != nil { - _log.Infof("unable to get session for id %s", err.Error()) - return err - } - - if resp.Status == authv3.SessionStatus_SessionExists { - _log.Debugw("session exists", "rsid", rsid) - data = resp.Data - } - } else if apiKey != "" { - resp, err := client.GetAPIKey(ctx, &authv3.GetAPIKeyRequest{ - ApiKey: apiKey, - }) - - if err != nil { - _log.Infow("unable to get api key", "key", apiKey, "error", err) - return err - } - - if resp.Status == authv3.APIKeyStatus_APIKeyExists { - data = resp.Data - } - } - - if data != nil { - _, err := hasher.IDFromString(data.Partner) - if err != nil { - _log.Infow("unable to convert partner id", "partnerID", data.Partner, "error", err.Error()) - return err - } - _, err = hasher.IDFromString(data.Organization) - if err != nil { - _log.Infow("unable to convert organization id", "organizationID", data.Organization, "error", err.Error()) - return err - } - - if _, ok := req.(commonv3.Metadata); ok { - _log.Debugw("adding request meta") - //rmo.SetPartnerID(partnerID) - //rmo.SetOrganizationID(organizationID) - } - } - if validateSession { - if data == nil { - return errors.New("403 Forbidden error") - } - } - return nil -} - -type options struct { - pool authv3.AuthPool - exclude *httprouter.Router - dummy bool - logRequest bool -} - -// Option is the functional arg for building auth interceptor -type Option func(*options) - -// WithExclude excludes the method and path from enforcing authn/authz -func WithExclude(method, path string) Option { - return func(opts *options) { - if opts.exclude == nil { - opts.exclude = httprouter.New() - } - - opts.exclude.Handle(method, path, _dummyHandler) - } -} - -// WithAuthPool adds auth pool -func WithAuthPool(pool authv3.AuthPool) Option { - return func(opts *options) { - opts.pool = pool - } -} - -// WithDummy creates a dummy auth interceptor -func WithDummy() Option { - return func(opts *options) { - opts.dummy = true - } -} - -// WithLogRequest logs request info -func WithLogRequest() Option { - return func(opts *options) { - opts.logRequest = true - } -} - -// authInterceptor implements the Authentication interceptor -type authInterceptor struct { - opts *options -} - -// NewAuthInterceptorWithOptions creates auth interceptor with options -func NewAuthInterceptorWithOptions(opts ...Option) grpc.UnaryServerInterceptor { - aOpts := &options{} - for _, opt := range opts { - opt(aOpts) - } - - if aOpts.dummy { - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - //addDummyMeta(req) - return handler(ctx, req) - } - } - - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - if err := allowRequest(ctx, aOpts, req); err != nil { - return nil, err - } - return handler(ctx, req) - } -} diff --git a/components/common/pkg/auth/interceptors/auth_test.go b/components/common/pkg/auth/interceptors/auth_test.go deleted file mode 100644 index 79191f3..0000000 --- a/components/common/pkg/auth/interceptors/auth_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package interceptors - -import ( - "context" - "testing" - - "google.golang.org/grpc/metadata" -) - -func TestGetRSID(t *testing.T) { - mapWithRsid := make(map[string]string) - mapWithRsid[cookieHeader] = "csrftoken=FpkPDGFZ2sAfgB1N7qZuQQfv7swEZb7Xr0q4e9tHlZAncVbt5u1a3rCa93Q2fC5s; rsid=v7eylddj5p2fl0l8q5wb6kton1t3kby5; logo_link=; support_email=support@rafay.co" - md := metadata.New(mapWithRsid) - ctx := metadata.NewIncomingContext(context.Background(), md) - rsid := getRsid(ctx) - if rsid != "v7eylddj5p2fl0l8q5wb6kton1t3kby5" { - t.Errorf("wrong rsid") - } -} diff --git a/components/common/pkg/auth/v3/auth.go b/components/common/pkg/auth/v3/auth.go new file mode 100644 index 0000000..439e76a --- /dev/null +++ b/components/common/pkg/auth/v3/auth.go @@ -0,0 +1,51 @@ +package authv3 + +import ( + "os" + + logv2 "github.com/RafaySystems/rcloud-base/components/common/pkg/log" + kclient "github.com/ory/kratos-client-go" +) + +var _log *logv2.Logger + +func init() { + _log = logv2.GetLogger() +} + +type Option struct { + // ExcludeRPCMethods is a list of full RPC method string in + // format /package.service/method (for example, + // /rafay.dev.rpc.v3.Idp/ListIdps). These RPC methods are to + // be excluded from the auth interceptor. + ExcludeRPCMethods []string +} + +type authContext struct { + kc *kclient.APIClient +} + +// NewAuthContext setup authentication and authorization dependencies. +func NewAuthContext() authContext { + var ( + kc *kclient.APIClient + kratosScheme string + kratosAddr string + ) + if v, ok := os.LookupEnv("KRATOS_SCHEME"); ok { + kratosScheme = v + } else { + kratosScheme = "http" + } + + if v, ok := os.LookupEnv("KRATOS_ADDR"); ok { + kratosAddr = v + } else { + kratosAddr = "localhost:4433" + } + kratosConfig := kclient.NewConfiguration() + kratosConfig.Servers[0].URL = kratosScheme + "://" + kratosAddr + kc = kclient.NewAPIClient(kratosConfig) + + return authContext{kc: kc} +} diff --git a/components/common/pkg/auth/v3/auth.pb.go b/components/common/pkg/auth/v3/auth.pb.go deleted file mode 100644 index ce2ee2e..0000000 --- a/components/common/pkg/auth/v3/auth.pb.go +++ /dev/null @@ -1,1645 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc (unknown) -// source: pkg/auth/v3/auth.proto - -package authv3 - -import ( - _ "github.com/gogo/protobuf/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AuthType int32 - -const ( - AuthType_AuthTypeNotSet AuthType = 0 - AuthType_SessionLogin AuthType = 1 - AuthType_APIKey AuthType = 2 -) - -// Enum value maps for AuthType. -var ( - AuthType_name = map[int32]string{ - 0: "AuthTypeNotSet", - 1: "SessionLogin", - 2: "APIKey", - } - AuthType_value = map[string]int32{ - "AuthTypeNotSet": 0, - "SessionLogin": 1, - "APIKey": 2, - } -) - -func (x AuthType) Enum() *AuthType { - p := new(AuthType) - *p = x - return p -} - -func (x AuthType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AuthType) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_auth_v3_auth_proto_enumTypes[0].Descriptor() -} - -func (AuthType) Type() protoreflect.EnumType { - return &file_pkg_auth_v3_auth_proto_enumTypes[0] -} - -func (x AuthType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AuthType.Descriptor instead. -func (AuthType) EnumDescriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{0} -} - -type ClientType int32 - -const ( - ClientType_ClientTypeNotSet ClientType = 0 - ClientType_BROWSER ClientType = 1 - ClientType_CLI ClientType = 2 -) - -// Enum value maps for ClientType. -var ( - ClientType_name = map[int32]string{ - 0: "ClientTypeNotSet", - 1: "BROWSER", - 2: "CLI", - } - ClientType_value = map[string]int32{ - "ClientTypeNotSet": 0, - "BROWSER": 1, - "CLI": 2, - } -) - -func (x ClientType) Enum() *ClientType { - p := new(ClientType) - *p = x - return p -} - -func (x ClientType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ClientType) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_auth_v3_auth_proto_enumTypes[1].Descriptor() -} - -func (ClientType) Type() protoreflect.EnumType { - return &file_pkg_auth_v3_auth_proto_enumTypes[1] -} - -func (x ClientType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ClientType.Descriptor instead. -func (ClientType) EnumDescriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{1} -} - -type SessionStatus int32 - -const ( - SessionStatus_SessionNotFound SessionStatus = 0 - SessionStatus_SessionExists SessionStatus = 1 -) - -// Enum value maps for SessionStatus. -var ( - SessionStatus_name = map[int32]string{ - 0: "SessionNotFound", - 1: "SessionExists", - } - SessionStatus_value = map[string]int32{ - "SessionNotFound": 0, - "SessionExists": 1, - } -) - -func (x SessionStatus) Enum() *SessionStatus { - p := new(SessionStatus) - *p = x - return p -} - -func (x SessionStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SessionStatus) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_auth_v3_auth_proto_enumTypes[2].Descriptor() -} - -func (SessionStatus) Type() protoreflect.EnumType { - return &file_pkg_auth_v3_auth_proto_enumTypes[2] -} - -func (x SessionStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SessionStatus.Descriptor instead. -func (SessionStatus) EnumDescriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{2} -} - -type APIKeyStatus int32 - -const ( - APIKeyStatus_APIKeyNotFound APIKeyStatus = 0 - APIKeyStatus_APIKeyExists APIKeyStatus = 1 -) - -// Enum value maps for APIKeyStatus. -var ( - APIKeyStatus_name = map[int32]string{ - 0: "APIKeyNotFound", - 1: "APIKeyExists", - } - APIKeyStatus_value = map[string]int32{ - "APIKeyNotFound": 0, - "APIKeyExists": 1, - } -) - -func (x APIKeyStatus) Enum() *APIKeyStatus { - p := new(APIKeyStatus) - *p = x - return p -} - -func (x APIKeyStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (APIKeyStatus) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_auth_v3_auth_proto_enumTypes[3].Descriptor() -} - -func (APIKeyStatus) Type() protoreflect.EnumType { - return &file_pkg_auth_v3_auth_proto_enumTypes[3] -} - -func (x APIKeyStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use APIKeyStatus.Descriptor instead. -func (APIKeyStatus) EnumDescriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{3} -} - -type RequestStatus int32 - -const ( - RequestStatus_RequestAllowed RequestStatus = 0 - RequestStatus_RequestNotAuthenticated RequestStatus = 1 - RequestStatus_RequestMethodOrURLNotAllowed RequestStatus = 2 -) - -// Enum value maps for RequestStatus. -var ( - RequestStatus_name = map[int32]string{ - 0: "RequestAllowed", - 1: "RequestNotAuthenticated", - 2: "RequestMethodOrURLNotAllowed", - } - RequestStatus_value = map[string]int32{ - "RequestAllowed": 0, - "RequestNotAuthenticated": 1, - "RequestMethodOrURLNotAllowed": 2, - } -) - -func (x RequestStatus) Enum() *RequestStatus { - p := new(RequestStatus) - *p = x - return p -} - -func (x RequestStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RequestStatus) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_auth_v3_auth_proto_enumTypes[4].Descriptor() -} - -func (RequestStatus) Type() protoreflect.EnumType { - return &file_pkg_auth_v3_auth_proto_enumTypes[4] -} - -func (x RequestStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RequestStatus.Descriptor instead. -func (RequestStatus) EnumDescriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{4} -} - -type GetSessionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` -} - -func (x *GetSessionRequest) Reset() { - *x = GetSessionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSessionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSessionRequest) ProtoMessage() {} - -func (x *GetSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSessionRequest.ProtoReflect.Descriptor instead. -func (*GetSessionRequest) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{0} -} - -func (x *GetSessionRequest) GetSessionId() string { - if x != nil { - return x.SessionId - } - return "" -} - -type ResourceURLMethods struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Methods []string `protobuf:"bytes,1,rep,name=methods,proto3" json:"methods,omitempty"` -} - -func (x *ResourceURLMethods) Reset() { - *x = ResourceURLMethods{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceURLMethods) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceURLMethods) ProtoMessage() {} - -func (x *ResourceURLMethods) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceURLMethods.ProtoReflect.Descriptor instead. -func (*ResourceURLMethods) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{1} -} - -func (x *ResourceURLMethods) GetMethods() []string { - if x != nil { - return x.Methods - } - return nil -} - -type NamespaceData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - NamespaceId string `protobuf:"bytes,2,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` - Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` -} - -func (x *NamespaceData) Reset() { - *x = NamespaceData{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamespaceData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamespaceData) ProtoMessage() {} - -func (x *NamespaceData) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamespaceData.ProtoReflect.Descriptor instead. -func (*NamespaceData) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{2} -} - -func (x *NamespaceData) GetProjectId() string { - if x != nil { - return x.ProjectId - } - return "" -} - -func (x *NamespaceData) GetNamespaceId() string { - if x != nil { - return x.NamespaceId - } - return "" -} - -func (x *NamespaceData) GetRole() string { - if x != nil { - return x.Role - } - return "" -} - -type ProjectRole struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` -} - -func (x *ProjectRole) Reset() { - *x = ProjectRole{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProjectRole) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProjectRole) ProtoMessage() {} - -func (x *ProjectRole) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProjectRole.ProtoReflect.Descriptor instead. -func (*ProjectRole) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{3} -} - -func (x *ProjectRole) GetProjectId() string { - if x != nil { - return x.ProjectId - } - return "" -} - -func (x *ProjectRole) GetRole() string { - if x != nil { - return x.Role - } - return "" -} - -type ProjectData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` - List []*ProjectRole `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *ProjectData) Reset() { - *x = ProjectData{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProjectData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProjectData) ProtoMessage() {} - -func (x *ProjectData) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProjectData.ProtoReflect.Descriptor instead. -func (*ProjectData) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{4} -} - -func (x *ProjectData) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *ProjectData) GetList() []*ProjectRole { - if x != nil { - return x.List - } - return nil -} - -type SessionData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - Organization string `protobuf:"bytes,2,opt,name=organization,proto3" json:"organization,omitempty"` - Partner string `protobuf:"bytes,3,opt,name=partner,proto3" json:"partner,omitempty"` - Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` - Permissions []string `protobuf:"bytes,5,rep,name=permissions,proto3" json:"permissions,omitempty"` - PartnerDomain string `protobuf:"bytes,6,opt,name=partner_domain,json=partnerDomain,proto3" json:"partner_domain,omitempty"` - Username string `protobuf:"bytes,7,opt,name=username,proto3" json:"username,omitempty"` - IsSuperAdmin bool `protobuf:"varint,8,opt,name=is_super_admin,json=isSuperAdmin,proto3" json:"is_super_admin,omitempty"` - IsPartnerAdmin bool `protobuf:"varint,9,opt,name=is_partner_admin,json=isPartnerAdmin,proto3" json:"is_partner_admin,omitempty"` - IsSsoUser bool `protobuf:"varint,10,opt,name=is_sso_user,json=isSsoUser,proto3" json:"is_sso_user,omitempty"` - ResourceUrls map[string]*ResourceURLMethods `protobuf:"bytes,11,rep,name=resource_urls,json=resourceUrls,proto3" json:"resource_urls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Ttl string `protobuf:"bytes,12,opt,name=ttl,proto3" json:"ttl,omitempty"` - Groups []string `protobuf:"bytes,13,rep,name=groups,proto3" json:"groups,omitempty"` - AuthType AuthType `protobuf:"varint,14,opt,name=auth_type,json=authType,proto3,enum=rafay.dev.auth.v3.AuthType" json:"auth_type,omitempty"` - Idp string `protobuf:"bytes,15,opt,name=idp,proto3" json:"idp,omitempty"` - IsOrgAdmin map[string]bool `protobuf:"bytes,16,rep,name=is_org_admin,json=isOrgAdmin,proto3" json:"is_org_admin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - ClientType ClientType `protobuf:"varint,17,opt,name=client_type,json=clientType,proto3,enum=rafay.dev.auth.v3.ClientType" json:"client_type,omitempty"` - IsAllNsAccess map[string]bool `protobuf:"bytes,18,rep,name=is_all_ns_access,json=isAllNsAccess,proto3" json:"is_all_ns_access,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Namespaces []*NamespaceData `protobuf:"bytes,19,rep,name=namespaces,proto3" json:"namespaces,omitempty"` - Project *ProjectData `protobuf:"bytes,20,opt,name=project,proto3" json:"project,omitempty"` - IsReadonlyOrgAdmin map[string]bool `protobuf:"bytes,21,rep,name=is_readonly_org_admin,json=isReadonlyOrgAdmin,proto3" json:"is_readonly_org_admin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` -} - -func (x *SessionData) Reset() { - *x = SessionData{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionData) ProtoMessage() {} - -func (x *SessionData) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionData.ProtoReflect.Descriptor instead. -func (*SessionData) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{5} -} - -func (x *SessionData) GetAccount() string { - if x != nil { - return x.Account - } - return "" -} - -func (x *SessionData) GetOrganization() string { - if x != nil { - return x.Organization - } - return "" -} - -func (x *SessionData) GetPartner() string { - if x != nil { - return x.Partner - } - return "" -} - -func (x *SessionData) GetRole() string { - if x != nil { - return x.Role - } - return "" -} - -func (x *SessionData) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *SessionData) GetPartnerDomain() string { - if x != nil { - return x.PartnerDomain - } - return "" -} - -func (x *SessionData) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *SessionData) GetIsSuperAdmin() bool { - if x != nil { - return x.IsSuperAdmin - } - return false -} - -func (x *SessionData) GetIsPartnerAdmin() bool { - if x != nil { - return x.IsPartnerAdmin - } - return false -} - -func (x *SessionData) GetIsSsoUser() bool { - if x != nil { - return x.IsSsoUser - } - return false -} - -func (x *SessionData) GetResourceUrls() map[string]*ResourceURLMethods { - if x != nil { - return x.ResourceUrls - } - return nil -} - -func (x *SessionData) GetTtl() string { - if x != nil { - return x.Ttl - } - return "" -} - -func (x *SessionData) GetGroups() []string { - if x != nil { - return x.Groups - } - return nil -} - -func (x *SessionData) GetAuthType() AuthType { - if x != nil { - return x.AuthType - } - return AuthType_AuthTypeNotSet -} - -func (x *SessionData) GetIdp() string { - if x != nil { - return x.Idp - } - return "" -} - -func (x *SessionData) GetIsOrgAdmin() map[string]bool { - if x != nil { - return x.IsOrgAdmin - } - return nil -} - -func (x *SessionData) GetClientType() ClientType { - if x != nil { - return x.ClientType - } - return ClientType_ClientTypeNotSet -} - -func (x *SessionData) GetIsAllNsAccess() map[string]bool { - if x != nil { - return x.IsAllNsAccess - } - return nil -} - -func (x *SessionData) GetNamespaces() []*NamespaceData { - if x != nil { - return x.Namespaces - } - return nil -} - -func (x *SessionData) GetProject() *ProjectData { - if x != nil { - return x.Project - } - return nil -} - -func (x *SessionData) GetIsReadonlyOrgAdmin() map[string]bool { - if x != nil { - return x.IsReadonlyOrgAdmin - } - return nil -} - -type GetSessionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status SessionStatus `protobuf:"varint,1,opt,name=status,proto3,enum=rafay.dev.auth.v3.SessionStatus" json:"status,omitempty"` - Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` - Data *SessionData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *GetSessionResponse) Reset() { - *x = GetSessionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSessionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSessionResponse) ProtoMessage() {} - -func (x *GetSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSessionResponse.ProtoReflect.Descriptor instead. -func (*GetSessionResponse) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{6} -} - -func (x *GetSessionResponse) GetStatus() SessionStatus { - if x != nil { - return x.Status - } - return SessionStatus_SessionNotFound -} - -func (x *GetSessionResponse) GetReason() string { - if x != nil { - return x.Reason - } - return "" -} - -func (x *GetSessionResponse) GetData() *SessionData { - if x != nil { - return x.Data - } - return nil -} - -type GetAPIKeyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ApiKey string `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` -} - -func (x *GetAPIKeyRequest) Reset() { - *x = GetAPIKeyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetAPIKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAPIKeyRequest) ProtoMessage() {} - -func (x *GetAPIKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetAPIKeyRequest.ProtoReflect.Descriptor instead. -func (*GetAPIKeyRequest) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{7} -} - -func (x *GetAPIKeyRequest) GetApiKey() string { - if x != nil { - return x.ApiKey - } - return "" -} - -type GetAPIKeyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status APIKeyStatus `protobuf:"varint,1,opt,name=status,proto3,enum=rafay.dev.auth.v3.APIKeyStatus" json:"status,omitempty"` - Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` - Secret string `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"` - Data *SessionData `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *GetAPIKeyResponse) Reset() { - *x = GetAPIKeyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetAPIKeyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAPIKeyResponse) ProtoMessage() {} - -func (x *GetAPIKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetAPIKeyResponse.ProtoReflect.Descriptor instead. -func (*GetAPIKeyResponse) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{8} -} - -func (x *GetAPIKeyResponse) GetStatus() APIKeyStatus { - if x != nil { - return x.Status - } - return APIKeyStatus_APIKeyNotFound -} - -func (x *GetAPIKeyResponse) GetReason() string { - if x != nil { - return x.Reason - } - return "" -} - -func (x *GetAPIKeyResponse) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - -func (x *GetAPIKeyResponse) GetData() *SessionData { - if x != nil { - return x.Data - } - return nil -} - -type IsRequestAllowedRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` - Rsid string `protobuf:"bytes,3,opt,name=rsid,proto3" json:"rsid,omitempty"` - ApiKey string `protobuf:"bytes,4,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` -} - -func (x *IsRequestAllowedRequest) Reset() { - *x = IsRequestAllowedRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IsRequestAllowedRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IsRequestAllowedRequest) ProtoMessage() {} - -func (x *IsRequestAllowedRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IsRequestAllowedRequest.ProtoReflect.Descriptor instead. -func (*IsRequestAllowedRequest) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{9} -} - -func (x *IsRequestAllowedRequest) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *IsRequestAllowedRequest) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *IsRequestAllowedRequest) GetRsid() string { - if x != nil { - return x.Rsid - } - return "" -} - -func (x *IsRequestAllowedRequest) GetApiKey() string { - if x != nil { - return x.ApiKey - } - return "" -} - -type IsRequestAllowedResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status RequestStatus `protobuf:"varint,1,opt,name=status,proto3,enum=rafay.dev.auth.v3.RequestStatus" json:"status,omitempty"` - Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` - SessionData *SessionData `protobuf:"bytes,3,opt,name=sessionData,proto3" json:"sessionData,omitempty"` -} - -func (x *IsRequestAllowedResponse) Reset() { - *x = IsRequestAllowedResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IsRequestAllowedResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IsRequestAllowedResponse) ProtoMessage() {} - -func (x *IsRequestAllowedResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IsRequestAllowedResponse.ProtoReflect.Descriptor instead. -func (*IsRequestAllowedResponse) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{10} -} - -func (x *IsRequestAllowedResponse) GetStatus() RequestStatus { - if x != nil { - return x.Status - } - return RequestStatus_RequestAllowed -} - -func (x *IsRequestAllowedResponse) GetReason() string { - if x != nil { - return x.Reason - } - return "" -} - -func (x *IsRequestAllowedResponse) GetSessionData() *SessionData { - if x != nil { - return x.SessionData - } - return nil -} - -type AuthErrorDetail struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrorCode string `protobuf:"bytes,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` - Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` - Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` -} - -func (x *AuthErrorDetail) Reset() { - *x = AuthErrorDetail{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthErrorDetail) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthErrorDetail) ProtoMessage() {} - -func (x *AuthErrorDetail) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthErrorDetail.ProtoReflect.Descriptor instead. -func (*AuthErrorDetail) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{11} -} - -func (x *AuthErrorDetail) GetErrorCode() string { - if x != nil { - return x.ErrorCode - } - return "" -} - -func (x *AuthErrorDetail) GetDetail() string { - if x != nil { - return x.Detail - } - return "" -} - -func (x *AuthErrorDetail) GetInfo() string { - if x != nil { - return x.Info - } - return "" -} - -type AuthError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StatusCode int32 `protobuf:"zigzag32,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` - Details []*AuthErrorDetail `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` -} - -func (x *AuthError) Reset() { - *x = AuthError{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthError) ProtoMessage() {} - -func (x *AuthError) ProtoReflect() protoreflect.Message { - mi := &file_pkg_auth_v3_auth_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthError.ProtoReflect.Descriptor instead. -func (*AuthError) Descriptor() ([]byte, []int) { - return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{12} -} - -func (x *AuthError) GetStatusCode() int32 { - if x != nil { - return x.StatusCode - } - return 0 -} - -func (x *AuthError) GetDetails() []*AuthErrorDetail { - if x != nil { - return x.Details - } - return nil -} - -var File_pkg_auth_v3_auth_proto protoreflect.FileDescriptor - -var file_pkg_auth_v3_auth_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x1a, 0x14, 0x67, 0x6f, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x32, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x55, 0x52, 0x4c, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x65, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x40, 0x0a, 0x0b, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, - 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x59, - 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, - 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, - 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, - 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xa6, 0x0a, 0x0a, 0x0b, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x74, 0x6e, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, - 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, 0x6e, - 0x65, 0x72, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1a, - 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, - 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x12, 0x28, 0x0a, 0x10, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x5f, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x50, 0x61, - 0x72, 0x74, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, - 0x5f, 0x73, 0x73, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x69, 0x73, 0x53, 0x73, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x12, 0x55, 0x0a, 0x0d, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x30, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, - 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, 0x6c, - 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x74, 0x74, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x0d, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, - 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x33, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75, 0x74, - 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x70, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x70, 0x12, 0x50, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6f, 0x72, - 0x67, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, - 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, - 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x73, - 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x69, - 0x73, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x3e, 0x0a, 0x0b, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, - 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x5a, 0x0a, 0x10, 0x69, 0x73, 0x5f, - 0x61, 0x6c, 0x6c, 0x5f, 0x6e, 0x73, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x12, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x2e, 0x49, 0x73, 0x41, 0x6c, 0x6c, 0x4e, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x4e, 0x73, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x61, 0x66, 0x61, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x04, 0xc8, 0xde, 0x1f, - 0x00, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, - 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x69, 0x0a, 0x15, 0x69, 0x73, 0x5f, 0x72, 0x65, - 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x6f, 0x72, 0x67, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, - 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, - 0x79, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, - 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x1a, 0x66, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, - 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3b, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x49, 0x73, - 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x49, 0x73, 0x41, - 0x6c, 0x6c, 0x4e, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x45, 0x0a, 0x17, 0x49, - 0x73, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, - 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x22, 0x9a, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x72, 0x61, 0x66, 0x61, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x2b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x22, 0xb0, 0x01, 0x0a, - 0x11, 0x47, 0x65, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x70, 0x0a, 0x17, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, - 0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x73, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x72, 0x73, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, - 0x79, 0x22, 0xae, 0x01, 0x0a, 0x18, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, - 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, - 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x33, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x12, 0x40, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, - 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x22, 0x5c, 0x0a, 0x0f, 0x41, 0x75, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, - 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, - 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, - 0x22, 0x6a, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x11, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x3c, - 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2a, 0x42, 0x0a, 0x08, - 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, - 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x74, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x12, 0x0a, - 0x0a, 0x06, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x10, 0x02, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, - 0x2a, 0x3e, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, - 0x0a, 0x10, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x53, - 0x65, 0x74, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x52, 0x4f, 0x57, 0x53, 0x45, 0x52, 0x10, - 0x01, 0x12, 0x07, 0x0a, 0x03, 0x43, 0x4c, 0x49, 0x10, 0x02, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, - 0x2a, 0x3d, 0x0a, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, - 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x10, 0x01, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, - 0x3a, 0x0a, 0x0c, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x12, 0x0a, 0x0e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, - 0x64, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x10, 0x01, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, 0x68, 0x0a, 0x0d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x0e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x10, 0x00, - 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x74, 0x41, 0x75, - 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x20, 0x0a, - 0x1c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x72, - 0x55, 0x52, 0x4c, 0x4e, 0x6f, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x10, 0x02, 0x1a, - 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x32, 0xa6, 0x02, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x6b, - 0x0a, 0x10, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, - 0x65, 0x64, 0x12, 0x2a, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, - 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, - 0x76, 0x33, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, - 0x77, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x72, 0x61, 0x66, 0x61, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x25, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x41, 0x50, 0x49, - 0x4b, 0x65, 0x79, 0x12, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, - 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd3, - 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x76, 0x33, 0xa2, - 0x02, 0x03, 0x52, 0x44, 0x41, 0xaa, 0x02, 0x11, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, - 0x76, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x11, 0x52, 0x61, 0x66, 0x61, - 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x1d, - 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, - 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, - 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, - 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_pkg_auth_v3_auth_proto_rawDescOnce sync.Once - file_pkg_auth_v3_auth_proto_rawDescData = file_pkg_auth_v3_auth_proto_rawDesc -) - -func file_pkg_auth_v3_auth_proto_rawDescGZIP() []byte { - file_pkg_auth_v3_auth_proto_rawDescOnce.Do(func() { - file_pkg_auth_v3_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_auth_v3_auth_proto_rawDescData) - }) - return file_pkg_auth_v3_auth_proto_rawDescData -} - -var file_pkg_auth_v3_auth_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_pkg_auth_v3_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 17) -var file_pkg_auth_v3_auth_proto_goTypes = []interface{}{ - (AuthType)(0), // 0: rafay.dev.auth.v3.AuthType - (ClientType)(0), // 1: rafay.dev.auth.v3.ClientType - (SessionStatus)(0), // 2: rafay.dev.auth.v3.SessionStatus - (APIKeyStatus)(0), // 3: rafay.dev.auth.v3.APIKeyStatus - (RequestStatus)(0), // 4: rafay.dev.auth.v3.RequestStatus - (*GetSessionRequest)(nil), // 5: rafay.dev.auth.v3.GetSessionRequest - (*ResourceURLMethods)(nil), // 6: rafay.dev.auth.v3.ResourceURLMethods - (*NamespaceData)(nil), // 7: rafay.dev.auth.v3.NamespaceData - (*ProjectRole)(nil), // 8: rafay.dev.auth.v3.ProjectRole - (*ProjectData)(nil), // 9: rafay.dev.auth.v3.ProjectData - (*SessionData)(nil), // 10: rafay.dev.auth.v3.SessionData - (*GetSessionResponse)(nil), // 11: rafay.dev.auth.v3.GetSessionResponse - (*GetAPIKeyRequest)(nil), // 12: rafay.dev.auth.v3.GetAPIKeyRequest - (*GetAPIKeyResponse)(nil), // 13: rafay.dev.auth.v3.GetAPIKeyResponse - (*IsRequestAllowedRequest)(nil), // 14: rafay.dev.auth.v3.IsRequestAllowedRequest - (*IsRequestAllowedResponse)(nil), // 15: rafay.dev.auth.v3.IsRequestAllowedResponse - (*AuthErrorDetail)(nil), // 16: rafay.dev.auth.v3.AuthErrorDetail - (*AuthError)(nil), // 17: rafay.dev.auth.v3.AuthError - nil, // 18: rafay.dev.auth.v3.SessionData.ResourceUrlsEntry - nil, // 19: rafay.dev.auth.v3.SessionData.IsOrgAdminEntry - nil, // 20: rafay.dev.auth.v3.SessionData.IsAllNsAccessEntry - nil, // 21: rafay.dev.auth.v3.SessionData.IsReadonlyOrgAdminEntry -} -var file_pkg_auth_v3_auth_proto_depIdxs = []int32{ - 8, // 0: rafay.dev.auth.v3.ProjectData.list:type_name -> rafay.dev.auth.v3.ProjectRole - 18, // 1: rafay.dev.auth.v3.SessionData.resource_urls:type_name -> rafay.dev.auth.v3.SessionData.ResourceUrlsEntry - 0, // 2: rafay.dev.auth.v3.SessionData.auth_type:type_name -> rafay.dev.auth.v3.AuthType - 19, // 3: rafay.dev.auth.v3.SessionData.is_org_admin:type_name -> rafay.dev.auth.v3.SessionData.IsOrgAdminEntry - 1, // 4: rafay.dev.auth.v3.SessionData.client_type:type_name -> rafay.dev.auth.v3.ClientType - 20, // 5: rafay.dev.auth.v3.SessionData.is_all_ns_access:type_name -> rafay.dev.auth.v3.SessionData.IsAllNsAccessEntry - 7, // 6: rafay.dev.auth.v3.SessionData.namespaces:type_name -> rafay.dev.auth.v3.NamespaceData - 9, // 7: rafay.dev.auth.v3.SessionData.project:type_name -> rafay.dev.auth.v3.ProjectData - 21, // 8: rafay.dev.auth.v3.SessionData.is_readonly_org_admin:type_name -> rafay.dev.auth.v3.SessionData.IsReadonlyOrgAdminEntry - 2, // 9: rafay.dev.auth.v3.GetSessionResponse.status:type_name -> rafay.dev.auth.v3.SessionStatus - 10, // 10: rafay.dev.auth.v3.GetSessionResponse.data:type_name -> rafay.dev.auth.v3.SessionData - 3, // 11: rafay.dev.auth.v3.GetAPIKeyResponse.status:type_name -> rafay.dev.auth.v3.APIKeyStatus - 10, // 12: rafay.dev.auth.v3.GetAPIKeyResponse.data:type_name -> rafay.dev.auth.v3.SessionData - 4, // 13: rafay.dev.auth.v3.IsRequestAllowedResponse.status:type_name -> rafay.dev.auth.v3.RequestStatus - 10, // 14: rafay.dev.auth.v3.IsRequestAllowedResponse.sessionData:type_name -> rafay.dev.auth.v3.SessionData - 16, // 15: rafay.dev.auth.v3.AuthError.details:type_name -> rafay.dev.auth.v3.AuthErrorDetail - 6, // 16: rafay.dev.auth.v3.SessionData.ResourceUrlsEntry.value:type_name -> rafay.dev.auth.v3.ResourceURLMethods - 14, // 17: rafay.dev.auth.v3.Auth.IsRequestAllowed:input_type -> rafay.dev.auth.v3.IsRequestAllowedRequest - 5, // 18: rafay.dev.auth.v3.Auth.GetSession:input_type -> rafay.dev.auth.v3.GetSessionRequest - 12, // 19: rafay.dev.auth.v3.Auth.GetAPIKey:input_type -> rafay.dev.auth.v3.GetAPIKeyRequest - 15, // 20: rafay.dev.auth.v3.Auth.IsRequestAllowed:output_type -> rafay.dev.auth.v3.IsRequestAllowedResponse - 11, // 21: rafay.dev.auth.v3.Auth.GetSession:output_type -> rafay.dev.auth.v3.GetSessionResponse - 13, // 22: rafay.dev.auth.v3.Auth.GetAPIKey:output_type -> rafay.dev.auth.v3.GetAPIKeyResponse - 20, // [20:23] is the sub-list for method output_type - 17, // [17:20] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name -} - -func init() { file_pkg_auth_v3_auth_proto_init() } -func file_pkg_auth_v3_auth_proto_init() { - if File_pkg_auth_v3_auth_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_pkg_auth_v3_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSessionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceURLMethods); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamespaceData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProjectRole); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProjectData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSessionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAPIKeyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAPIKeyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsRequestAllowedRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsRequestAllowedResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthErrorDetail); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_pkg_auth_v3_auth_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pkg_auth_v3_auth_proto_rawDesc, - NumEnums: 5, - NumMessages: 17, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_pkg_auth_v3_auth_proto_goTypes, - DependencyIndexes: file_pkg_auth_v3_auth_proto_depIdxs, - EnumInfos: file_pkg_auth_v3_auth_proto_enumTypes, - MessageInfos: file_pkg_auth_v3_auth_proto_msgTypes, - }.Build() - File_pkg_auth_v3_auth_proto = out.File - file_pkg_auth_v3_auth_proto_rawDesc = nil - file_pkg_auth_v3_auth_proto_goTypes = nil - file_pkg_auth_v3_auth_proto_depIdxs = nil -} diff --git a/components/common/pkg/auth/v3/auth.proto b/components/common/pkg/auth/v3/auth.proto deleted file mode 100644 index b9bf0fb..0000000 --- a/components/common/pkg/auth/v3/auth.proto +++ /dev/null @@ -1,140 +0,0 @@ -syntax = "proto3"; -package rafay.dev.auth.v3; - -import "gogoproto/gogo.proto"; - -enum AuthType { - option (gogoproto.goproto_enum_prefix) = false; - AuthTypeNotSet = 0; - SessionLogin = 1; - APIKey = 2; -} - -enum ClientType { - option (gogoproto.goproto_enum_prefix) = false; - ClientTypeNotSet = 0; - BROWSER = 1; - CLI = 2; -} - - -message GetSessionRequest { - string session_id = 1; -} - -enum SessionStatus { - // disable enum prefix - option (gogoproto.goproto_enum_prefix) = false; - - SessionNotFound = 0; - SessionExists = 1; -} - -message ResourceURLMethods { - repeated string methods = 1; -} - -message NamespaceData { - string project_id = 1; - string namespace_id = 2; - string role = 3; -} - -message ProjectRole { - string project_id = 1; - string role = 3; -} - -message ProjectData { - bool all = 1; - repeated ProjectRole list = 2 [(gogoproto.nullable) = false]; -} - -message SessionData { - string account = 1; - string organization = 2; - string partner = 3; - string role = 4; - repeated string permissions = 5; - string partner_domain = 6; - string username = 7; - bool is_super_admin = 8; - bool is_partner_admin = 9; - bool is_sso_user = 10; - map resource_urls = 11; - string ttl = 12; - repeated string groups = 13; - AuthType auth_type = 14; - string idp = 15; - map is_org_admin = 16; - ClientType client_type = 17; - map is_all_ns_access = 18; - repeated NamespaceData namespaces = 19 [(gogoproto.nullable) = false]; - ProjectData project = 20; - map is_readonly_org_admin = 21; -} - -message GetSessionResponse { - SessionStatus status = 1; - string reason = 2; - SessionData data = 3; -} - -message GetAPIKeyRequest { - string api_key = 1; -} - -enum APIKeyStatus { - // disable enum prefix - option (gogoproto.goproto_enum_prefix) = false; - - APIKeyNotFound = 0; - APIKeyExists = 1; -} - -message GetAPIKeyResponse { - APIKeyStatus status = 1; - string reason = 2; - string secret = 3; - SessionData data = 4; -} - - -message IsRequestAllowedRequest { - string url = 1; - string method = 2; - string rsid = 3; - string api_key = 4; -} - -enum RequestStatus { - // disable enum prefix - option (gogoproto.goproto_enum_prefix) = false; - - RequestAllowed = 0; - RequestNotAuthenticated = 1; - RequestMethodOrURLNotAllowed = 2; -} - -message IsRequestAllowedResponse { - RequestStatus status = 1; - string reason = 2; - SessionData sessionData = 3; -} - -message AuthErrorDetail { - string error_code = 1; - string detail = 2; - string info = 3; -} - -message AuthError { - sint32 status_code = 1; - repeated AuthErrorDetail details = 2; -} - -service Auth { - rpc IsRequestAllowed(IsRequestAllowedRequest) returns (IsRequestAllowedResponse); - rpc GetSession(GetSessionRequest) returns (GetSessionResponse); - rpc GetAPIKey(GetAPIKeyRequest) returns (GetAPIKeyResponse); -} diff --git a/components/common/pkg/auth/v3/auth_grpc.pb.go b/components/common/pkg/auth/v3/auth_grpc.pb.go deleted file mode 100644 index aff15f1..0000000 --- a/components/common/pkg/auth/v3/auth_grpc.pb.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: pkg/auth/v3/auth.proto - -package authv3 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// AuthClient is the client API for Auth service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AuthClient interface { - IsRequestAllowed(ctx context.Context, in *IsRequestAllowedRequest, opts ...grpc.CallOption) (*IsRequestAllowedResponse, error) - GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error) - GetAPIKey(ctx context.Context, in *GetAPIKeyRequest, opts ...grpc.CallOption) (*GetAPIKeyResponse, error) -} - -type authClient struct { - cc grpc.ClientConnInterface -} - -func NewAuthClient(cc grpc.ClientConnInterface) AuthClient { - return &authClient{cc} -} - -func (c *authClient) IsRequestAllowed(ctx context.Context, in *IsRequestAllowedRequest, opts ...grpc.CallOption) (*IsRequestAllowedResponse, error) { - out := new(IsRequestAllowedResponse) - err := c.cc.Invoke(ctx, "/rafay.dev.auth.v3.Auth/IsRequestAllowed", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error) { - out := new(GetSessionResponse) - err := c.cc.Invoke(ctx, "/rafay.dev.auth.v3.Auth/GetSession", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) GetAPIKey(ctx context.Context, in *GetAPIKeyRequest, opts ...grpc.CallOption) (*GetAPIKeyResponse, error) { - out := new(GetAPIKeyResponse) - err := c.cc.Invoke(ctx, "/rafay.dev.auth.v3.Auth/GetAPIKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AuthServer is the server API for Auth service. -// All implementations should embed UnimplementedAuthServer -// for forward compatibility -type AuthServer interface { - IsRequestAllowed(context.Context, *IsRequestAllowedRequest) (*IsRequestAllowedResponse, error) - GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error) - GetAPIKey(context.Context, *GetAPIKeyRequest) (*GetAPIKeyResponse, error) -} - -// UnimplementedAuthServer should be embedded to have forward compatible implementations. -type UnimplementedAuthServer struct { -} - -func (UnimplementedAuthServer) IsRequestAllowed(context.Context, *IsRequestAllowedRequest) (*IsRequestAllowedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsRequestAllowed not implemented") -} -func (UnimplementedAuthServer) GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSession not implemented") -} -func (UnimplementedAuthServer) GetAPIKey(context.Context, *GetAPIKeyRequest) (*GetAPIKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAPIKey not implemented") -} - -// UnsafeAuthServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AuthServer will -// result in compilation errors. -type UnsafeAuthServer interface { - mustEmbedUnimplementedAuthServer() -} - -func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer) { - s.RegisterService(&Auth_ServiceDesc, srv) -} - -func _Auth_IsRequestAllowed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsRequestAllowedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).IsRequestAllowed(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rafay.dev.auth.v3.Auth/IsRequestAllowed", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).IsRequestAllowed(ctx, req.(*IsRequestAllowedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSessionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).GetSession(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rafay.dev.auth.v3.Auth/GetSession", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).GetSession(ctx, req.(*GetSessionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_GetAPIKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAPIKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).GetAPIKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rafay.dev.auth.v3.Auth/GetAPIKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).GetAPIKey(ctx, req.(*GetAPIKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Auth_ServiceDesc is the grpc.ServiceDesc for Auth service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Auth_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "rafay.dev.auth.v3.Auth", - HandlerType: (*AuthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "IsRequestAllowed", - Handler: _Auth_IsRequestAllowed_Handler, - }, - { - MethodName: "GetSession", - Handler: _Auth_GetSession_Handler, - }, - { - MethodName: "GetAPIKey", - Handler: _Auth_GetAPIKey_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pkg/auth/v3/auth.proto", -} diff --git a/components/common/pkg/auth/v3/interceptor.go b/components/common/pkg/auth/v3/interceptor.go new file mode 100644 index 0000000..da12d70 --- /dev/null +++ b/components/common/pkg/auth/v3/interceptor.go @@ -0,0 +1,72 @@ +package authv3 + +import ( + context "context" + + "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" + commonpbv3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +func (ac authContext) NewAuthUnaryInterceptor(opt Option) grpc.UnaryServerInterceptor { + return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { + // TODO: Optimize authentication for a session/gRPC + // channel + for _, ex := range opt.ExcludeRPCMethods { + if ex == info.FullMethod { + return handler(ctx, req) + } + } + + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return nil, status.Error(codes.InvalidArgument, "grpc metadata not exist") + } + var ( + url string + method string + token string + cookie string + ) + if len(md.Get(gateway.GatewayURL)) != 0 { + url = md.Get(gateway.GatewayURL)[0] + } + if len(md.Get(gateway.GatewayMethod)) != 0 { + method = md.Get(gateway.GatewayMethod)[0] + } + if len(md.Get(gateway.GatewayAPIKey)) != 0 { + token = md.Get(gateway.GatewayAPIKey)[0] + } + if len(md.Get("grpcgateway-cookie")) != 0 { + cookie = md.Get("grpcgateway-cookie")[0] + } + acReq := &commonpbv3.IsRequestAllowedRequest{ + Url: url, + Method: method, + XSessionToken: token, + Cookie: cookie, + } + res, err := ac.IsRequestAllowed(ctx, acReq) + if err != nil { + _log.Errorf("Failed to authenticate a request: %s", err) + return nil, status.Error(codes.Internal, codes.Internal.String()) + } + + s := res.GetStatus() + switch s { + case commonpbv3.RequestStatus_RequestAllowed: + ctx := newSessionContext(ctx, res.SessionData) + return handler(ctx, req) + case commonpbv3.RequestStatus_RequestMethodOrURLNotAllowed: + return nil, status.Error(codes.PermissionDenied, res.GetReason()) + case commonpbv3.RequestStatus_RequestNotAuthenticated: + return nil, status.Error(codes.Unauthenticated, res.GetReason()) + } + + // status should be any of three above. + return nil, status.Error(codes.Internal, codes.Internal.String()) + } +} diff --git a/components/common/pkg/auth/v3/middleware.go b/components/common/pkg/auth/v3/middleware.go new file mode 100644 index 0000000..1ca45f2 --- /dev/null +++ b/components/common/pkg/auth/v3/middleware.go @@ -0,0 +1,43 @@ +package authv3 + +import ( + "net/http" + + commonv3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + "github.com/urfave/negroni" +) + +type authMiddleware struct { + ac authContext +} + +// Not maintained. Instead use gRPC interceptor for authentication. +func (ac authContext) NewAuthMiddleware() negroni.Handler { + return &authMiddleware{ac} +} + +func (am *authMiddleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) { + req := &commonv3.IsRequestAllowedRequest{ + Url: r.URL.String(), + Method: r.Method, + XSessionToken: r.Header.Get("X-Session-Token"), + Cookie: r.Header.Get("Cookie"), + } + res, err := am.ac.IsRequestAllowed(r.Context(), req) + if err != nil { + http.Error(rw, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) + return + } + + if res.GetStatus() == commonv3.RequestStatus_RequestNotAuthenticated { + http.Error(rw, res.GetReason(), http.StatusUnauthorized) + return + } else if res.GetStatus() == commonv3.RequestStatus_RequestMethodOrURLNotAllowed { + http.Error(rw, res.GetReason(), http.StatusForbidden) + return + } + + if res.GetStatus() == commonv3.RequestStatus_RequestAllowed { + next(rw, r) + } +} diff --git a/components/common/pkg/auth/v3/pool.go b/components/common/pkg/auth/v3/pool.go index ba10246..49d09d5 100644 --- a/components/common/pkg/auth/v3/pool.go +++ b/components/common/pkg/auth/v3/pool.go @@ -2,6 +2,7 @@ package authv3 import ( "github.com/RafaySystems/rcloud-base/components/common/pkg/pool" + rpcv3 "github.com/RafaySystems/rcloud-base/components/common/proto/rpc/v3" "context" @@ -12,12 +13,12 @@ import ( type AuthPoolClient interface { Unhealthy() Close() error - AuthClient + rpcv3.AuthClient } type authPoolClient struct { *grpcpool.ClientConn - *authClient + rpcv3.AuthClient } var _ AuthPoolClient = (*authPoolClient)(nil) @@ -47,7 +48,7 @@ func (p *authPool) NewClient(ctx context.Context) (AuthPoolClient, error) { } return &authPoolClient{ cc, - &authClient{cc.ClientConn}, + rpcv3.NewAuthClient(cc.ClientConn), }, nil } diff --git a/components/common/pkg/auth/v3/service.go b/components/common/pkg/auth/v3/service.go new file mode 100644 index 0000000..5413e45 --- /dev/null +++ b/components/common/pkg/auth/v3/service.go @@ -0,0 +1,66 @@ +package authv3 + +import ( + "context" + "strings" + + commonv3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" +) + +func (ac *authContext) IsRequestAllowed(ctx context.Context, req *commonv3.IsRequestAllowedRequest) (*commonv3.IsRequestAllowedResponse, error) { + res := &commonv3.IsRequestAllowedResponse{ + Status: commonv3.RequestStatus_Unknown, + SessionData: &commonv3.SessionData{}, + } + + // Authenticate request + err := ac.authenticate(ctx, req, res) + if err != nil { + return nil, err + } + + // Authorize request + err = ac.authorize(ctx, req, res) + if err != nil { + return nil, err + } + + return res, nil +} + +// authenticate validate whether the request is from a legitimate user +// and populate relevant information in res. +func (ac *authContext) authenticate(ctx context.Context, req *commonv3.IsRequestAllowedRequest, res *commonv3.IsRequestAllowedResponse) error { + tsr := ac.kc.V0alpha2Api.ToSession(ctx). + XSessionToken(req.GetXSessionToken()). + Cookie(req.GetCookie()) + session, _, err := ac.kc.V0alpha2Api.ToSessionExecute(tsr) + if err != nil { + // '401 Unauthorized' if the credentials are invalid or no credentials were sent. + if strings.Contains(err.Error(), "401 Unauthorized") { + res.Status = commonv3.RequestStatus_RequestNotAuthenticated + res.Reason = "no or invalid credentials" + return nil + } else { + return err + } + } + if session.GetActive() { + res.Status = commonv3.RequestStatus_RequestAllowed + res.SessionData.Account = session.Identity.GetId() + + // TODO: Better way to access traits + t := session.Identity.Traits.(map[string]interface{}) + res.SessionData.Username = t["email"].(string) + } else { + res.Status = commonv3.RequestStatus_RequestNotAuthenticated + res.Reason = "no active session" + } + return nil +} + +// authorize performs authorization of the request and populate +// relevant information in res. +func (ac *authContext) authorize(ctx context.Context, req *commonv3.IsRequestAllowedRequest, res *commonv3.IsRequestAllowedResponse) error { + return nil +} diff --git a/components/common/pkg/auth/v3/session.go b/components/common/pkg/auth/v3/session.go new file mode 100644 index 0000000..8891c93 --- /dev/null +++ b/components/common/pkg/auth/v3/session.go @@ -0,0 +1,20 @@ +package authv3 + +import ( + "context" + + commonv3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" +) + +type contextKey struct{} + +var sessionDataKey contextKey + +func newSessionContext(ctx context.Context, s *commonv3.SessionData) context.Context { + return context.WithValue(ctx, sessionDataKey, s) +} + +func GetSession(ctx context.Context) (*commonv3.SessionData, bool) { + s, ok := ctx.Value(sessionDataKey).(*commonv3.SessionData) + return s, ok +} diff --git a/components/common/pkg/gateway/annotator.go b/components/common/pkg/gateway/annotator.go index 1537f05..fc84722 100644 --- a/components/common/pkg/gateway/annotator.go +++ b/components/common/pkg/gateway/annotator.go @@ -9,16 +9,14 @@ import ( // Rafay Gateway annotations const ( - GatewayRequest = "rafay-gateway-request" - GatewayURL = "rafay-gateway-url" - GatewayRSID = "rafay-gateway-rsid" - GatewayAPIKey = "rafay-gateway-apikey" - GatewayMethod = "rafay-gateway-method" - rafaySessionCookie = "rsid" - rafayAPIKeyHeader = "X-RAFAY-API-KEYID" - UserAgent = "rafay-gateway-user-agent" - Host = "rafay-gateway-host" - RemoteAddr = "rafay-gateway-remote-addr" + GatewayRequest = "x-gateway-request" + GatewayURL = "x-gateway-url" + GatewaySessionCookie = "ory_kratos_session" + GatewayAPIKey = "X-Session-Token" + GatewayMethod = "x-gateway-method" + UserAgent = "x-gateway-user-agent" + Host = "x-gateway-host" + RemoteAddr = "x-gateway-remote-addr" ) // rafayGatewayAnnotator adds rafay gateway specific annotations @@ -26,17 +24,17 @@ var rafayGatewayAnnotator = func(ctx context.Context, r *http.Request) metadata. return metadata.New(map[string]string{ GatewayRequest: "true", GatewayURL: r.URL.EscapedPath(), - GatewayRSID: func() string { - sid, err := r.Cookie(rafaySessionCookie) - if err != nil { - return "" - } - return sid.Value - }(), - GatewayAPIKey: r.Header.Get(rafayAPIKeyHeader), + // GatewaySessionCookie: func() string { + // sid, err := r.Cookie(GatewaySessionCookie) + // if err != nil { + // return "" + // } + // return sid.Value + // }(), + GatewayAPIKey: r.Header.Get(GatewayAPIKey), GatewayMethod: r.Method, - UserAgent: r.UserAgent(), - Host: r.Host, - RemoteAddr: r.RemoteAddr, + // UserAgent: r.UserAgent(), + // Host: r.Host, + // RemoteAddr: r.RemoteAddr, }) } diff --git a/components/common/pkg/gateway/gateway.go b/components/common/pkg/gateway/gateway.go index c2ea635..8f0172a 100644 --- a/components/common/pkg/gateway/gateway.go +++ b/components/common/pkg/gateway/gateway.go @@ -26,8 +26,6 @@ func NewGateway(ctx context.Context, endpoint string, serveMuxOptions []runtime. runtime.WithMarshalerOption(runtime.MIMEWildcard, httpBody), runtime.WithMarshalerOption(jsonContentType, rafayJSON), runtime.WithMarshalerOption(yamlContentType, rafayYAML), - //runtime.WithProtoErrorHandler(customErrorHandler), - //runtime.WithIncomingHeaderMatcher(customHeaderMatcher), runtime.WithMetadata(rafayGatewayAnnotator), ) diff --git a/components/common/proto/rpc/v3/auth.pb.go b/components/common/proto/rpc/v3/auth.pb.go new file mode 100644 index 0000000..e59f4fb --- /dev/null +++ b/components/common/proto/rpc/v3/auth.pb.go @@ -0,0 +1,91 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/rpc/v3/auth.proto + +package rpcv3 + +import ( + v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_proto_rpc_v3_auth_proto protoreflect.FileDescriptor + +var file_proto_rpc_v3_auth_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x61, + 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x1a, 0x22, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, + 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, + 0x83, 0x01, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x7b, 0x0a, 0x10, 0x49, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x12, 0x32, 0x2e, 0x72, + 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x33, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xce, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x42, 0x09, + 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, + 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x3b, + 0x72, 0x70, 0x63, 0x76, 0x33, 0xa2, 0x02, 0x03, 0x52, 0x44, 0x52, 0xaa, 0x02, 0x10, 0x52, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x70, 0x63, 0x2e, 0x56, 0x33, 0xca, 0x02, + 0x10, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, + 0x33, 0xe2, 0x02, 0x1c, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, + 0x63, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x13, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, + 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_proto_rpc_v3_auth_proto_goTypes = []interface{}{ + (*v3.IsRequestAllowedRequest)(nil), // 0: rafay.dev.types.common.v3.IsRequestAllowedRequest + (*v3.IsRequestAllowedResponse)(nil), // 1: rafay.dev.types.common.v3.IsRequestAllowedResponse +} +var file_proto_rpc_v3_auth_proto_depIdxs = []int32{ + 0, // 0: rafay.dev.rpc.v3.Auth.IsRequestAllowed:input_type -> rafay.dev.types.common.v3.IsRequestAllowedRequest + 1, // 1: rafay.dev.rpc.v3.Auth.IsRequestAllowed:output_type -> rafay.dev.types.common.v3.IsRequestAllowedResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_rpc_v3_auth_proto_init() } +func file_proto_rpc_v3_auth_proto_init() { + if File_proto_rpc_v3_auth_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_rpc_v3_auth_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_rpc_v3_auth_proto_goTypes, + DependencyIndexes: file_proto_rpc_v3_auth_proto_depIdxs, + }.Build() + File_proto_rpc_v3_auth_proto = out.File + file_proto_rpc_v3_auth_proto_rawDesc = nil + file_proto_rpc_v3_auth_proto_goTypes = nil + file_proto_rpc_v3_auth_proto_depIdxs = nil +} diff --git a/components/common/proto/rpc/v3/auth.proto b/components/common/proto/rpc/v3/auth.proto new file mode 100644 index 0000000..ec44871 --- /dev/null +++ b/components/common/proto/rpc/v3/auth.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package rafay.dev.rpc.v3; + +import "proto/types/commonpb/v3/auth.proto"; + +service Auth { + rpc IsRequestAllowed(rafay.dev.types.common.v3.IsRequestAllowedRequest) returns (rafay.dev.types.common.v3.IsRequestAllowedResponse); + // rpc GetSession(GetSessionRequest) returns (GetSessionResponse); + // rpc GetAPIKey(GetAPIKeyRequest) returns (GetAPIKeyResponse); +} diff --git a/components/common/proto/rpc/v3/auth_grpc.pb.go b/components/common/proto/rpc/v3/auth_grpc.pb.go new file mode 100644 index 0000000..a59b3dc --- /dev/null +++ b/components/common/proto/rpc/v3/auth_grpc.pb.go @@ -0,0 +1,104 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: proto/rpc/v3/auth.proto + +package rpcv3 + +import ( + context "context" + v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AuthClient is the client API for Auth service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AuthClient interface { + IsRequestAllowed(ctx context.Context, in *v3.IsRequestAllowedRequest, opts ...grpc.CallOption) (*v3.IsRequestAllowedResponse, error) +} + +type authClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthClient(cc grpc.ClientConnInterface) AuthClient { + return &authClient{cc} +} + +func (c *authClient) IsRequestAllowed(ctx context.Context, in *v3.IsRequestAllowedRequest, opts ...grpc.CallOption) (*v3.IsRequestAllowedResponse, error) { + out := new(v3.IsRequestAllowedResponse) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Auth/IsRequestAllowed", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthServer is the server API for Auth service. +// All implementations should embed UnimplementedAuthServer +// for forward compatibility +type AuthServer interface { + IsRequestAllowed(context.Context, *v3.IsRequestAllowedRequest) (*v3.IsRequestAllowedResponse, error) +} + +// UnimplementedAuthServer should be embedded to have forward compatible implementations. +type UnimplementedAuthServer struct { +} + +func (UnimplementedAuthServer) IsRequestAllowed(context.Context, *v3.IsRequestAllowedRequest) (*v3.IsRequestAllowedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsRequestAllowed not implemented") +} + +// UnsafeAuthServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AuthServer will +// result in compilation errors. +type UnsafeAuthServer interface { + mustEmbedUnimplementedAuthServer() +} + +func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer) { + s.RegisterService(&Auth_ServiceDesc, srv) +} + +func _Auth_IsRequestAllowed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.IsRequestAllowedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).IsRequestAllowed(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Auth/IsRequestAllowed", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).IsRequestAllowed(ctx, req.(*v3.IsRequestAllowedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Auth_ServiceDesc is the grpc.ServiceDesc for Auth service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Auth_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rafay.dev.rpc.v3.Auth", + HandlerType: (*AuthServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IsRequestAllowed", + Handler: _Auth_IsRequestAllowed_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/rpc/v3/auth.proto", +} diff --git a/components/common/proto/types/commonpb/v3/auth.pb.go b/components/common/proto/types/commonpb/v3/auth.pb.go new file mode 100644 index 0000000..8d9437e --- /dev/null +++ b/components/common/proto/types/commonpb/v3/auth.pb.go @@ -0,0 +1,1041 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/types/commonpb/v3/auth.proto + +package commonv3 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RequestStatus int32 + +const ( + RequestStatus_Unknown RequestStatus = 0 + RequestStatus_RequestNotAuthenticated RequestStatus = 1 + RequestStatus_RequestMethodOrURLNotAllowed RequestStatus = 2 + RequestStatus_RequestAllowed RequestStatus = 3 +) + +// Enum value maps for RequestStatus. +var ( + RequestStatus_name = map[int32]string{ + 0: "Unknown", + 1: "RequestNotAuthenticated", + 2: "RequestMethodOrURLNotAllowed", + 3: "RequestAllowed", + } + RequestStatus_value = map[string]int32{ + "Unknown": 0, + "RequestNotAuthenticated": 1, + "RequestMethodOrURLNotAllowed": 2, + "RequestAllowed": 3, + } +) + +func (x RequestStatus) Enum() *RequestStatus { + p := new(RequestStatus) + *p = x + return p +} + +func (x RequestStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RequestStatus) Descriptor() protoreflect.EnumDescriptor { + return file_proto_types_commonpb_v3_auth_proto_enumTypes[0].Descriptor() +} + +func (RequestStatus) Type() protoreflect.EnumType { + return &file_proto_types_commonpb_v3_auth_proto_enumTypes[0] +} + +func (x RequestStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RequestStatus.Descriptor instead. +func (RequestStatus) EnumDescriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{0} +} + +type AuthType int32 + +const ( + AuthType_AuthTypeNotSet AuthType = 0 + AuthType_SessionLogin AuthType = 1 + AuthType_APIKey AuthType = 2 +) + +// Enum value maps for AuthType. +var ( + AuthType_name = map[int32]string{ + 0: "AuthTypeNotSet", + 1: "SessionLogin", + 2: "APIKey", + } + AuthType_value = map[string]int32{ + "AuthTypeNotSet": 0, + "SessionLogin": 1, + "APIKey": 2, + } +) + +func (x AuthType) Enum() *AuthType { + p := new(AuthType) + *p = x + return p +} + +func (x AuthType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AuthType) Descriptor() protoreflect.EnumDescriptor { + return file_proto_types_commonpb_v3_auth_proto_enumTypes[1].Descriptor() +} + +func (AuthType) Type() protoreflect.EnumType { + return &file_proto_types_commonpb_v3_auth_proto_enumTypes[1] +} + +func (x AuthType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AuthType.Descriptor instead. +func (AuthType) EnumDescriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{1} +} + +type ClientType int32 + +const ( + ClientType_ClientTypeNotSet ClientType = 0 + ClientType_BROWSER ClientType = 1 + ClientType_CLI ClientType = 2 +) + +// Enum value maps for ClientType. +var ( + ClientType_name = map[int32]string{ + 0: "ClientTypeNotSet", + 1: "BROWSER", + 2: "CLI", + } + ClientType_value = map[string]int32{ + "ClientTypeNotSet": 0, + "BROWSER": 1, + "CLI": 2, + } +) + +func (x ClientType) Enum() *ClientType { + p := new(ClientType) + *p = x + return p +} + +func (x ClientType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClientType) Descriptor() protoreflect.EnumDescriptor { + return file_proto_types_commonpb_v3_auth_proto_enumTypes[2].Descriptor() +} + +func (ClientType) Type() protoreflect.EnumType { + return &file_proto_types_commonpb_v3_auth_proto_enumTypes[2] +} + +func (x ClientType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ClientType.Descriptor instead. +func (ClientType) EnumDescriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{2} +} + +type IsRequestAllowedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` + XSessionToken string `protobuf:"bytes,3,opt,name=xSessionToken,proto3" json:"xSessionToken,omitempty"` + Cookie string `protobuf:"bytes,4,opt,name=cookie,proto3" json:"cookie,omitempty"` +} + +func (x *IsRequestAllowedRequest) Reset() { + *x = IsRequestAllowedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IsRequestAllowedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsRequestAllowedRequest) ProtoMessage() {} + +func (x *IsRequestAllowedRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsRequestAllowedRequest.ProtoReflect.Descriptor instead. +func (*IsRequestAllowedRequest) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{0} +} + +func (x *IsRequestAllowedRequest) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *IsRequestAllowedRequest) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *IsRequestAllowedRequest) GetXSessionToken() string { + if x != nil { + return x.XSessionToken + } + return "" +} + +func (x *IsRequestAllowedRequest) GetCookie() string { + if x != nil { + return x.Cookie + } + return "" +} + +// Remove unnecessary fields +type ResourceURLMethods struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Methods []string `protobuf:"bytes,1,rep,name=methods,proto3" json:"methods,omitempty"` +} + +func (x *ResourceURLMethods) Reset() { + *x = ResourceURLMethods{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceURLMethods) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceURLMethods) ProtoMessage() {} + +func (x *ResourceURLMethods) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceURLMethods.ProtoReflect.Descriptor instead. +func (*ResourceURLMethods) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{1} +} + +func (x *ResourceURLMethods) GetMethods() []string { + if x != nil { + return x.Methods + } + return nil +} + +type NamespaceData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + NamespaceId string `protobuf:"bytes,2,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` + Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` +} + +func (x *NamespaceData) Reset() { + *x = NamespaceData{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NamespaceData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NamespaceData) ProtoMessage() {} + +func (x *NamespaceData) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NamespaceData.ProtoReflect.Descriptor instead. +func (*NamespaceData) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{2} +} + +func (x *NamespaceData) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *NamespaceData) GetNamespaceId() string { + if x != nil { + return x.NamespaceId + } + return "" +} + +func (x *NamespaceData) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +type ProjectRole struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` +} + +func (x *ProjectRole) Reset() { + *x = ProjectRole{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectRole) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectRole) ProtoMessage() {} + +func (x *ProjectRole) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectRole.ProtoReflect.Descriptor instead. +func (*ProjectRole) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{3} +} + +func (x *ProjectRole) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ProjectRole) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +type ProjectData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` + List []*ProjectRole `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` +} + +func (x *ProjectData) Reset() { + *x = ProjectData{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectData) ProtoMessage() {} + +func (x *ProjectData) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectData.ProtoReflect.Descriptor instead. +func (*ProjectData) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{4} +} + +func (x *ProjectData) GetAll() bool { + if x != nil { + return x.All + } + return false +} + +func (x *ProjectData) GetList() []*ProjectRole { + if x != nil { + return x.List + } + return nil +} + +type SessionData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Organization string `protobuf:"bytes,2,opt,name=organization,proto3" json:"organization,omitempty"` + Partner string `protobuf:"bytes,3,opt,name=partner,proto3" json:"partner,omitempty"` + Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` + Permissions []string `protobuf:"bytes,5,rep,name=permissions,proto3" json:"permissions,omitempty"` + PartnerDomain string `protobuf:"bytes,6,opt,name=partner_domain,json=partnerDomain,proto3" json:"partner_domain,omitempty"` + Username string `protobuf:"bytes,7,opt,name=username,proto3" json:"username,omitempty"` + IsSuperAdmin bool `protobuf:"varint,8,opt,name=is_super_admin,json=isSuperAdmin,proto3" json:"is_super_admin,omitempty"` + IsPartnerAdmin bool `protobuf:"varint,9,opt,name=is_partner_admin,json=isPartnerAdmin,proto3" json:"is_partner_admin,omitempty"` + IsSsoUser bool `protobuf:"varint,10,opt,name=is_sso_user,json=isSsoUser,proto3" json:"is_sso_user,omitempty"` + ResourceUrls map[string]*ResourceURLMethods `protobuf:"bytes,11,rep,name=resource_urls,json=resourceUrls,proto3" json:"resource_urls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Ttl string `protobuf:"bytes,12,opt,name=ttl,proto3" json:"ttl,omitempty"` + Groups []string `protobuf:"bytes,13,rep,name=groups,proto3" json:"groups,omitempty"` + AuthType AuthType `protobuf:"varint,14,opt,name=auth_type,json=authType,proto3,enum=rafay.dev.types.common.v3.AuthType" json:"auth_type,omitempty"` + Idp string `protobuf:"bytes,15,opt,name=idp,proto3" json:"idp,omitempty"` + IsOrgAdmin map[string]bool `protobuf:"bytes,16,rep,name=is_org_admin,json=isOrgAdmin,proto3" json:"is_org_admin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + ClientType ClientType `protobuf:"varint,17,opt,name=client_type,json=clientType,proto3,enum=rafay.dev.types.common.v3.ClientType" json:"client_type,omitempty"` + IsAllNsAccess map[string]bool `protobuf:"bytes,18,rep,name=is_all_ns_access,json=isAllNsAccess,proto3" json:"is_all_ns_access,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Namespaces []*NamespaceData `protobuf:"bytes,19,rep,name=namespaces,proto3" json:"namespaces,omitempty"` + Project *ProjectData `protobuf:"bytes,20,opt,name=project,proto3" json:"project,omitempty"` +} + +func (x *SessionData) Reset() { + *x = SessionData{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SessionData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SessionData) ProtoMessage() {} + +func (x *SessionData) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SessionData.ProtoReflect.Descriptor instead. +func (*SessionData) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{5} +} + +func (x *SessionData) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +func (x *SessionData) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *SessionData) GetPartner() string { + if x != nil { + return x.Partner + } + return "" +} + +func (x *SessionData) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *SessionData) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *SessionData) GetPartnerDomain() string { + if x != nil { + return x.PartnerDomain + } + return "" +} + +func (x *SessionData) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *SessionData) GetIsSuperAdmin() bool { + if x != nil { + return x.IsSuperAdmin + } + return false +} + +func (x *SessionData) GetIsPartnerAdmin() bool { + if x != nil { + return x.IsPartnerAdmin + } + return false +} + +func (x *SessionData) GetIsSsoUser() bool { + if x != nil { + return x.IsSsoUser + } + return false +} + +func (x *SessionData) GetResourceUrls() map[string]*ResourceURLMethods { + if x != nil { + return x.ResourceUrls + } + return nil +} + +func (x *SessionData) GetTtl() string { + if x != nil { + return x.Ttl + } + return "" +} + +func (x *SessionData) GetGroups() []string { + if x != nil { + return x.Groups + } + return nil +} + +func (x *SessionData) GetAuthType() AuthType { + if x != nil { + return x.AuthType + } + return AuthType_AuthTypeNotSet +} + +func (x *SessionData) GetIdp() string { + if x != nil { + return x.Idp + } + return "" +} + +func (x *SessionData) GetIsOrgAdmin() map[string]bool { + if x != nil { + return x.IsOrgAdmin + } + return nil +} + +func (x *SessionData) GetClientType() ClientType { + if x != nil { + return x.ClientType + } + return ClientType_ClientTypeNotSet +} + +func (x *SessionData) GetIsAllNsAccess() map[string]bool { + if x != nil { + return x.IsAllNsAccess + } + return nil +} + +func (x *SessionData) GetNamespaces() []*NamespaceData { + if x != nil { + return x.Namespaces + } + return nil +} + +func (x *SessionData) GetProject() *ProjectData { + if x != nil { + return x.Project + } + return nil +} + +type IsRequestAllowedResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status RequestStatus `protobuf:"varint,1,opt,name=status,proto3,enum=rafay.dev.types.common.v3.RequestStatus" json:"status,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + SessionData *SessionData `protobuf:"bytes,3,opt,name=sessionData,proto3" json:"sessionData,omitempty"` +} + +func (x *IsRequestAllowedResponse) Reset() { + *x = IsRequestAllowedResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IsRequestAllowedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsRequestAllowedResponse) ProtoMessage() {} + +func (x *IsRequestAllowedResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_auth_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsRequestAllowedResponse.ProtoReflect.Descriptor instead. +func (*IsRequestAllowedResponse) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_auth_proto_rawDescGZIP(), []int{6} +} + +func (x *IsRequestAllowedResponse) GetStatus() RequestStatus { + if x != nil { + return x.Status + } + return RequestStatus_Unknown +} + +func (x *IsRequestAllowedResponse) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *IsRequestAllowedResponse) GetSessionData() *SessionData { + if x != nil { + return x.SessionData + } + return nil +} + +var File_proto_types_commonpb_v3_auth_proto protoreflect.FileDescriptor + +var file_proto_types_commonpb_v3_auth_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x22, + 0x81, 0x01, 0x0a, 0x17, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, + 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x78, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x78, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, + 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6f, + 0x6b, 0x69, 0x65, 0x22, 0x2e, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, + 0x52, 0x4c, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x73, 0x22, 0x65, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x40, 0x0a, 0x0b, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x5b, 0x0a, 0x0b, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x61, + 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x3a, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xae, 0x09, 0x0a, 0x0b, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x74, 0x6e, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, + 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, 0x6e, + 0x65, 0x72, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, + 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, + 0x12, 0x28, 0x0a, 0x10, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x5f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x50, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, + 0x5f, 0x73, 0x73, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x69, 0x73, 0x53, 0x73, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x12, 0x5d, 0x0a, 0x0d, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x38, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x55, 0x72, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x12, 0x40, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75, 0x74, + 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x70, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x70, 0x12, 0x58, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6f, 0x72, + 0x67, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x73, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x69, 0x73, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x12, 0x46, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x62, 0x0a, 0x10, 0x69, 0x73, 0x5f, + 0x61, 0x6c, 0x6c, 0x5f, 0x6e, 0x73, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x12, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x73, 0x41, 0x6c, + 0x6c, 0x4e, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, + 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x4e, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x48, 0x0a, + 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x6e, 0x0a, 0x11, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x43, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x49, 0x73, 0x4f, + 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x49, 0x73, 0x41, 0x6c, + 0x6c, 0x4e, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbe, 0x01, 0x0a, 0x18, 0x49, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2a, 0x6f, 0x0a, 0x0d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, + 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x74, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x72, 0x55, 0x52, 0x4c, 0x4e, 0x6f, 0x74, 0x41, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x10, 0x03, 0x2a, 0x3c, 0x0a, 0x08, + 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x74, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x10, 0x02, 0x2a, 0x38, 0x0a, 0x0a, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x74, 0x10, 0x00, 0x12, 0x0b, + 0x0a, 0x07, 0x42, 0x52, 0x4f, 0x57, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x43, + 0x4c, 0x49, 0x10, 0x02, 0x42, 0x8b, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, + 0x76, 0x33, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, + 0x54, 0x43, 0xaa, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x56, 0x33, 0xca, 0x02, + 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, + 0x5c, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x25, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x1d, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, + 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3a, 0x3a, + 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_types_commonpb_v3_auth_proto_rawDescOnce sync.Once + file_proto_types_commonpb_v3_auth_proto_rawDescData = file_proto_types_commonpb_v3_auth_proto_rawDesc +) + +func file_proto_types_commonpb_v3_auth_proto_rawDescGZIP() []byte { + file_proto_types_commonpb_v3_auth_proto_rawDescOnce.Do(func() { + file_proto_types_commonpb_v3_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_commonpb_v3_auth_proto_rawDescData) + }) + return file_proto_types_commonpb_v3_auth_proto_rawDescData +} + +var file_proto_types_commonpb_v3_auth_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_proto_types_commonpb_v3_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_proto_types_commonpb_v3_auth_proto_goTypes = []interface{}{ + (RequestStatus)(0), // 0: rafay.dev.types.common.v3.RequestStatus + (AuthType)(0), // 1: rafay.dev.types.common.v3.AuthType + (ClientType)(0), // 2: rafay.dev.types.common.v3.ClientType + (*IsRequestAllowedRequest)(nil), // 3: rafay.dev.types.common.v3.IsRequestAllowedRequest + (*ResourceURLMethods)(nil), // 4: rafay.dev.types.common.v3.ResourceURLMethods + (*NamespaceData)(nil), // 5: rafay.dev.types.common.v3.NamespaceData + (*ProjectRole)(nil), // 6: rafay.dev.types.common.v3.ProjectRole + (*ProjectData)(nil), // 7: rafay.dev.types.common.v3.ProjectData + (*SessionData)(nil), // 8: rafay.dev.types.common.v3.SessionData + (*IsRequestAllowedResponse)(nil), // 9: rafay.dev.types.common.v3.IsRequestAllowedResponse + nil, // 10: rafay.dev.types.common.v3.SessionData.ResourceUrlsEntry + nil, // 11: rafay.dev.types.common.v3.SessionData.IsOrgAdminEntry + nil, // 12: rafay.dev.types.common.v3.SessionData.IsAllNsAccessEntry +} +var file_proto_types_commonpb_v3_auth_proto_depIdxs = []int32{ + 6, // 0: rafay.dev.types.common.v3.ProjectData.list:type_name -> rafay.dev.types.common.v3.ProjectRole + 10, // 1: rafay.dev.types.common.v3.SessionData.resource_urls:type_name -> rafay.dev.types.common.v3.SessionData.ResourceUrlsEntry + 1, // 2: rafay.dev.types.common.v3.SessionData.auth_type:type_name -> rafay.dev.types.common.v3.AuthType + 11, // 3: rafay.dev.types.common.v3.SessionData.is_org_admin:type_name -> rafay.dev.types.common.v3.SessionData.IsOrgAdminEntry + 2, // 4: rafay.dev.types.common.v3.SessionData.client_type:type_name -> rafay.dev.types.common.v3.ClientType + 12, // 5: rafay.dev.types.common.v3.SessionData.is_all_ns_access:type_name -> rafay.dev.types.common.v3.SessionData.IsAllNsAccessEntry + 5, // 6: rafay.dev.types.common.v3.SessionData.namespaces:type_name -> rafay.dev.types.common.v3.NamespaceData + 7, // 7: rafay.dev.types.common.v3.SessionData.project:type_name -> rafay.dev.types.common.v3.ProjectData + 0, // 8: rafay.dev.types.common.v3.IsRequestAllowedResponse.status:type_name -> rafay.dev.types.common.v3.RequestStatus + 8, // 9: rafay.dev.types.common.v3.IsRequestAllowedResponse.sessionData:type_name -> rafay.dev.types.common.v3.SessionData + 4, // 10: rafay.dev.types.common.v3.SessionData.ResourceUrlsEntry.value:type_name -> rafay.dev.types.common.v3.ResourceURLMethods + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_proto_types_commonpb_v3_auth_proto_init() } +func file_proto_types_commonpb_v3_auth_proto_init() { + if File_proto_types_commonpb_v3_auth_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_types_commonpb_v3_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IsRequestAllowedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceURLMethods); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamespaceData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectRole); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_auth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SessionData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_auth_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IsRequestAllowedResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_types_commonpb_v3_auth_proto_rawDesc, + NumEnums: 3, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_types_commonpb_v3_auth_proto_goTypes, + DependencyIndexes: file_proto_types_commonpb_v3_auth_proto_depIdxs, + EnumInfos: file_proto_types_commonpb_v3_auth_proto_enumTypes, + MessageInfos: file_proto_types_commonpb_v3_auth_proto_msgTypes, + }.Build() + File_proto_types_commonpb_v3_auth_proto = out.File + file_proto_types_commonpb_v3_auth_proto_rawDesc = nil + file_proto_types_commonpb_v3_auth_proto_goTypes = nil + file_proto_types_commonpb_v3_auth_proto_depIdxs = nil +} diff --git a/components/common/proto/types/commonpb/v3/auth.proto b/components/common/proto/types/commonpb/v3/auth.proto new file mode 100644 index 0000000..e5c6f1a --- /dev/null +++ b/components/common/proto/types/commonpb/v3/auth.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package rafay.dev.types.common.v3; + +message IsRequestAllowedRequest { + string url = 1; + string method = 2; + string xSessionToken = 3; + string cookie = 4; +} + +enum RequestStatus { + Unknown = 0; + RequestNotAuthenticated = 1; + RequestMethodOrURLNotAllowed = 2; + RequestAllowed = 3; +} + +// Remove unnecessary fields +message ResourceURLMethods { + repeated string methods = 1; +} + +enum AuthType { + AuthTypeNotSet = 0; + SessionLogin = 1; + APIKey = 2; +} + +enum ClientType { + ClientTypeNotSet = 0; + BROWSER = 1; + CLI = 2; +} + +message NamespaceData { + string project_id = 1; + string namespace_id = 2; + string role = 3; +} + +message ProjectRole { + string project_id = 1; + string role = 3; +} + +message ProjectData { + bool all = 1; + repeated ProjectRole list = 2; +} + +message SessionData { + string account = 1; + string organization = 2; + string partner = 3; + string role = 4; + repeated string permissions = 5; + string partner_domain = 6; + string username = 7; + bool is_super_admin = 8; + bool is_partner_admin = 9; + bool is_sso_user = 10; + map resource_urls = 11; + string ttl = 12; + repeated string groups = 13; + AuthType auth_type = 14; + string idp = 15; + map is_org_admin = 16; + ClientType client_type = 17; + map is_all_ns_access = 18; + repeated NamespaceData namespaces = 19; + ProjectData project = 20; +} + +message IsRequestAllowedResponse { + RequestStatus status = 1; + string reason = 2; + SessionData sessionData = 3; +} diff --git a/components/usermgmt/go.mod b/components/usermgmt/go.mod index b56e8c4..feb90bd 100644 --- a/components/usermgmt/go.mod +++ b/components/usermgmt/go.mod @@ -9,17 +9,17 @@ require ( github.com/crewjam/saml v0.4.6 github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.3.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 github.com/ory/kratos-client-go v0.8.2-alpha.1 github.com/spf13/viper v1.10.1 - github.com/uptrace/bun v1.0.21 + github.com/uptrace/bun v1.0.20 github.com/uptrace/bun/dialect/pgdialect v1.0.20 github.com/uptrace/bun/driver/pgdriver v1.0.20 github.com/uptrace/bun/extra/bundebug v1.0.20 - google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 + google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 - sigs.k8s.io/controller-runtime v0.11.0 + sigs.k8s.io/controller-runtime v0.11.1 ) require ( @@ -35,7 +35,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.5.7 // indirect + github.com/google/go-cmp v0.5.6 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/googleapis/gnostic v0.5.5 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect @@ -44,7 +44,7 @@ require ( github.com/jinzhu/inflection v1.0.0 // indirect github.com/jonboulle/clockwork v0.2.2 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/julienschmidt/httprouter v1.3.0 // indirect + github.com/klauspost/cpuid/v2 v2.0.6 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/mattermost/xml-roundtrip-validator v0.1.0 // indirect github.com/mattn/go-colorable v0.1.12 // indirect @@ -61,25 +61,25 @@ require ( github.com/prometheus/common v0.28.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/russellhaering/goxmldsig v1.1.1 // indirect - github.com/segmentio/asm v1.1.3 // indirect - github.com/segmentio/encoding v0.3.3 // indirect - github.com/speps/go-hashids v2.0.0+incompatible // indirect + github.com/segmentio/asm v1.1.0 // indirect + github.com/segmentio/encoding v0.3.2 // indirect github.com/spf13/afero v1.6.0 // indirect github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect + github.com/urfave/negroni v1.0.0 // indirect github.com/valyala/fastjson v1.6.3 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.20.0 // indirect - golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect + go.uber.org/zap v1.19.1 // indirect + golang.org/x/crypto v0.0.0-20220126234351-aa10faf2a1f8 // indirect golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect + golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect @@ -89,15 +89,15 @@ require ( gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/api v0.23.2 // indirect - k8s.io/apiextensions-apiserver v0.23.2 // indirect - k8s.io/apimachinery v0.23.2 // indirect - k8s.io/client-go v0.23.2 // indirect - k8s.io/component-base v0.23.2 // indirect + k8s.io/api v0.23.4 // indirect + k8s.io/apiextensions-apiserver v0.23.4 // indirect + k8s.io/apimachinery v0.23.4 // indirect + k8s.io/client-go v0.23.4 // indirect + k8s.io/component-base v0.23.4 // indirect k8s.io/klog v1.0.0 // indirect k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26 // indirect - k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect + k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect + k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect mellium.im/sasl v0.2.1 // indirect sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect sigs.k8s.io/kustomize/pseudo/k8s v0.1.0 // indirect diff --git a/components/usermgmt/go.sum b/components/usermgmt/go.sum index e0e971a..0900389 100644 --- a/components/usermgmt/go.sum +++ b/components/usermgmt/go.sum @@ -167,8 +167,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5/go.mod h1:GgB8SF9nRG+GqaDtLcwJZsQFhcogVCJ79j4EdT0c2V4= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/denisenkom/go-mssqldb v0.11.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= @@ -279,7 +279,7 @@ github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29g github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/runtime v0.21.1/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= +github.com/go-openapi/runtime v0.23.0/go.mod h1:aQg+kaIQEn+A2CRSY1TxbM8+sT9g2V3aLc1FbIAnbbs= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= @@ -303,7 +303,7 @@ github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLs github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/strfmt v0.20.2/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicATpEfZwHUNk= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= @@ -324,6 +324,7 @@ github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9G github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= github.com/go-openapi/validate v0.20.3/go.mod h1:goDdqVGiigM3jChcrYJxD2joalke3ZXeftD16byIjA4= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= @@ -416,9 +417,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -467,8 +467,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 h1:I8MsauTJQXZ8df8qJvEln0kYNc3bSapuaSsEsnFdEFU= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3/go.mod h1:lZdb/YAJUSj9OqrCHs2ihjtoO3+xK3G53wTYXFWRGDo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 h1:I/pwhnUln5wbMnTyRbzswA0/JxpK8sZj0aUfI3TV1So= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2/go.mod h1:lsuH8kb4GlMdSlI4alNIBBSAt5CHJtg3i+0WuN9J5YM= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -552,12 +552,12 @@ github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= @@ -575,7 +575,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -585,6 +584,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI= +github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -596,6 +597,7 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -754,6 +756,7 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= @@ -764,16 +767,16 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/asm v1.1.3 h1:WM03sfUOENvvKexOLp+pCqgb/WDjsi7EK8gIsICtzhc= -github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg= -github.com/segmentio/encoding v0.3.3 h1:VG1HceOLwHkSDdkxshlu9pD4FftWkScmHc8RDQ+w9uM= -github.com/segmentio/encoding v0.3.3/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM= +github.com/segmentio/asm v1.1.0 h1:fkVr8k5J4sKoFjTGVD6r1yKvDKqmvrEh3K7iyVxgBs8= +github.com/segmentio/asm v1.1.0/go.mod h1:4EUJGaKsB8ImLUwOGORVsNd9vTRDeh44JGsY4aKp5I4= +github.com/segmentio/encoding v0.3.2 h1:gkXXteOfNaPPlrXTEf/e5tWvaQGVJWnvT3LqMzUeH7U= +github.com/segmentio/encoding v0.3.2/go.mod h1:waft2p6XI4z2pk07M0YzZV4wEiqaRvsBSyWNHxVx4gU= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -784,7 +787,6 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/speps/go-hashids v2.0.0+incompatible h1:kSfxGfESueJKTx0mpER9Y/1XHl+FVQjtCqRyYcviFbw= github.com/speps/go-hashids v2.0.0+incompatible/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -829,15 +831,16 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1 github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/uptrace/bun v1.0.20 h1:/T4p9C9tEN75U3cFMBr5njlP+rBfs4An8BmlQQPbcfE= github.com/uptrace/bun v1.0.20/go.mod h1:Uv7z0z+7dXnUS9P5hMF0hdiM/4M+xOUHQCrZpyDrpRc= -github.com/uptrace/bun v1.0.21 h1:5ek4bnrEmZo6wvY/RHt1dJNXzOPOnrfJeZMoZfZt9Io= -github.com/uptrace/bun v1.0.21/go.mod h1:u+QsgCgjGFwshy3euGAN1CLEO9RMf42lga5jQ/ezYsc= github.com/uptrace/bun/dialect/pgdialect v1.0.20 h1:1Yajz0M2AhOzvxFEQSAQ8TpqzSRFxYOg+saksIQ0dmU= github.com/uptrace/bun/dialect/pgdialect v1.0.20/go.mod h1:Z2UoOgTKHXgFOuInXsJKkNQJiFIaPkCvsj0EayOI2yk= github.com/uptrace/bun/driver/pgdriver v1.0.20 h1:CEWHL5NS5FQIJAJxY40t0llwe8XxVlsblbgi9Upm0fA= github.com/uptrace/bun/driver/pgdriver v1.0.20/go.mod h1:KAONvCIiI4A6HdMTZ8zCdGxh7P6+23Todz+bL8HRzV4= github.com/uptrace/bun/extra/bundebug v1.0.20 h1:lwuGUMiqujR3NuGDKgJu1j7XL3LsULSv1MDFHlYBAGs= github.com/uptrace/bun/extra/bundebug v1.0.20/go.mod h1:tDoi/zmjHkumthaCujwfI2+mni0G41HfJD4HC2oMdpk= +github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= +github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/fastjson v1.6.3 h1:tAKFnnwmeMGPbwJ7IwxcTPCNr3uIzoIj3/Fh90ra4xc= github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= @@ -909,7 +912,6 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -923,15 +925,16 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= -go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1169,7 +1172,6 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1386,9 +1388,8 @@ google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q= -google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1491,24 +1492,24 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg= -k8s.io/api v0.23.2 h1:62cpzreV3dCuj0hqPi8r4dyWh48ogMcyh+ga9jEGij4= -k8s.io/api v0.23.2/go.mod h1:sYuDb3flCtRPI8ghn6qFrcK5ZBu2mhbElxRE95qpwlI= +k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= +k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= k8s.io/apiextensions-apiserver v0.23.0/go.mod h1:xIFAEEDlAZgpVBl/1VSjGDmLoXAWRG40+GsWhKhAxY4= -k8s.io/apiextensions-apiserver v0.23.2 h1:N6CIVAhmF0ahgFKUMDdV/AUyckhUb4nIyVPohPtdUPk= -k8s.io/apiextensions-apiserver v0.23.2/go.mod h1:9cs7avT6+GfzbB0pambTvH11wcaR85QQg4ovl9s15UU= +k8s.io/apiextensions-apiserver v0.23.4 h1:AFDUEu/yEf0YnuZhqhIFhPLPhhcQQVuR1u3WCh0rveU= +k8s.io/apiextensions-apiserver v0.23.4/go.mod h1:TWYAKymJx7nLMxWCgWm2RYGXHrGlVZnxIlGnvtfYu+g= k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc= -k8s.io/apimachinery v0.23.2 h1:dBmjCOeYBdg2ibcQxMuUq+OopZ9fjfLIR5taP/XKeTs= -k8s.io/apimachinery v0.23.2/go.mod h1:zDqeV0AK62LbCI0CI7KbWCAYdLg+E+8UXJ0rIz5gmS8= +k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= +k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.23.0/go.mod h1:Cec35u/9zAepDPPFyT+UMrgqOCjgJ5qtfVJDxjZYmt4= -k8s.io/apiserver v0.23.2/go.mod h1:Kdt8gafkPev9Gfh+H6lCPbmRu42f7BfhOfHKKa3dtyU= +k8s.io/apiserver v0.23.4/go.mod h1:A6l/ZcNtxGfPSqbFDoxxOjEjSKBaQmE+UTveOmMkpNc= k8s.io/client-go v0.23.0/go.mod h1:hrDnpnK1mSr65lHHcUuIZIXDgEbzc7/683c6hyG4jTA= -k8s.io/client-go v0.23.2 h1:BNbOcxa99jxHH8mM1cPKGIrrKRnCSAfAtyonYGsbFtE= -k8s.io/client-go v0.23.2/go.mod h1:k3YbsWg6GWdHF1THHTQP88X9RhB1DWPo3Dq7KfU/D1c= +k8s.io/client-go v0.23.4 h1:YVWvPeerA2gpUudLelvsolzH7c2sFoXXR5wM/sWqNFU= +k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= k8s.io/code-generator v0.23.0/go.mod h1:vQvOhDXhuzqiVfM/YHp+dmg10WDZCchJVObc9MvowsE= -k8s.io/code-generator v0.23.2/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= +k8s.io/code-generator v0.23.4/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= k8s.io/component-base v0.23.0/go.mod h1:DHH5uiFvLC1edCpvcTDV++NKULdYYU6pR9Tt3HIKMKI= -k8s.io/component-base v0.23.2 h1:dAYmUhWIBWO762etTjBEEKtYYHi5CoQInSLtK6LM1Zs= -k8s.io/component-base v0.23.2/go.mod h1:wS9Z03MO3oJ0RU8bB/dbXTiluGju+SC/F5i660gxB8c= +k8s.io/component-base v0.23.4 h1:SziYh48+QKxK+ykJ3Ejqd98XdZIseVBG7sBaNLPqy6M= +k8s.io/component-base v0.23.4/go.mod h1:8o3Gg8i2vnUXGPOwciiYlkSaZT+p+7gA9Scoz8y4W4E= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -1520,13 +1521,13 @@ k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26 h1:2G24ndYyfk0l23ZrGutxb0s9TRe4m1ZjFlcu4cEU1zA= -k8s.io/kube-openapi v0.0.0-20220114203427-a0453230fd26/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= +k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= @@ -1534,8 +1535,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.25/go.mod h1:Mlj9PNLmG9bZ6BHFwFKDo5afkpWyUISkb9Me0GnK66I= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.27/go.mod h1:tq2nT0Kx7W+/f2JVE+zxYtUhdjuELJkVpNz+x/QN5R4= -sigs.k8s.io/controller-runtime v0.11.0 h1:DqO+c8mywcZLFJWILq4iktoECTyn30Bkj0CwgqMpZWQ= -sigs.k8s.io/controller-runtime v0.11.0/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= +sigs.k8s.io/controller-runtime v0.11.1 h1:7YIHT2QnHJArj/dk9aUkYhfqfK5cIxPOX5gPECfdZLU= +sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/kustomize/pseudo/k8s v0.1.0 h1:otg4dLFc03c3gzl+2CV8GPGcd1kk8wjXwD+UhhcCn5I= diff --git a/components/usermgmt/main.go b/components/usermgmt/main.go index 57372e9..7bc92f0 100644 --- a/components/usermgmt/main.go +++ b/components/usermgmt/main.go @@ -20,9 +20,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager/signals" authzrpcv1 "github.com/RafaySystems/rcloud-base/components/authz/proto/rpc/v1" - "github.com/RafaySystems/rcloud-base/components/common/pkg/auth/interceptors" authv3 "github.com/RafaySystems/rcloud-base/components/common/pkg/auth/v3" "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" + grpc "github.com/RafaySystems/rcloud-base/components/common/pkg/grpc" logv2 "github.com/RafaySystems/rcloud-base/components/common/pkg/log" configrpc "github.com/RafaySystems/rcloud-base/components/common/proto/rpc/config" "github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/providers" @@ -30,7 +30,6 @@ import ( "github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/service" pbrpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3" rpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3" - "google.golang.org/grpc" _grpc "google.golang.org/grpc" ) @@ -123,6 +122,8 @@ func setup() { appHostHTTP = viper.GetString(appHostHTTPEnv) rpcRelayPeeringPort = rpcPort + 1 + + // Kratos client setup kratosConfig := kclient.NewConfiguration() kratosUrl := kratosScheme + "://" + kratosAddr kratosConfig.Servers[0].URL = kratosUrl @@ -139,7 +140,7 @@ func setup() { )) } - conn, err := grpc.Dial(":"+fmt.Sprint(authzPort), grpc.WithInsecure()) + conn, err := _grpc.Dial(":"+fmt.Sprint(authzPort), _grpc.WithInsecure()) if err != nil { log.Fatal("unable to connect to authz") } @@ -151,7 +152,6 @@ func setup() { rrs = service.NewRolepermissionService(db) is = service.NewIdpService(db, appHostHTTP) ps = service.NewOIDCProviderService(db, kratosUrl) - _log.Infow("usermgmt setup complete") } @@ -175,6 +175,7 @@ func runAPI(wg *sync.WaitGroup, ctx context.Context) { defer wg.Done() ctx, cancel := context.WithCancel(ctx) defer cancel() + mux := http.NewServeMux() gwHandler, err := gateway.NewGateway( @@ -191,7 +192,6 @@ func runAPI(wg *sync.WaitGroup, ctx context.Context) { if err != nil { _log.Fatalw("unable to create gateway", "error", err) } - mux.Handle("/", gwHandler) s := http.Server{ @@ -204,7 +204,6 @@ func runAPI(wg *sync.WaitGroup, ctx context.Context) { }() _log.Infow("starting gateway server", "port", apiPort) - err = s.ListenAndServe() if err != nil { _log.Fatalw("unable to start gateway", "error", err) @@ -213,7 +212,6 @@ func runAPI(wg *sync.WaitGroup, ctx context.Context) { func runRPC(wg *sync.WaitGroup, ctx context.Context) { defer wg.Done() - // defer configPool.Close() defer gs.Close() defer rs.Close() defer rrs.Close() @@ -232,20 +230,13 @@ func runRPC(wg *sync.WaitGroup, ctx context.Context) { var opts []_grpc.ServerOption if !dev { + ac := authv3.NewAuthContext() + o := authv3.Option{} opts = append(opts, _grpc.UnaryInterceptor( - interceptors.NewAuthInterceptorWithOptions( - interceptors.WithLogRequest(), - interceptors.WithAuthPool(authPool), - interceptors.WithExclude("POST", "/v2/sentry/bootstrap/:templateToken/register"), - ), + ac.NewAuthUnaryInterceptor(o), )) - defer authPool.Close() - } else { - opts = append(opts, _grpc.UnaryInterceptor( - interceptors.NewAuthInterceptorWithOptions(interceptors.WithDummy())), - ) } - s := grpc.NewServer(opts...) + s, err := grpc.NewServer(opts...) if err != nil { _log.Fatalw("unable to create grpc server", "error", err) }