Skip to content

Commit e0c015d

Browse files
authored
Update ch4-05-grpc-hack.md
修改错别字
1 parent c6c368d commit e0c015d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ch4-rpc/ch4-05-grpc-hack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (a *Authentication) RequireTransportSecurity() bool {
222222
}
223223
```
224224

225-
在 GetRequestMetadata 方法中,我们返回地认证信息包装 user 和 password 两个信息。为了演示代码简单,RequireTransportSecurity 方法表示不要求底层使用安全连接。
225+
在 GetRequestMetadata 方法中,我们返回的认证信息包装 user 和 password 两个信息。为了演示代码简单,RequireTransportSecurity 方法表示不要求底层使用安全连接。
226226

227227
然后在每次请求 gRPC 服务时就可以将 Token 信息作为参数选项传人:
228228

@@ -280,7 +280,7 @@ func (a *Authentication) Auth(ctx context.Context) error {
280280
}
281281
```
282282

283-
详细地认证工作主要在 Authentication.Auth 方法中完成。首先通过 metadata.FromIncomingContext 从 ctx 上下文中获取元信息,然后取出相应的认证信息进行认证。如果认证失败,则返回一个 codes.Unauthenticated 类型地错误
283+
详细的认证工作主要在 Authentication.Auth 方法中完成。首先通过 metadata.FromIncomingContext 从 ctx 上下文中获取元信息,然后取出相应的认证信息进行认证。如果认证失败,则返回一个 codes.Unauthenticated 类型的错误
284284

285285
## 4.5.3 截取器
286286

0 commit comments

Comments
 (0)