Documentation
¶
Overview ¶
Package grpcauth 提供轻量级 gRPC 静态 Bearer Token 认证拦截器。 适用于内部服务间通信的简单预共享 token 校验场景。 如需完整的认证/授权流程(JWT 解析、RBAC 等),请使用 pkg/middleware/auth。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(token string, required bool) grpc.StreamServerInterceptor
StreamServerInterceptor 返回校验静态 Bearer Token 的流拦截器。
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(token string, required bool) grpc.UnaryServerInterceptor
UnaryServerInterceptor 返回校验静态 Bearer Token 的一元拦截器。 token 为期望的令牌值(不含 "Bearer " 前缀)。 required 为 true 时缺少 token 返回 Unauthenticated;为 false 时放行。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.