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

S3 publisher should support session token #2983

Closed
3 tasks done
bboure opened this issue Oct 23, 2022 · 0 comments · Fixed by #2984
Closed
3 tasks done

S3 publisher should support session token #2983

bboure opened this issue Oct 23, 2022 · 0 comments · Fixed by #2984

Comments

@bboure
Copy link
Contributor

bboure commented Oct 23, 2022

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

Right now, the s3 publisher does not accept a session token as part of the credentials.
This makes it unusable with something like configure-aws-credentials.

Proposed solution

I think the problem relies here as the AWS_SESSION_TOKEN environment variable is not taken into consideration. There is also no sessionToken option.

I think the best way to handle this is:

  • if no credentials options are passed at all, generateCredentials should return undefined, instead of returning env variables explicitely. The AWS SDK should pick them up on its own.
  • add a sessionToken option and return it here if users need to specify it manually.
  generateCredentials(): Credentials | undefined {
    const accessKeyId = this.config.accessKeyId;
    const secretAccessKey = this.config.secretAccessKey;
    const sessionToken = this.config.sessionToken;

    if (accessKeyId && secretAccessKey) {
      return { accessKeyId, secretAccessKey, sessionToken };
    }

    // use the SDK default
    return undefined;
  }

Alternatives considered

I see no alternative to this.

Additional information

If this sounds like something that could be done, I'd be happy to open a PR.

Thank you

@bboure bboure changed the title S3 publisher should support session torken S3 publisher should support session token Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant