2 * Copyright (C) the libgit2 contributors. All rights reserved.
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
8 #ifndef INCLUDE_transports_auth_h__
9 #define INCLUDE_transports_auth_h__
17 GIT_AUTHTYPE_BASIC
= 1,
18 GIT_AUTHTYPE_NEGOTIATE
= 2,
19 } git_http_authtype_t
;
21 typedef struct git_http_auth_context git_http_auth_context
;
23 struct git_http_auth_context
{
25 git_http_authtype_t type
;
27 /** Supported credentials */
28 git_credtype_t credtypes
;
30 /** Sets the challenge on the authentication context */
31 int (*set_challenge
)(git_http_auth_context
*ctx
, const char *challenge
);
33 /** Gets the next authentication token from the context */
34 int (*next_token
)(git_buf
*out
, git_http_auth_context
*ctx
, git_cred
*cred
);
36 /** Frees the authentication context */
37 void (*free
)(git_http_auth_context
*ctx
);
42 git_http_authtype_t type
;
44 /** Name of the scheme (as used in the Authorization header) */
47 /** Credential types this scheme supports */
48 git_credtype_t credtypes
;
50 /** Function to initialize an authentication context */
52 git_http_auth_context
**out
,
53 const gitno_connection_data
*connection_data
);
54 } git_http_auth_scheme
;
56 int git_http_auth_dummy(
57 git_http_auth_context
**out
,
58 const gitno_connection_data
*connection_data
);
60 int git_http_auth_basic(
61 git_http_auth_context
**out
,
62 const gitno_connection_data
*connection_data
);