Skip to content

Support URL including username and password as rfc1738 defined #202

Closed

Description

@PeterDaveHello

I found that I can not use setting like this, I'll keep asking me the Username and Password

[lfs]
    url = "http://temp:temp@localhost:8080/temp/test"

I'll respectfully suggest this project to support URL that contains username and password, thanks!

REF: https://www.ietf.org/rfc/rfc1738.txt

3.1. Common Internet Scheme Syntax

   While the syntax for the rest of the URL may vary depending on the
   particular scheme selected, URL schemes that involve the direct use
   of an IP-based protocol to a specified host on the Internet use a
   common syntax for the scheme-specific data:

        //<user>:<password>@<host>:<port>/<url-path>

   Some or all of the parts "<user>:<password>@", ":<password>",
   ":<port>", and "/<url-path>" may be excluded.  The scheme specific
   data start with a double slash "//" to indicate that it complies with
   the common Internet scheme syntax. The different components obey the
   following rules:

    user
        An optional user name. Some schemes (e.g., ftp) allow the
        specification of a user name.

    password
        An optional password. If present, it follows the user
        name separated from it by a colon.

   The user name (and password), if present, are followed by a
   commercial at-sign "@". Within the user and password field, any ":",
   "@", or "/" must be encoded.

Activity

  1. tclem commented on Apr 9, 2015

    @tclem
    Contributor

    Cheers for the report @PeterDaveHello!

    I'm concerned about security and storing passwords in config files, but agree with your point about sticking to the URL spec.

  2. PeterDaveHello commented on Apr 9, 2015

    @PeterDaveHello
    ContributorAuthor

    Yeah, I'm sure that I can use it with native git client to set the remote, so git-lts can be so 👍

  3. rubyist commented on Apr 9, 2015

    @rubyist
    Contributor

    I'm a little iffy on this. In order to set the lfs url per repo, it has to be set in the repo's .gitconfig file. If the credentials are encoded in the URL then not only will the credentials be checked into the repository, but everyone would have to have the same credentials. While it's technically possible, I fear that it would be promoting some bad practices if we support it.

  4. PeterDaveHello commented on Apr 9, 2015

    @PeterDaveHello
    ContributorAuthor

    What about in .git/config ? I think it'll be no problem?

  5. rubyist commented on Apr 9, 2015

    @rubyist
    Contributor

    It is possible to set it there, with the caveat that the lfs endpoint configuration doesn't travel with the repository (ie everyone will need to set it up manually).

    We could perhaps support using user:pass in the url as long as it doesn't come out of the checked in .gitconfig, or perhaps give a warning if it does. I'd definitely want to be careful how we document things. What are your thoughts on those?

  6. PeterDaveHello commented on Apr 9, 2015

    @PeterDaveHello
    ContributorAuthor

    I think it's a part of RFC's URL standard, I hope git-lfs can support it, though there may be potential issue, but it's depends on users, we can use it wisely.

  7. technoweenie commented on Apr 9, 2015

    @technoweenie
    Contributor

    👍 on giving a warning. I'd hope that anyone that would put their password would understand the ramifications, but you never know. I'd hate for someone to put an important password in there because they can't get git-credential set up or something.

  8. l3iggs commented on May 28, 2015

    @l3iggs

    I would very much like to see support for user:pass@ added. This would make it easy for me to make my git-lfs backed repo public (i.e. the user needs to enter no password to clone it), something I'm trying to do now (without success).

    Is there currently any other way to make a lfs-test-server backed repo public/passwordless so that cloning "just works" when the user only knows the repo's URL?

  9. technoweenie commented on Aug 11, 2016

    @technoweenie
    Contributor

    Fixed all the way back in v0.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions