auth: support "authorization" token for grpc-gateway
@@ -1000,8 +1000,12 @@ func (as *authStore) AuthInfoFromCtx(ctx context.Context) (*AuthInfo, error) {
return nil, nil
}
- ts, tok := md["token"]
- if !tok {
+ //TODO(mitake|hexfusion) review unifying key names
+ ts, ok := md["token"]
+ if !ok {
+ ts, ok = md["authorization"]
+ }
+ if !ok {
return nil, nil
}
@@ -1011,6 +1015,7 @@ func (as *authStore) AuthInfoFromCtx(ctx context.Context) (*AuthInfo, error) {
plog.Warningf("invalid auth token: %s", token)
return nil, ErrInvalidAuthToken
}
+
return authInfo, nil
}
