------------------------------------------------------------ revno: 13420 revision-id: squid3@treenet.co.nz-20140522091248-p227c0izbkpjlm83 parent: squid3@treenet.co.nz-20140522060405-k48wijnt54l8vrfa committer: Amos Jeffries branch nick: trunk timestamp: Thu 2014-05-22 02:12:48 -0700 message: Cleanup: document and rename Auth::UserRequest::module_start to startHelperLookup ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140522091248-p227c0izbkpjlm83 # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 9d1179a0b822a127a4973dbc24158d4bb4b0478d # timestamp: 2014-05-22 10:01:10 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140522060405-\ # k48wijnt54l8vrfa # # Begin patch === modified file 'src/auth/UserRequest.cc' --- src/auth/UserRequest.cc 2014-02-20 01:50:39 +0000 +++ src/auth/UserRequest.cc 2014-05-22 09:12:48 +0000 @@ -65,8 +65,8 @@ { assert(handler); assert(data); - debugs(29, 9, HERE << "auth_user_request '" << this << "'"); - module_start(request, al, handler, data); + debugs(29, 9, this); + startHelperLookup(request, al, handler, data); } bool === modified file 'src/auth/UserRequest.h' --- src/auth/UserRequest.h 2013-12-06 14:59:47 +0000 +++ src/auth/UserRequest.h 2014-05-22 09:12:48 +0000 @@ -158,15 +158,6 @@ virtual void releaseAuthServer(); - /** - * Called when squid is ready to put the request on hold and wait for a callback from the auth module - * when the auth module has performed it's external activities. - * - * \param handler Handler to process the callback when its run - * \param data CBDATA for handler - */ - virtual void module_start(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *handler, void *data) = 0; - // User credentials object this UserRequest is managing virtual User::Pointer user() {return _auth_user;} virtual const User::Pointer user() const {return _auth_user;} @@ -195,7 +186,18 @@ /// Add the appropriate [Proxy-]Authenticate header to the given reply static void addReplyAuthHeader(HttpReply * rep, UserRequest::Pointer auth_user_request, HttpRequest * request, int accelerated, int internal); + /** Start an asynchronous helper lookup to verify the user credentials + * + * Uses startHelperLookup() for scheme-specific actions. + * + * The given callback will be called when the auth module has performed + * it's external activities. + * + * \param handler Handler to process the callback when its run + * \param data CBDATA for handler + */ void start(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *handler, void *data); + char const * denyMessage(char const * const default_message = NULL); /** Possibly overrideable in future */ @@ -224,6 +226,15 @@ virtual const char *credentialsStr() = 0; const char *helperRequestKeyExtras(HttpRequest *, AccessLogEntry::Pointer &al); + +protected: + /** + * The scheme-specific actions to be performed when sending helper lookup. + * + * \see void start(HttpRequest *, AccessLogEntry::Pointer &, AUTHCB *, void *); + */ + virtual void startHelperLookup(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *handler, void *data) = 0; + private: static AuthAclState authenticate(UserRequest::Pointer * auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, Ip::Address &src_addr, AccessLogEntry::Pointer &al); === modified file 'src/auth/basic/UserRequest.cc' --- src/auth/basic/UserRequest.cc 2014-02-08 13:36:42 +0000 +++ src/auth/basic/UserRequest.cc 2014-05-22 09:12:48 +0000 @@ -93,7 +93,7 @@ /* send the initial data to a basic authenticator module */ void -Auth::Basic::UserRequest::module_start(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB * handler, void *data) +Auth::Basic::UserRequest::startHelperLookup(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB * handler, void *data) { assert(user()->auth_type == Auth::AUTH_BASIC); Auth::Basic::User *basic_auth = dynamic_cast(user().getRaw()); === modified file 'src/auth/basic/UserRequest.h' --- src/auth/basic/UserRequest.h 2013-12-06 14:59:47 +0000 +++ src/auth/basic/UserRequest.h 2014-05-22 09:12:48 +0000 @@ -26,7 +26,7 @@ virtual int authenticated() const; virtual void authenticate(HttpRequest * request, ConnStateData *conn, http_hdr_type type); virtual Auth::Direction module_direction(); - virtual void module_start(HttpRequest * request, AccessLogEntry::Pointer &al, AUTHCB *, void *); + virtual void startHelperLookup(HttpRequest * request, AccessLogEntry::Pointer &al, AUTHCB *, void *); virtual const char *credentialsStr(); private: === modified file 'src/auth/digest/UserRequest.cc' --- src/auth/digest/UserRequest.cc 2014-04-22 02:47:09 +0000 +++ src/auth/digest/UserRequest.cc 2014-05-22 09:12:48 +0000 @@ -272,7 +272,7 @@ /* send the initial data to a digest authenticator module */ void -Auth::Digest::UserRequest::module_start(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB * handler, void *data) +Auth::Digest::UserRequest::startHelperLookup(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB * handler, void *data) { char buf[8192]; === modified file 'src/auth/digest/UserRequest.h' --- src/auth/digest/UserRequest.h 2013-12-06 14:59:47 +0000 +++ src/auth/digest/UserRequest.h 2014-05-22 09:12:48 +0000 @@ -34,7 +34,7 @@ virtual void addAuthenticationInfoTrailer(HttpReply * rep, int accel); #endif - virtual void module_start(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *, void *); + virtual void startHelperLookup(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *, void *); virtual const char *credentialsStr(); char *nonceb64; /* "dcd98b7102dd2f0e8b11d0f600bfb0c093" */ === modified file 'src/auth/negotiate/UserRequest.cc' --- src/auth/negotiate/UserRequest.cc 2014-02-08 13:36:42 +0000 +++ src/auth/negotiate/UserRequest.cc 2014-05-22 09:12:48 +0000 @@ -97,7 +97,7 @@ } void -Auth::Negotiate::UserRequest::module_start(HttpRequest *req, AccessLogEntry::Pointer &al, AUTHCB * handler, void *data) +Auth::Negotiate::UserRequest::startHelperLookup(HttpRequest *req, AccessLogEntry::Pointer &al, AUTHCB * handler, void *data) { static char buf[MAX_AUTHTOKEN_LEN]; === modified file 'src/auth/negotiate/UserRequest.h' --- src/auth/negotiate/UserRequest.h 2013-12-06 14:59:47 +0000 +++ src/auth/negotiate/UserRequest.h 2014-05-22 09:12:48 +0000 @@ -26,7 +26,7 @@ virtual int authenticated() const; virtual void authenticate(HttpRequest * request, ConnStateData * conn, http_hdr_type type); virtual Direction module_direction(); - virtual void module_start(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *, void *); + virtual void startHelperLookup(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *, void *); virtual const char *credentialsStr(); virtual void addAuthenticationInfoHeader(HttpReply * rep, int accel); === modified file 'src/auth/ntlm/UserRequest.cc' --- src/auth/ntlm/UserRequest.cc 2014-02-08 13:36:42 +0000 +++ src/auth/ntlm/UserRequest.cc 2014-05-22 09:12:48 +0000 @@ -95,7 +95,7 @@ } void -Auth::Ntlm::UserRequest::module_start(HttpRequest *req, AccessLogEntry::Pointer &al, AUTHCB * handler, void *data) +Auth::Ntlm::UserRequest::startHelperLookup(HttpRequest *req, AccessLogEntry::Pointer &al, AUTHCB * handler, void *data) { static char buf[MAX_AUTHTOKEN_LEN]; === modified file 'src/auth/ntlm/UserRequest.h' --- src/auth/ntlm/UserRequest.h 2013-12-06 14:59:47 +0000 +++ src/auth/ntlm/UserRequest.h 2014-05-22 09:12:48 +0000 @@ -26,7 +26,7 @@ virtual int authenticated() const; virtual void authenticate(HttpRequest * request, ConnStateData * conn, http_hdr_type type); virtual Auth::Direction module_direction(); - virtual void module_start(HttpRequest *req, AccessLogEntry::Pointer &al, AUTHCB *, void *); + virtual void startHelperLookup(HttpRequest *req, AccessLogEntry::Pointer &al, AUTHCB *, void *); virtual const char *credentialsStr(); virtual const char * connLastHeader();