tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r1053002 - in /tuscany/sca-cpp/trunk: INSTALL configure.ac modules/http/form-auth-conf modules/http/httpd-conf modules/http/httpd.hpp modules/http/mod-openauth.cpp modules/http/open-auth-conf ubuntu/ubuntu-install-all
Date Mon, 27 Dec 2010 05:59:20 GMT
Author: jsdelfino
Date: Mon Dec 27 05:59:19 2010
New Revision: 1053002

URL: http://svn.apache.org/viewvc?rev=1053002&view=rev
Log:
Merge changes from apr-2 branch. Port to APR 1.4.x and enable mod_session_crypto.

Modified:
    tuscany/sca-cpp/trunk/INSTALL
    tuscany/sca-cpp/trunk/configure.ac
    tuscany/sca-cpp/trunk/modules/http/form-auth-conf
    tuscany/sca-cpp/trunk/modules/http/httpd-conf
    tuscany/sca-cpp/trunk/modules/http/httpd.hpp
    tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp
    tuscany/sca-cpp/trunk/modules/http/open-auth-conf
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all

Modified: tuscany/sca-cpp/trunk/INSTALL
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/INSTALL?rev=1053002&r1=1053001&r2=1053002&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/INSTALL (original)
+++ tuscany/sca-cpp/trunk/INSTALL Mon Dec 27 05:59:19 2010
@@ -46,7 +46,7 @@ Then install the following development d
 
 Apache HTTP server and APR:
 httpd-2.3.10 (http://httpd.apache.org/)
-with included libapr and libaprutil
+apr-1.4.x (http://apr.apache.org/)
 built with OpenSSL libssl-0.9.8, libpcre3-8.02,
 and expat 2.0.1
 
@@ -167,7 +167,7 @@ dependencies installed in the standard s
 dependencies installed under $HOME:
 
 ./configure --prefix=$HOME/tuscany-sca-cpp-bin \
---with-apr=$HOME/httpd-2.3.10-bin --with-httpd=$HOME/httpd-2.3.10-bin \
+--with-apr=$HOME/apr-1.4.x-bin --with-httpd=$HOME/httpd-2.3.10-bin \
 --with-memcached=$HOME/memcached-1.4.5-bin \
 --with-tinycdb=$HOME/tinycdb-0.77-bin \
 --with-curl=$HOME/curl-7.19.5-bin --with-libxml2=/usr \

Modified: tuscany/sca-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/configure.ac?rev=1053002&r1=1053001&r2=1053002&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/configure.ac (original)
+++ tuscany/sca-cpp/trunk/configure.ac Mon Dec 27 05:59:19 2010
@@ -259,18 +259,18 @@ AC_CHECK_LIB([mozjs], [JS_NewContext], [
 # Configure path to Apache APR and HTTPD includes and libs.
 AC_MSG_CHECKING([for apr])
 AC_ARG_WITH([apr], [AC_HELP_STRING([--with-apr=PATH], [path to installed Apache APR [default=/usr]])],
[
-  APR_INCLUDE="${withval}/include"
+  APR_INCLUDE="${withval}/include/apr-2"
   APR_LIB="${withval}/lib"
   AC_MSG_RESULT("${withval}")
 ], [
-  APR_INCLUDE="/usr/include/apr-1.0"
+  APR_INCLUDE="/usr/include/apr-2"
   APR_LIB="/usr/lib"
   AC_MSG_RESULT(/usr)
 ])
 AC_SUBST(APR_INCLUDE)
 AC_SUBST(APR_LIB)
 LIBS="-L${APR_LIB} ${defaultlibs}"
-AC_CHECK_LIB([apr-1], [apr_pool_initialize], [], [AC_MSG_ERROR([couldn't find a suitable
libapr-1, use --with-apr=PATH])])
+AC_CHECK_LIB([apr-2], [apr_pool_initialize], [], [AC_MSG_ERROR([couldn't find a suitable
libapr-2, use --with-apr=PATH])])
 
 AC_MSG_CHECKING([for httpd])
 AC_ARG_WITH([httpd], [AC_HELP_STRING([--with-httpd=PATH], [path to installed Apache HTTPD
[default=/usr]])], [
@@ -341,7 +341,7 @@ AC_CHECK_LIB([cdb], [cdb_make_start], []
 
 # Configure default includes and ldflags
 cxxflags="${cxxflags} ${INCLUDES} -I. -I${TUSCANY_SCACPP}/kernel -I${APR_INCLUDE} -I${HTTPD_INCLUDE}
-I${LIBXML2_INCLUDE} -I${JS_INCLUDE} -I${LIBCURL_INCLUDE}"
-ldflags="${ldflags} -ldl -L${APR_LIB} -R${APR_LIB} -lapr-1 -laprutil-1"
+ldflags="${ldflags} -ldl -L${APR_LIB} -R${APR_LIB} -lapr-2"
 ldflags="${ldflags} -L${LIBCURL_LIB} -R${LIBCURL_LIB} -L${JS_LIB} -R${JS_LIB} -L${LIBXML2_LIB}
-R${LIBXML2_LIB}"
 
 # Enable Python 2.6 support.

Modified: tuscany/sca-cpp/trunk/modules/http/form-auth-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/form-auth-conf?rev=1053002&r1=1053001&r2=1053002&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/form-auth-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/form-auth-conf Mon Dec 27 05:59:19 2010
@@ -25,6 +25,8 @@ root=`readlink -f $1`
 conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"`
 host=`echo $conf | awk '{ print $6 }'`
 
+pw=`cat $root/cert/ca.key | head -2 | tail -1`
+
 # Generate form authentication configuration
 cat >>$root/conf/auth.conf <<EOF
 # Generated by: form-auth-conf $*
@@ -38,7 +40,7 @@ AuthFormLoginRequiredLocation /login
 AuthFormLogoutLocation /
 Session On
 SessionCookieName TuscanyFormAuth path=/;secure=TRUE
-#SessionCryptoPassphrase secret
+SessionCryptoPassphrase $pw
 Require valid-user
 </Location>
 

Modified: tuscany/sca-cpp/trunk/modules/http/httpd-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd-conf?rev=1053002&r1=1053001&r2=1053002&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-conf Mon Dec 27 05:59:19 2010
@@ -191,7 +191,7 @@ LoadModule vhost_alias_module ${modules_
 LoadModule cgi_module ${modules_prefix}/modules/mod_cgi.so
 LoadModule unixd_module ${modules_prefix}/modules/mod_unixd.so
 LoadModule session_module ${modules_prefix}/modules/mod_session.so
-#LoadModule session_crypto_module ${modules_prefix}/modules/mod_session_crypto.so
+LoadModule session_crypto_module ${modules_prefix}/modules/mod_session_crypto.so
 LoadModule session_cookie_module ${modules_prefix}/modules/mod_session_cookie.so
 LoadModule slotmem_shm_module ${modules_prefix}/modules/mod_slotmem_shm.so
 LoadModule ratelimit_module ${modules_prefix}/modules/mod_ratelimit.so

Modified: tuscany/sca-cpp/trunk/modules/http/httpd.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd.hpp?rev=1053002&r1=1053001&r2=1053002&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd.hpp Mon Dec 27 05:59:19 2010
@@ -57,6 +57,7 @@
 #include <mod_core.h>
 #include <ap_provider.h>
 #include <mod_auth.h>
+#include <mod_session.h>
 
 #include "string.hpp"
 #include "stream.hpp"

Modified: tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp?rev=1053002&r1=1053001&r2=1053002&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp Mon Dec 27 05:59:19 2010
@@ -77,14 +77,51 @@ public:
 };
 
 /**
+ * Log a session entry.
+ */
+int debugSession(unused void* r, const char* key, const char* value) {
+    cdebug << "  session key: " << key << ", value: " << value <<
endl;
+    return 1;
+}
+
+/**
+ * Return the user info from a form auth encrypted session cookie.
+ */
+static int (*ap_session_load_fn) (request_rec * r, session_rec ** z) = NULL;
+static void (*ap_session_get_fn) (request_rec * r, session_rec * z, const char *key, const
char **value) = NULL;
+
+const failable<value> userInfoFromSession(const string& realm, request_rec* r)
{
+    debug("modopenauth::userInfoFromSession");
+    if (ap_session_load_fn == NULL)
+        ap_session_load_fn = APR_RETRIEVE_OPTIONAL_FN(ap_session_load);
+    session_rec *z = NULL;
+    ap_session_load_fn(r, &z);
+    if (z == NULL)
+        return mkfailure<value>("Couldn't retrieve user session");
+    apr_table_do(debugSession, r, z->entries, NULL);
+
+    if (ap_session_get_fn == NULL)
+        ap_session_get_fn = APR_RETRIEVE_OPTIONAL_FN(ap_session_get);
+    const char* user = NULL;
+    ap_session_get_fn(r, z, c_str(realm + "-user"), &user);
+    if (user == NULL)
+        return mkfailure<value>("Couldn't retrieve user id");
+    const char* pw = NULL;
+    ap_session_get_fn(r, z, c_str(realm + "-pw"), &pw);
+    if (pw == NULL)
+        return mkfailure<value>("Couldn't retrieve password");
+    return value(mklist<value>(mklist<value>("realm", realm), mklist<value>("id",
string(user)), mklist<value>("password", string(pw))));
+}
+
+/**
  * Return the user info from a form auth session cookie.
  */
-const failable<value> userInfo(const value& sid, const string& realm) {
+const failable<value> userInfoFromCookie(const value& sid, const string& realm,
request_rec* r) {
     const list<list<value>> info = httpd::queryArgs(sid);
-    debug(info, "modopenauth::userInfo::info");
+    debug(info, "modopenauth::userInfoFromCookie::info");
     const list<value> user = assoc<value>(realm + "-user", info);
     if (isNil(user))
-        return mkfailure<value>("Couldn't retrieve user id");
+        return userInfoFromSession(realm, r);
     const list<value> pw = assoc<value>(realm + "-pw", info);
     if (isNil(pw))
         return mkfailure<value>("Couldn't retrieve password");
@@ -94,8 +131,8 @@ const failable<value> userInfo(const val
 /**
  * Return the user info from a basic auth header.
  */
-const failable<value> userInfo(const char* header, const string& realm, request_rec*
r) {
-    debug(header, "modopenauth::userInfo::header");
+const failable<value> userInfoFromHeader(const char* header, const string& realm,
request_rec* r) {
+    debug(header, "modopenauth::userInfoFromHeader::header");
     if (strcasecmp(ap_getword(r->pool, &header, ' '), "Basic"))
         return mkfailure<value>("Wrong authentication scheme");
 
@@ -176,7 +213,7 @@ static int checkAuthn(request_rec *r) {
             return httpd::reportStatus(mkfailure<int>("Missing AuthName"));
 
         // Extract user info from the session id
-        const failable<value> info = userInfo(content(sid), aname);
+        const failable<value> info = userInfoFromCookie(content(sid), aname, r);
         if (hasContent(info)) {
 
             // Try to authenticate the request
@@ -205,7 +242,7 @@ static int checkAuthn(request_rec *r) {
             return httpd::reportStatus(mkfailure<int>("Missing AuthName"));
 
         // Extract user info from the session id
-        const failable<value> info = userInfo(header, aname, r);
+        const failable<value> info = userInfoFromHeader(header, aname, r);
         if (hasContent(info)) {
 
             // Try to authenticate the request

Modified: tuscany/sca-cpp/trunk/modules/http/open-auth-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/open-auth-conf?rev=1053002&r1=1053001&r2=1053002&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/open-auth-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/open-auth-conf Mon Dec 27 05:59:19 2010
@@ -25,6 +25,8 @@ root=`readlink -f $1`
 conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"`
 host=`echo $conf | awk '{ print $6 }'`
 
+pw=`cat $root/cert/ca.key | head -2 | tail -1`
+
 # Generate form authentication configuration
 cat >>$root/conf/auth.conf <<EOF
 # Generated by: open-auth-conf $*
@@ -32,6 +34,9 @@ cat >>$root/conf/auth.conf <<EOF
 <Location />
 AuthType Open
 AuthName "$host"
+Session On
+SessionCookieName TuscanyOpenAuth path=/;secure=TRUE
+SessionCryptoPassphrase $pw
 AuthOpenAuth On
 AuthOpenAuthLoginPage /login
 Require valid-user
@@ -44,9 +49,6 @@ AuthName "$host"
 AuthFormProvider file
 AuthFormLoginRequiredLocation /login
 AuthFormLogoutLocation /
-Session On
-SessionCookieName TuscanyOpenAuth path=/;secure=TRUE
-#SessionCryptoPassphrase secret
 Require valid-user
 SetHandler form-login-handler
 </Location>

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all?rev=1053002&r1=1053001&r2=1053002&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all Mon Dec 27 05:59:19 2010
@@ -44,17 +44,22 @@ if [ "$?" != "0" ]; then
 fi
 cd $build
 
-# Build Apache HTTP server
+# Build Apache APR and HTTP server
 sudo apt-get -y install libssl-dev libpcre3-dev
 if [ "$?" != "0" ]; then
     exit $?
 fi
+svn co -r 1051230 http://svn.apache.org/repos/asf/apr/apr/trunk apr-1.4.x
+cd apr-1.4.x
+./buildconf
+./configure -with-openssl --with-crypto --with-expat=$build/expat-2.0.1-bin --prefix=$build/apr-1.4.x-bin
+make
+make install
+cd $build
 wget http://archive.apache.org/dist/httpd/httpd-2.3.10-alpha.tar.gz
 tar xzf httpd-2.3.10-alpha.tar.gz
-wget http://archive.apache.org/dist/httpd/httpd-2.3.10-deps.tar.gz
-tar xzf httpd-2.3.10-deps.tar.gz
 cd httpd-2.3.10
-./configure --enable-ssl --enable-proxy --enable-usertrack --enable-cgi --enable-mods-shared=most
--enable-mpms-shared="prefork worker event" --with-mpm=prefork --with-included-apr --with-expat=$build/expat-2.0.1-bin
--prefix=$build/httpd-2.3.10-bin
+./configure --enable-ssl --enable-proxy --enable-usertrack --enable-cgi --enable-session-crypto
--enable-mods-shared=most --enable-mpms-shared="prefork worker event" --with-mpm=prefork --with-apr=$build/apr-1.4.x-bin
--with-expat=$build/expat-2.0.1-bin --prefix=$build/httpd-2.3.10-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -142,7 +147,7 @@ fi
 wget http://www.apache.org/dist/ws/axis2-c/1_6_0/axis2c-src-1.6.0.tar.gz
 tar xzf axis2c-src-1.6.0.tar.gz
 cd axis2c-src-1.6.0
-./configure --enable-libxml2 LIBXML2_CFLAGS="-I$build/libxml2-2.7.7-bin/include/libxml2"
LIBXML2_LIBS="-L$build/libxml2-2.7.7-bin/lib -lxml2" --enable-openssl --with-apache2=$build/httpd-2.3.10-bin/include
--prefix=$build/axis2c-1.6.0-bin
+./configure --enable-libxml2 LIBXML2_CFLAGS="-I$build/libxml2-2.7.7-bin/include/libxml2"
LIBXML2_LIBS="-L$build/libxml2-2.7.7-bin/lib -lxml2" --enable-openssl --with-apache2=$build/httpd-2.3.10-bin/include
--with-apr=$build/apr-1.4.x-bin/include/apr-2 --prefix=$build/axis2c-1.6.0-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -229,7 +234,7 @@ cd $build
 git clone git://github.com/jsdelfino/mod_auth_openid.git
 cd mod_auth_openid
 ./autogen.sh
-./configure --prefix=$build/mod-auth-openid-bin --with-apr=$build/httpd-2.3.10-bin --with-httpd=$build/httpd-2.3.10-bin
--with-curl=$build/curl-7.19.5-bin --with-libopkele=$build/libopkele-bin
+./configure --prefix=$build/mod-auth-openid-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.10-bin
--with-curl=$build/curl-7.19.5-bin --with-libopkele=$build/libopkele-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -327,7 +332,7 @@ git clone git://git.apache.org/tuscany-s
 cd tuscany-sca-cpp
 cp etc/git-exclude .git/info/exclude
 ./bootstrap
-./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.19.5-bin --with-apr=$build/httpd-2.3.10-bin
--with-httpd=$build/httpd-2.3.10-bin --with-memcached=$build/memcached-1.4.5-bin --with-tinycdb=$build/tinycdb-0.77-bin
--with-js-include=$build/tracemonkey-bin/include/js --with-js-lib=$build/tracemonkey-bin/lib
--with-libcloud=$build/libcloud-0.3.1-bin --enable-threads --enable-python --enable-gae --with-gae=$build/google_appengine
--enable-java --with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice --with-libxml2=$build/libxml2-2.7.7-bin
--with-axis2c=$build/axis2c-1.6.0-bin --enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat
--with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.5 --enable-sqldb --with-pgsql=$build/postgresql-9.0.1-bin
--enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid
--with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/l
 iboauth-0.9.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.19.5-bin --with-apr=$build/apr-1.4.x-bin
--with-httpd=$build/httpd-2.3.10-bin --with-memcached=$build/memcached-1.4.5-bin --with-tinycdb=$build/tinycdb-0.77-bin
--with-js-include=$build/tracemonkey-bin/include/js --with-js-lib=$build/tracemonkey-bin/lib
--with-libcloud=$build/libcloud-0.3.1-bin --enable-threads --enable-python --enable-gae --with-gae=$build/google_appengine
--enable-java --with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice --with-libxml2=$build/libxml2-2.7.7-bin
--with-axis2c=$build/axis2c-1.6.0-bin --enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat
--with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.5 --enable-sqldb --with-pgsql=$build/postgresql-9.0.1-bin
--enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid
--with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/libo
 auth-0.9.1-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -336,5 +341,5 @@ fi
 cd $build
 
 # Create bin archive
-tar czf tuscany-sca-cpp-all-1.0.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin axis2c-1.6.0-bin
libxml2-2.7.7-bin curl-7.19.5-bin httpd-2.3.10-bin tracemonkey-bin google_appengine libstrophe-bin
memcached-1.4.5-bin tinycdb-0.77-bin qpidc-0.6-bin vysper-0.5 postgresql-9.0.1-bin thrift-0.2.0-bin
scribe-2.2-bin libcloud-0.3.1-bin htmltidy-bin libopkele-bin mod-auth-openid-bin liboauth-0.9.1-bin
+tar czf tuscany-sca-cpp-all-1.0.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin axis2c-1.6.0-bin
libxml2-2.7.7-bin curl-7.19.5-bin httpd-2.3.10-bin apr-1.4.x-bin tracemonkey-bin google_appengine
libstrophe-bin memcached-1.4.5-bin tinycdb-0.77-bin qpidc-0.6-bin vysper-0.5 postgresql-9.0.1-bin
thrift-0.2.0-bin scribe-2.2-bin libcloud-0.3.1-bin htmltidy-bin libopkele-bin mod-auth-openid-bin
liboauth-0.9.1-bin
 



Mime
View raw message