@@ -30,20 +30,6 @@ type authWebTokenApi interface {
3030 AssumeRoleWithWebIdentity (ctx context.Context , params * sts.AssumeRoleWithWebIdentityInput , optFns ... func (* sts.Options )) (* sts.AssumeRoleWithWebIdentityOutput , error )
3131}
3232
33- // type CredentialExchange struct {
34- // logger zerolog.Logger
35- // samlSvc AuthSamlApi
36- // specificSvc authWebTokenApi
37- // }
38-
39- // func New(logger zerolog.Logger, samlSvc AuthSamlApi, specificSvc authWebTokenApi) *CredentialExchange {
40- // return &CredentialExchange{
41- // logger: logger,
42- // samlSvc: samlSvc,
43- // specificSvc: specificSvc,
44- // }
45- // }
46-
4733// LoginStsSaml exchanges saml response for STS creds
4834func LoginStsSaml (ctx context.Context , samlResponse string , role AWSRole , svc AuthSamlApi ) (* AWSCredentials , error ) {
4935
@@ -54,10 +40,6 @@ func LoginStsSaml(ctx context.Context, samlResponse string, role AWSRole, svc Au
5440 DurationSeconds : aws .Int32 (int32 (role .Duration )),
5541 }
5642
57- // unsetting the AWS_PROFILE here as we want to assume using samlResp credentials
58- //
59- // if profile is set the credential provider fails to cascade back to `[default]` section in ~/.aws/config
60- // os.Unsetenv("AWS_PROFILE")
6143 resp , err := svc .AssumeRoleWithSAML (ctx , params )
6244 if err != nil {
6345 return nil , fmt .Errorf ("%w, failed to retrieve STS credentials using SAML: %s" , ErrUnableAssume , err .Error ())
0 commit comments