Skip to content
This repository was archived by the owner on Dec 20, 2022. It is now read-only.

Commit 79614ab

Browse files
WindzCUHKkpangokevindiu
authored
[minor] GRPC support takeover (#91)
* add grpc support for authorization-proxy Signed-off-by: kpango <[email protected]> * use ioutil.NopCLoser in test code Signed-off-by: kevindiu <[email protected]> * fix race error in test code Signed-off-by: kevindiu <[email protected]> * add grpc design doc Signed-off-by: kevindiu <[email protected]> * add grpc design doc Signed-off-by: kevindiu <[email protected]> * fix unit test * typo * fix conflict * remove unused TLS * fix typo * update doc Signed-off-by: kpango <[email protected]> Signed-off-by: kevindiu <[email protected]> Co-authored-by: kpango <[email protected]> Co-authored-by: kevindiu <[email protected]>
1 parent 2e284df commit 79614ab

21 files changed

+2125
-87
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ alias:
1313
GITHUB_API: "https://api.github.com/"
1414
DOCKER_USER: "tatyano"
1515
setup_remote_docker: &setup_remote_docker
16-
version: 19.03.8
16+
version: 20.10.14
1717

1818
version: 2
1919
jobs:

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ type Transport struct {
290290

291291
// New returns the decoded configuration YAML file as *Config struct. Returns non-nil error if any.
292292
func New(path string) (*Config, error) {
293-
f, err := os.OpenFile(path, os.O_RDONLY, 0600)
293+
f, err := os.OpenFile(path, os.O_RDONLY, 0o600)
294294
if err != nil {
295295
return nil, errors.Wrap(err, "OpenFile failed")
296296
}

config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestNew(t *testing.T) {
6060
}
6161
defer f.Close()
6262

63-
err = f.Chmod(0000)
63+
err = f.Chmod(0o000)
6464
if err != nil {
6565
return err
6666
}

docs/grpc-design-brief.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Athenz provider sidecar with gRPC support
2+
3+
## How do we implement this feature?
4+
5+
Since provider sidecar is implemented in go, we decided to find a library that supports like reverse proxy feature in gRPC interface, and we found [this library](https://github.com/mwitkow/grpc-proxy).
6+
7+
## Making code changes
8+
9+
We implemented the feature with the below attention:
10+
11+
1. Match the current code structure
12+
2. No breakable changes from the user side
13+
14+
For 2, it is mainly focusing on the provider sidecar configuration.
15+
16+
When the user uses the legacy provider sidecar configuration file with the new version, it will still work without any update on the configuration file.
17+
18+
### Implementation
19+
20+
File changes:
21+
22+
https://github.com/yahoojapan/authorization-proxy/pull/83/files
23+
24+
We have updated/changed the implementation in the following layers:
25+
26+
- usecase
27+
- service
28+
- handler
29+
30+
#### Usecase layer
31+
32+
In this layer, we create gRPC handler and pass it to service layer.
33+
34+
[Reference](https://github.com/yahoojapan/authorization-proxy/blob/1e14186eb1dd959e246a18be98c92d40a677a56e/usecase/authz_proxyd.go#L71-L84)
35+
36+
#### Service layer
37+
38+
In service layer, we implemented server startup logic. When the handler created from usecase layer is nil, the HTTP mode will be started like before.
39+
40+
#### Handler layer
41+
42+
In this layer, we implemented gRPC reverse proxy handler.
43+
44+
When the value of the configuration `proxy.scheme` is set to `grpc`, the gRPC handler will be created, and the server will start with gRPC mode.
45+
46+
[Reference](https://github.com/yahoojapan/authorization-proxy/blob/1e14186eb1dd959e246a18be98c92d40a677a56e/config/config.go#L133)
47+
48+
If it is not `grpc`, nil will be returned, and the service layer will start with HTTP mode.
49+
50+
[Reference](https://github.com/yahoojapan/authorization-proxy/blob/1e14186eb1dd959e246a18be98c92d40a677a56e/handler/grpc.go)
51+
52+
It retrieves the role token from the gRPC metadata, and authorize it using the athenz-authorizer.
53+
54+
If authorization succeeded, the gRPC request will proxy to the backend.
55+
56+
## Configuration
57+
58+
In handler layer, the gRPC call will be authenticated and authorized by athenz policy.
59+
60+
Setting the athenz policy is almost the same as before, other than the resource set on the resource.
61+
62+
The resource name is defined in the proto files [here](https://github.com/vdaas/vald/tree/master/apis/proto/v1/vald), following by the following scheme.
63+
64+
`/<package name>.<service name>/<rpc name>`
65+
66+
For example, Vald provides an interface for users to insert vector. Here is the proto file:
67+
68+
https://github.com/vdaas/vald/blob/master/apis/proto/v1/vald/insert.proto
69+
70+
```proto
71+
syntax = "proto3";
72+
73+
package vald.v1;
74+
75+
import "apis/proto/v1/payload/payload.proto";
76+
import "github.com/googleapis/googleapis/google/api/annotations.proto";
77+
78+
option go_package = "github.com/vdaas/vald/apis/grpc/v1/vald";
79+
option java_multiple_files = true;
80+
option java_package = "org.vdaas.vald.api.v1.vald";
81+
option java_outer_classname = "ValdInsert";
82+
83+
service Insert {
84+
85+
rpc Insert(payload.v1.Insert.Request) returns (payload.v1.Object.Location) {
86+
option (google.api.http) = {
87+
post : "/insert"
88+
body : "*"
89+
};
90+
}
91+
92+
rpc StreamInsert(stream payload.v1.Insert.Request)
93+
returns (stream payload.v1.Object.StreamLocation) {}
94+
95+
rpc MultiInsert(payload.v1.Insert.MultiRequest)
96+
returns (payload.v1.Object.Locations) {
97+
option (google.api.http) = {
98+
post : "/insert/multiple"
99+
body : "*"
100+
};
101+
}
102+
}
103+
```
104+
105+
Following the syntax, to configure the resource in policy should be `/vald.v1.insert/insert`.
106+
107+
For another gRPC interfaces, it should be the same.
108+
109+
The policy action is `grpc`, which is hardcoded in the source code.
110+
111+
## Design
112+
113+
### Athenz Provider Sidecar
114+
115+
Athenz provider sidecar can start with either gRPC mode and HTTP mode at the same time. The reasons are:
116+
117+
- We wanted to make minimal changes to it
118+
- Supporting both gRPC and HTTP mode at the same time causes big changes on configuration file, and it may lead to breaking changes
119+
- Also there are no such requirement from users
120+
121+
### Athenz Policy
122+
123+
To design Athenz policy configuration, there are 2 fields we need to think about:
124+
125+
- Action
126+
- Resources
127+
128+
#### Policy Action
129+
130+
In the world of HTTP, different HTTP methods are supported, like `GET` and `POST`, and these value is used in action field.
131+
132+
But in gRPC, there are no such concept.
133+
For each RPC endpoint, only 1 resource is supported.
134+
135+
But [gRPC supports 4 different types](https://grpc.io/docs/what-is-grpc/core-concepts/#rpc-life-cycle):
136+
137+
- Unary RPC
138+
- Server streaming RPC
139+
- Client streaming RPC
140+
- Bidirectional streaming RPC
141+
142+
Due to the limitation of gRPC, each RPC endpoint support only 1 resource, a separate endpoint is required for each RPC type.
143+
144+
For the reasons above, currently Vald team decided to hardcode `grpc` in the action field and use the when performing authentication and authorization check.
145+
146+
[Reference](https://github.com/yahoojapan/authorization-proxy/blob/1e14186eb1dd959e246a18be98c92d40a677a56e/handler/grpc.go#L67)
147+
148+
#### Policy Resources
149+
150+
For HTTP mode of the provider sidecar, the HTTP url is set as the policy resources.
151+
152+
In gRPC, each RPC is differentiate with the gRPC method.
153+
154+
Like explained above, the gRPC method name is named by the following rule.
155+
156+
`/<package name>.<service name>/<rpc name>`
157+
158+
In Vald, each functionality is divided into different service. For example insert service, update service, delete service and etc.
159+
160+
For each services, each types (4 types explained above, e.g. unary, server streaming, etc.) are configured into different RPC.
161+
162+
We can easily control the authorization rule for each functionality by using wildcard resource in Vald.
163+
164+
For example we can easily enable or disable all insert resources for the user by configuring the Athenz policy like:
165+
166+
`ALLOW grpc <athenz.domain>:<role.name> <athenz.domain>:/vald.v1.insert/*`

go.mod

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ go 1.18
44

55
require (
66
github.com/kpango/glg v1.6.12
7+
github.com/mwitkow/grpc-proxy v0.0.0-20220126150247-db34e7bfee32
78
github.com/pkg/errors v0.9.1
89
github.com/yahoojapan/athenz-authorizer/v5 v5.3.2
9-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
10+
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29
11+
google.golang.org/grpc v1.46.2
12+
google.golang.org/protobuf v1.28.0
1013
gopkg.in/yaml.v2 v2.4.0
1114
)
1215

@@ -16,6 +19,7 @@ require (
1619
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d // indirect
1720
github.com/goccy/go-json v0.9.10 // indirect
1821
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
22+
github.com/golang/protobuf v1.5.2 // indirect
1923
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
2024
github.com/kpango/fastime v1.1.4 // indirect
2125
github.com/kpango/gache v1.2.7 // indirect
@@ -27,8 +31,10 @@ require (
2731
github.com/lestrrat-go/option v1.0.0 // indirect
2832
github.com/zeebo/xxh3 v1.0.1 // indirect
2933
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
34+
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d // indirect
35+
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
36+
golang.org/x/text v0.3.7 // indirect
37+
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 // indirect
3038
)
3139

32-
replace golang.org/x/text v0.3.0 => golang.org/x/text v0.3.3
33-
34-
replace golang.org/x/text v0.3.2 => golang.org/x/text v0.3.3
40+
replace golang.org/x/text => golang.org/x/text v0.3.7

go.sum

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y
9090
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
9191
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
9292
github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ=
93+
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
9394
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
9495
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
9596
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
@@ -145,6 +146,7 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
145146
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
146147
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
147148
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
149+
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
148150
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
149151
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
150152
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -160,6 +162,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
160162
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
161163
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
162164
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
165+
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
163166
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
164167
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
165168
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -240,6 +243,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
240243
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
241244
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
242245
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
246+
github.com/mwitkow/grpc-proxy v0.0.0-20220126150247-db34e7bfee32 h1:CC9KzU7WPrK6DTppkUGiwmttoHCNwOLT7Z+stp1eIpU=
247+
github.com/mwitkow/grpc-proxy v0.0.0-20220126150247-db34e7bfee32/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0=
243248
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
244249
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
245250
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
@@ -378,10 +383,12 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
378383
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
379384
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
380385
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
386+
golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
381387
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
382388
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
383389
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
384390
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
391+
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d h1:1n1fc535VhN8SYtD4cDUyNlfpAF2ROMM9+11equK3hs=
385392
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
386393
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
387394
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -405,8 +412,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
405412
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
406413
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
407414
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
408-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
409415
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
416+
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4=
417+
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
410418
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
411419
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
412420
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -450,19 +458,16 @@ golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7w
450458
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
451459
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
452460
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
461+
golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
453462
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
454463
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
455464
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
456465
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
457466
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
467+
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
458468
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
459469
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
460-
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
461-
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
462-
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
463-
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
464-
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
465-
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
470+
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
466471
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
467472
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
468473
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -592,6 +597,8 @@ google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6D
592597
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
593598
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
594599
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
600+
google.golang.org/genproto v0.0.0-20210401141331-865547bb08e2/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
601+
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 h1:E7wSQBXkH3T3diucK+9Z1kjn4+/9tNG7lZLr75oOhh8=
595602
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
596603
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
597604
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
@@ -613,6 +620,8 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG
613620
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
614621
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
615622
google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
623+
google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ=
624+
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
616625
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
617626
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
618627
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -626,6 +635,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
626635
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
627636
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
628637
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
638+
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
639+
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
629640
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
630641
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
631642
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -656,6 +667,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
656667
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
657668
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
658669
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
670+
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
659671
inet.af/peercred v0.0.0-20210906144145-0893ea02156a/go.mod h1:FjawnflS/udxX+SvpsMgZfdqx2aykOlkISeAsADi5IU=
660672
k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ=
661673
k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM=

handler/error.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,10 @@ const (
4242

4343
// ErrMsgUnverified "unauthenticated/unauthorized"
4444
ErrMsgUnverified = "unauthenticated/unauthorized"
45+
46+
// ErrGRPCMetadataNotFound "grpc metadata not found"
47+
ErrGRPCMetadataNotFound = "grpc metadata not found"
48+
49+
// ErrRoleTokenNotFound "role token not found"
50+
ErrRoleTokenNotFound = "role token not found"
4551
)

0 commit comments

Comments
 (0)