Giter VIP home page Giter VIP logo

Comments (7)

tmylk avatar tmylk commented on June 19, 2024

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.

tmylk avatar tmylk commented on June 19, 2024

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.

piskvorky avatar piskvorky commented on June 19, 2024

Is it possible to do so cleanly & unambiguously?

Is the S3 URI syntax described somewhere formally, so we know for sure?

from smart_open.

piskvorky avatar piskvorky commented on June 19, 2024

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.

jayantj avatar jayantj commented on June 19, 2024

/ 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.

tmylk avatar tmylk commented on June 19, 2024

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.

menshikh-iv avatar menshikh-iv commented on June 19, 2024

The problem still exists

from smart_open.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.