Commit 917ba7626f9be16ee7bf430cf16d6484717a65d0

Edward Thomson 2020-01-18T14:14:00

auth: update enum type name for consistency libgit2 does not use `type_t` suffixes as it's redundant; thus, rename `git_http_authtype_t` to `git_http_auth_t` for consistency.

diff --git a/src/transports/auth.c b/src/transports/auth.c
index 1912737..b5f9b40 100644
--- a/src/transports/auth.c
+++ b/src/transports/auth.c
@@ -47,7 +47,7 @@ on_error:
 }
 
 static git_http_auth_context basic_context = {
-	GIT_AUTHTYPE_BASIC,
+	GIT_HTTP_AUTH_BASIC,
 	GIT_CREDTYPE_USERPASS_PLAINTEXT,
 	0,
 	NULL,
diff --git a/src/transports/auth.h b/src/transports/auth.h
index aeea6ce..7624676 100644
--- a/src/transports/auth.h
+++ b/src/transports/auth.h
@@ -14,16 +14,16 @@
 #include "netops.h"
 
 typedef enum {
-	GIT_AUTHTYPE_BASIC = 1,
-	GIT_AUTHTYPE_NEGOTIATE = 2,
-	GIT_AUTHTYPE_NTLM = 4,
-} git_http_authtype_t;
+	GIT_HTTP_AUTH_BASIC = 1,
+	GIT_HTTP_AUTH_NEGOTIATE = 2,
+	GIT_HTTP_AUTH_NTLM = 4,
+} git_http_auth_t;
 
 typedef struct git_http_auth_context git_http_auth_context;
 
 struct git_http_auth_context {
 	/** Type of scheme */
-	git_http_authtype_t type;
+	git_http_auth_t type;
 
 	/** Supported credentials */
 	git_credtype_t credtypes;
@@ -46,7 +46,7 @@ struct git_http_auth_context {
 
 typedef struct {
 	/** Type of scheme */
-	git_http_authtype_t type;
+	git_http_auth_t type;
 
 	/** Name of the scheme (as used in the Authorization header) */
 	const char *name;
diff --git a/src/transports/auth_negotiate.c b/src/transports/auth_negotiate.c
index 2631543..260fc1c 100644
--- a/src/transports/auth_negotiate.c
+++ b/src/transports/auth_negotiate.c
@@ -274,7 +274,7 @@ int git_http_auth_negotiate(
 		return -1;
 	}
 
-	ctx->parent.type = GIT_AUTHTYPE_NEGOTIATE;
+	ctx->parent.type = GIT_HTTP_AUTH_NEGOTIATE;
 	ctx->parent.credtypes = GIT_CREDTYPE_DEFAULT;
 	ctx->parent.connection_affinity = 1;
 	ctx->parent.set_challenge = negotiate_set_challenge;
diff --git a/src/transports/auth_ntlm.c b/src/transports/auth_ntlm.c
index 240c9ed..7d9c597 100644
--- a/src/transports/auth_ntlm.c
+++ b/src/transports/auth_ntlm.c
@@ -207,7 +207,7 @@ int git_http_auth_ntlm(
 		return -1;
 	}
 
-	ctx->parent.type = GIT_AUTHTYPE_NTLM;
+	ctx->parent.type = GIT_HTTP_AUTH_NTLM;
 	ctx->parent.credtypes = GIT_CREDTYPE_USERPASS_PLAINTEXT;
 	ctx->parent.connection_affinity = 1;
 	ctx->parent.set_challenge = ntlm_set_challenge;
diff --git a/src/transports/http.c b/src/transports/http.c
index b581d6f..045b721 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -26,9 +26,9 @@
 #include "streams/socket.h"
 
 git_http_auth_scheme auth_schemes[] = {
-	{ GIT_AUTHTYPE_NEGOTIATE, "Negotiate", GIT_CREDTYPE_DEFAULT, git_http_auth_negotiate },
-	{ GIT_AUTHTYPE_NTLM, "NTLM", GIT_CREDTYPE_USERPASS_PLAINTEXT, git_http_auth_ntlm },
-	{ GIT_AUTHTYPE_BASIC, "Basic", GIT_CREDTYPE_USERPASS_PLAINTEXT, git_http_auth_basic },
+	{ GIT_HTTP_AUTH_NEGOTIATE, "Negotiate", GIT_CREDTYPE_DEFAULT, git_http_auth_negotiate },
+	{ GIT_HTTP_AUTH_NTLM, "NTLM", GIT_CREDTYPE_USERPASS_PLAINTEXT, git_http_auth_ntlm },
+	{ GIT_HTTP_AUTH_BASIC, "Basic", GIT_CREDTYPE_USERPASS_PLAINTEXT, git_http_auth_basic },
 };
 
 static const char *upload_pack_service = "upload-pack";
@@ -78,7 +78,7 @@ typedef struct {
 	git_net_url url;
 	git_stream *stream;
 
-	git_http_authtype_t authtypes;
+	git_http_auth_t authtypes;
 	git_credtype_t credtypes;
 
 	git_cred *cred;