修改获取token参数

This commit is contained in:
tzwang 2023-02-28 17:11:51 +08:00
parent 2280a72820
commit 12b6eddab9
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ const (
IAMUser = "pcmmodelarts"
IAMPassword = "!QAZ2wsx3edc4"
IAMDomain = "hw_008618597947378_01"
AuthMethod = "password"
IAMTokenUrl = "https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens"
ProjectName = "cn-north-4"
TokenHeader = "X-Subject-Token"
@ -26,7 +27,7 @@ var (
func GenerateToken() (string, time.Time) {
a := Auth{}
a.Auth.Scope.Project.Name = ProjectName
a.Auth.Identity.Methods = append(a.Auth.Identity.Methods, IAMPassword)
a.Auth.Identity.Methods = append(a.Auth.Identity.Methods, AuthMethod)
a.Auth.Identity.Password.User.Name = IAMUser
a.Auth.Identity.Password.User.Password = IAMPassword
a.Auth.Identity.Password.User.Domain.Name = IAMDomain