path: root/credential.h
diff options
authorJeff King <>2011-12-10 10:31:17 (GMT)
committerJunio C Hamano <>2011-12-12 07:16:24 (GMT)
commitd3e847c107c236126476e7efb272be3fa4339825 (patch)
tree9c11a24464851c65cb020c3571887e28ae94c9f1 /credential.h
parentabca927dbef2c310056b8a1a8be5561212b3243a (diff)
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: contains: protocol=http 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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'credential.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/credential.h b/credential.h
index 2ea7d49..8a6d162 100644
--- a/credential.h
+++ b/credential.h
@@ -24,5 +24,6 @@ void credential_approve(struct credential *);
void credential_reject(struct credential *);
int credential_read(struct credential *, FILE *);
+void credential_from_url(struct credential *, const char *url);
#endif /* CREDENTIAL_H */