Comments (7)
The name doesn't follow AWS best practices. What is the reason for using it?
The "@" symbol is not considered a safe character in AWS guide. It is referenced as "character that requires special handling".
from smart_open.
Need to add logic to distinguish s3://key:secret@bucket/object
vs s3://bucket/obj@ect
and s3://bucket/ob:j@ect
from smart_open.
Is it possible to do so cleanly & unambiguously?
Is the S3 URI syntax described somewhere formally, so we know for sure?
from smart_open.
Maybe if slashes /
are not allowed in credentials (I'm not sure -- maybe they are), a simple check would be "credentials before @
contain a /
=> they're not really credentials, treat @
as part of filename".
from smart_open.
/
is allowed in the credentials - secret keys usually have a slash in them
I think these are the two additional tests we need -
# correct uri, key contains @
parsed_uri = smart_open.ParseUri("s3://mybucket/mykey@mydir")
self.assertEqual(parsed_uri.scheme, "s3")
self.assertEqual(parsed_uri.bucket_id, "mybucket")
self.assertEqual(parsed_uri.key_id, "mykey@mydir")
self.assertEqual(parsed_uri.access_id, None)
self.assertEqual(parsed_uri.access_secret, None)
# correct uri with credentials, key contains @
parsed_uri = smart_open.ParseUri("s3://ACCESSID456:acces/sse_cr-et@mybucket/mykey@mydir")
self.assertEqual(parsed_uri.scheme, "s3")
self.assertEqual(parsed_uri.bucket_id, "mybucket")
self.assertEqual(parsed_uri.key_id, "mykey@mydir")
self.assertEqual(parsed_uri.access_id, "ACCESSID456")
self.assertEqual(parsed_uri.access_secret, "acces/sse_cr-et")
Seems slightly difficult to do cleanly, lots of edge cases.
from smart_open.
The Access Key ID is 20 alpha-numeric characters, so a regex can locate the s3://key:secret@bucket/object
. Will send a fix later today.
from smart_open.
The problem still exists
from smart_open.
Related Issues (20)
- python 3.11 support?
- Support for type annotations HOT 3
- Suggeted - allowing cache mechanism for files
- Getting OSError in s3 when permission for kms:Decrypt are missing HOT 4
- S3 open fails on files that contain '@' in their path HOT 5
- Writing to FTP fails with error "503 ASCII (Text) data type is not supported for file transfer operations. Please configure your FTP client to use IMAGE (Binary) type and try again" HOT 1
- Test failures with urllib3 2.0.4 HOT 4
- Compatibility issue with soundfile HOT 1
- Add OAuth2 support HOT 1
- pip install for version 3.0.0 failing HOT 14
- Feature request: zstandard compression HOT 1
- Incompatibility with moto 5 HOT 8
- Version 7.0.0 issue - import botocore error HOT 5
- Inconsistent python_requires minimum version HOT 3
- The result of smart_open.open (FileLikeProxy) lacks a __next__-method in 7.0.0 whereas in 6.4.0 (_io.TextIOWrapper) it did HOT 5
- zstd write does not work with `wb` mode
- No way to specify generation when opening a GS blob
- S3 SinglepartWriter writes on exception when garbage collected HOT 2
- [Documentation] `s3` URI example uses `my_key` ambiguously
- Add support of Huawei Object Storage Service (OBS)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smart_open.