grpcauth

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL