diff options
author | Jeff King <peff@peff.net> | 2011-12-10 05:31:17 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-11 23:16:24 -0800 |
commit | d3e847c107c236126476e7efb272be3fa4339825 (patch) | |
tree | 9c11a24464851c65cb020c3571887e28ae94c9f1 /Documentation | |
parent | abca927dbef2c310056b8a1a8be5561212b3243a (diff) | |
download | git-d3e847c107c236126476e7efb272be3fa4339825.tar.gz git-d3e847c107c236126476e7efb272be3fa4339825.tar.xz |
credential: add function for parsing url components
All of the components of a credential struct can be found in
a URL. For example, the URL:
http://foo:bar@example.com/repo.git
contains:
protocol=http
host=example.com
path=repo.git
username=foo
password=bar
We want to be able to turn URLs into broken-down credential
structs so that we know two things:
1. Which parts of the username/password we still need
2. What the context of the request is (for prompting or
as a key for storing credentials).
This code is based on http_auth_init in http.c, but needed a
few modifications in order to get all of the components that
the credential object is interested in.
Once the http code is switched over to the credential API,
then http_auth_init can just go away.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/technical/api-credentials.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/technical/api-credentials.txt b/Documentation/technical/api-credentials.txt index f624aefc6..21ca6a255 100644 --- a/Documentation/technical/api-credentials.txt +++ b/Documentation/technical/api-credentials.txt @@ -67,6 +67,10 @@ Functions that they may store the result to be used again. Any errors from helpers are ignored. +`credential_from_url`:: + + Parse a URL into broken-down credential fields. + Example ------- |