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

Add AWS session token support #23

Closed
wants to merge 14 commits into from
Closed

Add AWS session token support #23

wants to merge 14 commits into from

Commits on Oct 22, 2021

  1. Configuration menu
    Copy the full SHA
    c2952f5 View commit details
    Browse the repository at this point in the history
  2. Make S3 bucket name configurable in tests

    This commit will add a pytest fixture to configure the S3 bucket name.
    
    A configurable S3 bucket name enables contributors to run tests on their
    forks and in their AWS accounts, by setting a GitHub Secrets variable
    `${{ secrets.TEST_AWS_S3_BUCKET_NAME }}`. Defaults to `aioaws-testing`.
    
    The function is written with an if expression instead of with
    `os.getenv('TEST_AWS_S3_BUCKET_NAME', 'aioaws-testing')` because of how
    the environment variable value is passed in from GitHub Actions. If
    `${{ secrets.TEST_AWS_S3_BUCKET_NAME }}` is not set, then the value of
    the environment variable `TEST_AWS_S3_BUCKET_NAME` will be an empty
    string, and `os.getenv('TEST_AWS_S3_BUCKET_NAME', 'aioaws-testing')`
    will return an empty string.
    br3ndonland committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    65bca9b View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2021

  1. Make SES email address configurable in tests

    As with the S3 bucket name, enabling configuration of the email address
    allowscontributors to run tests on their forks and in their AWS accounts
    by setting `${{ secrets.TEST_AWS_SES_ADDRESS }}` in GitHub Secrets.
    Defaults to `testing@scolvin.com`.
    br3ndonland committed Oct 24, 2021
    Configuration menu
    Copy the full SHA
    782f863 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2021

  1. Add IAM role trust policy

    This is a "resource-based policy" that allows an IAM role to be assumed.
    https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_identity-vs-resource.html
    br3ndonland committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    db3a754 View commit details
    Browse the repository at this point in the history
  2. Assume IAM role for testing with GitHub Actions

    - Use aws-actions/configure-aws-credentials to obtain temporary security
      credentials
    - Pass both the static and temporary credentials to pytest
    br3ndonland committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    291c18a View commit details
    Browse the repository at this point in the history
  3. Parametrize AWS credentials with pytest

    Parametrize the pytest fixture so that it is generated for each item in
    params, and each test that uses the fixture runs for each param
    https://docs.pytest.org/en/latest/how-to/fixtures.html
    br3ndonland committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    49a713b View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2021

  1. Add AWS session token support

    Session tokens are used when AWS resources obtain temporary credentials.
    
    - Add `aws_session_token: str` model fields
      - `aioaws._types.S3ConfigProtocol`
      - `aioaws.s3.S3Config`
    - Add `aioaws.core.AwsClient.aws_session_token` attribute
    - Update `aioaws.core.AwsClient._auth_headers` to add session token into
      signature
    - For S3 downloads, add `X-Amz-Security-Token` param to
      `aioaws.core.AwsClient.add_signed_download_params`
    - For S3 uploads, allow `X-Amz-Security-Token` as an extra condition in
      `aioaws.core.AwsClient.upload_extra_conditions`, then add to upload
      signature using `aioaws.core.AwsClient.signed_upload_fields`
    br3ndonland committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    4105810 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dadbeb3 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2021

  1. Configuration menu
    Copy the full SHA
    db63694 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b7ba5f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fb8f459 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2022

  1. Configuration menu
    Copy the full SHA
    af657fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4f0142d View commit details
    Browse the repository at this point in the history
  3. Revert "Remove empty mapping from pull_request trigger"

    This reverts commit 4f0142d.
    br3ndonland committed Jan 22, 2022
    Configuration menu
    Copy the full SHA
    8839b21 View commit details
    Browse the repository at this point in the history