summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-08-20 14:54:22 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-08-20 14:54:22 +0200
commit6b36945d7e8a780a3063f09c65b3d9fed6525552 (patch)
treeba4922503566b803a2f925b6189eacab472796e6 /include
parent8820160818c8a15e345c0da13560bef9771e12c5 (diff)
parent57af0b928ec8dd12c443c9479973ad3e39f258b4 (diff)
downloadlibgit2-6b36945d7e8a780a3063f09c65b3d9fed6525552.tar.gz
Merge pull request #3388 from libgit2/cmn/smart-callbacks
transport: provide a way to get the callbacks
Diffstat (limited to 'include')
-rw-r--r--include/git2/sys/transport.h22
-rw-r--r--include/git2/transport.h11
2 files changed, 33 insertions, 0 deletions
diff --git a/include/git2/sys/transport.h b/include/git2/sys/transport.h
index 867fbcbce..4a75b0832 100644
--- a/include/git2/sys/transport.h
+++ b/include/git2/sys/transport.h
@@ -211,6 +211,28 @@ GIT_EXTERN(int) git_transport_smart(
git_remote *owner,
/* (git_smart_subtransport_definition *) */ void *payload);
+/**
+ * Call the certificate check for this transport.
+ *
+ * @param transport a smart transport
+ * @param cert the certificate to pass to the caller
+ * @param valid whether we believe the certificate is valid
+ * @param hostname the hostname we connected to
+ * @return the return value of the callback
+ */
+GIT_EXTERN(int) git_transport_smart_certificate_check(git_transport *transport, git_cert *cert, int valid, const char *hostname);
+
+/**
+ * Call the credentials callback for this transport
+ *
+ * @param out the pointer where the creds are to be stored
+ * @param transport a smart transport
+ * @param user the user we saw on the url (if any)
+ * @param methods available methods for authentication
+ * @return the return value of the callback
+ */
+GIT_EXTERN(int) git_transport_smart_credentials(git_cred **out, git_transport *transport, const char *user, int methods);
+
/*
*** End of base transport interface ***
*** Begin interface for subtransports for the smart transport ***
diff --git a/include/git2/transport.h b/include/git2/transport.h
index fd55eac0a..0ec241699 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -307,6 +307,17 @@ GIT_EXTERN(int) git_cred_ssh_key_memory_new(
const char *privatekey,
const char *passphrase);
+
+/**
+ * Free a credential.
+ *
+ * This is only necessary if you own the object; that is, if you are a
+ * transport.
+ *
+ * @param cred the object to free
+ */
+GIT_EXTERN(void) git_cred_free(git_cred *cred);
+
/**
* Signature of a function which acquires a credential object.
*