authz

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package authz 提供授权判定(PDP)能力。

Index

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 授权服务客户端。

func NewClient

func NewClient(authorizationService authzv1.AuthorizationServiceClient) *Client

NewClient 创建授权服务客户端。

func (*Client) Allow

func (c *Client) Allow(ctx context.Context, subject, domain, object, action string) (bool, error)

Allow 是 Check 的便捷封装,只返回最终布尔结果。

func (*Client) Check

Check 对单条 (subject, domain, object, action) 执行授权判定。

func (*Client) GetAuthorizationSnapshot

GetAuthorizationSnapshot 获取主体在指定租户/应用下的授权快照。

func (*Client) GrantAssignment

GrantAssignment 为主体授予角色。

func (*Client) Raw

Raw 返回原始 AuthorizationService gRPC 客户端。

func (*Client) RevokeAssignment

RevokeAssignment 撤销主体上的角色。

Jump to

Keyboard shortcuts

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