Files
git/credential.h
Jeff King 20a93d32fa look for credentials in config before prompting
When an http request receives a 401, we ask the user for
both a username and password. While it's generally not a
good idea for us to store the password in plaintext, having
to input the username each time is annoying, and can be
easily solved with a config variable.

This patch teaches the credential subsystem to look up items
in the git config file before prompting. Items are indexed
by the "unique" token passed to the credential system.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-03 15:25:12 -07:00

21 lines
522 B
C

#ifndef CREDENTIAL_H
#define CREDENTIAL_H
struct credential {
char *description;
char *username;
char *password;
char *unique;
};
struct string_list;
int credential_getpass(struct credential *);
void credential_from_config(struct credential *);
int credential_fill_gently(struct credential *, const struct string_list *methods);
void credential_fill(struct credential *, const struct string_list *methods);
void credential_reject(struct credential *, const struct string_list *methods);
#endif /* CREDENTIAL_H */