Move add_basic_auth method into the appropriate block
Merge pull request #3090 from tryba/s3-auth-support

Move add_basic_auth method into the appropriate block