Documentation
¶
Overview ¶
Package client 提供认证相关 gRPC 客户端能力。
Index ¶
- type Client
- func (c *Client) GetJWKS(ctx context.Context, req *authnv1.GetJWKSRequest) (*authnv1.GetJWKSResponse, error)
- func (c *Client) IssueServiceToken(ctx context.Context, req *authnv1.IssueServiceTokenRequest) (*authnv1.IssueServiceTokenResponse, error)
- func (c *Client) JWKSRaw() authnv1.JWKSServiceClient
- func (c *Client) Raw() authnv1.AuthServiceClient
- func (c *Client) RefreshToken(ctx context.Context, req *authnv1.RefreshTokenRequest) (*authnv1.RefreshTokenResponse, error)
- func (c *Client) RegisterOperationAccount(ctx context.Context, req *authnv1.RegisterOperationAccountRequest) (*authnv1.RegisterOperationAccountResponse, error)
- func (c *Client) RevokeRefreshToken(ctx context.Context, req *authnv1.RevokeRefreshTokenRequest) (*authnv1.RevokeRefreshTokenResponse, error)
- func (c *Client) RevokeToken(ctx context.Context, req *authnv1.RevokeTokenRequest) (*authnv1.RevokeTokenResponse, error)
- func (c *Client) VerifyToken(ctx context.Context, req *authnv1.VerifyTokenRequest) (*authnv1.VerifyTokenResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 认证服务客户端。
提供认证相关功能,包括:
- Token 验证和管理(VerifyToken、RefreshToken、RevokeToken、RevokeRefreshToken)
- 服务间认证(IssueServiceToken)
- JWKS 管理(GetJWKS)
func NewClient ¶
func NewClient(authService authnv1.AuthServiceClient, jwksService authnv1.JWKSServiceClient) *Client
NewClient 创建认证服务客户端。
func (*Client) GetJWKS ¶
func (c *Client) GetJWKS(ctx context.Context, req *authnv1.GetJWKSRequest) (*authnv1.GetJWKSResponse, error)
GetJWKS 获取 JSON Web Key Set (JWKS)。
func (*Client) IssueServiceToken ¶
func (c *Client) IssueServiceToken(ctx context.Context, req *authnv1.IssueServiceTokenRequest) (*authnv1.IssueServiceTokenResponse, error)
IssueServiceToken 签发服务间认证 Token。
func (*Client) JWKSRaw ¶
func (c *Client) JWKSRaw() authnv1.JWKSServiceClient
JWKSRaw 返回原始 JWKS 服务 gRPC 客户端。
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(ctx context.Context, req *authnv1.RefreshTokenRequest) (*authnv1.RefreshTokenResponse, error)
RefreshToken 使用 Refresh Token 刷新获取新的 Access Token。
func (*Client) RegisterOperationAccount ¶
func (c *Client) RegisterOperationAccount(ctx context.Context, req *authnv1.RegisterOperationAccountRequest) (*authnv1.RegisterOperationAccountResponse, error)
RegisterOperationAccount 创建运营后台账号,并按需创建用户、账户和密码凭据。
func (*Client) RevokeRefreshToken ¶
func (c *Client) RevokeRefreshToken(ctx context.Context, req *authnv1.RevokeRefreshTokenRequest) (*authnv1.RevokeRefreshTokenResponse, error)
RevokeRefreshToken 撤销 Refresh Token。
func (*Client) RevokeToken ¶
func (c *Client) RevokeToken(ctx context.Context, req *authnv1.RevokeTokenRequest) (*authnv1.RevokeTokenResponse, error)
RevokeToken 撤销 Access Token。
func (*Client) VerifyToken ¶
func (c *Client) VerifyToken(ctx context.Context, req *authnv1.VerifyTokenRequest) (*authnv1.VerifyTokenResponse, error)
VerifyToken 在线验证 Access Token。
Click to show internal directories.
Click to hide internal directories.