#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.am,v 1.121 2005/12/15 22:25:24 hno Exp $
+# $Id: Makefile.am,v 1.122 2005/12/18 09:23:39 serassio Exp $
#
# Uncomment and customize the following to suit your needs:
#
tests_testStore_LDADD= \
-L../lib -lmiscutil \
- @SQUID_CPPUNIT_LA@
+ @SQUID_CPPUNIT_LA@ \
+ @SSLLIB@
tests_testStore_LDFLAGS = $(LIBADD_DL)
tests_testStore_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
@SQUID_CPPUNIT_LA@
tests/testUfs.h \
$(SWAP_TEST_SOURCES)
tests_testUfs_LDADD= \
- $(SWAP_TEST_LDADD)
+ $(SWAP_TEST_LDADD) \
+ @SSLLIB@
tests_testUfs_LDFLAGS = $(LIBADD_DL)
tests_testUfs_DEPENDENCIES = \
$(SWAP_TEST_DS)
tests/testCoss.h \
$(SWAP_TEST_SOURCES)
tests_testCoss_LDADD= \
- $(SWAP_TEST_LDADD)
+ $(SWAP_TEST_LDADD) \
+ @SSLLIB@
tests_testCoss_LDFLAGS = $(LIBADD_DL)
tests_testCoss_DEPENDENCIES = \
$(SWAP_TEST_DS)
tests/testNull.h \
$(SWAP_TEST_SOURCES)
tests_testNull_LDADD= \
- $(SWAP_TEST_LDADD)
+ $(SWAP_TEST_LDADD) \
+ @SSLLIB@
tests_testNull_LDFLAGS = $(LIBADD_DL)
tests_testNull_DEPENDENCIES = \
$(SWAP_TEST_DS)
#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.in,v 1.358 2005/12/16 01:10:45 hno Exp $
+# $Id: Makefile.in,v 1.359 2005/12/18 09:23:39 serassio Exp $
#
# Uncomment and customize the following to suit your needs:
#
tests_testStore_LDADD = \
-L../lib -lmiscutil \
- @SQUID_CPPUNIT_LA@
+ @SQUID_CPPUNIT_LA@ \
+ @SSLLIB@
tests_testStore_LDFLAGS = $(LIBADD_DL)
tests_testStore_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
$(SWAP_TEST_SOURCES)
tests_testUfs_LDADD = \
- $(SWAP_TEST_LDADD)
+ $(SWAP_TEST_LDADD) \
+ @SSLLIB@
tests_testUfs_LDFLAGS = $(LIBADD_DL)
tests_testUfs_DEPENDENCIES = \
$(SWAP_TEST_SOURCES)
tests_testCoss_LDADD = \
- $(SWAP_TEST_LDADD)
+ $(SWAP_TEST_LDADD) \
+ @SSLLIB@
tests_testCoss_LDFLAGS = $(LIBADD_DL)
tests_testCoss_DEPENDENCIES = \
$(SWAP_TEST_SOURCES)
tests_testNull_LDADD = \
- $(SWAP_TEST_LDADD)
+ $(SWAP_TEST_LDADD) \
+ @SSLLIB@
tests_testNull_LDFLAGS = $(LIBADD_DL)
tests_testNull_DEPENDENCIES = \
#define DefaultAuthenticateChildrenMax 32 /* 32 processes */
+#ifndef __AUTH_AUTHENTICATE_STATE_T__
+#define __AUTH_AUTHENTICATE_STATE_T__
typedef enum {
AUTHENTICATE_STATE_NONE,
AUTHENTICATE_STATE_INITIAL,
}
authenticateStateData;
+#endif
class NegotiateUser : public AuthUser
{
#define DefaultAuthenticateChildrenMax 32 /* 32 processes */
+#ifndef __AUTH_AUTHENTICATE_STATE_T__
+#define __AUTH_AUTHENTICATE_STATE_T__
typedef enum {
AUTHENTICATE_STATE_NONE,
AUTHENTICATE_STATE_INITIAL,
}
authenticateStateData;
+#endif
class NTLMUser : public AuthUser
{
/*
- * $Id: stub_HttpReply.cc,v 1.1 2005/01/03 16:08:27 robertc Exp $
+ * $Id: stub_HttpReply.cc,v 1.2 2005/12/18 09:23:40 serassio Exp $
*
* DEBUG: section 84 Helper process maintenance
* AUTHOR: Robert Collins
#include "HttpReply.h"
void
-httpReplyAbsorb(HttpReply * rep, HttpReply * new_rep)
+HttpReply::absorb(HttpReply * new_rep)
{
fatal ("Not implemented");
}
void
-httpReplySetHeaders(HttpReply * rep, HttpVersion ver, http_status status,
- const char *reason, const char *ctype, int clen, time_t lmt, time_t expires)
+HttpReply::setHeaders(HttpVersion ver, http_status status, const char *reason,
+ const char *ctype, int clen, time_t lmt, time_t expires)
{
fatal ("Not implemented");
}
void
-httpReplyPackHeadersInto(const HttpReply * rep, Packer * p)
+HttpReply::packHeadersInto(Packer * p) const
{
fatal ("Not implemented");
}
-void
-httpReplyReset(HttpReply * rep)
+void HttpReply::reset()
{
fatal ("Not implemented");
}
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthBasicUserRequest );
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthDigestUserRequest );
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthNTLMUserRequest );
+CPPUNIT_TEST_SUITE_REGISTRATION( testAuthNegotiateUserRequest );
/* Instantiate all auth framework types */
void
char const * proxy_auths[][2]= { {"basic","Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="},
{"digest", "Digest username=\"robertdig\", realm=\"Squid proxy-caching web server\", nonce=\"yy8rQXjEWwixXVBj\", uri=\"/images/bg8.gif\", response=\"f75a7d3edd48d93c681c75dc4fb58700\", qop=auth, nc=00000012, cnonce=\"e2216641961e228e\" "},
- {"ntlm", "NTLM "}
+ {"ntlm", "NTLM "},
+ {"negotiate", "Negotiate "}
};
- for (unsigned count = 0; count < 3 ; count++) {
+ for (unsigned count = 0; count < 4 ; count++) {
if (strcasecmp(type, proxy_auths[count][0]) == 0)
return proxy_auths[count][1];
}
char const *ntlm_parms[]= {"program /home/robertc/install/squid/libexec/digest_pw_auth /home/robertc/install/squid/etc/digest.pwd"};
+ char const *negotiate_parms[]= {"program /home/robertc/install/squid/libexec/digest_pw_auth /home/robertc/install/squid/etc/digest.pwd"};
+
struct _scheme_params {
char const *name;
char const **params;
params[]={ {"digest", digest_parms, 2},
{"basic", basic_parms, 2},
- {"ntlm", ntlm_parms, 1}};
+ {"ntlm", ntlm_parms, 1},
+ {"negotiate", negotiate_parms, 1}};
- for (unsigned scheme=0; scheme < 3; scheme++)
+ for (unsigned scheme=0; scheme < 4; scheme++)
setup_scheme(getConfig(params[scheme].name), params[scheme].params, params[scheme].paramlength);
authenticateInit(&config);
CPPUNIT_ASSERT_EQUAL(0, strcmp("John", temp->username()));
delete temp;
}
+
+#include "auth/negotiate/auth_negotiate.h"
+/* AuthNegotiateUserRequest::AuthNegotiateUserRequest works
+ */
+void
+testAuthNegotiateUserRequest::construction()
+{
+ AuthNegotiateUserRequest();
+ AuthNegotiateUserRequest *temp=new AuthNegotiateUserRequest();
+ delete temp;
+}
+
+void
+testAuthNegotiateUserRequest::username()
+{
+ AuthNegotiateUserRequest();
+ AuthNegotiateUserRequest *temp=new AuthNegotiateUserRequest();
+ NegotiateUser *user=new NegotiateUser(AuthConfig::Find("negotiate"));
+ user->username("John");
+ temp->user(user);
+ user->addRequest(temp);
+ CPPUNIT_ASSERT_EQUAL(0, strcmp("John", temp->username()));
+ delete temp;
+}
void username();
};
+class testAuthNegotiateUserRequest : public CPPUNIT_NS::TestFixture
+{
+ CPPUNIT_TEST_SUITE( testAuthNegotiateUserRequest );
+ CPPUNIT_TEST( construction );
+ CPPUNIT_TEST( username );
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+
+protected:
+ void construction();
+ void username();
+};
+
#endif
flags.cachable = 1;
StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
HttpVersion version(1, 0);
- /* We are allowed to do this typecast */
- httpReplySetHeaders((HttpReply *)pe->getReply(), version, HTTP_OK, "dummy test object", "x-squid-internal/test", -1, -1, squid_curtime + 100000);
+ HttpReply *rep = (HttpReply *) pe->getReply(); // bypass const
+ rep->setHeaders(version, HTTP_OK, "dummy test object", "x-squid-internal/test", -1, -1, squid_curtime + 100000);
storeSetPublicKey(pe);
{
Packer p;
packerToStoreInit(&p, pe);
- httpReplyPackHeadersInto(pe->getReply(), &p);
+ pe->getReply()->packHeadersInto(&p);
packerClean(&p);
}
StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
HttpVersion version(1, 0);
/* We are allowed to do this typecast */
- httpReplySetHeaders((HttpReply *)pe->getReply(), version, HTTP_OK, "dummy test object", "x-squid-internal/test", -1, -1, squid_curtime + 100000);
+ HttpReply *rep = (HttpReply *) pe->getReply(); // bypass const
+ rep->setHeaders(version, HTTP_OK, "dummy test object", "x-squid-internal/test", -1, -1, squid_curtime + 100000);
storeSetPublicKey(pe);
{
Packer p;
packerToStoreInit(&p, pe);
- httpReplyPackHeadersInto(pe->getReply(), &p);
+ pe->getReply()->packHeadersInto(&p);
packerClean(&p);
}
flags.cachable = 1;
StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
HttpVersion version(1, 0);
- /* We are allowed to do this typecast */
- httpReplySetHeaders((HttpReply *)pe->getReply(), version, HTTP_OK, "dummy test object", "x-squid-internal/test", -1, -1, squid_curtime + 100000);
+ HttpReply *rep = (HttpReply *) pe->getReply(); // bypass const
+ rep->setHeaders(version, HTTP_OK, "dummy test object", "x-squid-internal/test", -1, -1, squid_curtime + 100000);
storeSetPublicKey(pe);
{
Packer p;
packerToStoreInit(&p, pe);
- httpReplyPackHeadersInto(pe->getReply(), &p);
+ pe->getReply()->packHeadersInto(&p);
packerClean(&p);
}