create_policy

package
v7.25.5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

新建授权策略

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateActions

type CreateActions = []string

授权策略规则的操作集合

type CreatePolicyParam

type CreatePolicyParam = Request

创建授权策略参数

type CreateResources

type CreateResources = []string

授权策略规则的资源集合

type CreateStatement

type CreateStatement struct {
	Actions   CreateActions   // 授权策略规则的操作集合,action 查询参考 action 接口,格式为 service/action_alias
	Resources CreateResources // 授权策略规则的资源集合,格式为 qrn:product:region:uid:[resource-type/]resource-id ;可以简写为 qrn:product:::resource-id
	Effect    string          // 授权策略规则的生效类型,允许访问或拒绝访问
}

授权策略规则

func (*CreateStatement) MarshalJSON

func (j *CreateStatement) MarshalJSON() ([]byte, error)

func (*CreateStatement) UnmarshalJSON

func (j *CreateStatement) UnmarshalJSON(data []byte) error

type CreateStatements

type CreateStatements = []CreateStatement

授权策略规则集合

type CreatedActions

type CreatedActions = []string

授权策略规则的操作集合

type CreatedPolicyData

type CreatedPolicyData = Data

返回的授权策略信息

type CreatedPolicyResp

type CreatedPolicyResp = Response

返回的授权策略响应

type CreatedResources

type CreatedResources = []string

授权策略规则的资源集合

type CreatedStatement

type CreatedStatement struct {
	Actions   CreatedActions   // 授权策略规则的操作集合
	Resources CreatedResources // 授权策略规则的资源集合
	Effect    string           // 授权策略规则的生效类型,允许访问或拒绝访问
}

授权策略规则

func (*CreatedStatement) MarshalJSON

func (j *CreatedStatement) MarshalJSON() ([]byte, error)

func (*CreatedStatement) UnmarshalJSON

func (j *CreatedStatement) UnmarshalJSON(data []byte) error

type CreatedStatements

type CreatedStatements = []CreatedStatement

授权策略规则集合

type Data

type Data struct {
	Id          string            // 记录 ID
	RootUid     int64             // 根用户 uid
	Alias       string            // 授权策略别名
	Description string            // 授权策略描述
	Enabled     bool              // 授权策略是否启用
	CreatedAt   string            // 授权策略创建时间
	UpdatedAt   string            // 授权策略上次更新时间
	Statement   CreatedStatements // 授权策略规则集合
}

授权策略信息

func (*Data) MarshalJSON

func (j *Data) MarshalJSON() ([]byte, error)

func (*Data) UnmarshalJSON

func (j *Data) UnmarshalJSON(data []byte) error

type Request

type Request struct {
	Credentials credentials.CredentialsProvider // 鉴权参数,用于生成鉴权凭证,如果为空,则使用 HTTPClientOptions 中的 CredentialsProvider
	Alias       string                          // 授权策略别名,由 `A-Za-z0-9` 组成
	EditType    int64                           // 1:是通过自定义 JSON 编辑的策略 2:是通过 UI 编辑的策略
	Description string                          // 授权策略描述
	Statement   CreateStatements                // 授权策略规则集合
}

调用 API 所用的请求

func (*Request) MarshalJSON

func (j *Request) MarshalJSON() ([]byte, error)

func (*Request) UnmarshalJSON

func (j *Request) UnmarshalJSON(data []byte) error

type Response

type Response struct {
	Data CreatedPolicyData // 授权策略信息
}

获取 API 所用的响应

func (*Response) MarshalJSON

func (j *Response) MarshalJSON() ([]byte, error)

func (*Response) UnmarshalJSON

func (j *Response) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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