Removed SWIG Lasso.c file.
Added a Python test for defederation (currently it aborts).
This commit is contained in:
parent
740fcce66a
commit
31aa53988b
|
@ -3,8 +3,7 @@ INCLUDES = -I$(top_srcdir)
|
|||
lib_LTLIBRARIES = liblassosharpglue.la
|
||||
|
||||
liblassosharpglue_la_SOURCES = \
|
||||
liblassosharpglue_wrap.c \
|
||||
$(top_srcdir)/swig/Lasso.c
|
||||
liblassosharpglue_wrap.c
|
||||
|
||||
liblassosharpglue_la_CFLAGS = \
|
||||
$(LASSO_CFLAGS) \
|
||||
|
|
|
@ -13,8 +13,8 @@ javasharedir = $(prefix)/share/java
|
|||
# Shared library.
|
||||
javalib_LTLIBRARIES = libjlasso.la
|
||||
|
||||
libjlasso_la_SOURCES = $(JAVA_MODULE)_wrap.c \
|
||||
$(top_srcdir)/swig/Lasso.c
|
||||
libjlasso_la_SOURCES = $(JAVA_MODULE)_wrap.c
|
||||
|
||||
libjlasso_la_CFLAGS = $(JDK_INCLUDES) \
|
||||
$(LASSO_CFLAGS) \
|
||||
-I$(top_srcdir)
|
||||
|
|
|
@ -6,8 +6,7 @@ python_LTLIBRARIES = _lassomod.la
|
|||
|
||||
PYTHON_PACKAGE=lassomod
|
||||
|
||||
_lassomod_la_SOURCES = $(PYTHON_PACKAGE)_wrap.c \
|
||||
$(top_srcdir)/swig/Lasso.c
|
||||
_lassomod_la_SOURCES = $(PYTHON_PACKAGE)_wrap.c
|
||||
|
||||
_lassomod_la_CFLAGS = $(LASSO_CFLAGS) \
|
||||
-DSWIG_COBJECT_TYPES \
|
||||
|
|
|
@ -86,10 +86,35 @@ class LogoutTestCase(unittest.TestCase):
|
|||
self.failIf(logout.get_next_providerID())
|
||||
|
||||
|
||||
class DefederationTestCase(unittest.TestCase):
|
||||
def test01(self):
|
||||
"""IDP initiated defederation; testing process_notification_msg with non Liberty query."""
|
||||
|
||||
lassoServer = lasso.Server(
|
||||
os.path.join(dataDir, 'idp1-la/metadata.xml'),
|
||||
None, # os.path.join(dataDir, 'idp1-la/public-key.pem') is no more used
|
||||
os.path.join(dataDir, 'idp1-la/private-key-raw.pem'),
|
||||
os.path.join(dataDir, 'idp1-la/certificate.pem'),
|
||||
lasso.signatureMethodRsaSha1)
|
||||
lassoServer.add_provider(
|
||||
os.path.join(dataDir, 'sp1-la/metadata.xml'),
|
||||
os.path.join(dataDir, 'sp1-la/public-key.pem'),
|
||||
os.path.join(dataDir, 'sp1-la/certificate.pem'))
|
||||
defederation = lasso.Defederation(lassoServer, lasso.providerTypeIdp)
|
||||
# The process_notification_msg should failt but not abort.
|
||||
try:
|
||||
defederation.process_notification_msg('nonLibertyQuery=1', lasso.httpMethodRedirect)
|
||||
except lasso.Error, error:
|
||||
pass
|
||||
else:
|
||||
fail('Defederation process_notification_msg should have failed.')
|
||||
|
||||
|
||||
suite1 = unittest.makeSuite(LoginTestCase, 'test')
|
||||
suite2 = unittest.makeSuite(LogoutTestCase, 'test')
|
||||
suite3 = unittest.makeSuite(DefederationTestCase, 'test')
|
||||
|
||||
allTests = unittest.TestSuite((suite1, suite2))
|
||||
allTests = unittest.TestSuite((suite1, suite2, suite3))
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(not unittest.TextTestRunner(verbosity = 2).run(allTests).wasSuccessful())
|
||||
|
|
75
swig/Lasso.c
75
swig/Lasso.c
|
@ -1,75 +0,0 @@
|
|||
/* -*- Mode: c; c-basic-offset: 8 -*-
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* SWIG bindings for Lasso Library
|
||||
*
|
||||
* Copyright (C) 2004 Entr'ouvert
|
||||
* http://lasso.entrouvert.org
|
||||
*
|
||||
* Authors: Romain Chantereau <rchantereau@entrouvert.com>
|
||||
* Emmanuel Raviart <eraviart@entrouvert.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include <lasso/lasso_config.h>
|
||||
#include <lasso/lasso.h>
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
***********************************************************************
|
||||
* Profiles
|
||||
***********************************************************************
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Profile
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
LassoAuthnRequest* lasso_profile_get_authn_request_ref(LassoProfile *profile)
|
||||
{
|
||||
if (profile->request_type == lassoMessageTypeAuthnRequest)
|
||||
return LASSO_AUTHN_REQUEST(profile->request);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LassoAuthnResponse* lasso_profile_get_authn_response_ref(LassoProfile *profile)
|
||||
{
|
||||
if (profile->response_type == lassoMessageTypeAuthnResponse)
|
||||
return LASSO_AUTHN_RESPONSE(profile->response);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LassoRequest* lasso_profile_get_request_ref(LassoProfile *profile)
|
||||
{
|
||||
if (profile->request_type == lassoMessageTypeRequest)
|
||||
return LASSO_REQUEST(profile->request);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LassoResponse* lasso_profile_get_response_ref(LassoProfile *profile)
|
||||
{
|
||||
if (profile->response_type == lassoMessageTypeResponse)
|
||||
return LASSO_RESPONSE(profile->response);
|
||||
else
|
||||
return NULL;
|
||||
}
|
46
swig/Lasso.i
46
swig/Lasso.i
|
@ -533,19 +533,49 @@ typedef struct _LassoProfile {
|
|||
lassoMessageType response_type;
|
||||
} LassoProfile;
|
||||
|
||||
/* Inline Methods */
|
||||
|
||||
%inline %{
|
||||
|
||||
LassoAuthnRequest* lasso_profile_get_authn_request_ref(LassoProfile *profile)
|
||||
{
|
||||
if (profile->request_type == lassoMessageTypeAuthnRequest)
|
||||
return LASSO_AUTHN_REQUEST(profile->request);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LassoAuthnResponse* lasso_profile_get_authn_response_ref(LassoProfile *profile)
|
||||
{
|
||||
if (profile->response_type == lassoMessageTypeAuthnResponse)
|
||||
return LASSO_AUTHN_RESPONSE(profile->response);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LassoRequest* lasso_profile_get_request_ref(LassoProfile *profile)
|
||||
{
|
||||
if (profile->request_type == lassoMessageTypeRequest)
|
||||
return LASSO_REQUEST(profile->request);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LassoResponse* lasso_profile_get_response_ref(LassoProfile *profile)
|
||||
{
|
||||
if (profile->response_type == lassoMessageTypeResponse)
|
||||
return LASSO_RESPONSE(profile->response);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
/* Methods */
|
||||
|
||||
LassoAuthnRequest* lasso_profile_get_authn_request_ref(LassoProfile *profile);
|
||||
|
||||
LassoAuthnResponse* lasso_profile_get_authn_response_ref(LassoProfile *profile);
|
||||
|
||||
%newobject lasso_profile_get_identity;
|
||||
LassoIdentity* lasso_profile_get_identity(LassoProfile *profile);
|
||||
|
||||
LassoRequest* lasso_profile_get_request_ref(LassoProfile *profile);
|
||||
|
||||
LassoResponse* lasso_profile_get_response_ref(LassoProfile *profile);
|
||||
|
||||
%newobject lasso_profile_get_session;
|
||||
LassoSession* lasso_profile_get_session(LassoProfile *profile);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
EXTRA_DIST = Lasso.i Lasso.c
|
||||
EXTRA_DIST = Lasso.i
|
||||
|
||||
clean-local:
|
||||
rm -f Lasso.py Lasso_wrap.c
|
||||
|
|
Loading…
Reference in New Issue