But if that's the code path that needs testing then it should probably be isolated to an auth library that can be tested by simply authenticating with the secret key alone and not needing to perform a chargeable action.
But if that's the code path that needs testing then it should probably be isolated to an auth library that can be tested by simply authenticating with the secret key alone and not needing to perform a chargeable action.
I'm not sure why the author thinks this required putting the credentials in the code itself. Heck, I'd argue that this integration test should be setting up the bucket and contents as part of the setup for the test itself, pulling the credentials from some sort of secrets manager.
It seems the test is about the data within the bucket assuming the correct format, not the connection to S3. Perhaps we can trust the author to have considered other ways to test this more properly that either wouldn't work for reasons or weren't nearly as fun.
If security is legitimately not orthogonal to functional testing then that is the interesting part of the problem, but I don't see that laid out in the article. It would be a case for AWS and others to improve or add methods to support the test case in a secure way.