Documentation
¶
Overview ¶
Package client 提供认证相关 gRPC 客户端能力。
Index ¶
- type Client
- func (c *Client) AccountOnboardingRaw() authnv2.AccountOnboardingServiceClient
- func (c *Client) CreateOperationAccount(ctx context.Context, req *authnv2.CreateOperationAccountRequest) (*authnv2.CreateOperationAccountResponse, error)
- func (c *Client) GetJWKS(ctx context.Context, req *authnv2.GetJWKSRequest) (*authnv2.GetJWKSResponse, error)
- func (c *Client) IssueServiceToken(ctx context.Context, req *authnv2.IssueServiceTokenRequest) (*authnv2.IssueServiceTokenResponse, error)
- func (c *Client) JWKSRaw() authnv2.JWKSServiceClient
- func (c *Client) Raw() authnv2.AuthServiceClient
- func (c *Client) RefreshToken(ctx context.Context, req *authnv2.RefreshTokenRequest) (*authnv2.RefreshTokenResponse, error)
- func (c *Client) RevokeRefreshToken(ctx context.Context, req *authnv2.RevokeRefreshTokenRequest) (*authnv2.RevokeRefreshTokenResponse, error)
- func (c *Client) RevokeToken(ctx context.Context, req *authnv2.RevokeTokenRequest) (*authnv2.RevokeTokenResponse, error)
- func (c *Client) VerifyToken(ctx context.Context, req *authnv2.VerifyTokenRequest) (*authnv2.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)
- 账号开通(CreateOperationAccount)
- 服务间认证(IssueServiceToken)
- JWKS 管理(GetJWKS)
func NewClient ¶
func NewClient( authService authnv2.AuthServiceClient, accountOnboardingService authnv2.AccountOnboardingServiceClient, jwksService authnv2.JWKSServiceClient, ) *Client
NewClient 创建认证服务客户端。
func (*Client) AccountOnboardingRaw ¶
func (c *Client) AccountOnboardingRaw() authnv2.AccountOnboardingServiceClient
AccountOnboardingRaw 返回原始账号开通 gRPC 客户端。
func (*Client) CreateOperationAccount ¶
func (c *Client) CreateOperationAccount(ctx context.Context, req *authnv2.CreateOperationAccountRequest) (*authnv2.CreateOperationAccountResponse, error)
CreateOperationAccount 创建运营后台账号,并按需创建用户、账户和密码凭据。
func (*Client) GetJWKS ¶
func (c *Client) GetJWKS(ctx context.Context, req *authnv2.GetJWKSRequest) (*authnv2.GetJWKSResponse, error)
GetJWKS 获取 JSON Web Key Set (JWKS)。
func (*Client) IssueServiceToken ¶
func (c *Client) IssueServiceToken(ctx context.Context, req *authnv2.IssueServiceTokenRequest) (*authnv2.IssueServiceTokenResponse, error)
IssueServiceToken 签发服务间认证 Token。
func (*Client) JWKSRaw ¶
func (c *Client) JWKSRaw() authnv2.JWKSServiceClient
JWKSRaw 返回原始 JWKS 服务 gRPC 客户端。
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(ctx context.Context, req *authnv2.RefreshTokenRequest) (*authnv2.RefreshTokenResponse, error)
RefreshToken 使用 Refresh Token 刷新获取新的 Access Token。
func (*Client) RevokeRefreshToken ¶
func (c *Client) RevokeRefreshToken(ctx context.Context, req *authnv2.RevokeRefreshTokenRequest) (*authnv2.RevokeRefreshTokenResponse, error)
RevokeRefreshToken 撤销 Refresh Token。
func (*Client) RevokeToken ¶
func (c *Client) RevokeToken(ctx context.Context, req *authnv2.RevokeTokenRequest) (*authnv2.RevokeTokenResponse, error)
RevokeToken 撤销 Access Token。
func (*Client) VerifyToken ¶
func (c *Client) VerifyToken(ctx context.Context, req *authnv2.VerifyTokenRequest) (*authnv2.VerifyTokenResponse, error)
VerifyToken 在线验证 Access Token。
Click to show internal directories.
Click to hide internal directories.