mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 13:37:08 +08:00
vendor: update buildkit to v0.19.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
6
vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go
generated
vendored
6
vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go
generated
vendored
@ -308,6 +308,11 @@ func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, err
|
||||
return aws.Credentials{Source: ProviderName}, err
|
||||
}
|
||||
|
||||
var accountID string
|
||||
if resp.AssumedRoleUser != nil {
|
||||
accountID = getAccountID(resp.AssumedRoleUser)
|
||||
}
|
||||
|
||||
return aws.Credentials{
|
||||
AccessKeyID: *resp.Credentials.AccessKeyId,
|
||||
SecretAccessKey: *resp.Credentials.SecretAccessKey,
|
||||
@ -316,5 +321,6 @@ func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, err
|
||||
|
||||
CanExpire: true,
|
||||
Expires: *resp.Credentials.Expiration,
|
||||
AccountID: accountID,
|
||||
}, nil
|
||||
}
|
||||
|
19
vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go
generated
vendored
19
vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go
generated
vendored
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
@ -135,6 +136,11 @@ func (p *WebIdentityRoleProvider) Retrieve(ctx context.Context) (aws.Credentials
|
||||
return aws.Credentials{}, fmt.Errorf("failed to retrieve credentials, %w", err)
|
||||
}
|
||||
|
||||
var accountID string
|
||||
if resp.AssumedRoleUser != nil {
|
||||
accountID = getAccountID(resp.AssumedRoleUser)
|
||||
}
|
||||
|
||||
// InvalidIdentityToken error is a temporary error that can occur
|
||||
// when assuming an Role with a JWT web identity token.
|
||||
|
||||
@ -145,6 +151,19 @@ func (p *WebIdentityRoleProvider) Retrieve(ctx context.Context) (aws.Credentials
|
||||
Source: WebIdentityProviderName,
|
||||
CanExpire: true,
|
||||
Expires: *resp.Credentials.Expiration,
|
||||
AccountID: accountID,
|
||||
}
|
||||
return value, nil
|
||||
}
|
||||
|
||||
// extract accountID from arn with format "arn:partition:service:region:account-id:[resource-section]"
|
||||
func getAccountID(u *types.AssumedRoleUser) string {
|
||||
if u.Arn == nil {
|
||||
return ""
|
||||
}
|
||||
parts := strings.Split(*u.Arn, ":")
|
||||
if len(parts) < 5 {
|
||||
return ""
|
||||
}
|
||||
return parts[4]
|
||||
}
|
||||
|
Reference in New Issue
Block a user