Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update README #123

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading