summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2018-08-13 16:50:17 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2018-08-14 18:52:11 +0100
commit81a59f2f7c7cf06c1457893880ebfeba82e902cc (patch)
treef6f41992fa64e49f0777a2df33e232f8a0809a3e /include
parent9fa6c1e0fb2d6f5a0c95e7680b0ad24f9f7615db (diff)
downloadnetsurf-81a59f2f7c7cf06c1457893880ebfeba82e902cc.tar.gz
netsurf-81a59f2f7c7cf06c1457893880ebfeba82e902cc.tar.bz2
HTTP Auth: Do get/set auth in the core.
Diffstat (limited to 'include')
-rw-r--r--include/netsurf/misc.h33
1 files changed, 30 insertions, 3 deletions
diff --git a/include/netsurf/misc.h b/include/netsurf/misc.h
index 2647b9a1c..cd86cf644 100644
--- a/include/netsurf/misc.h
+++ b/include/netsurf/misc.h
@@ -91,13 +91,40 @@ struct gui_misc_table {
* \param cbpw Context pointer passed to cb
* \return NSERROR_OK on sucess else error and cb never called
*/
- nserror (*cert_verify)(struct nsurl *url, const struct ssl_cert_info *certs, unsigned long num, nserror (*cb)(bool proceed, void *pw), void *cbpw);
+ nserror (*cert_verify)(struct nsurl *url,
+ const struct ssl_cert_info *certs,
+ unsigned long num,
+ nserror (*cb)(bool proceed, void *pw),
+ void *cbpw);
/**
* Prompt user for login
+ *
+ * To cancel a login, clients should call the `cb` callback passing
+ * NULL for username, and password. Otherwise, for logins, username
+ * and password should both be non-NULL. Pass "" if the empty string
+ * is required.
+ *
+ * If the front end returns NSERROR_OK for this function, they must,
+ * at some future time, call the `cb` with `cbpw` callback exactly once.
+ *
+ * If ther front end returns other than NSERROR_OK, they should not
+ * call the `cb` callback.
+ *
+ * \param url The URL being verified.
+ * \param realm The authorization realm.
+ * \param username Any current username (or empty string).
+ * \param password Any current password (or empty string).
+ * \param cb Callback upon user decision.
+ * \param cbpw Context pointer passed to cb
+ * \return NSERROR_OK on sucess else error and cb never called
*/
- void (*login)(struct nsurl *url, const char *realm,
- nserror (*cb)(bool proceed, void *pw), void *cbpw);
+ nserror (*login)(struct nsurl *url, const char *realm,
+ const char *username, const char *password,
+ nserror (*cb)(const char *username,
+ const char *password,
+ void *pw),
+ void *cbpw);
/**
* Prompt the user for a password for a PDF.