Skip to content

Commit

Permalink
adjust validate order
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian authored and yndu13 committed Apr 22, 2024
1 parent 7fca991 commit 3c50b50
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions credentials/credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,22 +310,26 @@ func checkoutAssumeRamoidc(config *Config) (err error) {
}

func checkRAMRoleArn(config *Config) (err error) {
if tea.StringValue(config.AccessKeyId) == "" {
err = errors.New("AccessKeyId cannot be empty")
return
}

if tea.StringValue(config.AccessKeySecret) == "" {
err = errors.New("AccessKeySecret cannot be empty")
return
}

if tea.StringValue(config.RoleArn) == "" {
err = errors.New("RoleArn cannot be empty")
return
}

if tea.StringValue(config.RoleSessionName) == "" {
err = errors.New("RoleSessionName cannot be empty")
return
}
if tea.StringValue(config.AccessKeyId) == "" {
err = errors.New("AccessKeyId cannot be empty")
return
}

return
}

Expand Down

0 comments on commit 3c50b50

Please sign in to comment.