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

Drop support for non-standard, deprecated AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables #1054

Merged

Conversation

timrogers
Copy link
Contributor

@timrogers timrogers commented Jul 5, 2023

Up until #855, we used non-standard environment variables for configuring AWS S3 credentials. With #855, we added support for the standard AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables, but maintained support for the old names, printing a warning when they're used.

We've had that behaviour for 4 months now, and it's time to cut the old behaviour.

With this change, only the new environment variable names will be accepted, and trying to use the old names will result in your argument not being recognised.

Closes #856.

  • Did you write/update appropriate tests
  • Release notes updated (if appropriate)
  • Appropriate logging output
  • Issue linked
  • Docs updated (or issue created)
  • New package licenses are added to ThirdPartyNotices.txt (if applicable)

…ECRET_KEY` environment variables

Up until #855, we used non-standard environment variables for
configuring AWS S3 credentials. With #855, we *added* support for
the standard `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
variables, but maintained support for the old names, printing a
warning when they're used.

We've had that behaviour for 4 months now, and it's time to cut
the old behaviour.

With this change, only the new environment variable names will
be accepted, and trying to use the old names will result in
your argument not being recognised.

Closes #856.
@timrogers timrogers force-pushed the timrogers/deprecate-non-standard-aws-environment-variables branch from e1b136f to 56d353c Compare July 5, 2023 01:03
@@ -16,40 +17,20 @@ public AwsApiFactoryTests()
}

[Fact]
public void It_Falls_Back_To_Aws_Access_Key_Environment_Variable_If_Aws_Access_Key_Id_Is_Not_Set()
public void It_Errors_If_Aws_Access_Key_Id_Is_Not_Provided_Or_Set_In_Environment_Variable()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably could remove this test file entirely as we don't test other similar logic - but writing this test gave me confidence that my changes were doing the right thing.

@@ -740,42 +738,6 @@ public async Task It_Throws_When_Aws_Bucket_Name_Is_Provided_But_But_No_Aws_Acce
.WithMessage("*--aws-access-key*AWS_ACCESS_KEY_ID*");
}

[Fact]
public async Task It_Does_Not_Throw_When_Aws_Bucket_Name_Is_Provided_And_Can_Fallback_To_Aws_Access_Key_Environment_Variable()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback behaviour is no longer here, so it doesn't need a test

@@ -1231,94 +1229,6 @@ public async Task Ghes_When_Aws_Bucket_Name_Is_Provided_But_No_Aws_Access_Key_Id
.WithMessage("*--aws-access-key*");
}

[Fact]
public async Task Ghes_When_Aws_Bucket_Name_Is_Provided_And_Can_Fallback_To_Aws_Access_Key_Environment_Variable_Does_Not_Throw()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback behaviour is no longer here, so it doesn't need a test

@timrogers
Copy link
Contributor Author

I just tested this locally, and I'm satisfied that it does what we're expecting 🏁

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Unit Test Results

781 tests   781 ✔️  25s ⏱️
    1 suites      0 💤
    1 files        0

Results for commit 660e793.

♻️ This comment has been updated with latest results.

@robandpdx
Copy link
Contributor

@timrogers Thank you for the graceful breaking change process here! I really appreciate that you took my feedback seriously. This saves us from angry and confused customers!!!

RELEASENOTES.md Outdated Show resolved Hide resolved
timrogers and others added 3 commits July 5, 2023 19:34
Co-authored-by: Dylan Smith <dylanfromwinnipeg@gmail.com>
Co-authored-by: Dylan Smith <dylanfromwinnipeg@gmail.com>
Co-authored-by: Dylan Smith <dylanfromwinnipeg@gmail.com>
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Code Coverage

Package Line Rate Branch Rate Complexity Health
Octoshift 86% 76% 1206
bbs2gh 79% 76% 653
ado2gh 84% 82% 617
gei 80% 75% 526
Summary 83% (6553 / 7868) 77% (1546 / 2012) 3002

@timrogers timrogers merged commit 5aea393 into main Jul 6, 2023
@timrogers timrogers deleted the timrogers/deprecate-non-standard-aws-environment-variables branch July 6, 2023 14:52
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 this pull request may close these issues.

Remove the obsolete AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables
4 participants