add gateway
This commit is contained in:
@@ -30,6 +30,17 @@ func ParseMetaCtx(ctx context.Context, opts *ParseOptions) (*Meta, error) {
|
||||
return nil, errcode.ErrJWTAuthNotFound
|
||||
}
|
||||
|
||||
// 安全获取 metadata 中的值
|
||||
identityValues := md.Get("authorization_identity")
|
||||
clientValues := md.Get("client")
|
||||
|
||||
if len(identityValues) == 0 {
|
||||
return nil, errcode.ErrJWTAuthNotFound
|
||||
}
|
||||
if len(clientValues) == 0 {
|
||||
return nil, errcode.ErrJWTAuthNotFound
|
||||
}
|
||||
|
||||
meta := &Meta{
|
||||
IDENTITY: md["authorization_identity"][0],
|
||||
CLIENT: md["client"][0],
|
||||
|
||||
Reference in New Issue
Block a user