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

Check self.access_token after set. #1147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sungminoh
Copy link

Afaik, aws cli supports access token to be set in the credential file.
So I have a local cron job that updates access token in .aws/credentials and .s3cfg file.
By this change, s3cmd won't request a token if it is set in .s3cfg or .aws/credentails though it is not given by command line

Afaik, aws cli supports access token to be set in the credential file.
So I have a local cron job that updates access token in `.aws/credentials` and `.s3cfg` file.
By this change, s3cmd won't request a token if it is set in `.s3cfg` or `.aws/credentails` though it is not given by command line
@@ -273,7 +273,8 @@ def __init__(self, configfile = None, access_key=None, secret_key=None, access_t
self.secret_key = secret_key
if access_token:
self.access_token = access_token
# Do not refresh the IAM role when an access token is provided.
# Do not refresh the IAM role when an access token is provided.
if self.access_token:
Copy link
Contributor

Choose a reason for hiding this comment

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

It's basically equal to previous if statement

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that it is the case if i'm not wrong.

Without this fix, if the access_token is set directly in the configuration file (and not set with command line or env var); then the access_token_refresh will not be disabled.

But, I'm wondering if there is not a side effect to this. Something like the goal was especially to not be stuck if an access token was written in the file. Especially for the case of a "configure" that would write the access token.

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.

3 participants