sts

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SecretId        string //访问管理密钥ID
	SecretKey       string //访问管理密钥KEY
	Region          string //区域 https://cloud.tencent.com/document/product/614/18940
	Name            string //您可以自定义调用方英文名称,由字母组成。
	Policy          string //授予该临时证书权限的CAM策略  https://cloud.tencent.com/document/product/598/10603
	DurationSeconds uint64 //指定临时证书的有效期,单位:秒,默认1800秒,主账号最长可设定有效期为7200秒,子账号最长可设定有效期为129600秒。
	Debug           bool   //debug
}

https://cloud.tencent.com/document/product/598/33416 使用子账户模式,请先通过主账户授权开通 QcloudTCBFullAccess(云开发全读写访问), QcloudAccessForTCBRole(云开发对云资源的访问权限) https://cloud.tencent.com/document/product/598/36256

type Sts

type Sts struct {
	*Config
	// contains filtered or unexported fields
}

https://cloud.tencent.com/document/product/598/33416

func NewStsClient

func NewStsClient(c *Config, redis *gredis.Redis, logger *logrus.Logger) *Sts

初始化实列

func (*Sts) GetFederationToken

func (c *Sts) GetFederationToken() (response *v20180813.GetFederationTokenResponse, err error)

获取临时token

func (*Sts) RefreshFederationToken

func (c *Sts) RefreshFederationToken() (response *v20180813.GetFederationTokenResponse, err error)

刷新token

func (*Sts) SetName

func (c *Sts) SetName(name string) *Sts

自定义调用方英文名称

func (*Sts) SetPolicy

func (c *Sts) SetPolicy(policy string) *Sts

授予该临时证书权限的CAM策略

Jump to

Keyboard shortcuts

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