-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Anonymous requests and their credentials #1395
Comments
Here's the workaround that I use to create "anonymous" clients for now: client = boto3.client('sqs', aws_access_key_id='', aws_secret_access_key='')
client._request_signer.sign = (lambda *args, **kwargs: None) |
Marking this as a feature request. |
The suggested workaround doesn't work for CFN. Maybe CFN is different from SQS?
If I try just blanking out the credentials (above) it says the token is invalid. So then I try overwriting the internal function as suggested...
Now it just says I have no token. I tried it with SQS and got the prescribed result: Before overwriting |
The workaround doesn't seem to work for me. I'm trying to download files from s3 anonymously (the s3 bucket is public and I want anyone to be able to run my app without messing around with AWS creds). My example:
Result:
Any idea how I can download via boto3 from s3 anonymously? |
It's been possible to configure a client for anonymous (unsigned) requests for quite some time: from botocore import UNSIGNED
from botocore.config import Config
from botocore.session import Session
session = Session()
config = Config(signature_version=UNSIGNED)
sts = session.create_client('sts', config=config) How a service reacts to/supports unsigned requests is going to be on a service-by-service basis. |
Per the most recent comment here, this is possible to configure via botocore, but the behavior can vary by service. For feature requests related to specific services such as SQS, we recommend reaching out through AWS Support for more direct escalation and tracking. We can also forward feature requests internally if you'd prefer, but please let us know if that's how you'd like to proceed. |
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
I've recently come across a situation where I was unable to work with a publicly writable SQS queue with boto3, it would be great for this to be possible without mocking the RequestSigner (which I did to make it work for now).
DISCLAIMER: there's #206 about more or less the same topic, feel free to close this issue and reopen that one.
Here's a code snippet that I'd expect to work without supplying any credentials:
And it fails with
Also, there's a question of how does one override the credentials to become
None
if there's a~/.aws/credentials
file with a default entry? Right now, I'm identifying "anonymous" clients by setting access_key_id/secret_access_key to empty strings, but is this the intended way to do it?The text was updated successfully, but these errors were encountered: