Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
yndu13 committed Oct 28, 2024
1 parent c0ceba9 commit a235167
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ func main() {
// 设置更小的权限策略,非必填。示例值:{"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"}
SetPolicy("Policy").
// 设置session过期时间,非必填。
SetSessionExpiration(3600)
SetRoleSessionExpiration(3600).
// 非必填,默认为sts.aliyuncs.com,建议使用Region化的STS域名,选择地理位置更接近的Region可以保证网络连通性,Region对应的域名请参考:https://api.aliyun.com/product/Sts
SetSTSEndpoint("sts.cn-hangzhou.aliyuncs.com")

provider, err := credentials.NewCredential(config)
if err != nil {
Expand Down Expand Up @@ -208,7 +210,11 @@ func main(){
// 设置更小的权限策略,非必填。示例值:{"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"}
SetPolicy("Policy").
// 设置session过期时间,非必填。
SetRoleSessionExpiration(3600)
SetRoleSessionExpiration(3600).
// 非必填,角色外部 ID,该参数为外部提供的用于表示角色的参数信息,主要功能是防止混淆代理人问题。更多信息请参考:https://help.aliyun.com/zh/ram/use-cases/use-externalid-to-prevent-the-confused-deputy-problem
SetExternalId("ExternalId").
// 非必填,默认为sts.aliyuncs.com,建议使用Region化的STS域名,选择地理位置更接近的Region可以保证网络连通性,Region对应的域名请参考:https://api.aliyun.com/product/Sts
SetSTSEndpoint("sts.cn-hangzhou.aliyuncs.com")

provider, err := credentials.NewCredential(config)
if err != nil {
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ func main() {
// Optional. Specify limited permissions for the RAM role. Example: {"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"}.
SetPolicy("Policy").
// Optional. Specify the validity period of the session.
SetSessionExpiration(3600)
SetRoleSessionExpiration(3600).
// Optional. The default value is sts.aliyuncs.com. It is recommended to use a regionalized STS domain name. Selecting a region that is geographically closer can ensure network connectivity. For the domain name corresponding to the region, please refer to: https://api.alibabacloud.com/product/Sts
SetSTSEndpoint("sts.cn-hangzhou.aliyuncs.com")

provider, err := credentials.NewCredential(config)
if err != nil {
return
Expand Down Expand Up @@ -213,7 +216,11 @@ func main(){
// Optional. Specify limited permissions for the RAM role. Example: {"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"}.
SetPolicy("Policy").
// Optional. Specify the expiration of the session
SetRoleSessionExpiration(3600)
SetRoleSessionExpiration(3600).
// Optional, role external ID, this parameter is the parameter information provided externally to represent the role, and its main function is to prevent the confused deputy problem. For more information, please refer to: https://www.alibabacloud.com/help/en/ram/use-cases/use-externalid-to-prevent-the-confused-deputy-problem
SetExternalId("ExternalId").
// Optional. The default value is sts.aliyuncs.com. It is recommended to use a regionalized STS domain name. Selecting a region that is geographically closer can ensure network connectivity. For the domain name corresponding to the region, please refer to: https://api.alibabacloud.com/product/Sts
SetSTSEndpoint("sts.cn-hangzhou.aliyuncs.com")

provider, err := credentials.NewCredential(config)
if err != nil {
Expand Down

0 comments on commit a235167

Please sign in to comment.