[serf] r2498 committed - Add some comments for easier tracking all auth vtable implementations....

2 views
Skip to first unread message

se...@googlecode.com

unread,
Apr 10, 2015, 10:05:31 AM4/10/15
to serf...@googlegroups.com
Revision: 2498
Author: chemodax
Date: Fri Apr 10 14:05:14 2015 UTC
Log: Add some comments for easier tracking all auth vtable
implementations.

* auth/auth_basic.c
* auth/auth_digest.c
* auth/auth_spnego.c
(serf__handle_basic_auth, serf__init_basic_connection,
serf__setup_request_basic_auth, validate_response_func,
serf__handle_digest_auth, serf__init_digest_connection,
serf__setup_request_digest_auth, serf__validate_response_digest_auth,
serf__init_spnego_connection, serf__handle_spnego_auth,
serf__setup_request_spnego_auth, serf__validate_response_spnego_auth):
Mention what kind of auth callback function implements.

https://code.google.com/p/serf/source/detail?r=2498

Modified:
/trunk/auth/auth_basic.c
/trunk/auth/auth_digest.c
/trunk/auth/auth_spnego.c

=======================================
--- /trunk/auth/auth_basic.c Wed Apr 8 18:38:47 2015 UTC
+++ /trunk/auth/auth_basic.c Fri Apr 10 14:05:14 2015 UTC
@@ -30,6 +30,7 @@
const char *value;
} basic_authn_info_t;

+/* Implements serf__auth_handler_func_t callback. */
static apr_status_t
serf__handle_basic_auth(int code,
serf_request_t *request,
@@ -113,7 +114,8 @@
/* For Basic authentication we expect all authn info to be the same for all
connections in the context to the same server (same realm, username,
password). Therefore we can keep the header value in the per-server
store
- context instead of per connection.
+ context instead of per connection. Implements serf__init_conn_func_t
+ callback.
TODO: we currently don't cache this info per realm, so each time a
request
'switches realms', we have to ask the application for new credentials.
*/
static apr_status_t
@@ -138,6 +140,7 @@
return APR_SUCCESS;
}

+/* Implements serf__setup_request_func_t callback. */
static apr_status_t
serf__setup_request_basic_auth(peer_t peer,
int code,
@@ -167,6 +170,7 @@
return SERF_ERROR_AUTHN_FAILED;
}

+/* Implements serf__validate_response_func_t callback. */
static apr_status_t
validate_response_func(const serf__authn_scheme_t *scheme,
peer_t peer,
=======================================
--- /trunk/auth/auth_digest.c Wed Apr 8 18:38:47 2015 UTC
+++ /trunk/auth/auth_digest.c Fri Apr 10 14:05:14 2015 UTC
@@ -227,6 +227,7 @@
return APR_SUCCESS;
}

+/* Implements serf__auth_handler_func_t callback. */
static apr_status_t
serf__handle_digest_auth(int code,
serf_request_t *request,
@@ -358,6 +359,7 @@
return status;
}

+/* Implements serf__init_conn_func_t callback. */
static apr_status_t
serf__init_digest_connection(const serf__authn_scheme_t *scheme,
int code,
@@ -383,6 +385,7 @@
return APR_SUCCESS;
}

+/* Implements serf__setup_request_func_t callback. */
static apr_status_t
serf__setup_request_digest_auth(peer_t peer,
int code,
@@ -447,6 +450,7 @@
return APR_SUCCESS;
}

+/* Implements serf__validate_response_func_t callback. */
static apr_status_t
serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme,
peer_t peer,
=======================================
--- /trunk/auth/auth_spnego.c Wed Apr 8 18:38:47 2015 UTC
+++ /trunk/auth/auth_spnego.c Fri Apr 10 14:05:14 2015 UTC
@@ -359,7 +359,7 @@
}

/* A new connection is created to a server that's known to use
- Kerberos. */
+ Kerberos. Implements serf__init_conn_func_t callback. */
static apr_status_t
serf__init_spnego_connection(const serf__authn_scheme_t *scheme,
int code,
@@ -403,7 +403,8 @@
return APR_SUCCESS;
}

-/* A 40x response was received, handle the authentication. */
+/* Implements serf__auth_handler_func_t callback.
+ A 40x response was received, handle the authentication. */
static apr_status_t
serf__handle_spnego_auth(int code,
serf_request_t *request,
@@ -426,7 +427,8 @@
pool);
}

-/* Setup the authn headers on this request message. */
+/* Callback function (implements serf__setup_request_func_t). Setup the
authn
+ headers on this request message. */
static apr_status_t
serf__setup_request_spnego_auth(peer_t peer,
int code,
@@ -564,7 +566,8 @@
return b.hdr_value;
}

-/* Function is called when 2xx responses are received. Normally we don't
+/* Callback function (implements serf__validate_response_func_t).
+ * Function is called when 2xx responses are received. Normally we don't
* have to do anything, except for the first response after the
* authentication handshake. This specific response includes authentication
* data which should be validated by the client (mutual authentication).
Reply all
Reply to author
Forward
0 new messages