diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2005-11-20 15:38:19 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2005-11-20 15:38:19 +0000 |
commit | ebb9f7dffc22196e6c1cb18b218fc411b4d190c2 (patch) | |
tree | fce2aedd2eebee66103da6dc0f811063b8934f12 | |
parent | 56c88d1921c3b05c0213d2a1321502b2290b0b6f (diff) | |
download | lasso-ebb9f7dffc22196e6c1cb18b218fc411b4d190c2.tar.gz lasso-ebb9f7dffc22196e6c1cb18b218fc411b4d190c2.tar.xz lasso-ebb9f7dffc22196e6c1cb18b218fc411b4d190c2.zip |
SAML 2.0 support (only web-sso for the moment)
199 files changed, 15907 insertions, 232 deletions
diff --git a/configure.ac b/configure.ac index 1041dae9..dbe0a821 100644 --- a/configure.ac +++ b/configure.ac @@ -563,6 +563,41 @@ AC_MSG_RESULT($enable_perl) AC_SUBST(PERL_VERSION) +dnl Checks for zlib library (code adapted from libxml2 configure.in) +_cppflags="${CPPFLAGS}" +_ldflags="${LDFLAGS}" + +AC_ARG_WITH(zlib, +[ --with-zlib[[=DIR]] use libz in DIR],[ + if test "$withval" != "no" -a "$withval" != "yes"; then + Z_DIR=$withval + CPPFLAGS="${CPPFLAGS} -I$withval/include" + LDFLAGS="${LDFLAGS} -L$withval/lib" + fi +]) +AC_CHECK_HEADERS(zlib.h, + AC_CHECK_LIB(z, gzread,[ + AC_DEFINE([HAVE_LIBZ], [], [Have compression library]) + if test "x${Z_DIR}" != "x"; then + Z_CFLAGS="-I${Z_DIR}/include" + Z_LIBS="-L${Z_DIR}/lib -lz" + [case ${host} in + *-*-solaris*) + Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" + ;; + esac] + else + Z_LIBS="-lz" + fi])) + +test "z$Z_LIBS" != "z" || AC_MSG_ERROR(missing zlib) + +AC_SUBST(Z_CFLAGS) +AC_SUBST(Z_LIBS) + +CPPFLAGS=${_cppflags} +LDFLAGS=${_ldflags} + dnl ========================================================================== dnl Test suite (requires check) dnl ========================================================================== @@ -740,7 +775,7 @@ dnl ========================================================================== dnl Final steps: lasso config dnl ========================================================================== LASSO_PUB_CFLAGS="$LASSO_DEFINES" -LASSO_CORE_CFLAGS="$LASSO_CFLAGS $LASSO_DEFINES -DLASSO_INTERNALS" +LASSO_CORE_CFLAGS="$LASSO_CFLAGS $LASSO_DEFINES $Z_CFLAGS -DLASSO_INTERNALS" if test $MINGW -eq 1; then LASSO_CORE_LIBS="-llasso-0" else @@ -749,7 +784,8 @@ fi AC_SUBST(LASSO_CORE_CFLAGS) AC_SUBST(LASSO_CORE_LIBS) -LASSO_LIBS="-L${libdir} $LASSO_LIBS" +LASSO_CFLAGS="$LASSO_CFLAGS" +LASSO_LIBS="-L${libdir} $Z_LIBS $LASSO_LIBS" AC_SUBST(LASSO_CFLAGS) AC_SUBST(LASSO_LIBS) @@ -780,12 +816,15 @@ java/Makefile lasso/Makefile lasso/id-ff/Makefile lasso/id-wsf/Makefile +lasso/saml-2.0/Makefile lasso/xml/Makefile +lasso/xml/saml-2.0/Makefile perl/Makefile php/Makefile python/Makefile swig/Makefile swig/wsf-support.i +swig/saml-2.0/Makefile tests/Makefile tests/data/Makefile tests/data/ca1-la/Makefile diff --git a/lasso/Makefile.am b/lasso/Makefile.am index 6f16afe9..bead20ea 100644 --- a/lasso/Makefile.am +++ b/lasso/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = xml id-ff id-wsf +SUBDIRS = xml id-ff id-wsf saml-2.0 liblassoincludedir = $(includedir)/lasso @@ -43,7 +43,9 @@ endif if MINGW liblasso_la_LIBADD = \ $(top_builddir)/lasso/xml/liblasso-xml.la \ + $(top_builddir)/lasso/xml/saml-2.0/liblasso-xml-saml2.la \ $(top_builddir)/lasso/id-ff/liblasso-id-ff.la \ + $(top_builddir)/lasso/saml-2.0/liblasso-saml-20.la \ $(WSF_LIB_FILE) \ $(LASSO_LIBS) \ lasso.rc.lo @@ -55,7 +57,9 @@ liblasso_la_LDFLAGS = -no-undefined -version-info @LASSO_VERSION_INFO@ \ else liblasso_la_LIBADD = \ $(top_builddir)/lasso/xml/liblasso-xml.la \ + $(top_builddir)/lasso/xml/saml-2.0/liblasso-xml-saml2.la \ $(top_builddir)/lasso/id-ff/liblasso-id-ff.la \ + $(top_builddir)/lasso/saml-2.0/liblasso-saml-20.la \ $(WSF_LIB_FILE) \ $(LASSO_LIBS) # Just make damn sure the ABI stays the same between diff --git a/lasso/errors.c b/lasso/errors.c index 8a14f639..e4789c5d 100644 --- a/lasso/errors.c +++ b/lasso/errors.c @@ -67,9 +67,11 @@ lasso_strerror(int error_code) return "Signature template has not been found."; case LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND: - return "ProviderID unknown to LassoServer"; + return "ProviderID unknown to LassoServer."; case LASSO_SERVER_ERROR_ADD_PROVIDER_FAILED: return "Failed to add new provider."; + case LASSO_SERVER_ERROR_ADD_PROVIDER_PROTOCOL_MISMATCH: + return "Failed to add new provider (protocol mismatch)."; case LASSO_LOGOUT_ERROR_UNSUPPORTED_PROFILE: return "Unsupported protocol profile"; diff --git a/lasso/errors.h b/lasso/errors.h index 8b649e5c..e5f421a2 100644 --- a/lasso/errors.h +++ b/lasso/errors.h @@ -55,6 +55,7 @@ /* Server */ #define LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND -201 #define LASSO_SERVER_ERROR_ADD_PROVIDER_FAILED -202 +#define LASSO_SERVER_ERROR_ADD_PROVIDER_PROTOCOL_MISMATCH -203 /* Single Logout */ #define LASSO_LOGOUT_ERROR_UNSUPPORTED_PROFILE -301 diff --git a/lasso/extract_symbols.py b/lasso/extract_symbols.py index af99281b..72c5e1a4 100644 --- a/lasso/extract_symbols.py +++ b/lasso/extract_symbols.py @@ -17,7 +17,8 @@ else: regex = re.compile('LASSO_EXPORT.*(lasso_[a-zA-Z0-9_]+).*\(') symbols = [] -for header_file in glob.glob('%s/*/*.h' % srcdir) + glob.glob('%s/*.h' % srcdir): +for header_file in glob.glob('%s/*/*.h' % srcdir) + glob.glob('%s/*.h' % srcdir) + \ + glob.glob('%s/*/*/*.h' % srcdir): symbols.extend(regex.findall(file(header_file).read().replace('\\\n', ''))) wsf = ['lasso_disco_', 'lasso_dst_', 'lasso_is_', 'lasso_profile_service', diff --git a/lasso/extract_types.py b/lasso/extract_types.py index 83fab0c6..95419f62 100644 --- a/lasso/extract_types.py +++ b/lasso/extract_types.py @@ -1,8 +1,10 @@ #! /usr/bin/env python +from cStringIO import StringIO import glob import re import sys +import os enable_wsf = 0 @@ -21,7 +23,7 @@ wsf = ['lasso_disco_', 'lasso_dst_', 'lasso_is_', 'lasso_profile_service', if enable_wsf: wsf = [] -fd = open('types.c', 'w') +fd = StringIO() print >> fd, "/* This file has been autogenerated; changes will be lost */" print >> fd, "" @@ -29,7 +31,7 @@ print >> fd, "typedef GType (*type_function) (void);" print >> fd, "" header_files = [] -for header_file in glob.glob('%s/*/*.h' % srcdir): +for header_file in glob.glob('%s/*/*.h' % srcdir) + glob.glob('%s/*/*/*.h' % srcdir): if not enable_wsf and 'id-wsf' in header_file: continue header_files.append(header_file) @@ -58,3 +60,5 @@ for header_file in header_files: print >> fd, "\tNULL" print >> fd, "};" +if not os.path.exists('types.c') or fd.getvalue() != file('types.c').read(): + file('types.c', 'w').write(fd.getvalue()) diff --git a/lasso/id-ff/defederation.c b/lasso/id-ff/defederation.c index 3bd5e1ea..fdb5cc6b 100644 --- a/lasso/id-ff/defederation.c +++ b/lasso/id-ff/defederation.c @@ -83,8 +83,10 @@ lasso_defederation_build_notification_msg(LassoDefederation *defederation) /* build the logout request message */ profile->msg_url = lasso_provider_get_metadata_one( remote_provider, "SoapEndpoint"); - profile->request->private_key_file = profile->server->private_key; - profile->request->certificate_file = profile->server->certificate; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->certificate_file = + profile->server->certificate; profile->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->request)); return 0; } @@ -232,9 +234,9 @@ lasso_defederation_init_notification(LassoDefederation *defederation, gchar *rem g_strdup(profile->msg_relayState); } - if (lasso_provider_compatibility_level(remote_provider) < LIBERTY_1_2) { - profile->request->MajorVersion = 1; - profile->request->MinorVersion = 1; + if (lasso_provider_get_protocol_conformance(remote_provider) < LASSO_PROTOCOL_LIBERTY_1_2) { + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MajorVersion = 1; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MinorVersion = 1; } /* remove federation with remote provider id */ diff --git a/lasso/id-ff/federation.c b/lasso/id-ff/federation.c index 499d74ff..dbcc2a71 100644 --- a/lasso/id-ff/federation.c +++ b/lasso/id-ff/federation.c @@ -33,7 +33,7 @@ struct _LassoFederationPrivate /* static methods/functions */ /*****************************************************************************/ -static LassoSamlNameIdentifier* +static LassoNode* lasso_federation_build_name_identifier(const gchar *nameQualifier, const gchar *format, const gchar *content) { @@ -49,7 +49,7 @@ lasso_federation_build_name_identifier(const gchar *nameQualifier, nameIdentifier->NameQualifier = g_strdup(nameQualifier); nameIdentifier->Format = g_strdup(format); - return nameIdentifier; + return LASSO_NODE(nameIdentifier); } /*****************************************************************************/ @@ -107,7 +107,7 @@ lasso_federation_verify_name_identifier(LassoFederation *federation, /* verify local name identifier */ if (federation->local_nameIdentifier != NULL) { - s = federation->local_nameIdentifier->content; + s = LASSO_SAML_NAME_IDENTIFIER(federation->local_nameIdentifier)->content; if (strcmp(s, name_identifier->content) == 0) { return TRUE; } @@ -115,7 +115,7 @@ lasso_federation_verify_name_identifier(LassoFederation *federation, /* verify remote name identifier */ if (federation->remote_nameIdentifier != NULL) { - s = federation->remote_nameIdentifier->content; + s = LASSO_SAML_NAME_IDENTIFIER(federation->remote_nameIdentifier)->content; if (strcmp(s, name_identifier->content) == 0) { return TRUE; } diff --git a/lasso/id-ff/federation.h b/lasso/id-ff/federation.h index aa9541dd..7b113d0b 100644 --- a/lasso/id-ff/federation.h +++ b/lasso/id-ff/federation.h @@ -52,8 +52,8 @@ struct _LassoFederation { /*< public >*/ gchar *remote_providerID; - LassoSamlNameIdentifier *local_nameIdentifier; - LassoSamlNameIdentifier *remote_nameIdentifier; + LassoNode *local_nameIdentifier; + LassoNode *remote_nameIdentifier; /*< private >*/ LassoFederationPrivate *private_data; diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c index e571a147..69fad979 100644 --- a/lasso/id-ff/login.c +++ b/lasso/id-ff/login.c @@ -49,6 +49,8 @@ #include <lasso/id-ff/sessionprivate.h> #include <lasso/id-ff/identityprivate.h> +#include <lasso/saml-2.0/loginprivate.h> + struct _LassoLoginPrivate { char *soap_request_msg; @@ -210,19 +212,25 @@ lasso_login_build_assertion(LassoLogin *login, LassoFederation *federation; g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - /* federation MAY be NULL */ profile = LASSO_PROFILE(login); if (profile->identity == NULL) return LASSO_PROFILE_ERROR_IDENTITY_NOT_FOUND; + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_build_assertion(login, + authenticationMethod, authenticationInstant, + reauthenticateOnOrAfter, notBefore, notOnOrAfter); + } + federation = g_hash_table_lookup(profile->identity->federations, profile->remote_providerID); assertion = LASSO_SAML_ASSERTION(lasso_lib_assertion_new_full( LASSO_PROVIDER(profile->server)->ProviderID, - profile->request->RequestID, + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->RequestID, profile->remote_providerID, notBefore, notOnOrAfter)); if (strcmp(login->nameIDPolicy, LASSO_LIB_NAMEID_POLICY_TYPE_ONE_TIME) == 0) { @@ -236,12 +244,12 @@ lasso_login_build_assertion(LassoLogin *login, as = lasso_lib_authentication_statement_new_full(authenticationMethod, authenticationInstant, reauthenticateOnOrAfter, NULL, nameIdentifier); - profile->nameIdentifier = nameIdentifier; + profile->nameIdentifier = LASSO_NODE(nameIdentifier); } else { as = lasso_lib_authentication_statement_new_full(authenticationMethod, authenticationInstant, reauthenticateOnOrAfter, - federation->remote_nameIdentifier, - federation->local_nameIdentifier); + LASSO_SAML_NAME_IDENTIFIER(federation->remote_nameIdentifier), + LASSO_SAML_NAME_IDENTIFIER(federation->local_nameIdentifier)); } assertion->AuthenticationStatement = LASSO_SAML_AUTHENTICATION_STATEMENT(as); @@ -271,9 +279,10 @@ lasso_login_build_assertion(LassoLogin *login, lasso_node_destroy(LASSO_NODE(login->assertion)); login->assertion = LASSO_SAML_ASSERTION(g_object_ref(assertion)); lasso_session_add_assertion(profile->session, profile->remote_providerID, - LASSO_SAML_ASSERTION(g_object_ref(assertion))); + g_object_ref(assertion)); - if (profile->request->MajorVersion == 1 && profile->request->MinorVersion < 2) { + if (LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MajorVersion == 1 && + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MinorVersion < 2) { /* pre-id-ff 1.2, saml 1.0 */ LassoSamlSubjectStatementAbstract *ss; @@ -573,6 +582,11 @@ lasso_login_accept_sso(LassoLogin *login) if (profile->response == NULL) return LASSO_ERROR_UNDEFINED; + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_accept_sso(login); + } + if (LASSO_SAMLP_RESPONSE(profile->response)->Assertion == NULL) return LASSO_ERROR_UNDEFINED; @@ -655,20 +669,22 @@ lasso_login_build_artifact_msg(LassoLogin *login, LassoHttpMethod http_method) g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + profile = LASSO_PROFILE(login); + + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_build_artifact_msg(login, http_method); + } + if (http_method != LASSO_HTTP_METHOD_REDIRECT && http_method != LASSO_HTTP_METHOD_POST) { return critical_error(LASSO_PROFILE_ERROR_INVALID_HTTP_METHOD); } - profile = LASSO_PROFILE(login); - /* ProtocolProfile must be BrwsArt */ if (login->protocolProfile != LASSO_LOGIN_PROTOCOL_PROFILE_BRWS_ART) { return critical_error(LASSO_PROFILE_ERROR_INVALID_PROTOCOLPROFILE); } - if (profile->remote_providerID == NULL) - return critical_error(LASSO_PROFILE_ERROR_MISSING_REMOTE_PROVIDERID); - /* build artifact infos */ remote_provider = g_hash_table_lookup(profile->server->providers, profile->remote_providerID); @@ -787,6 +803,11 @@ lasso_login_build_authn_request_msg(LassoLogin *login) return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND); } + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_build_authn_request_msg(login, remote_provider); + } + protocolProfile = LASSO_LIB_AUTHN_REQUEST(profile->request)->ProtocolProfile; if (protocolProfile == NULL) protocolProfile = LASSO_LIB_PROTOCOL_PROFILE_BRWS_ART; @@ -837,10 +858,12 @@ lasso_login_build_authn_request_msg(LassoLogin *login) } if (login->http_method == LASSO_HTTP_METHOD_POST) { if (must_sign) { - profile->request->private_key_file = profile->server->private_key; - profile->request->certificate_file = profile->server->certificate; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->certificate_file = + profile->server->certificate; } - lareq = lasso_node_export_to_base64(LASSO_NODE(profile->request)); + lareq = lasso_node_export_to_base64(profile->request); if (lareq == NULL) { message(G_LOG_LEVEL_CRITICAL, @@ -895,12 +918,17 @@ lasso_login_build_authn_response_msg(LassoLogin *login) /* Countermeasure: The issuer should sign <lib:AuthnResponse> messages. * (binding and profiles (1.2errata2, page 65) */ if (profile->server->certificate) - profile->response->sign_type = LASSO_SIGNATURE_TYPE_WITHX509; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->sign_type = + LASSO_SIGNATURE_TYPE_WITHX509; else - profile->response->sign_type = LASSO_SIGNATURE_TYPE_SIMPLE; - profile->response->sign_method = LASSO_SIGNATURE_METHOD_RSA_SHA1; - profile->response->private_key_file = profile->server->private_key; - profile->response->certificate_file = profile->server->certificate; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->sign_type = + LASSO_SIGNATURE_TYPE_SIMPLE; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->sign_method = + LASSO_SIGNATURE_METHOD_RSA_SHA1; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->certificate_file = + profile->server->certificate; /* build an lib:AuthnResponse base64 encoded */ profile->msg_body = lasso_node_export_to_base64(LASSO_NODE(profile->response)); @@ -936,9 +964,16 @@ lasso_login_build_request_msg(LassoLogin *login) profile = LASSO_PROFILE(login); - profile->request->private_key_file = profile->server->private_key; - profile->request->certificate_file = profile->server->certificate; - LASSO_PROFILE(login)->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->request)); + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_build_request_msg(login); + } + + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->request); remote_provider = g_hash_table_lookup(profile->server->providers, profile->remote_providerID); @@ -972,11 +1007,18 @@ lasso_login_build_response_msg(LassoLogin *login, gchar *remote_providerID) g_return_val_if_fail(LASSO_IS_LOGIN(login), -1); profile = LASSO_PROFILE(login); + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_build_response_msg(login, remote_providerID); + } + profile->response = lasso_samlp_response_new(); - profile->response->InResponseTo = g_strdup(profile->request->RequestID); - if (profile->request->MajorVersion == 1 && profile->request->MinorVersion == 0) { + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->InResponseTo = + g_strdup(LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->RequestID); + if (LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MajorVersion == 1 && + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MinorVersion == 0) { /* this is a SAML 1.0 request, must create SAML 1.0 response */ - profile->response->MinorVersion = 0; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->MinorVersion = 0; } if (profile->server->certificate) { @@ -1013,8 +1055,9 @@ lasso_login_build_response_msg(LassoLogin *login, gchar *remote_providerID) LassoSamlpStatus *status; status = lasso_session_get_status(profile->session, remote_providerID); - assertion = lasso_session_get_assertion(profile->session, - profile->remote_providerID); + assertion = LASSO_SAML_ASSERTION( + lasso_session_get_assertion(profile->session, + profile->remote_providerID)); if (status) { lasso_node_destroy(LASSO_NODE(LASSO_SAMLP_RESPONSE( profile->response)->Status)); @@ -1034,9 +1077,11 @@ lasso_login_build_response_msg(LassoLogin *login, gchar *remote_providerID) lasso_profile_set_response_status(profile, LASSO_SAML_STATUS_CODE_REQUEST_DENIED); } - profile->response->private_key_file = profile->server->private_key; - profile->response->certificate_file = profile->server->certificate; - profile->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->response)); + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->response); return ret; } @@ -1071,13 +1116,10 @@ lasso_login_init_authn_request(LassoLogin *login, const gchar *remote_providerID { LassoProfile *profile; LassoProvider *remote_provider; + LassoSamlpRequestAbstract *request; g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - if (http_method != LASSO_HTTP_METHOD_REDIRECT && http_method != LASSO_HTTP_METHOD_POST) { - return critical_error(LASSO_PROFILE_ERROR_INVALID_HTTP_METHOD); - } - profile = LASSO_PROFILE(login); /* clean state */ @@ -1090,6 +1132,9 @@ lasso_login_init_authn_request(LassoLogin *login, const gchar *remote_providerID profile->remote_providerID = g_strdup(remote_providerID); } else { profile->remote_providerID = lasso_server_get_first_providerID(profile->server); + if (profile->remote_providerID == NULL) { + return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND); + } } remote_provider = g_hash_table_lookup(profile->server->providers, @@ -1097,31 +1142,41 @@ lasso_login_init_authn_request(LassoLogin *login, const gchar *remote_providerID if (LASSO_IS_PROVIDER(remote_provider) == FALSE) return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND); + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_init_authn_request(login, remote_provider, http_method); + } + + if (http_method != LASSO_HTTP_METHOD_REDIRECT && http_method != LASSO_HTTP_METHOD_POST) { + return critical_error(LASSO_PROFILE_ERROR_INVALID_HTTP_METHOD); + } + login->http_method = http_method; - profile->request = LASSO_SAMLP_REQUEST_ABSTRACT(lasso_lib_authn_request_new()); + profile->request = LASSO_NODE(lasso_lib_authn_request_new()); if (profile->request == NULL) { return critical_error(LASSO_PROFILE_ERROR_BUILDING_REQUEST_FAILED); } - profile->request->RequestID = lasso_build_unique_id(32); - profile->request->MajorVersion = LASSO_LIB_MAJOR_VERSION_N; - profile->request->MinorVersion = LASSO_LIB_MINOR_VERSION_N; - if (lasso_provider_compatibility_level(remote_provider) < LIBERTY_1_2) { - profile->request->MajorVersion = 1; - profile->request->MinorVersion = 0; + request = LASSO_SAMLP_REQUEST_ABSTRACT(profile->request); + request->RequestID = lasso_build_unique_id(32); + request->MajorVersion = LASSO_LIB_MAJOR_VERSION_N; + request->MinorVersion = LASSO_LIB_MINOR_VERSION_N; + if (lasso_provider_get_protocol_conformance(remote_provider) < LASSO_PROTOCOL_LIBERTY_1_2) { + request->MajorVersion = 1; + request->MinorVersion = 0; } - profile->request->IssueInstant = lasso_get_current_time(); + request->IssueInstant = lasso_get_current_time(); LASSO_LIB_AUTHN_REQUEST(profile->request)->ProviderID = g_strdup( LASSO_PROVIDER(profile->server)->ProviderID); LASSO_LIB_AUTHN_REQUEST(profile->request)->RelayState = g_strdup(profile->msg_relayState); if (http_method == LASSO_HTTP_METHOD_POST) { - profile->request->sign_method = LASSO_SIGNATURE_METHOD_RSA_SHA1; + request->sign_method = LASSO_SIGNATURE_METHOD_RSA_SHA1; if (profile->server->certificate) { - profile->request->sign_type = LASSO_SIGNATURE_TYPE_WITHX509; + request->sign_type = LASSO_SIGNATURE_TYPE_WITHX509; } else { - profile->request->sign_type = LASSO_SIGNATURE_TYPE_SIMPLE; + request->sign_type = LASSO_SIGNATURE_TYPE_SIMPLE; } } @@ -1152,10 +1207,17 @@ lasso_login_init_request(LassoLogin *login, gchar *response_msg, char provider_succinct_id[21]; char artifact[43]; LassoSamlpRequestAbstract *request; + LassoProfile *profile; g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(response_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); - + + profile = LASSO_PROFILE(login); + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_init_request(login, response_msg, + response_http_method); + } if (response_http_method != LASSO_HTTP_METHOD_REDIRECT && response_http_method != LASSO_HTTP_METHOD_POST) { return critical_error(LASSO_PROFILE_ERROR_INVALID_HTTP_METHOD); @@ -1194,10 +1256,10 @@ lasso_login_init_request(LassoLogin *login, gchar *response_msg, provider_succinct_id_b64 = (char*)xmlSecBase64Encode((xmlChar*)provider_succinct_id, 20, 0); - LASSO_PROFILE(login)->remote_providerID = lasso_server_get_providerID_from_hash( - LASSO_PROFILE(login)->server, provider_succinct_id_b64); + profile->remote_providerID = lasso_server_get_providerID_from_hash( + profile->server, provider_succinct_id_b64); xmlFree(provider_succinct_id_b64); - if (LASSO_PROFILE(login)->remote_providerID == NULL) { + if (profile->remote_providerID == NULL) { return critical_error(LASSO_PROFILE_ERROR_MISSING_REMOTE_PROVIDERID); } @@ -1208,14 +1270,14 @@ lasso_login_init_request(LassoLogin *login, gchar *response_msg, request->IssueInstant = lasso_get_current_time(); LASSO_SAMLP_REQUEST(request)->AssertionArtifact = artifact_b64; - if (LASSO_PROFILE(login)->server->certificate) { + if (profile->server->certificate) { request->sign_type = LASSO_SIGNATURE_TYPE_WITHX509; } else { request->sign_type = LASSO_SIGNATURE_TYPE_SIMPLE; } request->sign_method = LASSO_SIGNATURE_METHOD_RSA_SHA1; - LASSO_PROFILE(login)->request = LASSO_SAMLP_REQUEST_ABSTRACT(request); + profile->request = LASSO_NODE(request); return ret; } @@ -1246,8 +1308,8 @@ lasso_login_init_idp_initiated_authn_request(LassoLogin *login, profile = LASSO_PROFILE(login); /* no RequestID attribute or it would be used in response assertion */ - g_free(profile->request->RequestID); - profile->request->RequestID = NULL; + g_free(LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->RequestID); + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->RequestID = NULL; LASSO_LIB_AUTHN_REQUEST(profile->request)->NameIDPolicy = LASSO_LIB_NAMEID_POLICY_TYPE_ANY; return 0; @@ -1264,6 +1326,13 @@ lasso_login_init_idp_initiated_authn_request(LassoLogin *login, gboolean lasso_login_must_ask_for_consent(LassoLogin *login) { + LassoProfile *profile = LASSO_PROFILE(login); + + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_must_ask_for_consent(login); + } + if (lasso_login_must_ask_for_consent_private(login)) { if (LASSO_LIB_AUTHN_REQUEST(LASSO_PROFILE(login)->request)->IsPassive) return FALSE; @@ -1285,9 +1354,16 @@ gboolean lasso_login_must_authenticate(LassoLogin *login) { LassoLibAuthnRequest *request; + LassoProfile *profile; g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + profile = LASSO_PROFILE(login); + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_must_authenticate(login); + } + request = LASSO_LIB_AUTHN_REQUEST(LASSO_PROFILE(login)->request); if (request == NULL) { return critical_error(LASSO_PROFILE_ERROR_MISSING_REQUEST); @@ -1334,6 +1410,11 @@ lasso_login_process_authn_request_msg(LassoLogin *login, const char *authn_reque profile = LASSO_PROFILE(login); + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_process_authn_request_msg(login, authn_request_msg); + } + if (authn_request_msg == NULL) { format = 0; if (profile->request == NULL) { @@ -1357,7 +1438,7 @@ lasso_login_process_authn_request_msg(LassoLogin *login, const char *authn_reque return critical_error(LASSO_PROFILE_ERROR_INVALID_MSG); } - profile->request = LASSO_SAMLP_REQUEST_ABSTRACT(request); + profile->request = LASSO_NODE(request); /* get remote ProviderID */ profile->remote_providerID = g_strdup( @@ -1423,10 +1504,11 @@ lasso_login_process_authn_request_msg(LassoLogin *login, const char *authn_reque profile->response = lasso_lib_authn_response_new( LASSO_PROVIDER(profile->server)->ProviderID, LASSO_LIB_AUTHN_REQUEST(profile->request)); - if (profile->request->MajorVersion == 1 && profile->request->MinorVersion < 2) { + if (LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MajorVersion == 1 && + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MinorVersion < 2) { /* pre-id-ff 1.2, move accordingly */ - profile->response->MajorVersion = 1; - profile->response->MinorVersion = 0; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->MajorVersion = 1; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->MinorVersion = 0; } @@ -1508,8 +1590,13 @@ lasso_login_process_request_msg(LassoLogin *login, gchar *request_msg) g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(request_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_process_request_msg(login, request_msg); + } + /* rebuild samlp:Request with request_msg */ - profile->request = LASSO_SAMLP_REQUEST_ABSTRACT(lasso_node_new_from_soap(request_msg)); + profile->request = lasso_node_new_from_soap(request_msg); if (profile->request == NULL) { return critical_error(LASSO_PROFILE_ERROR_INVALID_MSG); } @@ -1538,15 +1625,23 @@ lasso_login_process_request_msg(LassoLogin *login, gchar *request_msg) gint lasso_login_process_response_msg(LassoLogin *login, gchar *response_msg) { + LassoProfile *profile; + g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(response_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); + profile = LASSO_PROFILE(login); + + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_process_response_msg(login, response_msg); + } + /* rebuild samlp:Response with response_msg */ - LASSO_PROFILE(login)->response = LASSO_SAMLP_RESPONSE_ABSTRACT( - lasso_node_new_from_soap(response_msg)); - if (! LASSO_IS_SAMLP_RESPONSE(LASSO_PROFILE(login)->response) ) { - lasso_node_destroy(LASSO_NODE(LASSO_PROFILE(login)->response)); - LASSO_PROFILE(login)->response = NULL; + profile->response = lasso_node_new_from_soap(response_msg); + if (! LASSO_IS_SAMLP_RESPONSE(profile->response) ) { + lasso_node_destroy(profile->response); + profile->response = NULL; return critical_error(LASSO_PROFILE_ERROR_INVALID_MSG); } @@ -1821,6 +1916,12 @@ lasso_login_validate_request_msg(LassoLogin *login, gboolean authentication_resu profile = LASSO_PROFILE(login); + if (lasso_provider_get_protocol_conformance(LASSO_PROVIDER(profile->server)) == \ + LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_login_validate_request_msg(login, + authentication_result, is_consent_obtained); + } + /* modify AuthnResponse StatusCode if user authentication is not OK */ if (authentication_result == FALSE) { lasso_profile_set_response_status(profile, diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c index 2a10a376..f2454220 100644 --- a/lasso/id-ff/logout.c +++ b/lasso/id-ff/logout.c @@ -91,9 +91,11 @@ lasso_logout_build_request_msg(LassoLogout *logout) /* build the logout request message */ profile->msg_url = lasso_provider_get_metadata_one( remote_provider, "SoapEndpoint"); - profile->request->private_key_file = profile->server->private_key; - profile->request->certificate_file = profile->server->certificate; - profile->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->request)); + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->request); return 0; } @@ -190,9 +192,11 @@ lasso_logout_build_response_msg(LassoLogout *logout) /* build logout response message */ if (profile->http_request_method == LASSO_HTTP_METHOD_SOAP) { profile->msg_url = NULL; - profile->response->private_key_file = profile->server->private_key; - profile->response->certificate_file = profile->server->certificate; - profile->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->response)); + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->response); return 0; } @@ -289,6 +293,7 @@ lasso_logout_init_request(LassoLogout *logout, char *remote_providerID, LassoProfile *profile; LassoProvider *remote_provider; LassoSamlNameIdentifier *nameIdentifier; + LassoNode *assertion_n; LassoSamlAssertion *assertion; LassoFederation *federation = NULL; gboolean is_http_redirect_get_method = FALSE; @@ -317,11 +322,13 @@ lasso_logout_init_request(LassoLogout *logout, char *remote_providerID, } /* get assertion */ - assertion = lasso_session_get_assertion(session, profile->remote_providerID); - if (LASSO_IS_SAML_ASSERTION(assertion) == FALSE) { + assertion_n = lasso_session_get_assertion(session, profile->remote_providerID); + if (LASSO_IS_SAML_ASSERTION(assertion_n) == FALSE) { message(G_LOG_LEVEL_CRITICAL, "Assertion not found"); return LASSO_ERROR_UNDEFINED; } + + assertion = LASSO_SAML_ASSERTION(assertion_n); if (assertion->AuthenticationStatement && LASSO_IS_LIB_AUTHENTICATION_STATEMENT( assertion->AuthenticationStatement)) { @@ -425,9 +432,9 @@ lasso_logout_init_request(LassoLogout *logout, char *remote_providerID, 0); } - if (lasso_provider_compatibility_level(remote_provider) < LIBERTY_1_2) { - profile->request->MajorVersion = 1; - profile->request->MinorVersion = 1; + if (lasso_provider_get_protocol_conformance(remote_provider) < LASSO_PROTOCOL_LIBERTY_1_2) { + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MajorVersion = 1; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MinorVersion = 1; } if (session_index) @@ -671,9 +678,8 @@ lasso_logout_process_response_msg(LassoLogout *logout, gchar *response_msg) lasso_node_destroy(LASSO_NODE(profile->response)); profile->remote_providerID = logout->initial_remote_providerID; - profile->request = LASSO_SAMLP_REQUEST_ABSTRACT(logout->initial_request); - profile->response = LASSO_SAMLP_RESPONSE_ABSTRACT( - logout->initial_response); + profile->request = logout->initial_request; + profile->response = logout->initial_response; logout->initial_remote_providerID = NULL; logout->initial_request = NULL; @@ -736,6 +742,7 @@ lasso_logout_validate_request(LassoLogout *logout) LassoProvider *remote_provider; LassoSamlNameIdentifier *nameIdentifier; LassoSamlAssertion *assertion; + LassoNode *assertion_n; g_return_val_if_fail(LASSO_IS_LOGOUT(logout), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); @@ -799,13 +806,15 @@ lasso_logout_validate_request(LassoLogout *logout) } /* verify authentication */ - assertion = lasso_session_get_assertion(profile->session, profile->remote_providerID); - if (assertion == NULL) { + assertion_n = lasso_session_get_assertion(profile->session, profile->remote_providerID); + if (assertion_n == NULL) { message(G_LOG_LEVEL_WARNING, "%s has no assertion", profile->remote_providerID); lasso_profile_set_response_status(profile, LASSO_SAML_STATUS_CODE_REQUEST_DENIED); return LASSO_ERROR_UNDEFINED; } + assertion = LASSO_SAML_ASSERTION(assertion_n); + /* If name identifier is federated, then verify federation */ if (strcmp(nameIdentifier->Format, LASSO_LIB_NAME_IDENTIFIER_FORMAT_FEDERATED) == 0) { if (LASSO_IS_IDENTITY(profile->identity) == FALSE) { @@ -893,13 +902,15 @@ static void check_soap_support(gchar *key, LassoProvider *provider, LassoProfile { GList *supported_profiles; LassoSamlAssertion *assertion; + LassoNode *assertion_n; if (strcmp(provider->ProviderID, profile->remote_providerID) == 0) return; /* original service provider (initiated logout) */ - assertion = lasso_session_get_assertion(profile->session, provider->ProviderID); - if (assertion == NULL) + assertion_n = lasso_session_get_assertion(profile->session, provider->ProviderID); + if (assertion_n == NULL) return; /* not authenticated with this provider */ + assertion = LASSO_SAML_ASSERTION(assertion_n); supported_profiles = lasso_provider_get_metadata_list(provider, "SingleLogoutProtocolProfile"); diff --git a/lasso/id-ff/name_identifier_mapping.c b/lasso/id-ff/name_identifier_mapping.c index f718cc26..1ac1d734 100644 --- a/lasso/id-ff/name_identifier_mapping.c +++ b/lasso/id-ff/name_identifier_mapping.c @@ -78,9 +78,11 @@ lasso_name_identifier_mapping_build_request_msg(LassoNameIdentifierMapping *mapp return critical_error(LASSO_PROFILE_ERROR_UNKNOWN_PROFILE_URL); } - profile->request->private_key_file = profile->server->private_key; - profile->request->certificate_file = profile->server->certificate; - profile->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->request)); + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->request); if (profile->msg_body == NULL) { return critical_error(LASSO_PROFILE_ERROR_BUILDING_MESSAGE_FAILED); } @@ -141,9 +143,11 @@ lasso_name_identifier_mapping_build_response_msg(LassoNameIdentifierMapping *map } profile->msg_url = NULL; - profile->response->private_key_file = profile->server->private_key; - profile->response->certificate_file = profile->server->certificate; - profile->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->response)); + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->response); return 0; } @@ -215,9 +219,9 @@ lasso_name_identifier_mapping_init_request(LassoNameIdentifierMapping *mapping, } /* name identifier */ - nameIdentifier = federation->local_nameIdentifier; + nameIdentifier = LASSO_SAML_NAME_IDENTIFIER(federation->local_nameIdentifier); if (nameIdentifier == NULL) - nameIdentifier = federation->remote_nameIdentifier; + nameIdentifier = LASSO_SAML_NAME_IDENTIFIER(federation->remote_nameIdentifier); if (nameIdentifier == NULL) { return critical_error(LASSO_PROFILE_ERROR_NAME_IDENTIFIER_NOT_FOUND); } @@ -242,9 +246,9 @@ lasso_name_identifier_mapping_init_request(LassoNameIdentifierMapping *mapping, return critical_error(LASSO_PROFILE_ERROR_BUILDING_REQUEST_FAILED); } - if (lasso_provider_compatibility_level(remote_provider) < LIBERTY_1_2) { - profile->request->MajorVersion = 1; - profile->request->MinorVersion = 1; + if (lasso_provider_get_protocol_conformance(remote_provider) < LASSO_PROTOCOL_LIBERTY_1_2) { + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MajorVersion = 1; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MinorVersion = 1; } profile->http_request_method = LASSO_HTTP_METHOD_SOAP; @@ -452,9 +456,9 @@ lasso_name_identifier_mapping_validate_request(LassoNameIdentifierMapping *mappi LASSO_LIB_STATUS_CODE_UNKNOWN_PRINCIPAL); return critical_error(LASSO_PROFILE_ERROR_FEDERATION_NOT_FOUND); } - nameIdentifier = federation->remote_nameIdentifier; + nameIdentifier = LASSO_SAML_NAME_IDENTIFIER(federation->remote_nameIdentifier); if (nameIdentifier == NULL) - nameIdentifier = federation->local_nameIdentifier; + nameIdentifier = LASSO_SAML_NAME_IDENTIFIER(federation->local_nameIdentifier); if (nameIdentifier == NULL) { lasso_profile_set_response_status(profile, @@ -476,9 +480,9 @@ lasso_name_identifier_mapping_validate_request(LassoNameIdentifierMapping *mappi return LASSO_ERROR_UNDEFINED; } - targetNameIdentifier = federation->remote_nameIdentifier; + targetNameIdentifier = LASSO_SAML_NAME_IDENTIFIER(federation->remote_nameIdentifier); if (targetNameIdentifier == NULL) { - targetNameIdentifier = federation->local_nameIdentifier; + targetNameIdentifier = LASSO_SAML_NAME_IDENTIFIER(federation->local_nameIdentifier); } if (targetNameIdentifier == NULL) { diff --git a/lasso/id-ff/name_registration.c b/lasso/id-ff/name_registration.c index 43b34c49..33a20d09 100644 --- a/lasso/id-ff/name_registration.c +++ b/lasso/id-ff/name_registration.c @@ -74,9 +74,11 @@ lasso_name_registration_build_request_msg(LassoNameRegistration *name_registrati if (profile->http_request_method == LASSO_HTTP_METHOD_SOAP) { profile->msg_url = lasso_provider_get_metadata_one( remote_provider, "SoapEndpoint"); - profile->request->private_key_file = profile->server->private_key; - profile->request->certificate_file = profile->server->certificate; - profile->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->request)); + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->request); return 0; } @@ -152,9 +154,11 @@ lasso_name_registration_build_response_msg(LassoNameRegistration *name_registrat if (profile->http_request_method == LASSO_HTTP_METHOD_SOAP) { profile->msg_url = NULL; - profile->response->private_key_file = profile->server->private_key; - profile->response->certificate_file = profile->server->certificate; - profile->msg_body = lasso_node_export_to_soap(LASSO_NODE(profile->response)); + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->private_key_file = + profile->server->private_key; + LASSO_SAMLP_RESPONSE_ABSTRACT(profile->response)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->response); return 0; } @@ -322,9 +326,9 @@ lasso_name_registration_init_request(LassoNameRegistration *name_registration, LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(profile->request)->RelayState = g_strdup(profile->msg_relayState); - if (lasso_provider_compatibility_level(remote_provider) < LIBERTY_1_2) { - profile->request->MajorVersion = 1; - profile->request->MinorVersion = 1; + if (lasso_provider_get_protocol_conformance(remote_provider) < LASSO_PROTOCOL_LIBERTY_1_2) { + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MajorVersion = 1; + LASSO_SAMLP_REQUEST_ABSTRACT(profile->request)->MinorVersion = 1; } profile->http_request_method = http_method; diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c index 880fefe6..864a68c0 100644 --- a/lasso/id-ff/profile.c +++ b/lasso/id-ff/profile.c @@ -33,16 +33,10 @@ #include <lasso/id-ff/profile.h> #include <lasso/id-ff/profileprivate.h> -struct _LassoProfilePrivate -{ - gboolean dispose_has_run; -}; - /*****************************************************************************/ /* public functions */ /*****************************************************************************/ - /** * lasso_profile_get_nameIdentifier: * @profile: a #LassoProifle @@ -77,9 +71,9 @@ lasso_profile_get_nameIdentifier(LassoProfile *profile) return NULL; if (federation->remote_nameIdentifier) - return federation->remote_nameIdentifier; + return LASSO_SAML_NAME_IDENTIFIER(federation->remote_nameIdentifier); - return federation->local_nameIdentifier; + return LASSO_SAML_NAME_IDENTIFIER(federation->local_nameIdentifier); } /** @@ -350,6 +344,27 @@ lasso_profile_set_session_from_dump(LassoProfile *profile, const gchar *dump) return 0; } +char* +lasso_profile_get_artifact(LassoProfile *profile) +{ + return g_strdup(profile->private_data->artifact); +} + +char* +lasso_profile_get_artifact_message(LassoProfile *profile) +{ + return g_strdup(profile->private_data->artifact_message); +} + +void +lasso_profile_set_artifact_message(LassoProfile *profile, char *message) +{ + if (profile->private_data->artifact_message) { + g_free(profile->private_data->artifact_message); + } + profile->private_data->artifact_message = g_strdup(message); +} + /*****************************************************************************/ /* private methods */ @@ -389,6 +404,10 @@ dispose(GObject *object) profile->identity = NULL; lasso_session_destroy(profile->session); profile->session = NULL; + g_free(profile->private_data->artifact); + profile->private_data->artifact = NULL; + g_free(profile->private_data->artifact_message); + profile->private_data->artifact_message = NULL; G_OBJECT_CLASS(parent_class)->dispose(G_OBJECT(profile)); } @@ -410,6 +429,8 @@ instance_init(LassoProfile *profile) { profile->private_data = g_new(LassoProfilePrivate, 1); profile->private_data->dispose_has_run = FALSE; + profile->private_data->artifact = NULL; + profile->private_data->artifact_message = NULL; profile->server = NULL; profile->request = NULL; diff --git a/lasso/id-ff/profile.h b/lasso/id-ff/profile.h index 1fe585ba..de281b5b 100644 --- a/lasso/id-ff/profile.h +++ b/lasso/id-ff/profile.h @@ -89,10 +89,10 @@ struct _LassoProfile { /*< public >*/ LassoServer *server; - LassoSamlpRequestAbstract *request; - LassoSamlpResponseAbstract *response; + LassoNode *request; + LassoNode *response; - LassoSamlNameIdentifier *nameIdentifier; + LassoNode *nameIdentifier; gchar *remote_providerID; @@ -133,6 +133,10 @@ LASSO_EXPORT gint lasso_profile_set_identity_from_dump(LassoProfile *profile, co LASSO_EXPORT gint lasso_profile_set_session_from_dump(LassoProfile *profile, const gchar *dump); LASSO_EXPORT LassoSamlNameIdentifier* lasso_profile_get_nameIdentifier(LassoProfile *profile); +LASSO_EXPORT char* lasso_profile_get_artifact(LassoProfile *profile); +LASSO_EXPORT char* lasso_profile_get_artifact_message(LassoProfile *profile); +LASSO_EXPORT void lasso_profile_set_artifact_message(LassoProfile *profile, char *message); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/lasso/id-ff/profileprivate.h b/lasso/id-ff/profileprivate.h index 7f42c0ff..ca747527 100644 --- a/lasso/id-ff/profileprivate.h +++ b/lasso/id-ff/profileprivate.h @@ -32,6 +32,13 @@ extern "C" { #include <lasso/id-ff/profile.h> +struct _LassoProfilePrivate +{ + char *artifact; + char *artifact_message; + gboolean dispose_has_run; +}; + void lasso_profile_set_response_status(LassoProfile *profile, const gchar *statusCodeValue); #ifdef __cplusplus diff --git a/lasso/id-ff/provider.c b/lasso/id-ff/provider.c index d598925a..9160460f 100644 --- a/lasso/id-ff/provider.c +++ b/lasso/id-ff/provider.c @@ -29,21 +29,12 @@ #include <xmlsec/errors.h> #include <xmlsec/xmldsig.h> #include <xmlsec/xmltree.h> +#include <xmlsec/templates.h> #include <lasso/id-ff/provider.h> #include <lasso/id-ff/providerprivate.h> -struct _LassoProviderPrivate -{ - gboolean dispose_has_run; - LibertyConformanceLevel conformance; - GHashTable *SPDescriptor; - char *default_assertion_consumer; - GHashTable *IDPDescriptor; - xmlNode *organization; - xmlSecKey *public_key; - xmlNode *signing_key_descriptor; -}; +#include <lasso/saml-2.0/providerprivate.h> static char *protocol_uris[] = { "http://projectliberty.org/profiles/fedterm", @@ -166,7 +157,8 @@ lasso_provider_get_metadata_list(LassoProvider *provider, const char *name) * * Return value: the #LassoHttpMethod **/ -LassoHttpMethod lasso_provider_get_first_http_method(LassoProvider *provider, +LassoHttpMethod +lasso_provider_get_first_http_method(LassoProvider *provider, LassoProvider *remote_provider, LassoMdProtocolType protocol_type) { char *protocol_profile_prefix; @@ -175,6 +167,11 @@ LassoHttpMethod lasso_provider_get_first_http_method(LassoProvider *provider, GList *t1, *t2 = NULL; gboolean found; + if (provider->private_data->conformance == LASSO_PROTOCOL_SAML_2_0) { + return lasso_saml20_provider_get_first_http_method( + provider, remote_provider, protocol_type); + } + if (remote_provider->role == LASSO_PROVIDER_ROLE_SP) provider->role = LASSO_PROVIDER_ROLE_IDP; if (remote_provider->role == LASSO_PROVIDER_ROLE_IDP) @@ -581,8 +578,8 @@ lasso_provider_get_type() return this_type; } -LibertyConformanceLevel -lasso_provider_compatibility_level(LassoProvider *provider) +LassoProtocolConformance +lasso_provider_get_protocol_conformance(LassoProvider *provider) { return provider->private_data->conformance; } @@ -601,9 +598,19 @@ lasso_provider_load_metadata(LassoProvider *provider, const gchar *metadata) doc = xmlParseFile(metadata); if (doc == NULL) return FALSE; + + node = xmlDocGetRootElement(doc); + if (node == NULL || node->ns == NULL) + return FALSE; provider->metadata_filename = g_strdup(metadata); - provider->private_data->conformance = LIBERTY_1_2; + + if (strcmp((char*)node->ns->href, LASSO_SAML20_METADATA_HREF) == 0) { + provider->private_data->conformance = LASSO_PROTOCOL_SAML_2_0; + return lasso_saml20_provider_load_metadata(provider, node); + } + + provider->private_data->conformance = LASSO_PROTOCOL_LIBERTY_1_2; xpathCtx = xmlXPathNewContext(doc); xmlXPathRegisterNs(xpathCtx, (xmlChar*)"md", (xmlChar*)LASSO_METADATA_HREF); @@ -621,7 +628,7 @@ lasso_provider_load_metadata(LassoProvider *provider, const gchar *metadata) xmlXPathFreeContext(xpathCtx); return FALSE; } - provider->private_data->conformance = LIBERTY_1_1; + provider->private_data->conformance = LASSO_PROTOCOL_LIBERTY_1_1; xpath_idp = "/md11:IDPDescriptor"; xpath_sp = "/md11:SPDescriptor"; } @@ -632,7 +639,7 @@ lasso_provider_load_metadata(LassoProvider *provider, const gchar *metadata) if (xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr == 1) { load_descriptor(xpathObj->nodesetval->nodeTab[0], provider->private_data->IDPDescriptor, provider); - if (provider->private_data->conformance < LIBERTY_1_2) { + if (provider->private_data->conformance < LASSO_PROTOCOL_LIBERTY_1_2) { /* lookup ProviderID */ node = xpathObj->nodesetval->nodeTab[0]->children; while (node) { @@ -650,7 +657,7 @@ lasso_provider_load_metadata(LassoProvider *provider, const gchar *metadata) if (xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr == 1) { load_descriptor(xpathObj->nodesetval->nodeTab[0], provider->private_data->SPDescriptor, provider); - if (provider->private_data->conformance < LIBERTY_1_2) { + if (provider->private_data->conformance < LASSO_PROTOCOL_LIBERTY_1_2) { /* lookup ProviderID */ node = xpathObj->nodesetval->nodeTab[0]->children; while (node) { @@ -711,6 +718,46 @@ lasso_provider_new(LassoProviderRole role, const char *metadata, lasso_node_destroy(LASSO_NODE(provider)); return NULL; } +/* + xmlSecKeyDataIdListDebugDump(xmlSecKeyDataIdsGet(), stdout); + */ + fprintf(stderr, "key: %p\n", LASSO_PROVIDER(provider)->private_data->public_key); + fprintf(stderr, "key: %p\n", LASSO_PROVIDER(provider)->private_data->public_key->value); + xmlSecKeyDataDebugXmlDump( + LASSO_PROVIDER(provider)->private_data->public_key->value, + stdout); + + /* + xmlSecKeyDataDebugXmlDump( + xmlSecKeyGetData(LASSO_PROVIDER(provider)->private_data->public_key, + xmlSecKeyDataValueGetKlass()), + stdout); + */ + { + xmlNode *node, *ki_node; + xmlSecKeyInfoCtxPtr ctx; + xmlOutputBufferPtr buf; + xmlCharEncodingHandlerPtr handler = NULL; + xmlChar *buffer; + + ctx = xmlSecKeyInfoCtxCreate(NULL); + ctx->mode = xmlSecKeyInfoModeWrite; + xmlSecKeyDebugDump(provider->private_data->public_key, stdout); + xmlSecKeyInfoCtxDebugDump(ctx, stdout); + node = xmlNewNode(NULL, "Toto"); + ki_node = xmlSecAddChild(node, xmlSecNodeKeyInfo, xmlSecDSigNs); + xmlSecTmplKeyInfoAddKeyName(ki_node, NULL); + xmlSecTmplKeyInfoAddKeyValue(ki_node); + xmlSecKeyInfoNodeWrite(ki_node, provider->private_data->public_key, ctx); + + handler = xmlFindCharEncodingHandler("utf-8"); + buf = xmlAllocOutputBuffer(handler); + xmlNodeDumpOutput(buf, NULL, node, 0, 0, "utf-8"); + xmlOutputBufferFlush(buf); + buffer = buf->conv ? buf->conv->content : buf->buffer->content; + fprintf(stderr, "buffer: \n%s\n", buffer); + + } return provider; } @@ -741,12 +788,21 @@ lasso_provider_load_public_key(LassoProvider *provider) xmlSecByte *value; int length; int rc; + xmlSecKey *xmlseckey; + xmlSecKeyInfoCtxPtr ctx; + + xmlseckey = xmlSecKeyCreate(); + + ctx = xmlSecKeyInfoCtxCreate(NULL); + ctx->mode = xmlSecKeyInfoModeRead; /* could use XPath but going down manually will do */ while (t) { if (t->type == XML_ELEMENT_NODE) { if (strcmp((char*)t->name, "KeyInfo") == 0 || strcmp((char*)t->name, "X509Data") == 0) { + xmlSecKeyInfoNodeRead(t, xmlseckey, ctx); + break; t = t->children; continue; } @@ -767,12 +823,12 @@ lasso_provider_load_public_key(LassoProvider *provider) xmlFree(b64_value); g_free(value); } - xmlSecErrorsDefaultCallbackEnableOutput(FALSE); + //xmlSecErrorsDefaultCallbackEnableOutput(FALSE); for (i=0; key_formats[i] && pub_key == NULL; i++) { pub_key = xmlSecCryptoAppKeyLoadMemory(value, rc, key_formats[i], NULL, NULL, NULL); } - xmlSecErrorsDefaultCallbackEnableOutput(TRUE); + //xmlSecErrorsDefaultCallbackEnableOutput(TRUE); xmlFree(b64_value); g_free(value); provider->private_data->public_key = pub_key; diff --git a/lasso/id-ff/provider.h b/lasso/id-ff/provider.h index 6ac80405..9cad9124 100644 --- a/lasso/id-ff/provider.h +++ b/lasso/id-ff/provider.h @@ -55,6 +55,8 @@ typedef struct _LassoProviderPrivate LassoProviderPrivate; * @LASSO_HTTP_METHOD_POST: Browser POST * @LASSO_HTTP_METHOD_REDIRECT: HTTP-Redirect based * @LASSO_HTTP_METHOD_SOAP: SOAP/HTTP based + * @LASSO_HTTP_METHOD_ARTIFACT_GET: Artifact by HTTP GET (SAML 2.0) + * @LASSO_HTTP_METHOD_ARTIFACT_POST: Artifact by HTTP POST (SAML 2.0) * * Method. **/ @@ -65,7 +67,9 @@ typedef enum { LASSO_HTTP_METHOD_GET, LASSO_HTTP_METHOD_POST, LASSO_HTTP_METHOD_REDIRECT, - LASSO_HTTP_METHOD_SOAP + LASSO_HTTP_METHOD_SOAP, + LASSO_HTTP_METHOD_ARTIFACT_GET, + LASSO_HTTP_METHOD_ARTIFACT_POST } LassoHttpMethod; @@ -76,6 +80,9 @@ typedef enum { * @LASSO_MD_PROTOCOL_TYPE_REGISTER_NAME_IDENTIFIER: Name Registration * @LASSO_MD_PROTOCOL_TYPE_SINGLE_LOGOUT: Single Logout * @LASSO_MD_PROTOCOL_TYPE_SINGLE_SIGN_ON: Single Sign-On and Federation + * @LASSO_MD_PROTOCOL_TYPE_ARTIFACT_RESOLUTION: Artifact Resolution (SAML 2.0) + * @LASSO_MD_PROTOCOL_TYPE_MANAGE_NAME_ID: Manage Name Identifier (SAML 2.0) + * @LASSO_MD_PROTOCOL_TYPE_ASSERTION_ID_REQUEST: Assertion ID Request (SAML 2.0) * * Liberty Metadata Type. **/ @@ -84,7 +91,10 @@ typedef enum { LASSO_MD_PROTOCOL_TYPE_NAME_IDENTIFIER_MAPPING, LASSO_MD_PROTOCOL_TYPE_REGISTER_NAME_IDENTIFIER, LASSO_MD_PROTOCOL_TYPE_SINGLE_LOGOUT, - LASSO_MD_PROTOCOL_TYPE_SINGLE_SIGN_ON + LASSO_MD_PROTOCOL_TYPE_SINGLE_SIGN_ON, + LASSO_MD_PROTOCOL_TYPE_ARTIFACT_RESOLUTION, + LASSO_MD_PROTOCOL_TYPE_MANAGE_NAME_ID, + LASSO_MD_PROTOCOL_TYPE_ASSERTION_ID_REQUEST } LassoMdProtocolType; @@ -103,6 +113,23 @@ typedef enum { } LassoProviderRole; +/** + * LassoProtocolConformance: + * LASSO_PROTOCOL_LIBERTY_1_0: Liberty ID-FF 1.0 + * LASSO_PROTOCOL_LIBERTY_1_1: Liberty ID-FF 1.1 + * LASSO_PROTOCOL_LIBERTY_1_2: Liberty ID-FF 1.2 / ID-WSF 1.0 + * LASSO_PROTOCOL_SAML_2_0: SAML 2.0 + * + * Provider protocol conformance. + **/ +typedef enum { + LASSO_PROTOCOL_LIBERTY_1_0, + LASSO_PROTOCOL_LIBERTY_1_1, + LASSO_PROTOCOL_LIBERTY_1_2, + LASSO_PROTOCOL_SAML_2_0 +} LassoProtocolConformance; + + struct _LassoProvider { LassoNode parent; @@ -146,6 +173,9 @@ LASSO_EXPORT gchar* lasso_provider_get_base64_succinct_id(LassoProvider *provide LASSO_EXPORT xmlNode* lasso_provider_get_organization(LassoProvider *provider); +LASSO_EXPORT LassoProtocolConformance lasso_provider_get_protocol_conformance( + LassoProvider *provider); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/lasso/id-ff/providerprivate.h b/lasso/id-ff/providerprivate.h index d9d30b1e..f9172834 100644 --- a/lasso/id-ff/providerprivate.h +++ b/lasso/id-ff/providerprivate.h @@ -29,16 +29,22 @@ extern "C" { #endif /* __cplusplus */ -typedef enum { - LIBERTY_1_0, - LIBERTY_1_1, - LIBERTY_1_2, -} LibertyConformanceLevel; +struct _LassoProviderPrivate +{ + gboolean dispose_has_run; + LassoProtocolConformance conformance; + GHashTable *SPDescriptor; + char *default_assertion_consumer; + GHashTable *IDPDescriptor; + xmlNode *organization; + xmlSecKey *public_key; + xmlNode *signing_key_descriptor; +}; + gboolean lasso_provider_load_metadata(LassoProvider *provider, const gchar *metadata); int lasso_provider_verify_signature(LassoProvider *provider, const char *message, const char *id_attr_name, LassoMessageFormat format); -LibertyConformanceLevel lasso_provider_compatibility_level(LassoProvider *provider); gboolean lasso_provider_load_public_key(LassoProvider *provider); xmlSecKey* lasso_provider_get_public_key(LassoProvider *provider); diff --git a/lasso/id-ff/server.c b/lasso/id-ff/server.c index 77f20d99..24c8bc03 100644 --- a/lasso/id-ff/server.c +++ b/lasso/id-ff/server.c @@ -65,6 +65,18 @@ lasso_server_add_provider(LassoServer *server, LassoProviderRole role, return critical_error(LASSO_SERVER_ERROR_ADD_PROVIDER_FAILED); } + if (LASSO_PROVIDER(server)->private_data->conformance == LASSO_PROTOCOL_SAML_2_0 && + provider->private_data->conformance != LASSO_PROTOCOL_SAML_2_0) { + lasso_node_destroy(LASSO_NODE(provider)); + return LASSO_SERVER_ERROR_ADD_PROVIDER_PROTOCOL_MISMATCH; + } + + if (LASSO_PROVIDER(server)->private_data->conformance == LASSO_PROTOCOL_LIBERTY_1_2 && + provider->private_data->conformance > LASSO_PROTOCOL_LIBERTY_1_2) { + lasso_node_destroy(LASSO_NODE(provider)); + return LASSO_SERVER_ERROR_ADD_PROVIDER_PROTOCOL_MISMATCH; + } + g_hash_table_insert(server->providers, g_strdup(provider->ProviderID), provider); return 0; diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c index 9ee0b1e8..2089956a 100644 --- a/lasso/id-ff/session.c +++ b/lasso/id-ff/session.c @@ -47,7 +47,7 @@ struct _LassoSessionPrivate * Return value: 0 on success; or a negative value otherwise. **/ gint -lasso_session_add_assertion(LassoSession *session, char *providerID, LassoSamlAssertion *assertion) +lasso_session_add_assertion(LassoSession *session, char *providerID, LassoNode *assertion) { g_return_val_if_fail(session != NULL, -1); g_return_val_if_fail(providerID != NULL, -2); @@ -96,7 +96,7 @@ lasso_session_add_status(LassoSession *session, char *providerID, LassoSamlpStat * #LassoSamlAssertion is internally allocated and must not be freed by * the caller. **/ -LassoSamlAssertion* +LassoNode* lasso_session_get_assertion(LassoSession *session, gchar *providerID) { return g_hash_table_lookup(session->assertions, providerID); diff --git a/lasso/id-ff/sessionprivate.h b/lasso/id-ff/sessionprivate.h index f42730f8..f59ced4e 100644 --- a/lasso/id-ff/sessionprivate.h +++ b/lasso/id-ff/sessionprivate.h @@ -34,11 +34,11 @@ extern "C" { #include <lasso/id-ff/session.h> gint lasso_session_add_assertion(LassoSession *session, - char *providerID, LassoSamlAssertion *assertion); + char *providerID, LassoNode *assertion); gint lasso_session_add_status(LassoSession *session, char *providerID, LassoSamlpStatus *authn_response); -LassoSamlAssertion* lasso_session_get_assertion( +LassoNode* lasso_session_get_assertion( LassoSession *session, gchar *providerID); LassoSamlpStatus* lasso_session_get_status( LassoSession *session, gchar *providerID); diff --git a/lasso/saml-2.0/Makefile.am b/lasso/saml-2.0/Makefile.am new file mode 100644 index 00000000..49e4f418 --- /dev/null +++ b/lasso/saml-2.0/Makefile.am @@ -0,0 +1,23 @@ +liblassoincludedir = $(includedir)/lasso/saml-2.0 + +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lasso \ + $(LASSO_CORE_CFLAGS) \ + -DG_LOG_DOMAIN=\"lasso\" + +noinst_LTLIBRARIES = liblasso-saml-20.la + +liblasso_saml_20_la_SOURCES = \ + federation.c \ + profile.c \ + provider.c \ + login.c + +lasso_private_h_sources = \ + federationprivate.h \ + profileprivate.h \ + providerprivate.h \ + loginprivate.h + +EXTRA_DIST = $(lasso_private_h_sources) diff --git a/lasso/saml-2.0/federation.c b/lasso/saml-2.0/federation.c new file mode 100644 index 00000000..3a95848d --- /dev/null +++ b/lasso/saml-2.0/federation.c @@ -0,0 +1,59 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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/id-ff/federation.h> +#include "federationprivate.h" + +#include <lasso/xml/saml-2.0/saml2_name_id.h> + + +static LassoNode* +lasso_saml20_federation_build_name_identifier(const gchar *nameQualifier, + const gchar *format, const gchar *content) +{ + LassoSaml2NameID *name_id; + + name_id = LASSO_SAML2_NAME_ID(lasso_saml2_name_id_new()); + if (content == NULL) { + name_id->content = lasso_build_unique_id(32); + } else { + name_id->content = g_strdup(content); + } + name_id->NameQualifier = g_strdup(nameQualifier); + name_id->Format = g_strdup(format); + + return LASSO_NODE(name_id); +} + + +void +lasso_saml20_federation_build_local_name_identifier(LassoFederation *federation, + const gchar *nameQualifier, const gchar *format, const gchar *content) +{ + federation->local_nameIdentifier = lasso_saml20_federation_build_name_identifier( + nameQualifier, format, content); +} + + diff --git a/lasso/saml-2.0/federationprivate.h b/lasso/saml-2.0/federationprivate.h new file mode 100644 index 00000000..6da8c3c6 --- /dev/null +++ b/lasso/saml-2.0/federationprivate.h @@ -0,0 +1,39 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML20_FEDERATION_PRIVATE_H__ +#define __LASSO_SAML20_FEDERATION_PRIVATE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +void lasso_saml20_federation_build_local_name_identifier(LassoFederation *federation, + const gchar *nameQualifier, const gchar *format, const gchar *content); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML20_FEDERATION_PRIVATE_H__ */ diff --git a/lasso/saml-2.0/login.c b/lasso/saml-2.0/login.c new file mode 100644 index 00000000..6315343d --- /dev/null +++ b/lasso/saml-2.0/login.c @@ -0,0 +1,642 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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/saml-2.0/providerprivate.h> +#include <lasso/saml-2.0/loginprivate.h> +#include <lasso/saml-2.0/profileprivate.h> +#include <lasso/saml-2.0/federationprivate.h> + +#include <lasso/id-ff/providerprivate.h> +#include <lasso/id-ff/login.h> +#include <lasso/id-ff/identityprivate.h> +#include <lasso/id-ff/sessionprivate.h> + +#include <lasso/xml/saml-2.0/samlp2_authn_request.h> +#include <lasso/xml/saml-2.0/samlp2_response.h> +#include <lasso/xml/saml-2.0/saml2_assertion.h> +#include <lasso/xml/saml-2.0/saml2_audience_restriction.h> + + +static int lasso_saml20_login_process_federation(LassoLogin *login, gboolean is_consent_obtained); +static gboolean lasso_saml20_login_must_ask_for_consent_private(LassoLogin *login); +static gint lasso_saml20_login_process_response_status_and_assertion(LassoLogin *login); + +gint +lasso_saml20_login_init_authn_request(LassoLogin *login, LassoProvider *remote_provider, + LassoHttpMethod http_method) +{ + LassoProfile *profile = LASSO_PROFILE(login); + LassoSamlp2RequestAbstract *request; + + if (http_method != LASSO_HTTP_METHOD_REDIRECT && + http_method != LASSO_HTTP_METHOD_POST && + http_method != LASSO_HTTP_METHOD_ARTIFACT_GET && + http_method != LASSO_HTTP_METHOD_ARTIFACT_POST) { + return critical_error(LASSO_PROFILE_ERROR_INVALID_HTTP_METHOD); + } + + login->http_method = http_method; + /* XXX: check this protocol profile is supported */ + + profile->request = lasso_samlp2_authn_request_new(); + if (profile->request == NULL) { + return critical_error(LASSO_PROFILE_ERROR_BUILDING_REQUEST_FAILED); + } + + request = LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request); + request->ID = lasso_build_unique_id(32); + request->Version = g_strdup("2.0"); + request->Issuer = LASSO_SAML2_NAME_ID(lasso_saml2_name_id_new_with_string( + LASSO_PROVIDER(profile->server)->ProviderID)); + request->IssueInstant = lasso_get_current_time(); + + LASSO_SAMLP2_AUTHN_REQUEST(request)->NameIDPolicy = LASSO_SAMLP2_NAME_ID_POLICY( + lasso_samlp2_name_id_policy_new()); + LASSO_SAMLP2_AUTHN_REQUEST(request)->NameIDPolicy->Format = + g_strdup(LASSO_SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT); + LASSO_SAMLP2_AUTHN_REQUEST(request)->NameIDPolicy->SPNameQualifier = + g_strdup(request->Issuer->content); + + + if (http_method != LASSO_HTTP_METHOD_REDIRECT) { + request->sign_method = LASSO_SIGNATURE_METHOD_RSA_SHA1; + if (profile->server->certificate) { + request->sign_type = LASSO_SIGNATURE_TYPE_WITHX509; + } else { + request->sign_type = LASSO_SIGNATURE_TYPE_SIMPLE; + } + } + + return 0; +} + + +gint +lasso_saml20_login_build_authn_request_msg(LassoLogin *login, LassoProvider *remote_provider) +{ + char *query, *url; + char *md_authnRequestsSigned; + gboolean must_sign; + LassoProfile *profile = LASSO_PROFILE(login); + + md_authnRequestsSigned = lasso_provider_get_metadata_one( + LASSO_PROVIDER(profile->server), "AuthnRequestsSigned"); + must_sign = (md_authnRequestsSigned && strcmp(md_authnRequestsSigned, "true") == 0); + g_free(md_authnRequestsSigned); + + if (login->http_method == LASSO_HTTP_METHOD_REDIRECT) { + /* REDIRECT -> query */ + if (must_sign) { + query = lasso_node_export_to_query(profile->request, + profile->server->signature_method, + profile->server->private_key); + } else { + query = lasso_node_export_to_query( + LASSO_NODE(profile->request), 0, NULL); + } + if (query == NULL) { + return critical_error(LASSO_PROFILE_ERROR_BUILDING_QUERY_FAILED); + } + + url = lasso_provider_get_metadata_one(remote_provider, + "SingleSignOnService HTTP-Redirect"); + if (url == NULL) { + return critical_error(LASSO_PROFILE_ERROR_UNKNOWN_PROFILE_URL); + } + + profile->msg_url = g_strdup_printf("%s?%s", url, query); + profile->msg_body = NULL; + g_free(query); + g_free(url); + } else { + /* POST and Artifact-GET|POST */ + if (must_sign) { + LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request)->private_key_file = + profile->server->private_key; + LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request)->certificate_file = + profile->server->certificate; + } + + if (login->http_method == LASSO_HTTP_METHOD_POST) { + char *lareq = lasso_node_export_to_base64(profile->request); + profile->msg_url = lasso_provider_get_metadata_one( + remote_provider, "SingleSignOnService HTTP-POST"); + profile->msg_body = lareq; + } else { + /* artifact method */ + char *artifact = lasso_saml20_profile_generate_artifact(profile, 0); + url = lasso_provider_get_metadata_one( + remote_provider, "SingleSignOnService HTTP-Artifact"); + if (login->http_method == LASSO_HTTP_METHOD_ARTIFACT_GET) { + profile->msg_url = g_strdup_printf("%s?SAMLArt=%s", + url, artifact); + } else { + /* TODO: ARTIFACT POST */ + } + } + } + + return 0; +} + +int +lasso_saml20_login_process_authn_request_msg(LassoLogin *login, const char *authn_request_msg) +{ + LassoNode *request; + LassoMessageFormat format; + LassoProfile *profile = LASSO_PROFILE(login); + LassoSamlp2StatusResponse *response; + + request = lasso_samlp2_authn_request_new(); + format = lasso_node_init_from_message(request, authn_request_msg); + if (format == LASSO_MESSAGE_FORMAT_UNKNOWN || + format == LASSO_MESSAGE_FORMAT_ERROR) { + return critical_error(LASSO_PROFILE_ERROR_INVALID_MSG); + } + + profile->request = request; + profile->remote_providerID = g_strdup( + LASSO_SAMLP2_REQUEST_ABSTRACT(request)->Issuer->content); + + /* XXX: checks authn request signature */ + + profile->response = lasso_samlp2_response_new(); + response = LASSO_SAMLP2_STATUS_RESPONSE(profile->response); + response->ID = lasso_build_unique_id(32); + response->Version = g_strdup("2.0"); + response->Issuer = LASSO_SAML2_NAME_ID(lasso_saml2_name_id_new_with_string( + LASSO_PROVIDER(profile->server)->ProviderID)); + response->IssueInstant = lasso_get_current_time(); + response->InResponseTo = g_strdup(LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request)->ID); + + return 0; +} + + +gboolean +lasso_saml20_login_must_authenticate(LassoLogin *login) +{ + LassoSamlp2AuthnRequest *request; + + request = LASSO_SAMLP2_AUTHN_REQUEST(LASSO_PROFILE(login)->request); + if (request == NULL) { + return critical_error(LASSO_PROFILE_ERROR_MISSING_REQUEST); + } + + /* get IsPassive and ForceAuthn in AuthnRequest if exists */ + if ((request->ForceAuthn || LASSO_PROFILE(login)->session == NULL) && + request->IsPassive == FALSE) + return TRUE; + + return FALSE; +} + +static gboolean +lasso_saml20_login_must_ask_for_consent_private(LassoLogin *login) +{ + LassoProfile *profile = LASSO_PROFILE(login); + LassoSamlp2NameIDPolicy *name_id_policy; + char *consent; + + name_id_policy = LASSO_SAMLP2_AUTHN_REQUEST(profile->request)->NameIDPolicy; + + if (name_id_policy) { + char *format = name_id_policy->Format; + if (strcmp(format, LASSO_SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT) == 0) { + return FALSE; + } + } + + consent = LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request)->Consent; + if (consent == NULL) + return TRUE; + + if (strcmp(consent, LASSO_SAML2_CONSENT_OBTAINED) == 0) + return FALSE; + + if (strcmp(consent, LASSO_SAML2_CONSENT_PRIOR) == 0) + return FALSE; + + if (strcmp(consent, LASSO_SAML2_CONSENT_IMPLICIT) == 0) + return FALSE; + + if (strcmp(consent, LASSO_SAML2_CONSENT_EXPLICIT) == 0) + return FALSE; + + if (strcmp(consent, LASSO_SAML2_CONSENT_UNAVAILABLE) == 0) + return TRUE; + + if (strcmp(consent, LASSO_SAML2_CONSENT_INAPPLICABLE) == 0) + return TRUE; + + return TRUE; +} + +gboolean +lasso_saml20_login_must_ask_for_consent(LassoLogin *login) +{ + LassoProfile *profile = LASSO_PROFILE(login); + + if (LASSO_SAMLP2_AUTHN_REQUEST(profile->request)->IsPassive) + return FALSE; + + return lasso_saml20_login_must_ask_for_consent_private(login); +} + +int +lasso_saml20_login_validate_request_msg(LassoLogin *login, gboolean authentication_result, + gboolean is_consent_obtained) +{ + LassoProfile *profile; + int ret; + + profile = LASSO_PROFILE(login); + + if (authentication_result == FALSE) { + lasso_saml20_profile_set_response_status(profile, + LASSO_SAML2_STATUS_CODE_REQUEST_DENIED); + return LASSO_LOGIN_ERROR_REQUEST_DENIED; + } + + if (profile->signature_status == LASSO_DS_ERROR_INVALID_SIGNATURE) { + lasso_saml20_profile_set_response_status(profile, + LASSO_SAML2_STATUS_CODE_REQUEST_DENIED); + return LASSO_LOGIN_ERROR_INVALID_SIGNATURE; + } + + if (profile->signature_status == LASSO_DS_ERROR_SIGNATURE_NOT_FOUND) { + lasso_saml20_profile_set_response_status(profile, + LASSO_SAML2_STATUS_CODE_REQUEST_DENIED); + return LASSO_LOGIN_ERROR_UNSIGNED_AUTHN_REQUEST; + } + + if (profile->signature_status == 0 && authentication_result == TRUE) { + ret = lasso_saml20_login_process_federation(login, is_consent_obtained); + if (ret) + return ret; + } + + lasso_saml20_profile_set_response_status(profile, LASSO_SAML2_STATUS_CODE_SUCCESS); + + return 0; +} + +static int +lasso_saml20_login_process_federation(LassoLogin *login, gboolean is_consent_obtained) +{ + LassoProfile *profile = LASSO_PROFILE(login); + LassoSamlp2NameIDPolicy *name_id_policy; + char *name_id_policy_format = NULL; + LassoFederation *federation; + + /* verify if identity already exists else create it */ + if (profile->identity == NULL) { + profile->identity = lasso_identity_new(); + } + + name_id_policy = LASSO_SAMLP2_AUTHN_REQUEST(profile->request)->NameIDPolicy; + if (name_id_policy) + name_id_policy_format = name_id_policy->Format; + else + return 0; /* XXX: ? */ + + if (name_id_policy_format && strcmp(name_id_policy_format, + LASSO_SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT) == 0) { + return 0; + } + + /* search a federation in the identity */ + federation = g_hash_table_lookup(profile->identity->federations, + profile->remote_providerID); + if (name_id_policy->AllowCreate == FALSE) { + /* a federation MUST exist */ + if (federation == NULL) { + return LASSO_LOGIN_ERROR_FEDERATION_NOT_FOUND; + } + } + + if (lasso_saml20_login_must_ask_for_consent_private(login) && !is_consent_obtained) { + return LASSO_LOGIN_ERROR_CONSENT_NOT_OBTAINED; + } + + if (federation == NULL) { + federation = lasso_federation_new(profile->remote_providerID); + lasso_saml20_federation_build_local_name_identifier(federation, + LASSO_PROVIDER(profile->server)->ProviderID, + LASSO_SAML2_NAME_IDENTIFIER_FORMAT_PERSISTENT, + NULL); + lasso_identity_add_federation(profile->identity, federation); + } + + profile->nameIdentifier = g_object_ref(federation->local_nameIdentifier); + + return 0; +} + +int +lasso_saml20_login_build_assertion(LassoLogin *login, + const char *authenticationMethod, + const char *authenticationInstant, + const char *reauthenticateOnOrAfter, + const char *notBefore, + const char *notOnOrAfter) +{ + LassoProfile *profile = LASSO_PROFILE(login); + LassoFederation *federation; + LassoSaml2Assertion *assertion; + LassoSaml2AudienceRestriction *audience_restriction; + LassoSamlp2NameIDPolicy *name_id_policy; + LassoSaml2NameID *name_id = NULL; + + federation = g_hash_table_lookup(profile->identity->federations, + profile->remote_providerID); + + assertion = LASSO_SAML2_ASSERTION(lasso_saml2_assertion_new()); + assertion->ID = lasso_build_unique_id(32); + assertion->Version = g_strdup("2.0"); + assertion->IssueInstant = lasso_get_current_time(); + assertion->Issuer = LASSO_SAML2_NAME_ID(lasso_saml2_name_id_new_with_string( + LASSO_PROVIDER(profile->server)->ProviderID)); + assertion->Conditions = LASSO_SAML2_CONDITIONS(lasso_saml2_conditions_new()); + assertion->Conditions->NotBefore = g_strdup(notBefore); + assertion->Conditions->NotOnOrAfter = g_strdup(notOnOrAfter); + audience_restriction = LASSO_SAML2_AUDIENCE_RESTRICTION( + lasso_saml2_audience_restriction_new()); + audience_restriction->Audience = g_strdup(profile->remote_providerID); + assertion->Conditions->AudienceRestriction = g_list_append(NULL, audience_restriction); + + name_id_policy = LASSO_SAMLP2_AUTHN_REQUEST(profile->request)->NameIDPolicy; + assertion->Subject = LASSO_SAML2_SUBJECT(lasso_saml2_subject_new()); + if (name_id_policy == NULL || strcmp(name_id_policy->Format, + LASSO_SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT) == 0) { + /* transient -> don't use a federation */ + name_id = LASSO_SAML2_NAME_ID(lasso_saml2_name_id_new_with_string( + lasso_build_unique_id(32))); + name_id->NameQualifier = g_strdup( + LASSO_PROVIDER(profile->server)->ProviderID); + name_id->Format = g_strdup(LASSO_SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT); + + assertion->Subject->NameID = name_id; + } else { + if (federation->remote_nameIdentifier) { + assertion->Subject->NameID = g_object_ref( + federation->remote_nameIdentifier); + } else { + assertion->Subject->NameID = g_object_ref( + federation->local_nameIdentifier); + } + } + + if (profile->server->certificate) { + assertion->sign_type = LASSO_SIGNATURE_TYPE_WITHX509; + } else { + assertion->sign_type = LASSO_SIGNATURE_TYPE_SIMPLE; + } + assertion->sign_method = profile->server->signature_method; + assertion->private_key_file = g_strdup(profile->server->private_key); + assertion->certificate_file = g_strdup(profile->server->certificate); + + /* store assertion in session object */ + if (profile->session == NULL) { + profile->session = lasso_session_new(); + } + + lasso_session_add_assertion(profile->session, + profile->remote_providerID, + g_object_ref(assertion)); + + LASSO_SAMLP2_RESPONSE(profile->response)->Assertion = g_list_append(NULL, assertion); + + return 0; +} + + +gint +lasso_saml20_login_build_artifact_msg(LassoLogin *login, LassoHttpMethod http_method) +{ + LassoProfile *profile; + LassoProvider *remote_provider; + char *artifact; + char *url; + + profile = LASSO_PROFILE(login); + + if (profile->remote_providerID == NULL) + return critical_error(LASSO_PROFILE_ERROR_MISSING_REMOTE_PROVIDERID); + + remote_provider = g_hash_table_lookup(profile->server->providers, + profile->remote_providerID); + if (LASSO_IS_PROVIDER(remote_provider) == FALSE) + return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND); + + url = lasso_saml20_provider_get_assertion_consumer_service_url(remote_provider, + LASSO_SAMLP2_AUTHN_REQUEST( + profile->request)->AssertionConsumerServiceIndex); + + artifact = lasso_saml20_profile_generate_artifact(profile, 1); + login->assertionArtifact = g_strdup(artifact); + if (http_method == LASSO_HTTP_METHOD_ARTIFACT_GET) { + profile->msg_url = g_strdup_printf("%s?SAMLArt=%s", url, artifact); + /* XXX: RelayState */ + } else { + /* XXX: ARTIFACT POST */ + } + return 0; +} + + +gint +lasso_saml20_login_init_request(LassoLogin *login, gchar *response_msg, + LassoHttpMethod response_http_method) +{ + return lasso_saml20_profile_init_artifact_resolve( + LASSO_PROFILE(login), response_msg, response_http_method); +} + + +gint +lasso_saml20_login_build_request_msg(LassoLogin *login) +{ + LassoProfile *profile; + LassoProvider *remote_provider; + + profile = LASSO_PROFILE(login); + profile->msg_body = lasso_node_export_to_soap(profile->request); + + LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request)->private_key_file = + profile->server->private_key; + LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request)->certificate_file = + profile->server->certificate; + profile->msg_body = lasso_node_export_to_soap(profile->request); + + remote_provider = g_hash_table_lookup(profile->server->providers, + profile->remote_providerID); + if (LASSO_IS_PROVIDER(remote_provider) == FALSE) { + return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND); + } + profile->msg_url = lasso_provider_get_metadata_one(remote_provider, + "ArtifactResolutionService SOAP"); + return 0; +} + +gint +lasso_saml20_login_process_request_msg(LassoLogin *login, gchar *request_msg) +{ + LassoProfile *profile = LASSO_PROFILE(login); + int rc; + + rc = lasso_saml20_profile_process_artifact_resolve(profile, request_msg); + if (rc != 0) { + return rc; + } + /* compat with liberty id-ff code */ + login->assertionArtifact = lasso_profile_get_artifact(profile); + return 0; +} + +gint +lasso_saml20_login_build_response_msg(LassoLogin *login, gchar *remote_providerID) +{ + return lasso_saml20_profile_build_artifact_response(LASSO_PROFILE(login)); +} + +gint +lasso_saml20_login_process_response_msg(LassoLogin *login, gchar *response_msg) +{ + LassoProfile *profile = LASSO_PROFILE(login); + int rc; + + rc = lasso_saml20_profile_process_artifact_response(profile, response_msg); + if (rc) { + return rc; + } + + return lasso_saml20_login_process_response_status_and_assertion(login); +} + +static gint +lasso_saml20_login_process_response_status_and_assertion(LassoLogin *login) +{ + LassoProvider *idp; + LassoSamlp2StatusResponse *response; + char *status_value; + int ret = 0; + + g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + + response = LASSO_SAMLP2_STATUS_RESPONSE(LASSO_PROFILE(login)->response); + + if (response->Status == NULL || ! LASSO_IS_SAMLP2_STATUS(response->Status) || + response->Status->StatusCode == NULL || + response->Status->StatusCode->Value == NULL) { + return LASSO_ERROR_UNDEFINED; + } + + status_value = response->Status->StatusCode->Value; + if (status_value && strcmp(status_value, LASSO_SAML2_STATUS_CODE_SUCCESS) != 0) { + if (strcmp(status_value, LASSO_SAML2_STATUS_CODE_REQUEST_DENIED) == 0) + return LASSO_LOGIN_ERROR_REQUEST_DENIED; + if (strcmp(status_value, LASSO_SAML2_STATUS_CODE_RESPONDER) == 0) { + /* samlp:Responder */ + if (response->Status->StatusCode->StatusCode && + response->Status->StatusCode->StatusCode->Value) { + status_value = response->Status->StatusCode->StatusCode->Value; + if (strcmp(status_value, + LASSO_LIB_STATUS_CODE_FEDERATION_DOES_NOT_EXIST) == 0) { + return LASSO_LOGIN_ERROR_FEDERATION_NOT_FOUND; + } + if (strcmp(status_value, + LASSO_LIB_STATUS_CODE_UNKNOWN_PRINCIPAL) == 0) { + return LASSO_LOGIN_ERROR_UNKNOWN_PRINCIPAL; + } + } + } + return LASSO_LOGIN_ERROR_STATUS_NOT_SUCCESS; + } + + if (LASSO_SAMLP2_RESPONSE(response)->Assertion) { + LassoProfile *profile = LASSO_PROFILE(login); + LassoSaml2Assertion *assertion = LASSO_SAMLP2_RESPONSE(response)->Assertion->data; + idp = g_hash_table_lookup(profile->server->providers, profile->remote_providerID); + if (idp == NULL) + return LASSO_ERROR_UNDEFINED; + + /* FIXME: verify assertion signature */ + + /* store NameIdentifier */ + if (assertion->Subject == NULL) { + return LASSO_ERROR_UNDEFINED; + } + + profile->nameIdentifier = g_object_ref(assertion->Subject->NameID); + + if (LASSO_PROFILE(login)->nameIdentifier == NULL) + return LASSO_ERROR_UNDEFINED; + } + + return ret; +} + +gint +lasso_saml20_login_accept_sso(LassoLogin *login) +{ + LassoProfile *profile; + LassoSaml2Assertion *assertion; + LassoSaml2NameID *ni, *idp_ni = NULL; + LassoFederation *federation; + + profile = LASSO_PROFILE(login); + + if (LASSO_SAMLP2_RESPONSE(profile->response)->Assertion == NULL) + return LASSO_ERROR_UNDEFINED; + + assertion = LASSO_SAMLP2_RESPONSE(profile->response)->Assertion->data; + if (assertion == NULL) + return LASSO_ERROR_UNDEFINED; + + lasso_session_add_assertion(profile->session, profile->remote_providerID, + g_object_ref(assertion)); + + ni = assertion->Subject->NameID; + + if (ni == NULL) + return LASSO_ERROR_UNDEFINED; + + + /* create federation, only if nameidentifier format is Federated */ + if (strcmp(ni->Format, LASSO_SAML2_NAME_IDENTIFIER_FORMAT_PERSISTENT) == 0) { + federation = lasso_federation_new(LASSO_PROFILE(login)->remote_providerID); + if (ni != NULL && idp_ni != NULL) { + federation->local_nameIdentifier = g_object_ref(ni); + federation->remote_nameIdentifier = g_object_ref(idp_ni); + } else { + federation->remote_nameIdentifier = g_object_ref(ni); + } + /* add federation in identity */ + lasso_identity_add_federation(LASSO_PROFILE(login)->identity, federation); + } + + return 0; +} + diff --git a/lasso/saml-2.0/loginprivate.h b/lasso/saml-2.0/loginprivate.h new file mode 100644 index 00000000..8ed01b6d --- /dev/null +++ b/lasso/saml-2.0/loginprivate.h @@ -0,0 +1,59 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML20_LOGIN_PRIVATE_H__ +#define __LASSO_SAML20_LOGIN_PRIVATE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/id-ff/login.h> + +gint lasso_saml20_login_init_authn_request(LassoLogin *login, LassoProvider *remote_provider, + LassoHttpMethod http_method); +gint lasso_saml20_login_build_authn_request_msg(LassoLogin *login, LassoProvider *remote_provider); +gint lasso_saml20_login_process_authn_request_msg(LassoLogin *login, const char *authn_request_msg); +gboolean lasso_saml20_login_must_authenticate(LassoLogin *login); +gboolean lasso_saml20_login_must_ask_for_consent(LassoLogin *login); +int lasso_saml20_login_validate_request_msg(LassoLogin *login, gboolean authentication_result, + gboolean is_consent_obtained); +int lasso_saml20_login_build_assertion(LassoLogin *login, + const char *authenticationMethod, const char *authenticationInstant, + const char *reauthenticateOnOrAfter, const char *notBefore, + const char *notOnOrAfter); +gint lasso_saml20_login_build_artifact_msg(LassoLogin *login, LassoHttpMethod http_method); +gint lasso_saml20_login_init_request(LassoLogin *login, gchar *response_msg, + LassoHttpMethod response_http_method); +gint lasso_saml20_login_build_request_msg(LassoLogin *login); +gint lasso_saml20_login_process_request_msg(LassoLogin *login, gchar *request_msg); +gint lasso_saml20_login_build_response_msg(LassoLogin *login, gchar *remote_providerID); +gint lasso_saml20_login_process_response_msg(LassoLogin *login, gchar *response_msg); +gint lasso_saml20_login_accept_sso(LassoLogin *login); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML20_LOGIN_PRIVATE_H__ */ diff --git a/lasso/saml-2.0/profile.c b/lasso/saml-2.0/profile.c new file mode 100644 index 00000000..f6041e4b --- /dev/null +++ b/lasso/saml-2.0/profile.c @@ -0,0 +1,277 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 <xmlsec/base64.h> + +#include <lasso/saml-2.0/providerprivate.h> +#include <lasso/saml-2.0/profileprivate.h> + +#include <lasso/id-ff/providerprivate.h> +#include <lasso/id-ff/profile.h> +#include <lasso/id-ff/profileprivate.h> +#include <lasso/id-ff/serverprivate.h> + +#include <lasso/xml/saml-2.0/samlp2_request_abstract.h> +#include <lasso/xml/saml-2.0/samlp2_artifact_resolve.h> +#include <lasso/xml/saml-2.0/samlp2_artifact_response.h> +#include <lasso/xml/saml-2.0/samlp2_name_id_mapping_response.h> +#include <lasso/xml/saml-2.0/samlp2_status_response.h> +#include <lasso/xml/saml-2.0/samlp2_response.h> + + +static char* lasso_saml20_profile_build_artifact(LassoProvider *provider); + +/** + * lasso_saml20_profile_generate_artifact + * @profile: a #LassoProfile + * @part: 0 for request, 1 for response + * + * Generates an artifact for current request or response and sets @profile + * attributes accordingly. + * + * Return value: the generated artifact (internally allocated, don't free) + **/ +char* +lasso_saml20_profile_generate_artifact(LassoProfile *profile, int part) +{ + profile->private_data->artifact = lasso_saml20_profile_build_artifact( + LASSO_PROVIDER(profile->server)); + if (part == 0) { + profile->private_data->artifact_message = lasso_node_dump(profile->request); + } else if (part == 1) { + profile->private_data->artifact_message = lasso_node_dump(profile->response); + } else { + /* XXX: RequestDenied here? */ + } + + return profile->private_data->artifact; +} + + +static char* +lasso_saml20_profile_build_artifact(LassoProvider *provider) +{ + xmlSecByte samlArt[42], *b64_samlArt; + char *source_succinct_id; + char *ret; + + source_succinct_id = lasso_sha1(provider->ProviderID); + + /* Artifact Format is described in saml-bindings-2.0-os, 3.6.4.2. */ + memcpy(samlArt, "\000\004", 2); /* type code */ + memcpy(samlArt+2, source_succinct_id, 20); + lasso_build_random_sequence((char*)samlArt+22, 20); + + xmlFree(source_succinct_id); + b64_samlArt = xmlSecBase64Encode(samlArt, 42, 0); + + ret = g_strdup((char*)b64_samlArt); + xmlFree(b64_samlArt); + + return ret; +} + +void +lasso_saml20_profile_set_response_status(LassoProfile *profile, const char *status_code_value) +{ + LassoSamlp2Status *status; + + status = LASSO_SAMLP2_STATUS(lasso_samlp2_status_new()); + status->StatusCode = LASSO_SAMLP2_STATUS_CODE(lasso_samlp2_status_code_new()); + status->StatusCode->Value = g_strdup(status_code_value); + + if (strcmp(status_code_value, LASSO_SAML2_STATUS_CODE_SUCCESS) != 0 && + strcmp(status_code_value, LASSO_SAML2_STATUS_CODE_VERSION_MISMATCH) != 0) { + status->StatusCode->Value = g_strdup(LASSO_SAML2_STATUS_CODE_RESPONDER); + status->StatusCode->StatusCode = LASSO_SAMLP2_STATUS_CODE( + lasso_samlp2_status_code_new()); + status->StatusCode->StatusCode->Value = g_strdup(status_code_value); + } + + if (LASSO_IS_SAMLP2_RESPONSE(profile->response) || + LASSO_IS_SAMLP2_ARTIFACT_RESPONSE(profile->response) || + LASSO_IS_SAMLP2_NAME_ID_MAPPING_RESPONSE(profile->response) || + LASSO_IS_SAMLP2_STATUS_RESPONSE(profile->response)) { + LassoSamlp2StatusResponse *response; + response = LASSO_SAMLP2_STATUS_RESPONSE(profile->response); + if (response->Status) + lasso_node_destroy(LASSO_NODE(response->Status)); + response->Status = status; + return; + } + + message(G_LOG_LEVEL_CRITICAL, "Failed to set status"); + g_assert_not_reached(); +} + + +int +lasso_saml20_profile_init_artifact_resolve(LassoProfile *profile, + const char *msg, LassoHttpMethod method) +{ + char **query_fields; + char *artifact_b64 = NULL, *provider_succinct_id_b64; + char provider_succinct_id[21]; + char artifact[43]; + LassoSamlp2RequestAbstract *request; + int i; + + if (method == LASSO_HTTP_METHOD_ARTIFACT_GET) { + query_fields = urlencoded_to_strings(msg); + for (i=0; query_fields[i]; i++) { + if (strncmp(query_fields[i], "SAMLArt=", 8) != 0) { + xmlFree(query_fields[i]); + continue; + } + artifact_b64 = g_strdup(query_fields[i]+8); + xmlFree(query_fields[i]); + } + g_free(query_fields); + } else { + artifact_b64 = g_strdup(msg); + } + + i = xmlSecBase64Decode((xmlChar*)artifact_b64, (xmlChar*)artifact, 43); + if (i < 0 || i > 42) { + g_free(artifact_b64); + return LASSO_ERROR_UNDEFINED; + } + + if (artifact[0] != 0 || artifact[1] != 4) { /* wrong type code */ + g_free(artifact_b64); + return LASSO_ERROR_UNDEFINED; + } + + memcpy(provider_succinct_id, artifact+2, 20); + provider_succinct_id[20] = 0; + + provider_succinct_id_b64 = (char*)xmlSecBase64Encode((xmlChar*)provider_succinct_id, 20, 0); + + profile->remote_providerID = lasso_server_get_providerID_from_hash( + profile->server, provider_succinct_id_b64); + xmlFree(provider_succinct_id_b64); + if (profile->remote_providerID == NULL) { + return critical_error(LASSO_PROFILE_ERROR_MISSING_REMOTE_PROVIDERID); + } + + if (profile->request) { + lasso_node_destroy(profile->request); + } + profile->request = lasso_samlp2_artifact_resolve_new(); + request = LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request); + LASSO_SAMLP2_ARTIFACT_RESOLVE(request)->Artifact = artifact_b64; + request->ID = lasso_build_unique_id(32); + request->Version = g_strdup("2.0"); + request->Issuer = LASSO_SAML2_NAME_ID(lasso_saml2_name_id_new_with_string( + LASSO_PROVIDER(profile->server)->ProviderID)); + request->IssueInstant = lasso_get_current_time(); + + request->sign_method = LASSO_SIGNATURE_METHOD_RSA_SHA1; + if (profile->server->certificate) { + request->sign_type = LASSO_SIGNATURE_TYPE_WITHX509; + } else { + request->sign_type = LASSO_SIGNATURE_TYPE_SIMPLE; + } + + return 0; +} + +int +lasso_saml20_profile_process_artifact_resolve(LassoProfile *profile, const char *msg) +{ + LassoProvider *remote_provider; + int rc; + + if (profile->request) { + lasso_node_destroy(profile->request); + } + + profile->request = lasso_node_new_from_soap(msg); + if (profile->request == NULL) { + return critical_error(LASSO_PROFILE_ERROR_INVALID_MSG); + } + if (! LASSO_IS_SAMLP2_ARTIFACT_RESOLVE(profile->request)) { + return critical_error(LASSO_PROFILE_ERROR_INVALID_MSG); + } + + profile->remote_providerID = g_strdup(LASSO_SAMLP2_REQUEST_ABSTRACT( + profile->request)->Issuer->content); + remote_provider = g_hash_table_lookup(profile->server->providers, + profile->remote_providerID); + + rc = lasso_provider_verify_signature(remote_provider, msg, "ID", LASSO_MESSAGE_FORMAT_SOAP); + + profile->private_data->artifact = g_strdup( + LASSO_SAMLP2_ARTIFACT_RESOLVE(profile->request)->Artifact); + + return rc; +} + +int +lasso_saml20_profile_build_artifact_response(LassoProfile *profile) +{ + LassoSamlp2StatusResponse *response; + LassoNode *resp = lasso_node_new_from_dump(profile->private_data->artifact_message); + if (resp == NULL) + return LASSO_ERROR_UNDEFINED; + + response = LASSO_SAMLP2_STATUS_RESPONSE(lasso_samlp2_artifact_response_new()); + LASSO_SAMLP2_ARTIFACT_RESPONSE(response)->any = resp; + response->ID = lasso_build_unique_id(32); + response->Version = g_strdup("2.0"); + response->Issuer = LASSO_SAML2_NAME_ID(lasso_saml2_name_id_new_with_string( + LASSO_PROVIDER(profile->server)->ProviderID)); + response->IssueInstant = lasso_get_current_time(); + response->InResponseTo = g_strdup(LASSO_SAMLP2_REQUEST_ABSTRACT(profile->request)->ID); + response->sign_method = LASSO_SIGNATURE_METHOD_RSA_SHA1; + if (profile->server->certificate) { + response->sign_type = LASSO_SIGNATURE_TYPE_WITHX509; + } else { + response->sign_type = LASSO_SIGNATURE_TYPE_SIMPLE; + } + response->private_key_file = profile->server->private_key; + response->certificate_file = profile->server->certificate; + + profile->response = LASSO_NODE(response); + lasso_saml20_profile_set_response_status(profile, LASSO_SAML2_STATUS_CODE_SUCCESS); + + profile->msg_body = lasso_node_export_to_soap(profile->response); + return 0; +} + +int +lasso_saml20_profile_process_artifact_response(LassoProfile *profile, const char *msg) +{ + LassoNode *response; + + response = lasso_node_new_from_soap(msg); + /* XXX: check status code */ + + profile->response = g_object_ref(LASSO_SAMLP2_ARTIFACT_RESPONSE(response)->any); + lasso_node_destroy(response); + + return 0; +} + + diff --git a/lasso/saml-2.0/profileprivate.h b/lasso/saml-2.0/profileprivate.h new file mode 100644 index 00000000..f43c88ef --- /dev/null +++ b/lasso/saml-2.0/profileprivate.h @@ -0,0 +1,46 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML20_PROFILE_PRIVATE_H__ +#define __LASSO_SAML20_PROFILE_PRIVATE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/id-ff/profile.h> + +char* lasso_saml20_profile_generate_artifact(LassoProfile *profile, int part); +void lasso_saml20_profile_set_response_status(LassoProfile *profile, const char *status_code_value); +int lasso_saml20_profile_init_artifact_resolve(LassoProfile *profile, + const char *msg, LassoHttpMethod method); +int lasso_saml20_profile_process_artifact_resolve(LassoProfile *profile, const char *msg); +int lasso_saml20_profile_build_artifact_response(LassoProfile *profile); +int lasso_saml20_profile_process_artifact_response(LassoProfile *profile, const char *msg); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML20_PROFILE_PRIVATE_H__ */ diff --git a/lasso/saml-2.0/provider.c b/lasso/saml-2.0/provider.c new file mode 100644 index 00000000..3a473cf5 --- /dev/null +++ b/lasso/saml-2.0/provider.c @@ -0,0 +1,254 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 <xmlsec/base64.h> + +#include <lasso/saml-2.0/providerprivate.h> +#include <lasso/id-ff/providerprivate.h> + + +static void +load_descriptor(xmlNode *xmlnode, GHashTable *descriptor, LassoProvider *provider) +{ + char *descriptor_attrs[] = {"AuthnRequestsSigned", "WantAuthnRequestsSigned", NULL}; + int i; + xmlNode *t; + GList *elements; + char *name, *binding; + xmlChar *value; + + t = xmlnode->children; + while (t) { + if (t->type != XML_ELEMENT_NODE) { + t = t->next; + continue; + } + if (strcmp((char*)t->name, "KeyDescriptor") == 0) { + char *use = (char*)xmlGetProp(t, (xmlChar*)"use"); + if (use && strcmp(use, "signing") == 0) { + provider->private_data->signing_key_descriptor = xmlCopyNode(t, 1); + } + t = t->next; + continue; + } + binding = (char*)xmlGetProp(t, (xmlChar*)"Binding"); + if (binding) { + /* Endpoint type */ + char *binding_s = NULL; + if (strcmp(binding, LASSO_SAML20_METADATA_BINDING_SOAP) == 0) { + binding_s = "SOAP"; + } else if (strcmp(binding, LASSO_SAML20_METADATA_BINDING_REDIRECT) == 0) { + binding_s = "HTTP-Redirect"; + } else if (strcmp(binding, LASSO_SAML20_METADATA_BINDING_POST) == 0) { + binding_s = "HTTP-POST"; + } else if (strcmp(binding, LASSO_SAML20_METADATA_BINDING_ARTIFACT) == 0) { + binding_s = "HTTP-Artifact"; + } else { + message(G_LOG_LEVEL_CRITICAL, "XXX: unknown binding: %s", binding); + xmlFree(binding); + t = t->next; + continue; + } + value = xmlGetProp(t, (xmlChar*)"Location"); + if (value == NULL) { + message(G_LOG_LEVEL_CRITICAL, "XXX: missing location"); + xmlFree(binding); + t = t->next; + continue; + } + if (strcmp((char*)t->name, "AssertionConsumerService") == 0) { + char *index = (char*)xmlGetProp(t, (xmlChar*)"index"); + char *is_default = (char*)xmlGetProp(t, (xmlChar*)"isDefault"); + if (is_default && strcmp(is_default, "true") == 0) { + provider->private_data->default_assertion_consumer = + g_strdup(index); + } + name = g_strdup_printf("%s %s %s", t->name, binding_s, index); + xmlFree(index); + xmlFree(is_default); + } else { + name = g_strdup_printf("%s %s", t->name, binding_s); + } + xmlFree(binding); + } else { + name = g_strdup((char*)t->name); + value = xmlNodeGetContent(t); + } + elements = g_hash_table_lookup(descriptor, name); + elements = g_list_append(elements, g_strdup((char*)value)); + xmlFree(value); + g_hash_table_insert(descriptor, name, elements); + t = t->next; + } + + for (i=0; descriptor_attrs[i]; i++) { + value = xmlGetProp(xmlnode, (xmlChar*)descriptor_attrs[i]); + if (value == NULL) continue; + + name = g_strdup(descriptor_attrs[i]); + elements = g_hash_table_lookup(descriptor, name); + elements = g_list_append(elements, g_strdup((char*)value)); + xmlFree(value); + g_hash_table_insert(descriptor, name, elements); + } + +} + +gboolean +lasso_saml20_provider_load_metadata(LassoProvider *provider, xmlNode *root_node) +{ + xmlNode *node, *descriptor_node; + + if (strcmp((char*)root_node->name, "EntityDescriptor") == 0) { + node = root_node; + } else if (strcmp((char*)root_node->name, "EntitiesDescriptor") == 0) { + /* XXX: take the first entity; would it be possible to have an + * optional argument to take another one ? */ + node = root_node->children; + while (node && strcmp((char*)node->name, "EntityDescriptor") != 0) { + node = node->next; + } + if (node == NULL) + return FALSE; + } else { + /* what? */ + return FALSE; + } + + provider->ProviderID = (char*)xmlGetProp(node, (xmlChar*)"entityID"); + if (provider->ProviderID == NULL) + return FALSE; + + for (descriptor_node = node->children; descriptor_node != NULL; + descriptor_node = descriptor_node->next) { + if (descriptor_node->type != XML_ELEMENT_NODE) + continue; + + if (strcmp((char*)descriptor_node->name, "IDPSSODescriptor") == 0) { + load_descriptor(descriptor_node, + provider->private_data->IDPDescriptor, provider); + provider->role = LASSO_PROVIDER_ROLE_IDP; + continue; + } + + if (strcmp((char*)descriptor_node->name, "SPSSODescriptor") == 0) { + load_descriptor(descriptor_node, + provider->private_data->SPDescriptor, provider); + provider->role = LASSO_PROVIDER_ROLE_SP; + continue; + } + + if (strcmp((char*)descriptor_node->name, "Organization") == 0) { + provider->private_data->organization = xmlCopyNode( + descriptor_node, 1); + continue; + } + } + + + + return TRUE; +} + +LassoHttpMethod +lasso_saml20_provider_get_first_http_method(LassoProvider *provider, + LassoProvider *remote_provider, LassoMdProtocolType protocol_type) +{ + LassoHttpMethod method = LASSO_HTTP_METHOD_NONE; + int i; + const char *possible_bindings[] = { + "SOAP", "HTTP-Redirect", "HTTP-Post", NULL + }; + LassoHttpMethod method_bindings[] = { + LASSO_HTTP_METHOD_SOAP, LASSO_HTTP_METHOD_REDIRECT, LASSO_HTTP_METHOD_POST + }; + const char *profiles[] = { + "", /* No fedterm in SAML 2.0 */ + "NameIDMappingService", + "", /* No rni in SAML 2.0 */ + "SingleLogoutService", + "SingleSignOnService", + "ArtifactResolutionService", + "ManageNameIDService", + "AssertionIDRequestService", + NULL + }; + + if (remote_provider->role == LASSO_PROVIDER_ROLE_SP) + provider->role = LASSO_PROVIDER_ROLE_IDP; + if (remote_provider->role == LASSO_PROVIDER_ROLE_IDP) + provider->role = LASSO_PROVIDER_ROLE_SP; + + for (i=0; possible_bindings[i] && method == LASSO_HTTP_METHOD_NONE; i++) { + char *s; + GList *l1, *l2; + + s = g_strdup_printf("%s %s", profiles[protocol_type], possible_bindings[i]); + l1 = lasso_provider_get_metadata_list(provider, s); + l2 = lasso_provider_get_metadata_list(remote_provider, s); + if (l1 && l2) { + method = method_bindings[i]; + } + } + + return method; +} + +gchar* +lasso_saml20_provider_get_assertion_consumer_service_url(LassoProvider *provider, + int service_id) +{ + GHashTable *descriptor; + GList *l = NULL; + char *sid; + char *name; + const char *possible_bindings[] = { + "HTTP-Artifact", "HTTP-Post", NULL + }; + int i; + + if (service_id == -1) { + sid = provider->private_data->default_assertion_consumer; + } else { + sid = g_strdup_printf("%d", service_id); + } + + + descriptor = provider->private_data->SPDescriptor; + if (descriptor == NULL) + return NULL; + + for (i=0; possible_bindings[i]; i++) { + name = g_strdup_printf("AssertionConsumerService %s %s", + possible_bindings[i], sid); + l = g_hash_table_lookup(descriptor, name); + g_free(name); + if (l != NULL) + break; + } + if (l) + return g_strdup(l->data); + return NULL; +} + diff --git a/lasso/saml-2.0/providerprivate.h b/lasso/saml-2.0/providerprivate.h new file mode 100644 index 00000000..7e47dbf4 --- /dev/null +++ b/lasso/saml-2.0/providerprivate.h @@ -0,0 +1,49 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML20_PROVIDER_PRIVATE_H__ +#define __LASSO_SAML20_PROVIDER_PRIVATE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> +#include <lasso/id-ff/provider.h> + +gboolean lasso_saml20_provider_load_metadata(LassoProvider *provider, xmlNode *root_node); + +LassoHttpMethod lasso_saml20_provider_get_first_http_method(LassoProvider *provider, + LassoProvider *remote_provider, LassoMdProtocolType protocol_type); + +char* lasso_saml20_provider_build_artifact(LassoProvider *provider); + +gchar* lasso_saml20_provider_get_assertion_consumer_service_url(LassoProvider *provider, + int service_id); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML20_PROVIDER_PRIVATE_H__ */ diff --git a/lasso/xml/Makefile.am b/lasso/xml/Makefile.am index 16d99c87..bc83f599 100644 --- a/lasso/xml/Makefile.am +++ b/lasso/xml/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = saml-2.0 + liblassoincludedir = $(includedir)/lasso/xml INCLUDES = \ diff --git a/lasso/xml/lib_authn_response.c b/lasso/xml/lib_authn_response.c index a7fc2767..8ed663e6 100644 --- a/lasso/xml/lib_authn_response.c +++ b/lasso/xml/lib_authn_response.c @@ -122,7 +122,7 @@ lasso_lib_authn_response_get_type() * * Return value: a newly created #LassoLibAuthnResponse object **/ -LassoSamlpResponseAbstract* +LassoNode* lasso_lib_authn_response_new(char *providerID, LassoLibAuthnRequest *request) { LassoLibAuthnResponse *response; @@ -138,5 +138,5 @@ lasso_lib_authn_response_new(char *providerID, LassoLibAuthnRequest *request) response->RelayState = g_strdup(request->RelayState); } - return LASSO_SAMLP_RESPONSE_ABSTRACT(response); + return LASSO_NODE(response); } diff --git a/lasso/xml/lib_authn_response.h b/lasso/xml/lib_authn_response.h index d029d963..fa1abe0b 100644 --- a/lasso/xml/lib_authn_response.h +++ b/lasso/xml/lib_authn_response.h @@ -68,7 +68,7 @@ struct _LassoLibAuthnResponseClass { }; LASSO_EXPORT GType lasso_lib_authn_response_get_type(void); -LASSO_EXPORT LassoSamlpResponseAbstract* lasso_lib_authn_response_new( +LASSO_EXPORT LassoNode* lasso_lib_authn_response_new( char *providerID, LassoLibAuthnRequest *request); #ifdef __cplusplus diff --git a/lasso/xml/lib_federation_termination_notification.c b/lasso/xml/lib_federation_termination_notification.c index 441ef9b2..07b9b6fd 100644 --- a/lasso/xml/lib_federation_termination_notification.c +++ b/lasso/xml/lib_federation_termination_notification.c @@ -202,7 +202,7 @@ lasso_lib_federation_termination_notification_get_type() * Return value: a newly created #LassoLibFederationTerminationNotification * object **/ -LassoSamlpRequestAbstract* +LassoNode* lasso_lib_federation_termination_notification_new() { return g_object_new(LASSO_TYPE_LIB_FEDERATION_TERMINATION_NOTIFICATION, NULL); @@ -222,7 +222,7 @@ lasso_lib_federation_termination_notification_new() * Return value: a newly created #LassoLibFederationTerminationNotification * object **/ -LassoSamlpRequestAbstract* +LassoNode* lasso_lib_federation_termination_notification_new_full(char *providerID, LassoSamlNameIdentifier *nameIdentifier, LassoSignatureType sign_type, LassoSignatureMethod sign_method) @@ -242,5 +242,5 @@ lasso_lib_federation_termination_notification_new_full(char *providerID, LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(request)->NameIdentifier = g_object_ref(nameIdentifier); - return request; + return LASSO_NODE(request); } diff --git a/lasso/xml/lib_federation_termination_notification.h b/lasso/xml/lib_federation_termination_notification.h index bee30ecc..5982c049 100644 --- a/lasso/xml/lib_federation_termination_notification.h +++ b/lasso/xml/lib_federation_termination_notification.h @@ -74,8 +74,8 @@ struct _LassoLibFederationTerminationNotificationClass { }; LASSO_EXPORT GType lasso_lib_federation_termination_notification_get_type(void); -LASSO_EXPORT LassoSamlpRequestAbstract* lasso_lib_federation_termination_notification_new(void); -LASSO_EXPORT LassoSamlpRequestAbstract* lasso_lib_federation_termination_notification_new_full( +LASSO_EXPORT LassoNode* lasso_lib_federation_termination_notification_new(void); +LASSO_EXPORT LassoNode* lasso_lib_federation_termination_notification_new_full( char *providerID, LassoSamlNameIdentifier *nameIdentifier, LassoSignatureType sign_type, LassoSignatureMethod sign_method); diff --git a/lasso/xml/lib_logout_request.c b/lasso/xml/lib_logout_request.c index a3d0290b..fe694d0f 100644 --- a/lasso/xml/lib_logout_request.c +++ b/lasso/xml/lib_logout_request.c @@ -176,7 +176,7 @@ lasso_lib_logout_request_get_type() * * Return value: a newly created #LassoLibLogoutRequest object **/ -LassoSamlpRequestAbstract* +LassoNode* lasso_lib_logout_request_new() { return g_object_new(LASSO_TYPE_LIB_LOGOUT_REQUEST, NULL); @@ -195,7 +195,7 @@ lasso_lib_logout_request_new() * * Return value: a newly created #LassoLibLogoutRequest object **/ -LassoSamlpRequestAbstract* +LassoNode* lasso_lib_logout_request_new_full(char *providerID, LassoSamlNameIdentifier *nameIdentifier, LassoSignatureType sign_type, LassoSignatureMethod sign_method) { @@ -212,5 +212,5 @@ lasso_lib_logout_request_new_full(char *providerID, LassoSamlNameIdentifier *nam LASSO_LIB_LOGOUT_REQUEST(request)->ProviderID = g_strdup(providerID); LASSO_LIB_LOGOUT_REQUEST(request)->NameIdentifier = g_object_ref(nameIdentifier); - return request; + return LASSO_NODE(request); } diff --git a/lasso/xml/lib_logout_request.h b/lasso/xml/lib_logout_request.h index 0788409f..6b2dbbfa 100644 --- a/lasso/xml/lib_logout_request.h +++ b/lasso/xml/lib_logout_request.h @@ -68,9 +68,9 @@ struct _LassoLibLogoutRequestClass { }; LASSO_EXPORT GType lasso_lib_logout_request_get_type(void); -LASSO_EXPORT LassoSamlpRequestAbstract* lasso_lib_logout_request_new(void); +LASSO_EXPORT LassoNode* lasso_lib_logout_request_new(void); -LASSO_EXPORT LassoSamlpRequestAbstract* lasso_lib_logout_request_new_full( +LASSO_EXPORT LassoNode* lasso_lib_logout_request_new_full( char *providerID, LassoSamlNameIdentifier *nameIdentifier, LassoSignatureType sign_type, LassoSignatureMethod sign_method); diff --git a/lasso/xml/lib_logout_response.c b/lasso/xml/lib_logout_response.c index b2fbe767..85b8b471 100644 --- a/lasso/xml/lib_logout_response.c +++ b/lasso/xml/lib_logout_response.c @@ -84,7 +84,7 @@ lasso_lib_logout_response_get_type() * * Return value: a newly created #LassoLibLogoutResponse object **/ -LassoSamlpResponseAbstract* +LassoNode* lasso_lib_logout_response_new() { return g_object_new(LASSO_TYPE_LIB_LOGOUT_RESPONSE, NULL); @@ -104,7 +104,7 @@ lasso_lib_logout_response_new() * * Return value: a newly created #LassoLibLogoutResponse object **/ -LassoSamlpResponseAbstract* +LassoNode* lasso_lib_logout_response_new_full(char *providerID, const char *statusCodeValue, LassoLibLogoutRequest *request, LassoSignatureType sign_type, LassoSignatureMethod sign_method) @@ -125,5 +125,5 @@ lasso_lib_logout_response_new_full(char *providerID, const char *statusCodeValue response->Status->StatusCode = lasso_samlp_status_code_new(); response->Status->StatusCode->Value = g_strdup(statusCodeValue); - return LASSO_SAMLP_RESPONSE_ABSTRACT(response); + return LASSO_NODE(response); } diff --git a/lasso/xml/lib_logout_response.h b/lasso/xml/lib_logout_response.h index b72120b4..a3c8381b 100644 --- a/lasso/xml/lib_logout_response.h +++ b/lasso/xml/lib_logout_response.h @@ -58,9 +58,9 @@ struct _LassoLibLogoutResponseClass { }; LASSO_EXPORT GType lasso_lib_logout_response_get_type(void); -LASSO_EXPORT LassoSamlpResponseAbstract* lasso_lib_logout_response_new(void); +LASSO_EXPORT LassoNode* lasso_lib_logout_response_new(void); -LASSO_EXPORT LassoSamlpResponseAbstract* lasso_lib_logout_response_new_full( +LASSO_EXPORT LassoNode* lasso_lib_logout_response_new_full( char *providerID, const char *statusCodeValue, LassoLibLogoutRequest *request, LassoSignatureType sign_type, LassoSignatureMethod sign_method); diff --git a/lasso/xml/lib_name_identifier_mapping_request.c b/lasso/xml/lib_name_identifier_mapping_request.c index 34027eaf..94bbdb05 100644 --- a/lasso/xml/lib_name_identifier_mapping_request.c +++ b/lasso/xml/lib_name_identifier_mapping_request.c @@ -127,7 +127,7 @@ lasso_lib_name_identifier_mapping_request_get_type() * * Return value: a newly created #LassoLibNameIdentifierMappingRequest object **/ -LassoSamlpRequestAbstract* +LassoNode* lasso_lib_name_identifier_mapping_request_new() { return g_object_new(LASSO_TYPE_LIB_NAME_IDENTIFIER_MAPPING_REQUEST, NULL); @@ -147,7 +147,7 @@ lasso_lib_name_identifier_mapping_request_new() * * Return value: a newly created #LassoLibNameIdentifierMappingRequest object **/ -LassoSamlpRequestAbstract* +LassoNode* lasso_lib_name_identifier_mapping_request_new_full(char *providerID, LassoSamlNameIdentifier *nameIdentifier, const char *targetNamespace, LassoSignatureType sign_type, LassoSignatureMethod sign_method) @@ -173,5 +173,5 @@ lasso_lib_name_identifier_mapping_request_new_full(char *providerID, /* XXX: consent ? */ - return request; + return LASSO_NODE(request); } diff --git a/lasso/xml/lib_name_identifier_mapping_request.h b/lasso/xml/lib_name_identifier_mapping_request.h index afdd1207..a73486ca 100644 --- a/lasso/xml/lib_name_identifier_mapping_request.h +++ b/lasso/xml/lib_name_identifier_mapping_request.h @@ -73,8 +73,8 @@ struct _LassoLibNameIdentifierMappingRequestClass { }; LASSO_EXPORT GType lasso_lib_name_identifier_mapping_request_get_type(void); -LASSO_EXPORT LassoSamlpRequestAbstract* lasso_lib_name_identifier_mapping_request_new(void); -LASSO_EXPORT LassoSamlpRequestAbstract* lasso_lib_name_identifier_mapping_request_new_full( +LASSO_EXPORT LassoNode* lasso_lib_name_identifier_mapping_request_new(void); +LASSO_EXPORT LassoNode* lasso_lib_name_identifier_mapping_request_new_full( char *providerID, LassoSamlNameIdentifier *nameIdentifier, const char *targetNamespace, LassoSignatureType sign_type, LassoSignatureMethod sign_method); diff --git a/lasso/xml/lib_name_identifier_mapping_response.c b/lasso/xml/lib_name_identifier_mapping_response.c index b3fd7737..05511406 100644 --- a/lasso/xml/lib_name_identifier_mapping_response.c +++ b/lasso/xml/lib_name_identifier_mapping_response.c @@ -115,7 +115,7 @@ lasso_lib_name_identifier_mapping_response_get_type() * * Return value: a newly created #LassoLibNameIdentifierMappingResponse object **/ -LassoSamlpResponseAbstract* +LassoNode* lasso_lib_name_identifier_mapping_response_new() { return g_object_new(LASSO_TYPE_LIB_NAME_IDENTIFIER_MAPPING_RESPONSE, NULL); @@ -135,7 +135,7 @@ lasso_lib_name_identifier_mapping_response_new() * * Return value: a newly created #LassoLibNameIdentifierMappingResponse object **/ -LassoSamlpResponseAbstract* +LassoNode* lasso_lib_name_identifier_mapping_response_new_full(char *providerID, const char *statusCodeValue, LassoLibNameIdentifierMappingRequest *request, LassoSignatureType sign_type, LassoSignatureMethod sign_method) @@ -155,5 +155,5 @@ lasso_lib_name_identifier_mapping_response_new_full(char *providerID, const char response->Status->StatusCode = lasso_samlp_status_code_new(); response->Status->StatusCode->Value = g_strdup(statusCodeValue); - return LASSO_SAMLP_RESPONSE_ABSTRACT(response); + return LASSO_NODE(response); } diff --git a/lasso/xml/lib_name_identifier_mapping_response.h b/lasso/xml/lib_name_identifier_mapping_response.h index 5961ee34..1762e1fd 100644 --- a/lasso/xml/lib_name_identifier_mapping_response.h +++ b/lasso/xml/lib_name_identifier_mapping_response.h @@ -73,9 +73,9 @@ struct _LassoLibNameIdentifierMappingResponseClass { }; LASSO_EXPORT GType lasso_lib_name_identifier_mapping_response_get_type(void); -LASSO_EXPORT LassoSamlpResponseAbstract* lasso_lib_name_identifier_mapping_response_new(void); +LASSO_EXPORT LassoNode* lasso_lib_name_identifier_mapping_response_new(void); -LASSO_EXPORT LassoSamlpResponseAbstract* lasso_lib_name_identifier_mapping_response_new_full( +LASSO_EXPORT LassoNode* lasso_lib_name_identifier_mapping_response_new_full( char *provideRID, const char *statusCodeValue, LassoLibNameIdentifierMappingRequest *request, LassoSignatureType sign_type, LassoSignatureMethod sign_method); diff --git a/lasso/xml/lib_register_name_identifier_request.c b/lasso/xml/lib_register_name_identifier_request.c index 53c5c46b..1fba8fde 100644 --- a/lasso/xml/lib_register_name_identifier_request.c +++ b/lasso/xml/lib_register_name_identifier_request.c @@ -202,7 +202,7 @@ lasso_lib_register_name_identifier_request_get_type() * * Return value: a newly created #LassoLibRegisterNameIdentifierRequest object **/ -LassoSamlpRequestAbstract* +LassoNode* lasso_lib_register_name_identifier_request_new() { return g_object_new(LASSO_TYPE_LIB_REGISTER_NAME_IDENTIFIER_REQUEST, NULL); @@ -223,7 +223,7 @@ lasso_lib_register_name_identifier_request_new() * * Return value: a newly created #LassoLibRegisterNameIdentifierRequest object **/ -LassoSamlpRequestAbstract* +LassoNode* lasso_lib_register_name_identifier_request_new_full(const char *providerID, LassoSamlNameIdentifier *idpNameIdentifier, LassoSamlNameIdentifier *spNameIdentifier, @@ -248,5 +248,5 @@ lasso_lib_register_name_identifier_request_new_full(const char *providerID, request->SPProvidedNameIdentifier = spNameIdentifier; request->OldProvidedNameIdentifier = oldNameIdentifier; - return request_base; + return LASSO_NODE(request_base); } diff --git a/lasso/xml/lib_register_name_identifier_request.h b/lasso/xml/lib_register_name_identifier_request.h index e7cc24cf..0918aee5 100644 --- a/lasso/xml/lib_register_name_identifier_request.h +++ b/lasso/xml/lib_register_name_identifier_request.h @@ -76,8 +76,8 @@ struct _LassoLibRegisterNameIdentifierRequestClass { }; LASSO_EXPORT GType lasso_lib_register_name_identifier_request_get_type(void); -LASSO_EXPORT LassoSamlpRequestAbstract* lasso_lib_register_name_identifier_request_new(void); -LASSO_EXPORT LassoSamlpRequestAbstract* lasso_lib_register_name_identifier_request_new_full( +LASSO_EXPORT LassoNode* lasso_lib_register_name_identifier_request_new(void); +LASSO_EXPORT LassoNode* lasso_lib_register_name_identifier_request_new_full( const char *providerID, LassoSamlNameIdentifier *idpNameIdentifier, LassoSamlNameIdentifier *spNameIdentifier, diff --git a/lasso/xml/lib_register_name_identifier_response.c b/lasso/xml/lib_register_name_identifier_response.c index 202a639f..3b4ecaa3 100644 --- a/lasso/xml/lib_register_name_identifier_response.c +++ b/lasso/xml/lib_register_name_identifier_response.c @@ -87,7 +87,7 @@ lasso_lib_register_name_identifier_response_get_type() * * Return value: a newly created #LassoLibRegisterNameIdentifierResponse object **/ -LassoSamlpResponseAbstract* +LassoNode* lasso_lib_register_name_identifier_response_new() { return g_object_new(LASSO_TYPE_LIB_REGISTER_NAME_IDENTIFIER_RESPONSE, NULL); @@ -107,7 +107,7 @@ lasso_lib_register_name_identifier_response_new() * * Return value: a newly created #LassoLibRegisterNameIdentifierResponse object **/ -LassoSamlpResponseAbstract* +LassoNode* lasso_lib_register_name_identifier_response_new_full(const char *providerID, const char *statusCodeValue, LassoLibRegisterNameIdentifierRequest *request, LassoSignatureType sign_type, LassoSignatureMethod sign_method) @@ -129,5 +129,5 @@ lasso_lib_register_name_identifier_response_new_full(const char *providerID, response->Status->StatusCode = lasso_samlp_status_code_new(); response->Status->StatusCode->Value = g_strdup(statusCodeValue); - return LASSO_SAMLP_RESPONSE_ABSTRACT(response); + return LASSO_NODE(response); } diff --git a/lasso/xml/lib_register_name_identifier_response.h b/lasso/xml/lib_register_name_identifier_response.h index 669a635c..eab8aeb0 100644 --- a/lasso/xml/lib_register_name_identifier_response.h +++ b/lasso/xml/lib_register_name_identifier_response.h @@ -61,8 +61,8 @@ struct _LassoLibRegisterNameIdentifierResponseClass { }; LASSO_EXPORT GType lasso_lib_register_name_identifier_response_get_type(void); -LASSO_EXPORT LassoSamlpResponseAbstract* lasso_lib_register_name_identifier_response_new(void); -LASSO_EXPORT LassoSamlpResponseAbstract* lasso_lib_register_name_identifier_response_new_full( +LASSO_EXPORT LassoNode* lasso_lib_register_name_identifier_response_new(void); +LASSO_EXPORT LassoNode* lasso_lib_register_name_identifier_response_new_full( const char *providerID, const char *statusCodeValue, LassoLibRegisterNameIdentifierRequest *request, LassoSignatureType sign_type, LassoSignatureMethod sign_method); diff --git a/lasso/xml/saml-2.0/Makefile.am b/lasso/xml/saml-2.0/Makefile.am new file mode 100644 index 00000000..b2761909 --- /dev/null +++ b/lasso/xml/saml-2.0/Makefile.am @@ -0,0 +1,110 @@ +liblassoincludedir = $(includedir)/lasso/xml/saml-2.0 + +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lasso \ + $(LASSO_CORE_CFLAGS) \ + -DG_LOG_DOMAIN=\"lasso\" + +noinst_LTLIBRARIES = liblasso-xml-saml2.la + +liblasso_xml_saml2_la_SOURCES = \ + saml2_action.c \ + saml2_advice.c \ + saml2_assertion.c \ + saml2_attribute.c \ + saml2_attribute_statement.c \ + saml2_audience_restriction.c \ + saml2_authn_context.c \ + saml2_authn_statement.c \ + saml2_authz_decision_statement.c \ + saml2_base_idabstract.c \ + saml2_condition_abstract.c \ + saml2_conditions.c \ + saml2_encrypted_element.c \ + saml2_evidence.c \ + saml2_key_info_confirmation_data.c \ + saml2_name_id.c \ + saml2_one_time_use.c \ + saml2_proxy_restriction.c \ + saml2_statement_abstract.c \ + saml2_subject.c \ + saml2_subject_confirmation.c \ + saml2_subject_confirmation_data.c \ + saml2_subject_locality.c \ + samlp2_artifact_resolve.c \ + samlp2_artifact_response.c \ + samlp2_assertion_idrequest.c \ + samlp2_attribute_query.c \ + samlp2_authn_query.c \ + samlp2_authn_request.c \ + samlp2_authz_decision_query.c \ + samlp2_extensions.c \ + samlp2_idp_entry.c \ + samlp2_idp_list.c \ + samlp2_logout_request.c \ + samlp2_manage_name_id_request.c \ + samlp2_name_id_mapping_request.c \ + samlp2_name_id_mapping_response.c \ + samlp2_name_id_policy.c \ + samlp2_request_abstract.c \ + samlp2_requested_authn_context.c \ + samlp2_response.c \ + samlp2_scoping.c \ + samlp2_status.c \ + samlp2_status_code.c \ + samlp2_status_detail.c \ + samlp2_status_response.c \ + samlp2_subject_query_abstract.c \ + samlp2_terminate.c + +liblassoinclude_HEADERS = \ + saml2_action.h \ + saml2_advice.h \ + saml2_assertion.h \ + saml2_attribute.h \ + saml2_attribute_statement.h \ + saml2_audience_restriction.h \ + saml2_authn_context.h \ + saml2_authn_statement.h \ + saml2_authz_decision_statement.h \ + saml2_base_idabstract.h \ + saml2_condition_abstract.h \ + saml2_conditions.h \ + saml2_encrypted_element.h \ + saml2_evidence.h \ + saml2_key_info_confirmation_data.h \ + saml2_name_id.h \ + saml2_one_time_use.h \ + saml2_proxy_restriction.h \ + saml2_statement_abstract.h \ + saml2_subject_confirmation_data.h \ + saml2_subject_confirmation.h \ + saml2_subject.h \ + saml2_subject_locality.h \ + samlp2_artifact_resolve.h \ + samlp2_artifact_response.h \ + samlp2_assertion_idrequest.h \ + samlp2_attribute_query.h \ + samlp2_authn_query.h \ + samlp2_authn_request.h \ + samlp2_authz_decision_query.h \ + samlp2_extensions.h \ + samlp2_idp_entry.h \ + samlp2_idp_list.h \ + samlp2_logout_request.h \ + samlp2_manage_name_id_request.h \ + samlp2_name_id_mapping_request.h \ + samlp2_name_id_mapping_response.h \ + samlp2_name_id_policy.h \ + samlp2_request_abstract.h \ + samlp2_requested_authn_context.h \ + samlp2_response.h \ + samlp2_scoping.h \ + samlp2_status_code.h \ + samlp2_status_detail.h \ + samlp2_status.h \ + samlp2_status_response.h \ + samlp2_subject_query_abstract.h \ + samlp2_terminate.h + diff --git a/lasso/xml/saml-2.0/saml2_action.c b/lasso/xml/saml-2.0/saml2_action.c new file mode 100644 index 00000000..551dca03 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_action.c @@ -0,0 +1,132 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_action.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="ActionType"> + * <simpleContent> + * <extension base="string"> + * <attribute name="Namespace" type="anyURI" use="required"/> + * </extension> + * </simpleContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "content", SNIPPET_TEXT_CHILD, + G_STRUCT_OFFSET(LassoSaml2Action, content) }, + { "Namespace", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Action, Namespace) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2Action *node) +{ + node->content = NULL; + node->Namespace = NULL; +} + +static void +class_init(LassoSaml2ActionClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Action"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_action_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2ActionClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2Action), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2Action", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_action_new: + * + * Creates a new #LassoSaml2Action object. + * + * Return value: a newly created #LassoSaml2Action object + **/ +LassoNode* +lasso_saml2_action_new() +{ + return g_object_new(LASSO_TYPE_SAML2_ACTION, NULL); +} + + +/** + * lasso_saml2_action_new_with_string: + * @content: + * + * Creates a new #LassoSaml2Action object and initializes it + * with @content. + * + * Return value: a newly created #LassoSaml2Action object + **/ +LassoNode* +lasso_saml2_action_new_with_string(char *content) +{ + LassoSaml2Action *object; + object = g_object_new(LASSO_TYPE_SAML2_ACTION, NULL); + object->content = g_strdup(content); + return LASSO_NODE(object); +} diff --git a/lasso/xml/saml-2.0/saml2_action.h b/lasso/xml/saml-2.0/saml2_action.h new file mode 100644 index 00000000..1c7a983d --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_action.h @@ -0,0 +1,78 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_ACTION_H__ +#define __LASSO_SAML2_ACTION_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_ACTION (lasso_saml2_action_get_type()) +#define LASSO_SAML2_ACTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_ACTION, \ + LassoSaml2Action)) +#define LASSO_SAML2_ACTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_ACTION, \ + LassoSaml2ActionClass)) +#define LASSO_IS_SAML2_ACTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_ACTION)) +#define LASSO_IS_SAML2_ACTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_ACTION)) +#define LASSO_SAML2_ACTION_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_ACTION, \ + LassoSaml2ActionClass)) + +typedef struct _LassoSaml2Action LassoSaml2Action; +typedef struct _LassoSaml2ActionClass LassoSaml2ActionClass; + + +struct _LassoSaml2Action { + LassoNode parent; + + /*< public >*/ + /* elements */ + char *content; + /* attributes */ + char *Namespace; +}; + + +struct _LassoSaml2ActionClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_action_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_action_new(void); + +LASSO_EXPORT LassoNode* lasso_saml2_action_new_with_string(char *content); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_ACTION_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_advice.c b/lasso/xml/saml-2.0/saml2_advice.c new file mode 100644 index 00000000..a270cda3 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_advice.c @@ -0,0 +1,121 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_advice.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="AdviceType"> + * <choice minOccurs="0" maxOccurs="unbounded"> + * <element ref="saml:AssertionIDRef"/> + * <element ref="saml:AssertionURIRef"/> + * <element ref="saml:Assertion"/> + * <element ref="saml:EncryptedAssertion"/> + * <any namespace="##other" processContents="lax"/> + * </choice> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "AssertionIDRef", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Advice, AssertionIDRef) }, + { "AssertionURIRef", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Advice, AssertionURIRef) }, + { "Assertion", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Advice, Assertion) }, + { "EncryptedAssertion", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Advice, EncryptedAssertion) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2Advice *node) +{ + node->AssertionIDRef = NULL; + node->AssertionURIRef = NULL; + node->Assertion = NULL; + node->EncryptedAssertion = NULL; +} + +static void +class_init(LassoSaml2AdviceClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Advice"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_advice_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2AdviceClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2Advice), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2Advice", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_advice_new: + * + * Creates a new #LassoSaml2Advice object. + * + * Return value: a newly created #LassoSaml2Advice object + **/ +LassoNode* +lasso_saml2_advice_new() +{ + return g_object_new(LASSO_TYPE_SAML2_ADVICE, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_advice.h b/lasso/xml/saml-2.0/saml2_advice.h new file mode 100644 index 00000000..964b5d67 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_advice.h @@ -0,0 +1,84 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_ADVICE_H__ +#define __LASSO_SAML2_ADVICE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#ifndef __LASSO_SAML2_ASSERTION_H__ +/* to avoid circular inclusion of saml2_assertion.h */ +typedef struct _LassoSaml2Assertion LassoSaml2Assertion; +#endif + + +#define LASSO_TYPE_SAML2_ADVICE (lasso_saml2_advice_get_type()) +#define LASSO_SAML2_ADVICE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_ADVICE, \ + LassoSaml2Advice)) +#define LASSO_SAML2_ADVICE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_ADVICE, \ + LassoSaml2AdviceClass)) +#define LASSO_IS_SAML2_ADVICE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_ADVICE)) +#define LASSO_IS_SAML2_ADVICE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_ADVICE)) +#define LASSO_SAML2_ADVICE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_ADVICE, \ + LassoSaml2AdviceClass)) + +typedef struct _LassoSaml2Advice LassoSaml2Advice; +typedef struct _LassoSaml2AdviceClass LassoSaml2AdviceClass; + + +struct _LassoSaml2Advice { + LassoNode parent; + + /*< public >*/ + /* elements */ + GList *AssertionIDRef; + GList *AssertionURIRef; + GList *Assertion; /* of LassoSaml2Assertion */ + GList *EncryptedAssertion; /* of LassoSaml2EncryptedElement */ +}; + + +struct _LassoSaml2AdviceClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_advice_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_advice_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_ADVICE_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_assertion.c b/lasso/xml/saml-2.0/saml2_assertion.c new file mode 100644 index 00000000..1e23a80a --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_assertion.c @@ -0,0 +1,196 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 <xmlsec/xmldsig.h> +#include <xmlsec/templates.h> + +#include "saml2_assertion.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="AssertionType"> + * <sequence> + * <element ref="saml:Issuer"/> + * <element ref="ds:Signature" minOccurs="0"/> + * <element ref="saml:Subject" minOccurs="0"/> + * <element ref="saml:Conditions" minOccurs="0"/> + * <element ref="saml:Advice" minOccurs="0"/> + * <choice minOccurs="0" maxOccurs="unbounded"> + * <element ref="saml:Statement"/> + * <element ref="saml:AuthnStatement"/> + * <element ref="saml:AuthzDecisionStatement"/> + * <element ref="saml:AttributeStatement"/> + * </choice> + * </sequence> + * <attribute name="Version" type="string" use="required"/> + * <attribute name="ID" type="ID" use="required"/> + * <attribute name="IssueInstant" type="dateTime" use="required"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Issuer", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Assertion, Issuer), + "LassoSaml2NameID" }, + { "Subject", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Assertion, Subject) }, + { "Conditions", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Assertion, Conditions) }, + { "Advice", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Assertion, Advice) }, + { "Statement", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Assertion, Statement) }, + { "AuthnStatement", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Assertion, AuthnStatement) }, + { "AuthzDecisionStatement", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Assertion, AuthzDecisionStatement) }, + { "AttributeStatement", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Assertion, AttributeStatement) }, + { "Version", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Assertion, Version) }, + { "ID", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Assertion, ID) }, + { "IssueInstant", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Assertion, IssueInstant) }, + { "Signature", SNIPPET_SIGNATURE, + G_STRUCT_OFFSET(LassoSaml2Assertion, ID) }, + + /* hidden fields; used in lasso dumps */ + { "SignType", SNIPPET_ATTRIBUTE | SNIPPET_INTEGER | SNIPPET_LASSO_DUMP, + G_STRUCT_OFFSET(LassoSaml2Assertion, sign_type) }, + { "SignMethod", SNIPPET_ATTRIBUTE | SNIPPET_INTEGER | SNIPPET_LASSO_DUMP, + G_STRUCT_OFFSET(LassoSaml2Assertion, sign_method) }, + { "PrivateKeyFile", SNIPPET_CONTENT | SNIPPET_LASSO_DUMP, + G_STRUCT_OFFSET(LassoSaml2Assertion, private_key_file) }, + { "CertificateFile", SNIPPET_CONTENT | SNIPPET_LASSO_DUMP, + G_STRUCT_OFFSET(LassoSaml2Assertion, certificate_file) }, + + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + + +static xmlNode* +get_xmlNode(LassoNode *node, gboolean lasso_dump) +{ + LassoSaml2Assertion *request = LASSO_SAML2_ASSERTION(node); + xmlNode *xmlnode; + int rc; + + xmlnode = parent_class->get_xmlNode(node, lasso_dump); + + if (lasso_dump == FALSE && request->sign_type) { + rc = lasso_sign_node(xmlnode, "ID", request->ID, + request->private_key_file, request->certificate_file); + /* signature may have failed; what to do ? */ + } + + return xmlnode; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2Assertion *node) +{ + node->Issuer = NULL; + node->Subject = NULL; + node->Conditions = NULL; + node->Advice = NULL; + node->Statement = NULL; + node->AuthnStatement = NULL; + node->AuthzDecisionStatement = NULL; + node->AttributeStatement = NULL; + node->Version = NULL; + node->ID = NULL; + node->IssueInstant = NULL; + node->sign_type = LASSO_SIGNATURE_TYPE_NONE; +} + +static void +class_init(LassoSaml2AssertionClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->get_xmlNode = get_xmlNode; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Assertion"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); + + nclass->node_data->sign_type_offset = G_STRUCT_OFFSET( + LassoSaml2Assertion, sign_type); + nclass->node_data->sign_method_offset = G_STRUCT_OFFSET( + LassoSaml2Assertion, sign_method); +} + +GType +lasso_saml2_assertion_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2AssertionClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2Assertion), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2Assertion", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_assertion_new: + * + * Creates a new #LassoSaml2Assertion object. + * + * Return value: a newly created #LassoSaml2Assertion object + **/ +LassoNode* +lasso_saml2_assertion_new() +{ + return g_object_new(LASSO_TYPE_SAML2_ASSERTION, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_assertion.h b/lasso/xml/saml-2.0/saml2_assertion.h new file mode 100644 index 00000000..080a726a --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_assertion.h @@ -0,0 +1,96 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_ASSERTION_H__ +#define __LASSO_SAML2_ASSERTION_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#define LASSO_TYPE_SAML2_ASSERTION (lasso_saml2_assertion_get_type()) +#define LASSO_SAML2_ASSERTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_ASSERTION, \ + LassoSaml2Assertion)) +#define LASSO_SAML2_ASSERTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_ASSERTION, \ + LassoSaml2AssertionClass)) +#define LASSO_IS_SAML2_ASSERTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_ASSERTION)) +#define LASSO_IS_SAML2_ASSERTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_ASSERTION)) +#define LASSO_SAML2_ASSERTION_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_ASSERTION, \ + LassoSaml2AssertionClass)) + +typedef struct _LassoSaml2Assertion LassoSaml2Assertion; +typedef struct _LassoSaml2AssertionClass LassoSaml2AssertionClass; + +#include "saml2_advice.h" +#include "saml2_conditions.h" +#include "saml2_subject.h" +#include "saml2_name_id.h" + +struct _LassoSaml2Assertion { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSaml2NameID *Issuer; + LassoSaml2Subject *Subject; + LassoSaml2Conditions *Conditions; + LassoSaml2Advice *Advice; + GList *Statement; /* of LassoSaml2StatementAbstract */ + GList *AuthnStatement; /* of LassoSaml2AuthnStatement */ + GList *AuthzDecisionStatement; /* of LassoSaml2AuthzDecisionStatement */ + GList *AttributeStatement; /* of LassoSaml2AttributeStatement */ + /* attributes */ + char *Version; + char *ID; + char *IssueInstant; + /*< private >*/ + /* ds:Signature stuffs */ + LassoSignatureType sign_type; + LassoSignatureMethod sign_method; + char *private_key_file; + char *certificate_file; + +}; + + +struct _LassoSaml2AssertionClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_assertion_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_assertion_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_ASSERTION_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_attribute.c b/lasso/xml/saml-2.0/saml2_attribute.c new file mode 100644 index 00000000..a43fe638 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_attribute.c @@ -0,0 +1,121 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_attribute.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="AttributeType"> + * <sequence> + * <element ref="saml:AttributeValue" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * <attribute name="Name" type="string" use="required"/> + * <attribute name="NameFormat" type="anyURI" use="optional"/> + * <attribute name="FriendlyName" type="string" use="optional"/> + * <anyAttribute namespace="##other" processContents="lax"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "AttributeValue", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Attribute, AttributeValue) }, + { "Name", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Attribute, Name) }, + { "NameFormat", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Attribute, NameFormat) }, + { "FriendlyName", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Attribute, FriendlyName) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2Attribute *node) +{ + node->AttributeValue = NULL; + node->Name = NULL; + node->NameFormat = NULL; + node->FriendlyName = NULL; +} + +static void +class_init(LassoSaml2AttributeClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Attribute"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_attribute_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2AttributeClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2Attribute), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2Attribute", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_attribute_new: + * + * Creates a new #LassoSaml2Attribute object. + * + * Return value: a newly created #LassoSaml2Attribute object + **/ +LassoNode* +lasso_saml2_attribute_new() +{ + return g_object_new(LASSO_TYPE_SAML2_ATTRIBUTE, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_attribute.h b/lasso/xml/saml-2.0/saml2_attribute.h new file mode 100644 index 00000000..3b2dcbb9 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_attribute.h @@ -0,0 +1,79 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_ATTRIBUTE_H__ +#define __LASSO_SAML2_ATTRIBUTE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_ATTRIBUTE (lasso_saml2_attribute_get_type()) +#define LASSO_SAML2_ATTRIBUTE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_ATTRIBUTE, \ + LassoSaml2Attribute)) +#define LASSO_SAML2_ATTRIBUTE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_ATTRIBUTE, \ + LassoSaml2AttributeClass)) +#define LASSO_IS_SAML2_ATTRIBUTE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_ATTRIBUTE)) +#define LASSO_IS_SAML2_ATTRIBUTE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_ATTRIBUTE)) +#define LASSO_SAML2_ATTRIBUTE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_ATTRIBUTE, \ + LassoSaml2AttributeClass)) + +typedef struct _LassoSaml2Attribute LassoSaml2Attribute; +typedef struct _LassoSaml2AttributeClass LassoSaml2AttributeClass; + + +struct _LassoSaml2Attribute { + LassoNode parent; + + /*< public >*/ + /* elements */ + /* XXX */ void *AttributeValue; + /* attributes */ + char *Name; + char *NameFormat; + char *FriendlyName; +}; + + +struct _LassoSaml2AttributeClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_attribute_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_attribute_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_ATTRIBUTE_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_attribute_statement.c b/lasso/xml/saml-2.0/saml2_attribute_statement.c new file mode 100644 index 00000000..4b1ee3fc --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_attribute_statement.c @@ -0,0 +1,116 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_attribute_statement.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="AttributeStatementType"> + * <complexContent> + * <extension base="saml:StatementAbstractType"> + * <choice maxOccurs="unbounded"> + * <element ref="saml:Attribute"/> + * <element ref="saml:EncryptedAttribute"/> + * </choice> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Attribute", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2AttributeStatement, Attribute) }, + { "EncryptedAttribute", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2AttributeStatement, EncryptedAttribute) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2AttributeStatement *node) +{ + node->Attribute = NULL; + node->EncryptedAttribute = NULL; +} + +static void +class_init(LassoSaml2AttributeStatementClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AttributeStatement"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_attribute_statement_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2AttributeStatementClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2AttributeStatement), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAML2_STATEMENT_ABSTRACT, + "LassoSaml2AttributeStatement", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_attribute_statement_new: + * + * Creates a new #LassoSaml2AttributeStatement object. + * + * Return value: a newly created #LassoSaml2AttributeStatement object + **/ +LassoNode* +lasso_saml2_attribute_statement_new() +{ + return g_object_new(LASSO_TYPE_SAML2_ATTRIBUTE_STATEMENT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_attribute_statement.h b/lasso/xml/saml-2.0/saml2_attribute_statement.h new file mode 100644 index 00000000..5d2ed65b --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_attribute_statement.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_ATTRIBUTE_STATEMENT_H__ +#define __LASSO_SAML2_ATTRIBUTE_STATEMENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_statement_abstract.h" + +#define LASSO_TYPE_SAML2_ATTRIBUTE_STATEMENT (lasso_saml2_attribute_statement_get_type()) +#define LASSO_SAML2_ATTRIBUTE_STATEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_ATTRIBUTE_STATEMENT, \ + LassoSaml2AttributeStatement)) +#define LASSO_SAML2_ATTRIBUTE_STATEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_ATTRIBUTE_STATEMENT, \ + LassoSaml2AttributeStatementClass)) +#define LASSO_IS_SAML2_ATTRIBUTE_STATEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_ATTRIBUTE_STATEMENT)) +#define LASSO_IS_SAML2_ATTRIBUTE_STATEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_ATTRIBUTE_STATEMENT)) +#define LASSO_SAML2_ATTRIBUTE_STATEMENT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_ATTRIBUTE_STATEMENT, \ + LassoSaml2AttributeStatementClass)) + +typedef struct _LassoSaml2AttributeStatement LassoSaml2AttributeStatement; +typedef struct _LassoSaml2AttributeStatementClass LassoSaml2AttributeStatementClass; + + +struct _LassoSaml2AttributeStatement { + LassoSaml2StatementAbstract parent; + + /*< public >*/ + /* elements */ + GList *Attribute; /* of LassoSaml2Attribute */ + GList *EncryptedAttribute; /* of LassoSaml2EncryptedElement */ +}; + + +struct _LassoSaml2AttributeStatementClass { + LassoSaml2StatementAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_attribute_statement_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_attribute_statement_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_ATTRIBUTE_STATEMENT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_audience_restriction.c b/lasso/xml/saml-2.0/saml2_audience_restriction.c new file mode 100644 index 00000000..4aa30ae8 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_audience_restriction.c @@ -0,0 +1,112 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_audience_restriction.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="AudienceRestrictionType"> + * <complexContent> + * <extension base="saml:ConditionAbstractType"> + * <sequence> + * <element ref="saml:Audience" maxOccurs="unbounded"/> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Audience", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSaml2AudienceRestriction, Audience) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2AudienceRestriction *node) +{ + node->Audience = NULL; +} + +static void +class_init(LassoSaml2AudienceRestrictionClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AudienceRestriction"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_audience_restriction_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2AudienceRestrictionClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2AudienceRestriction), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAML2_CONDITION_ABSTRACT, + "LassoSaml2AudienceRestriction", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_audience_restriction_new: + * + * Creates a new #LassoSaml2AudienceRestriction object. + * + * Return value: a newly created #LassoSaml2AudienceRestriction object + **/ +LassoNode* +lasso_saml2_audience_restriction_new() +{ + return g_object_new(LASSO_TYPE_SAML2_AUDIENCE_RESTRICTION, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_audience_restriction.h b/lasso/xml/saml-2.0/saml2_audience_restriction.h new file mode 100644 index 00000000..e100d833 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_audience_restriction.h @@ -0,0 +1,75 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_AUDIENCE_RESTRICTION_H__ +#define __LASSO_SAML2_AUDIENCE_RESTRICTION_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_condition_abstract.h" + +#define LASSO_TYPE_SAML2_AUDIENCE_RESTRICTION (lasso_saml2_audience_restriction_get_type()) +#define LASSO_SAML2_AUDIENCE_RESTRICTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_AUDIENCE_RESTRICTION, \ + LassoSaml2AudienceRestriction)) +#define LASSO_SAML2_AUDIENCE_RESTRICTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_AUDIENCE_RESTRICTION, \ + LassoSaml2AudienceRestrictionClass)) +#define LASSO_IS_SAML2_AUDIENCE_RESTRICTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_AUDIENCE_RESTRICTION)) +#define LASSO_IS_SAML2_AUDIENCE_RESTRICTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_AUDIENCE_RESTRICTION)) +#define LASSO_SAML2_AUDIENCE_RESTRICTION_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_AUDIENCE_RESTRICTION, \ + LassoSaml2AudienceRestrictionClass)) + +typedef struct _LassoSaml2AudienceRestriction LassoSaml2AudienceRestriction; +typedef struct _LassoSaml2AudienceRestrictionClass LassoSaml2AudienceRestrictionClass; + + +struct _LassoSaml2AudienceRestriction { + LassoSaml2ConditionAbstract parent; + + /*< public >*/ + /* elements */ + char *Audience; +}; + + +struct _LassoSaml2AudienceRestrictionClass { + LassoSaml2ConditionAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_audience_restriction_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_audience_restriction_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_AUDIENCE_RESTRICTION_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_authn_context.c b/lasso/xml/saml-2.0/saml2_authn_context.c new file mode 100644 index 00000000..0c903f68 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_authn_context.c @@ -0,0 +1,130 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_authn_context.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="AuthnContextType"> + * <sequence> + * <choice> + * <sequence> + * <element ref="saml:AuthnContextClassRef"/> + * <choice minOccurs="0"> + * <element ref="saml:AuthnContextDecl"/> + * <element ref="saml:AuthnContextDeclRef"/> + * </choice> + * </sequence> + * <choice> + * <element ref="saml:AuthnContextDecl"/> + * <element ref="saml:AuthnContextDeclRef"/> + * </choice> + * </choice> + * <element ref="saml:AuthenticatingAuthority" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "AuthnContextClassRef", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSaml2AuthnContext, AuthnContextClassRef) }, + { "AuthnContextDecl", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2AuthnContext, AuthnContextDecl) }, + { "AuthnContextDeclRef", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSaml2AuthnContext, AuthnContextDeclRef) }, + { "AuthenticatingAuthority", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSaml2AuthnContext, AuthenticatingAuthority) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2AuthnContext *node) +{ + node->AuthnContextClassRef = NULL; + node->AuthnContextDecl = NULL; + node->AuthnContextDeclRef = NULL; + node->AuthenticatingAuthority = NULL; +} + +static void +class_init(LassoSaml2AuthnContextClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AuthnContext"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_authn_context_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2AuthnContextClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2AuthnContext), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2AuthnContext", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_authn_context_new: + * + * Creates a new #LassoSaml2AuthnContext object. + * + * Return value: a newly created #LassoSaml2AuthnContext object + **/ +LassoNode* +lasso_saml2_authn_context_new() +{ + return g_object_new(LASSO_TYPE_SAML2_AUTHN_CONTEXT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_authn_context.h b/lasso/xml/saml-2.0/saml2_authn_context.h new file mode 100644 index 00000000..e1490c1f --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_authn_context.h @@ -0,0 +1,78 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_AUTHN_CONTEXT_H__ +#define __LASSO_SAML2_AUTHN_CONTEXT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_AUTHN_CONTEXT (lasso_saml2_authn_context_get_type()) +#define LASSO_SAML2_AUTHN_CONTEXT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_AUTHN_CONTEXT, \ + LassoSaml2AuthnContext)) +#define LASSO_SAML2_AUTHN_CONTEXT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_AUTHN_CONTEXT, \ + LassoSaml2AuthnContextClass)) +#define LASSO_IS_SAML2_AUTHN_CONTEXT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_AUTHN_CONTEXT)) +#define LASSO_IS_SAML2_AUTHN_CONTEXT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_AUTHN_CONTEXT)) +#define LASSO_SAML2_AUTHN_CONTEXT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_AUTHN_CONTEXT, \ + LassoSaml2AuthnContextClass)) + +typedef struct _LassoSaml2AuthnContext LassoSaml2AuthnContext; +typedef struct _LassoSaml2AuthnContextClass LassoSaml2AuthnContextClass; + + +struct _LassoSaml2AuthnContext { + LassoNode parent; + + /*< public >*/ + /* elements */ + char *AuthnContextClassRef; + /* XXX */ void *AuthnContextDecl; + char *AuthnContextDeclRef; + char *AuthenticatingAuthority; +}; + + +struct _LassoSaml2AuthnContextClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_authn_context_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_authn_context_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_AUTHN_CONTEXT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_authn_statement.c b/lasso/xml/saml-2.0/saml2_authn_statement.c new file mode 100644 index 00000000..f95ebc78 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_authn_statement.c @@ -0,0 +1,128 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_authn_statement.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="AuthnStatementType"> + * <complexContent> + * <extension base="saml:StatementAbstractType"> + * <sequence> + * <element ref="saml:SubjectLocality" minOccurs="0"/> + * <element ref="saml:AuthnContext"/> + * </sequence> + * <attribute name="AuthnInstant" type="dateTime" use="required"/> + * <attribute name="SessionIndex" type="string" use="optional"/> + * <attribute name="SessionNotOnOrAfter" type="dateTime" use="optional"/> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "SubjectLocality", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2AuthnStatement, SubjectLocality) }, + { "AuthnContext", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2AuthnStatement, AuthnContext) }, + { "AuthnInstant", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2AuthnStatement, AuthnInstant) }, + { "SessionIndex", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2AuthnStatement, SessionIndex) }, + { "SessionNotOnOrAfter", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2AuthnStatement, SessionNotOnOrAfter) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2AuthnStatement *node) +{ + node->SubjectLocality = NULL; + node->AuthnContext = NULL; + node->AuthnInstant = NULL; + node->SessionIndex = NULL; + node->SessionNotOnOrAfter = NULL; +} + +static void +class_init(LassoSaml2AuthnStatementClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AuthnStatement"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_authn_statement_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2AuthnStatementClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2AuthnStatement), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAML2_STATEMENT_ABSTRACT, + "LassoSaml2AuthnStatement", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_authn_statement_new: + * + * Creates a new #LassoSaml2AuthnStatement object. + * + * Return value: a newly created #LassoSaml2AuthnStatement object + **/ +LassoNode* +lasso_saml2_authn_statement_new() +{ + return g_object_new(LASSO_TYPE_SAML2_AUTHN_STATEMENT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_authn_statement.h b/lasso/xml/saml-2.0/saml2_authn_statement.h new file mode 100644 index 00000000..6fcd11b8 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_authn_statement.h @@ -0,0 +1,82 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_AUTHN_STATEMENT_H__ +#define __LASSO_SAML2_AUTHN_STATEMENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_subject_locality.h" +#include "saml2_authn_context.h" +#include "saml2_statement_abstract.h" + +#define LASSO_TYPE_SAML2_AUTHN_STATEMENT (lasso_saml2_authn_statement_get_type()) +#define LASSO_SAML2_AUTHN_STATEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_AUTHN_STATEMENT, \ + LassoSaml2AuthnStatement)) +#define LASSO_SAML2_AUTHN_STATEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_AUTHN_STATEMENT, \ + LassoSaml2AuthnStatementClass)) +#define LASSO_IS_SAML2_AUTHN_STATEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_AUTHN_STATEMENT)) +#define LASSO_IS_SAML2_AUTHN_STATEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_AUTHN_STATEMENT)) +#define LASSO_SAML2_AUTHN_STATEMENT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_AUTHN_STATEMENT, \ + LassoSaml2AuthnStatementClass)) + +typedef struct _LassoSaml2AuthnStatement LassoSaml2AuthnStatement; +typedef struct _LassoSaml2AuthnStatementClass LassoSaml2AuthnStatementClass; + + +struct _LassoSaml2AuthnStatement { + LassoSaml2StatementAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2SubjectLocality *SubjectLocality; + LassoSaml2AuthnContext *AuthnContext; + /* attributes */ + char *AuthnInstant; + char *SessionIndex; + char *SessionNotOnOrAfter; +}; + + +struct _LassoSaml2AuthnStatementClass { + LassoSaml2StatementAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_authn_statement_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_authn_statement_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_AUTHN_STATEMENT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_authz_decision_statement.c b/lasso/xml/saml-2.0/saml2_authz_decision_statement.c new file mode 100644 index 00000000..e728500f --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_authz_decision_statement.c @@ -0,0 +1,123 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_authz_decision_statement.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="AuthzDecisionStatementType"> + * <complexContent> + * <extension base="saml:StatementAbstractType"> + * <sequence> + * <element ref="saml:Action" maxOccurs="unbounded"/> + * <element ref="saml:Evidence" minOccurs="0"/> + * </sequence> + * <attribute name="Resource" type="anyURI" use="required"/> + * <attribute name="Decision" type="saml:DecisionType" use="required"/> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Action", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2AuthzDecisionStatement, Action) }, + { "Evidence", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2AuthzDecisionStatement, Evidence) }, + { "Resource", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2AuthzDecisionStatement, Resource) }, + { "Decision", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2AuthzDecisionStatement, Decision) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2AuthzDecisionStatement *node) +{ + node->Action = NULL; + node->Evidence = NULL; + node->Resource = NULL; +} + +static void +class_init(LassoSaml2AuthzDecisionStatementClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AuthzDecisionStatement"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_authz_decision_statement_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2AuthzDecisionStatementClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2AuthzDecisionStatement), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAML2_STATEMENT_ABSTRACT, + "LassoSaml2AuthzDecisionStatement", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_authz_decision_statement_new: + * + * Creates a new #LassoSaml2AuthzDecisionStatement object. + * + * Return value: a newly created #LassoSaml2AuthzDecisionStatement object + **/ +LassoNode* +lasso_saml2_authz_decision_statement_new() +{ + return g_object_new(LASSO_TYPE_SAML2_AUTHZ_DECISION_STATEMENT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_authz_decision_statement.h b/lasso/xml/saml-2.0/saml2_authz_decision_statement.h new file mode 100644 index 00000000..67fc8195 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_authz_decision_statement.h @@ -0,0 +1,81 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_AUTHZ_DECISION_STATEMENT_H__ +#define __LASSO_SAML2_AUTHZ_DECISION_STATEMENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_action.h" +#include "saml2_evidence.h" +#include "saml2_statement_abstract.h" + +#define LASSO_TYPE_SAML2_AUTHZ_DECISION_STATEMENT (lasso_saml2_authz_decision_statement_get_type()) +#define LASSO_SAML2_AUTHZ_DECISION_STATEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_AUTHZ_DECISION_STATEMENT, \ + LassoSaml2AuthzDecisionStatement)) +#define LASSO_SAML2_AUTHZ_DECISION_STATEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_AUTHZ_DECISION_STATEMENT, \ + LassoSaml2AuthzDecisionStatementClass)) +#define LASSO_IS_SAML2_AUTHZ_DECISION_STATEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_AUTHZ_DECISION_STATEMENT)) +#define LASSO_IS_SAML2_AUTHZ_DECISION_STATEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_AUTHZ_DECISION_STATEMENT)) +#define LASSO_SAML2_AUTHZ_DECISION_STATEMENT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_AUTHZ_DECISION_STATEMENT, \ + LassoSaml2AuthzDecisionStatementClass)) + +typedef struct _LassoSaml2AuthzDecisionStatement LassoSaml2AuthzDecisionStatement; +typedef struct _LassoSaml2AuthzDecisionStatementClass LassoSaml2AuthzDecisionStatementClass; + + +struct _LassoSaml2AuthzDecisionStatement { + LassoSaml2StatementAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2Action *Action; + LassoSaml2Evidence *Evidence; + /* attributes */ + char *Resource; + char *Decision; +}; + + +struct _LassoSaml2AuthzDecisionStatementClass { + LassoSaml2StatementAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_authz_decision_statement_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_authz_decision_statement_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_AUTHZ_DECISION_STATEMENT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_base_idabstract.c b/lasso/xml/saml-2.0/saml2_base_idabstract.c new file mode 100644 index 00000000..95f4c16e --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_base_idabstract.c @@ -0,0 +1,109 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_base_idabstract.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="BaseIDAbstractType" abstract="true"> + * <attributeGroup ref="saml:IDNameQualifiers"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "NameQualifier", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2BaseIDAbstract, NameQualifier) }, + { "SPNameQualifier", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2BaseIDAbstract, SPNameQualifier) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2BaseIDAbstract *node) +{ + node->NameQualifier = NULL; + node->SPNameQualifier = NULL; +} + +static void +class_init(LassoSaml2BaseIDAbstractClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "BaseIDAbstract"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_base_idabstract_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2BaseIDAbstractClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2BaseIDAbstract), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2BaseIDAbstract", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_base_idabstract_new: + * + * Creates a new #LassoSaml2BaseIDAbstract object. + * + * Return value: a newly created #LassoSaml2BaseIDAbstract object + **/ +LassoNode* +lasso_saml2_base_idabstract_new() +{ + return g_object_new(LASSO_TYPE_SAML2_BASE_IDABSTRACT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_base_idabstract.h b/lasso/xml/saml-2.0/saml2_base_idabstract.h new file mode 100644 index 00000000..3934505d --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_base_idabstract.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_BASE_IDABSTRACT_H__ +#define __LASSO_SAML2_BASE_IDABSTRACT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_BASE_IDABSTRACT (lasso_saml2_base_idabstract_get_type()) +#define LASSO_SAML2_BASE_IDABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_BASE_IDABSTRACT, \ + LassoSaml2BaseIDAbstract)) +#define LASSO_SAML2_BASE_IDABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_BASE_IDABSTRACT, \ + LassoSaml2BaseIDAbstractClass)) +#define LASSO_IS_SAML2_BASE_IDABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_BASE_IDABSTRACT)) +#define LASSO_IS_SAML2_BASE_IDABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_BASE_IDABSTRACT)) +#define LASSO_SAML2_BASE_IDABSTRACT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_BASE_IDABSTRACT, \ + LassoSaml2BaseIDAbstractClass)) + +typedef struct _LassoSaml2BaseIDAbstract LassoSaml2BaseIDAbstract; +typedef struct _LassoSaml2BaseIDAbstractClass LassoSaml2BaseIDAbstractClass; + + +struct _LassoSaml2BaseIDAbstract { + LassoNode parent; + + /*< public >*/ + /* attributes */ + char *NameQualifier; + char *SPNameQualifier; +}; + + +struct _LassoSaml2BaseIDAbstractClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_base_idabstract_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_base_idabstract_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_BASE_IDABSTRACT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_condition_abstract.c b/lasso/xml/saml-2.0/saml2_condition_abstract.c new file mode 100644 index 00000000..aba22eb2 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_condition_abstract.c @@ -0,0 +1,111 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_condition_abstract.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="ConditionAbstractType" abstract="true"/> + * <element name="AudienceRestriction" type="saml:AudienceRestrictionType"/> + * <complexType name="AudienceRestrictionType"> + * <complexContent> + * <extension base="saml:ConditionAbstractType"> + * <sequence> + * <element ref="saml:Audience" maxOccurs="unbounded"/> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2ConditionAbstract *node) +{ +} + +static void +class_init(LassoSaml2ConditionAbstractClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "ConditionAbstract"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_condition_abstract_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2ConditionAbstractClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2ConditionAbstract), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2ConditionAbstract", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_condition_abstract_new: + * + * Creates a new #LassoSaml2ConditionAbstract object. + * + * Return value: a newly created #LassoSaml2ConditionAbstract object + **/ +LassoNode* +lasso_saml2_condition_abstract_new() +{ + return g_object_new(LASSO_TYPE_SAML2_CONDITION_ABSTRACT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_condition_abstract.h b/lasso/xml/saml-2.0/saml2_condition_abstract.h new file mode 100644 index 00000000..5b204b96 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_condition_abstract.h @@ -0,0 +1,73 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_CONDITION_ABSTRACT_H__ +#define __LASSO_SAML2_CONDITION_ABSTRACT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_CONDITION_ABSTRACT (lasso_saml2_condition_abstract_get_type()) +#define LASSO_SAML2_CONDITION_ABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_CONDITION_ABSTRACT, \ + LassoSaml2ConditionAbstract)) +#define LASSO_SAML2_CONDITION_ABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_CONDITION_ABSTRACT, \ + LassoSaml2ConditionAbstractClass)) +#define LASSO_IS_SAML2_CONDITION_ABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_CONDITION_ABSTRACT)) +#define LASSO_IS_SAML2_CONDITION_ABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_CONDITION_ABSTRACT)) +#define LASSO_SAML2_CONDITION_ABSTRACT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_CONDITION_ABSTRACT, \ + LassoSaml2ConditionAbstractClass)) + +typedef struct _LassoSaml2ConditionAbstract LassoSaml2ConditionAbstract; +typedef struct _LassoSaml2ConditionAbstractClass LassoSaml2ConditionAbstractClass; + + +struct _LassoSaml2ConditionAbstract { + LassoNode parent; + + /*< public >*/ +}; + + +struct _LassoSaml2ConditionAbstractClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_condition_abstract_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_condition_abstract_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_CONDITION_ABSTRACT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_conditions.c b/lasso/xml/saml-2.0/saml2_conditions.c new file mode 100644 index 00000000..9b851a39 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_conditions.c @@ -0,0 +1,128 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_conditions.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="ConditionsType"> + * <choice minOccurs="0" maxOccurs="unbounded"> + * <element ref="saml:Condition"/> + * <element ref="saml:AudienceRestriction"/> + * <element ref="saml:OneTimeUse"/> + * <element ref="saml:ProxyRestriction"/> + * </choice> + * <attribute name="NotBefore" type="dateTime" use="optional"/> + * <attribute name="NotOnOrAfter" type="dateTime" use="optional"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Condition", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Conditions, Condition) }, + { "AudienceRestriction", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Conditions, AudienceRestriction) }, + { "OneTimeUse", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Conditions, OneTimeUse) }, + { "ProxyRestriction", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Conditions, ProxyRestriction) }, + { "NotBefore", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Conditions, NotBefore) }, + { "NotOnOrAfter", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2Conditions, NotOnOrAfter) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2Conditions *node) +{ + node->Condition = NULL; + node->AudienceRestriction = NULL; + node->OneTimeUse = NULL; + node->ProxyRestriction = NULL; + node->NotBefore = NULL; + node->NotOnOrAfter = NULL; +} + +static void +class_init(LassoSaml2ConditionsClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Conditions"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_conditions_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2ConditionsClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2Conditions), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2Conditions", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_conditions_new: + * + * Creates a new #LassoSaml2Conditions object. + * + * Return value: a newly created #LassoSaml2Conditions object + **/ +LassoNode* +lasso_saml2_conditions_new() +{ + return g_object_new(LASSO_TYPE_SAML2_CONDITIONS, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_conditions.h b/lasso/xml/saml-2.0/saml2_conditions.h new file mode 100644 index 00000000..05248f33 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_conditions.h @@ -0,0 +1,81 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_CONDITIONS_H__ +#define __LASSO_SAML2_CONDITIONS_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_CONDITIONS (lasso_saml2_conditions_get_type()) +#define LASSO_SAML2_CONDITIONS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_CONDITIONS, \ + LassoSaml2Conditions)) +#define LASSO_SAML2_CONDITIONS_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_CONDITIONS, \ + LassoSaml2ConditionsClass)) +#define LASSO_IS_SAML2_CONDITIONS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_CONDITIONS)) +#define LASSO_IS_SAML2_CONDITIONS_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_CONDITIONS)) +#define LASSO_SAML2_CONDITIONS_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_CONDITIONS, \ + LassoSaml2ConditionsClass)) + +typedef struct _LassoSaml2Conditions LassoSaml2Conditions; +typedef struct _LassoSaml2ConditionsClass LassoSaml2ConditionsClass; + + +struct _LassoSaml2Conditions { + LassoNode parent; + + /*< public >*/ + /* elements */ + GList *Condition; /* of LassoSaml2ConditionAbstract */ + GList *AudienceRestriction; /* of LassoSaml2AudienceRestriction */ + GList *OneTimeUse; /* of LassoSaml2OneTimeUse */ + GList *ProxyRestriction; /* of LassoSaml2ProxyRestriction */ + /* attributes */ + char *NotBefore; + char *NotOnOrAfter; +}; + + +struct _LassoSaml2ConditionsClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_conditions_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_conditions_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_CONDITIONS_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_encrypted_element.c b/lasso/xml/saml-2.0/saml2_encrypted_element.c new file mode 100644 index 00000000..84b69923 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_encrypted_element.c @@ -0,0 +1,112 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_encrypted_element.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="EncryptedElementType"> + * <sequence> + * <element ref="xenc:EncryptedData"/> + * <element ref="xenc:EncryptedKey" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "EncryptedData", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2EncryptedElement, EncryptedData) }, + { "EncryptedKey", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2EncryptedElement, EncryptedKey) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2EncryptedElement *node) +{ + node->EncryptedData = NULL; + node->EncryptedKey = NULL; +} + +static void +class_init(LassoSaml2EncryptedElementClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "EncryptedElement"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_encrypted_element_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2EncryptedElementClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2EncryptedElement), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2EncryptedElement", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_encrypted_element_new: + * + * Creates a new #LassoSaml2EncryptedElement object. + * + * Return value: a newly created #LassoSaml2EncryptedElement object + **/ +LassoNode* +lasso_saml2_encrypted_element_new() +{ + return g_object_new(LASSO_TYPE_SAML2_ENCRYPTED_ELEMENT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_encrypted_element.h b/lasso/xml/saml-2.0/saml2_encrypted_element.h new file mode 100644 index 00000000..8ef58871 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_encrypted_element.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_ENCRYPTED_ELEMENT_H__ +#define __LASSO_SAML2_ENCRYPTED_ELEMENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_ENCRYPTED_ELEMENT (lasso_saml2_encrypted_element_get_type()) +#define LASSO_SAML2_ENCRYPTED_ELEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_ENCRYPTED_ELEMENT, \ + LassoSaml2EncryptedElement)) +#define LASSO_SAML2_ENCRYPTED_ELEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_ENCRYPTED_ELEMENT, \ + LassoSaml2EncryptedElementClass)) +#define LASSO_IS_SAML2_ENCRYPTED_ELEMENT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_ENCRYPTED_ELEMENT)) +#define LASSO_IS_SAML2_ENCRYPTED_ELEMENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_ENCRYPTED_ELEMENT)) +#define LASSO_SAML2_ENCRYPTED_ELEMENT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_ENCRYPTED_ELEMENT, \ + LassoSaml2EncryptedElementClass)) + +typedef struct _LassoSaml2EncryptedElement LassoSaml2EncryptedElement; +typedef struct _LassoSaml2EncryptedElementClass LassoSaml2EncryptedElementClass; + + +struct _LassoSaml2EncryptedElement { + LassoNode parent; + + /*< public >*/ + /* elements */ + /* XXX */ void *EncryptedData; + /* XXX */ void *EncryptedKey; +}; + + +struct _LassoSaml2EncryptedElementClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_encrypted_element_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_encrypted_element_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_ENCRYPTED_ELEMENT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_evidence.c b/lasso/xml/saml-2.0/saml2_evidence.c new file mode 100644 index 00000000..9b3bd18d --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_evidence.c @@ -0,0 +1,120 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_evidence.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="EvidenceType"> + * <choice maxOccurs="unbounded"> + * <element ref="saml:AssertionIDRef"/> + * <element ref="saml:AssertionURIRef"/> + * <element ref="saml:Assertion"/> + * <element ref="saml:EncryptedAssertion"/> + * </choice> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "AssertionIDRef", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Evidence, AssertionIDRef) }, + { "AssertionURIRef", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Evidence, AssertionURIRef) }, + { "Assertion", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Evidence, Assertion) }, + { "EncryptedAssertion", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSaml2Evidence, EncryptedAssertion) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2Evidence *node) +{ + node->AssertionIDRef = NULL; + node->AssertionURIRef = NULL; + node->Assertion = NULL; + node->EncryptedAssertion = NULL; +} + +static void +class_init(LassoSaml2EvidenceClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Evidence"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_evidence_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2EvidenceClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2Evidence), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2Evidence", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_evidence_new: + * + * Creates a new #LassoSaml2Evidence object. + * + * Return value: a newly created #LassoSaml2Evidence object + **/ +LassoNode* +lasso_saml2_evidence_new() +{ + return g_object_new(LASSO_TYPE_SAML2_EVIDENCE, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_evidence.h b/lasso/xml/saml-2.0/saml2_evidence.h new file mode 100644 index 00000000..d4aaef16 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_evidence.h @@ -0,0 +1,84 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_EVIDENCE_H__ +#define __LASSO_SAML2_EVIDENCE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#ifndef __LASSO_SAML2_ASSERTION_H__ +/* to avoid circular inclusion of saml2_assertion.h */ +typedef struct _LassoSaml2Assertion LassoSaml2Assertion; +#endif + + +#define LASSO_TYPE_SAML2_EVIDENCE (lasso_saml2_evidence_get_type()) +#define LASSO_SAML2_EVIDENCE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_EVIDENCE, \ + LassoSaml2Evidence)) +#define LASSO_SAML2_EVIDENCE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_EVIDENCE, \ + LassoSaml2EvidenceClass)) +#define LASSO_IS_SAML2_EVIDENCE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_EVIDENCE)) +#define LASSO_IS_SAML2_EVIDENCE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_EVIDENCE)) +#define LASSO_SAML2_EVIDENCE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_EVIDENCE, \ + LassoSaml2EvidenceClass)) + +typedef struct _LassoSaml2Evidence LassoSaml2Evidence; +typedef struct _LassoSaml2EvidenceClass LassoSaml2EvidenceClass; + + +struct _LassoSaml2Evidence { + LassoNode parent; + + /*< public >*/ + /* elements */ + GList *AssertionIDRef; + GList *AssertionURIRef; + GList *Assertion; /* of LassoSaml2Assertion */ + GList *EncryptedAssertion; /* of LassoSaml2EncryptedElement */ +}; + + +struct _LassoSaml2EvidenceClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_evidence_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_evidence_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_EVIDENCE_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_key_info_confirmation_data.c b/lasso/xml/saml-2.0/saml2_key_info_confirmation_data.c new file mode 100644 index 00000000..47d4866a --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_key_info_confirmation_data.c @@ -0,0 +1,112 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_key_info_confirmation_data.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="KeyInfoConfirmationDataType" mixed="false"> + * <complexContent> + * <restriction base="saml:SubjectConfirmationDataType"> + * <sequence> + * <element ref="ds:KeyInfo" maxOccurs="unbounded"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "KeyInfo", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2KeyInfoConfirmationData, KeyInfo) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2KeyInfoConfirmationData *node) +{ + node->KeyInfo = NULL; +} + +static void +class_init(LassoSaml2KeyInfoConfirmationDataClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "KeyInfoConfirmationData"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_key_info_confirmation_data_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2KeyInfoConfirmationDataClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2KeyInfoConfirmationData), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2KeyInfoConfirmationData", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_key_info_confirmation_data_new: + * + * Creates a new #LassoSaml2KeyInfoConfirmationData object. + * + * Return value: a newly created #LassoSaml2KeyInfoConfirmationData object + **/ +LassoNode* +lasso_saml2_key_info_confirmation_data_new() +{ + return g_object_new(LASSO_TYPE_SAML2_KEY_INFO_CONFIRMATION_DATA, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_key_info_confirmation_data.h b/lasso/xml/saml-2.0/saml2_key_info_confirmation_data.h new file mode 100644 index 00000000..841b0dbb --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_key_info_confirmation_data.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_KEY_INFO_CONFIRMATION_DATA_H__ +#define __LASSO_SAML2_KEY_INFO_CONFIRMATION_DATA_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_KEY_INFO_CONFIRMATION_DATA \ + (lasso_saml2_key_info_confirmation_data_get_type()) +#define LASSO_SAML2_KEY_INFO_CONFIRMATION_DATA(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_KEY_INFO_CONFIRMATION_DATA, \ + LassoSaml2KeyInfoConfirmationData)) +#define LASSO_SAML2_KEY_INFO_CONFIRMATION_DATA_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_KEY_INFO_CONFIRMATION_DATA, \ + LassoSaml2KeyInfoConfirmationDataClass)) +#define LASSO_IS_SAML2_KEY_INFO_CONFIRMATION_DATA(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_KEY_INFO_CONFIRMATION_DATA)) +#define LASSO_IS_SAML2_KEY_INFO_CONFIRMATION_DATA_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_KEY_INFO_CONFIRMATION_DATA)) +#define LASSO_SAML2_KEY_INFO_CONFIRMATION_DATA_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_KEY_INFO_CONFIRMATION_DATA, \ + LassoSaml2KeyInfoConfirmationDataClass)) + +typedef struct _LassoSaml2KeyInfoConfirmationData LassoSaml2KeyInfoConfirmationData; +typedef struct _LassoSaml2KeyInfoConfirmationDataClass LassoSaml2KeyInfoConfirmationDataClass; + + +struct _LassoSaml2KeyInfoConfirmationData { + LassoNode parent; + + /*< public >*/ + /* elements */ + /* XXX */ void *KeyInfo; +}; + + +struct _LassoSaml2KeyInfoConfirmationDataClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_key_info_confirmation_data_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_key_info_confirmation_data_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_KEY_INFO_CONFIRMATION_DATA_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_name_id.c b/lasso/xml/saml-2.0/saml2_name_id.c new file mode 100644 index 00000000..31064c3c --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_name_id.c @@ -0,0 +1,143 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_name_id.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="NameIDType"> + * <simpleContent> + * <extension base="string"> + * <attributeGroup ref="saml:IDNameQualifiers"/> + * <attribute name="Format" type="anyURI" use="optional"/> + * <attribute name="SPProvidedID" type="string" use="optional"/> + * </extension> + * </simpleContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "content", SNIPPET_TEXT_CHILD, + G_STRUCT_OFFSET(LassoSaml2NameID, content) }, + { "Format", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2NameID, Format) }, + { "SPProvidedID", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2NameID, SPProvidedID) }, + { "NameQualifier", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2NameID, NameQualifier) }, + { "SPNameQualifier", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2NameID, SPNameQualifier) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2NameID *node) +{ + node->content = NULL; + node->Format = NULL; + node->SPProvidedID = NULL; + node->NameQualifier = NULL; + node->SPNameQualifier = NULL; +} + +static void +class_init(LassoSaml2NameIDClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "NameID"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_name_id_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2NameIDClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2NameID), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2NameID", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_name_id_new: + * + * Creates a new #LassoSaml2NameID object. + * + * Return value: a newly created #LassoSaml2NameID object + **/ +LassoNode* +lasso_saml2_name_id_new() +{ + return g_object_new(LASSO_TYPE_SAML2_NAME_ID, NULL); +} + + +/** + * lasso_saml2_name_id_new_with_string: + * @content: + * + * Creates a new #LassoSaml2NameID object and initializes it + * with @content. + * + * Return value: a newly created #LassoSaml2NameID object + **/ +LassoNode* +lasso_saml2_name_id_new_with_string(char *content) +{ + LassoSaml2NameID *object; + object = g_object_new(LASSO_TYPE_SAML2_NAME_ID, NULL); + object->content = g_strdup(content); + return LASSO_NODE(object); +} diff --git a/lasso/xml/saml-2.0/saml2_name_id.h b/lasso/xml/saml-2.0/saml2_name_id.h new file mode 100644 index 00000000..6f4f56b0 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_name_id.h @@ -0,0 +1,81 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_NAME_ID_H__ +#define __LASSO_SAML2_NAME_ID_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_NAME_ID (lasso_saml2_name_id_get_type()) +#define LASSO_SAML2_NAME_ID(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_NAME_ID, \ + LassoSaml2NameID)) +#define LASSO_SAML2_NAME_ID_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_NAME_ID, \ + LassoSaml2NameIDClass)) +#define LASSO_IS_SAML2_NAME_ID(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_NAME_ID)) +#define LASSO_IS_SAML2_NAME_ID_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_NAME_ID)) +#define LASSO_SAML2_NAME_ID_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_NAME_ID, \ + LassoSaml2NameIDClass)) + +typedef struct _LassoSaml2NameID LassoSaml2NameID; +typedef struct _LassoSaml2NameIDClass LassoSaml2NameIDClass; + + +struct _LassoSaml2NameID { + LassoNode parent; + + /*< public >*/ + /* elements */ + char *content; + /* attributes */ + char *Format; + char *SPProvidedID; + char *NameQualifier; + char *SPNameQualifier; +}; + + +struct _LassoSaml2NameIDClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_name_id_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_name_id_new(void); + +LASSO_EXPORT LassoNode* lasso_saml2_name_id_new_with_string(char *content); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_NAME_ID_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_one_time_use.c b/lasso/xml/saml-2.0/saml2_one_time_use.c new file mode 100644 index 00000000..57e0f266 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_one_time_use.c @@ -0,0 +1,105 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_one_time_use.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="OneTimeUseType"> + * <complexContent> + * <extension base="saml:ConditionAbstractType"/> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2OneTimeUse *node) +{ +} + +static void +class_init(LassoSaml2OneTimeUseClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "OneTimeUse"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_one_time_use_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2OneTimeUseClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2OneTimeUse), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAML2_CONDITION_ABSTRACT, + "LassoSaml2OneTimeUse", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_one_time_use_new: + * + * Creates a new #LassoSaml2OneTimeUse object. + * + * Return value: a newly created #LassoSaml2OneTimeUse object + **/ +LassoNode* +lasso_saml2_one_time_use_new() +{ + return g_object_new(LASSO_TYPE_SAML2_ONE_TIME_USE, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_one_time_use.h b/lasso/xml/saml-2.0/saml2_one_time_use.h new file mode 100644 index 00000000..89b300eb --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_one_time_use.h @@ -0,0 +1,73 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_ONE_TIME_USE_H__ +#define __LASSO_SAML2_ONE_TIME_USE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_condition_abstract.h" + +#define LASSO_TYPE_SAML2_ONE_TIME_USE (lasso_saml2_one_time_use_get_type()) +#define LASSO_SAML2_ONE_TIME_USE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_ONE_TIME_USE, \ + LassoSaml2OneTimeUse)) +#define LASSO_SAML2_ONE_TIME_USE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_ONE_TIME_USE, \ + LassoSaml2OneTimeUseClass)) +#define LASSO_IS_SAML2_ONE_TIME_USE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_ONE_TIME_USE)) +#define LASSO_IS_SAML2_ONE_TIME_USE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_ONE_TIME_USE)) +#define LASSO_SAML2_ONE_TIME_USE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_ONE_TIME_USE, \ + LassoSaml2OneTimeUseClass)) + +typedef struct _LassoSaml2OneTimeUse LassoSaml2OneTimeUse; +typedef struct _LassoSaml2OneTimeUseClass LassoSaml2OneTimeUseClass; + + +struct _LassoSaml2OneTimeUse { + LassoSaml2ConditionAbstract parent; + + /*< public >*/ +}; + + +struct _LassoSaml2OneTimeUseClass { + LassoSaml2ConditionAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_one_time_use_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_one_time_use_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_ONE_TIME_USE_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_proxy_restriction.c b/lasso/xml/saml-2.0/saml2_proxy_restriction.c new file mode 100644 index 00000000..0c0cfc2c --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_proxy_restriction.c @@ -0,0 +1,115 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_proxy_restriction.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="ProxyRestrictionType"> + * <complexContent> + * <extension base="saml:ConditionAbstractType"> + * <sequence> + * <element ref="saml:Audience" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * <attribute name="Count" type="nonNegativeInteger" use="optional"/> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Audience", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSaml2ProxyRestriction, Audience) }, + { "Count", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSaml2ProxyRestriction, Count) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2ProxyRestriction *node) +{ + node->Audience = NULL; +} + +static void +class_init(LassoSaml2ProxyRestrictionClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "ProxyRestriction"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_proxy_restriction_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2ProxyRestrictionClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2ProxyRestriction), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAML2_CONDITION_ABSTRACT, + "LassoSaml2ProxyRestriction", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_proxy_restriction_new: + * + * Creates a new #LassoSaml2ProxyRestriction object. + * + * Return value: a newly created #LassoSaml2ProxyRestriction object + **/ +LassoNode* +lasso_saml2_proxy_restriction_new() +{ + return g_object_new(LASSO_TYPE_SAML2_PROXY_RESTRICTION, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_proxy_restriction.h b/lasso/xml/saml-2.0/saml2_proxy_restriction.h new file mode 100644 index 00000000..2347f302 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_proxy_restriction.h @@ -0,0 +1,77 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_PROXY_RESTRICTION_H__ +#define __LASSO_SAML2_PROXY_RESTRICTION_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_condition_abstract.h" + +#define LASSO_TYPE_SAML2_PROXY_RESTRICTION (lasso_saml2_proxy_restriction_get_type()) +#define LASSO_SAML2_PROXY_RESTRICTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_PROXY_RESTRICTION, \ + LassoSaml2ProxyRestriction)) +#define LASSO_SAML2_PROXY_RESTRICTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_PROXY_RESTRICTION, \ + LassoSaml2ProxyRestrictionClass)) +#define LASSO_IS_SAML2_PROXY_RESTRICTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_PROXY_RESTRICTION)) +#define LASSO_IS_SAML2_PROXY_RESTRICTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_PROXY_RESTRICTION)) +#define LASSO_SAML2_PROXY_RESTRICTION_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_PROXY_RESTRICTION, \ + LassoSaml2ProxyRestrictionClass)) + +typedef struct _LassoSaml2ProxyRestriction LassoSaml2ProxyRestriction; +typedef struct _LassoSaml2ProxyRestrictionClass LassoSaml2ProxyRestrictionClass; + + +struct _LassoSaml2ProxyRestriction { + LassoSaml2ConditionAbstract parent; + + /*< public >*/ + /* elements */ + char *Audience; + /* attributes */ + char *Count; +}; + + +struct _LassoSaml2ProxyRestrictionClass { + LassoSaml2ConditionAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_proxy_restriction_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_proxy_restriction_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_PROXY_RESTRICTION_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_statement_abstract.c b/lasso/xml/saml-2.0/saml2_statement_abstract.c new file mode 100644 index 00000000..7a9aaaba --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_statement_abstract.c @@ -0,0 +1,115 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_statement_abstract.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="StatementAbstractType" abstract="true"/> + * <element name="AuthnStatement" type="saml:AuthnStatementType"/> + * <complexType name="AuthnStatementType"> + * <complexContent> + * <extension base="saml:StatementAbstractType"> + * <sequence> + * <element ref="saml:SubjectLocality" minOccurs="0"/> + * <element ref="saml:AuthnContext"/> + * </sequence> + * <attribute name="AuthnInstant" type="dateTime" use="required"/> + * <attribute name="SessionIndex" type="string" use="optional"/> + * <attribute name="SessionNotOnOrAfter" type="dateTime" use="optional"/> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2StatementAbstract *node) +{ +} + +static void +class_init(LassoSaml2StatementAbstractClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "StatementAbstract"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_statement_abstract_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2StatementAbstractClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2StatementAbstract), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2StatementAbstract", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_statement_abstract_new: + * + * Creates a new #LassoSaml2StatementAbstract object. + * + * Return value: a newly created #LassoSaml2StatementAbstract object + **/ +LassoNode* +lasso_saml2_statement_abstract_new() +{ + return g_object_new(LASSO_TYPE_SAML2_STATEMENT_ABSTRACT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_statement_abstract.h b/lasso/xml/saml-2.0/saml2_statement_abstract.h new file mode 100644 index 00000000..aa5f05ab --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_statement_abstract.h @@ -0,0 +1,73 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_STATEMENT_ABSTRACT_H__ +#define __LASSO_SAML2_STATEMENT_ABSTRACT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_STATEMENT_ABSTRACT (lasso_saml2_statement_abstract_get_type()) +#define LASSO_SAML2_STATEMENT_ABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_STATEMENT_ABSTRACT, \ + LassoSaml2StatementAbstract)) +#define LASSO_SAML2_STATEMENT_ABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_STATEMENT_ABSTRACT, \ + LassoSaml2StatementAbstractClass)) +#define LASSO_IS_SAML2_STATEMENT_ABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_STATEMENT_ABSTRACT)) +#define LASSO_IS_SAML2_STATEMENT_ABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_STATEMENT_ABSTRACT)) +#define LASSO_SAML2_STATEMENT_ABSTRACT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_STATEMENT_ABSTRACT, \ + LassoSaml2StatementAbstractClass)) + +typedef struct _LassoSaml2StatementAbstract LassoSaml2StatementAbstract; +typedef struct _LassoSaml2StatementAbstractClass LassoSaml2StatementAbstractClass; + + +struct _LassoSaml2StatementAbstract { + LassoNode parent; + + /*< public >*/ +}; + + +struct _LassoSaml2StatementAbstractClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_statement_abstract_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_statement_abstract_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_STATEMENT_ABSTRACT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_subject.c b/lasso/xml/saml-2.0/saml2_subject.c new file mode 100644 index 00000000..8352d90f --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_subject.c @@ -0,0 +1,126 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_subject.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="SubjectType"> + * <choice> + * <sequence> + * <choice> + * <element ref="saml:BaseID"/> + * <element ref="saml:NameID"/> + * <element ref="saml:EncryptedID"/> + * </choice> + * <element ref="saml:SubjectConfirmation" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * <element ref="saml:SubjectConfirmation" maxOccurs="unbounded"/> + * </choice> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "BaseID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Subject, BaseID) }, + { "NameID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Subject, NameID) }, + { "EncryptedID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Subject, EncryptedID), + "LassoSaml2EncryptedElement" }, + { "SubjectConfirmation", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2Subject, SubjectConfirmation) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2Subject *node) +{ + node->BaseID = NULL; + node->NameID = NULL; + node->EncryptedID = NULL; + node->SubjectConfirmation = NULL; +} + +static void +class_init(LassoSaml2SubjectClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Subject"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_subject_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2SubjectClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2Subject), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2Subject", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_subject_new: + * + * Creates a new #LassoSaml2Subject object. + * + * Return value: a newly created #LassoSaml2Subject object + **/ +LassoNode* +lasso_saml2_subject_new() +{ + return g_object_new(LASSO_TYPE_SAML2_SUBJECT, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_subject.h b/lasso/xml/saml-2.0/saml2_subject.h new file mode 100644 index 00000000..ba39630a --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_subject.h @@ -0,0 +1,81 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_SUBJECT_H__ +#define __LASSO_SAML2_SUBJECT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_subject_confirmation.h" +#include "saml2_encrypted_element.h" +#include "saml2_name_id.h" +#include "saml2_base_idabstract.h" + +#define LASSO_TYPE_SAML2_SUBJECT (lasso_saml2_subject_get_type()) +#define LASSO_SAML2_SUBJECT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_SUBJECT, \ + LassoSaml2Subject)) +#define LASSO_SAML2_SUBJECT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_SUBJECT, \ + LassoSaml2SubjectClass)) +#define LASSO_IS_SAML2_SUBJECT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_SUBJECT)) +#define LASSO_IS_SAML2_SUBJECT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_SUBJECT)) +#define LASSO_SAML2_SUBJECT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_SUBJECT, \ + LassoSaml2SubjectClass)) + +typedef struct _LassoSaml2Subject LassoSaml2Subject; +typedef struct _LassoSaml2SubjectClass LassoSaml2SubjectClass; + + +struct _LassoSaml2Subject { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSaml2BaseIDAbstract *BaseID; + LassoSaml2NameID *NameID; + LassoSaml2EncryptedElement *EncryptedID; + LassoSaml2SubjectConfirmation *SubjectConfirmation; +}; + + +struct _LassoSaml2SubjectClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_subject_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_subject_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_SUBJECT_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_subject_confirmation.c b/lasso/xml/saml-2.0/saml2_subject_confirmation.c new file mode 100644 index 00000000..2d44231a --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_subject_confirmation.c @@ -0,0 +1,127 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_subject_confirmation.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="SubjectConfirmationType"> + * <sequence> + * <choice minOccurs="0"> + * <element ref="saml:BaseID"/> + * <element ref="saml:NameID"/> + * <element ref="saml:EncryptedID"/> + * </choice> + * <element ref="saml:SubjectConfirmationData" minOccurs="0"/> + * </sequence> + * <attribute name="Method" type="anyURI" use="required"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "BaseID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, BaseID) }, + { "NameID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, NameID) }, + { "EncryptedID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, EncryptedID), + "LassoSaml2EncryptedElement" }, + { "SubjectConfirmationData", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, SubjectConfirmationData) }, + { "Method", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmation, Method) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2SubjectConfirmation *node) +{ + node->BaseID = NULL; + node->NameID = NULL; + node->EncryptedID = NULL; + node->SubjectConfirmationData = NULL; + node->Method = NULL; +} + +static void +class_init(LassoSaml2SubjectConfirmationClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "SubjectConfirmation"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_subject_confirmation_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2SubjectConfirmationClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2SubjectConfirmation), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2SubjectConfirmation", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_subject_confirmation_new: + * + * Creates a new #LassoSaml2SubjectConfirmation object. + * + * Return value: a newly created #LassoSaml2SubjectConfirmation object + **/ +LassoNode* +lasso_saml2_subject_confirmation_new() +{ + return g_object_new(LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_subject_confirmation.h b/lasso/xml/saml-2.0/saml2_subject_confirmation.h new file mode 100644 index 00000000..aef63514 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_subject_confirmation.h @@ -0,0 +1,83 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_SUBJECT_CONFIRMATION_H__ +#define __LASSO_SAML2_SUBJECT_CONFIRMATION_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_encrypted_element.h" +#include "saml2_name_id.h" +#include "saml2_base_idabstract.h" +#include "saml2_subject_confirmation_data.h" + +#define LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION (lasso_saml2_subject_confirmation_get_type()) +#define LASSO_SAML2_SUBJECT_CONFIRMATION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION, \ + LassoSaml2SubjectConfirmation)) +#define LASSO_SAML2_SUBJECT_CONFIRMATION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION, \ + LassoSaml2SubjectConfirmationClass)) +#define LASSO_IS_SAML2_SUBJECT_CONFIRMATION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION)) +#define LASSO_IS_SAML2_SUBJECT_CONFIRMATION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION)) +#define LASSO_SAML2_SUBJECT_CONFIRMATION_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION, \ + LassoSaml2SubjectConfirmationClass)) + +typedef struct _LassoSaml2SubjectConfirmation LassoSaml2SubjectConfirmation; +typedef struct _LassoSaml2SubjectConfirmationClass LassoSaml2SubjectConfirmationClass; + + +struct _LassoSaml2SubjectConfirmation { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSaml2BaseIDAbstract *BaseID; + LassoSaml2NameID *NameID; + LassoSaml2EncryptedElement *EncryptedID; + LassoSaml2SubjectConfirmationData *SubjectConfirmationData; + /* attributes */ + char *Method; +}; + + +struct _LassoSaml2SubjectConfirmationClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_subject_confirmation_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_subject_confirmation_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_SUBJECT_CONFIRMATION_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_subject_confirmation_data.c b/lasso/xml/saml-2.0/saml2_subject_confirmation_data.c new file mode 100644 index 00000000..98d423e0 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_subject_confirmation_data.c @@ -0,0 +1,130 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_subject_confirmation_data.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="SubjectConfirmationDataType" mixed="true"> + * <complexContent> + * <restriction base="anyType"> + * <sequence> + * <any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * <attribute name="NotBefore" type="dateTime" use="optional"/> + * <attribute name="NotOnOrAfter" type="dateTime" use="optional"/> + * <attribute name="Recipient" type="anyURI" use="optional"/> + * <attribute name="InResponseTo" type="NCName" use="optional"/> + * <attribute name="Address" type="string" use="optional"/> + * <anyAttribute namespace="##other" processContents="lax"/> + * </restriction> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "NotBefore", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmationData, NotBefore) }, + { "NotOnOrAfter", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmationData, NotOnOrAfter) }, + { "Recipient", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmationData, Recipient) }, + { "InResponseTo", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmationData, InResponseTo) }, + { "Address", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2SubjectConfirmationData, Address) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2SubjectConfirmationData *node) +{ + node->NotBefore = NULL; + node->NotOnOrAfter = NULL; + node->Recipient = NULL; + node->InResponseTo = NULL; + node->Address = NULL; +} + +static void +class_init(LassoSaml2SubjectConfirmationDataClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "SubjectConfirmationData"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_subject_confirmation_data_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2SubjectConfirmationDataClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2SubjectConfirmationData), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2SubjectConfirmationData", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_subject_confirmation_data_new: + * + * Creates a new #LassoSaml2SubjectConfirmationData object. + * + * Return value: a newly created #LassoSaml2SubjectConfirmationData object + **/ +LassoNode* +lasso_saml2_subject_confirmation_data_new() +{ + return g_object_new(LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION_DATA, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_subject_confirmation_data.h b/lasso/xml/saml-2.0/saml2_subject_confirmation_data.h new file mode 100644 index 00000000..ac807c82 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_subject_confirmation_data.h @@ -0,0 +1,80 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_SUBJECT_CONFIRMATION_DATA_H__ +#define __LASSO_SAML2_SUBJECT_CONFIRMATION_DATA_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION_DATA \ + (lasso_saml2_subject_confirmation_data_get_type()) +#define LASSO_SAML2_SUBJECT_CONFIRMATION_DATA(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION_DATA, \ + LassoSaml2SubjectConfirmationData)) +#define LASSO_SAML2_SUBJECT_CONFIRMATION_DATA_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION_DATA, \ + LassoSaml2SubjectConfirmationDataClass)) +#define LASSO_IS_SAML2_SUBJECT_CONFIRMATION_DATA(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION_DATA)) +#define LASSO_IS_SAML2_SUBJECT_CONFIRMATION_DATA_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION_DATA)) +#define LASSO_SAML2_SUBJECT_CONFIRMATION_DATA_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_SUBJECT_CONFIRMATION_DATA, \ + LassoSaml2SubjectConfirmationDataClass)) + +typedef struct _LassoSaml2SubjectConfirmationData LassoSaml2SubjectConfirmationData; +typedef struct _LassoSaml2SubjectConfirmationDataClass LassoSaml2SubjectConfirmationDataClass; + + +struct _LassoSaml2SubjectConfirmationData { + LassoNode parent; + + /*< public >*/ + /* attributes */ + char *NotBefore; + char *NotOnOrAfter; + char *Recipient; + char *InResponseTo; + char *Address; +}; + + +struct _LassoSaml2SubjectConfirmationDataClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_subject_confirmation_data_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_subject_confirmation_data_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_SUBJECT_CONFIRMATION_DATA_H__ */ diff --git a/lasso/xml/saml-2.0/saml2_subject_locality.c b/lasso/xml/saml-2.0/saml2_subject_locality.c new file mode 100644 index 00000000..7f1d4867 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_subject_locality.c @@ -0,0 +1,110 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "saml2_subject_locality.h" + +/* + * Schema fragment (saml-schema-assertion-2.0.xsd): + * + * <complexType name="SubjectLocalityType"> + * <attribute name="Address" type="string" use="optional"/> + * <attribute name="DNSName" type="string" use="optional"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Address", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2SubjectLocality, Address) }, + { "DNSName", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSaml2SubjectLocality, DNSName) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSaml2SubjectLocality *node) +{ + node->Address = NULL; + node->DNSName = NULL; +} + +static void +class_init(LassoSaml2SubjectLocalityClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "SubjectLocality"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_ASSERTION_HREF, LASSO_SAML2_ASSERTION_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_saml2_subject_locality_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSaml2SubjectLocalityClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSaml2SubjectLocality), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSaml2SubjectLocality", &this_info, 0); + } + return this_type; +} + +/** + * lasso_saml2_subject_locality_new: + * + * Creates a new #LassoSaml2SubjectLocality object. + * + * Return value: a newly created #LassoSaml2SubjectLocality object + **/ +LassoNode* +lasso_saml2_subject_locality_new() +{ + return g_object_new(LASSO_TYPE_SAML2_SUBJECT_LOCALITY, NULL); +} diff --git a/lasso/xml/saml-2.0/saml2_subject_locality.h b/lasso/xml/saml-2.0/saml2_subject_locality.h new file mode 100644 index 00000000..6998e954 --- /dev/null +++ b/lasso/xml/saml-2.0/saml2_subject_locality.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAML2_SUBJECT_LOCALITY_H__ +#define __LASSO_SAML2_SUBJECT_LOCALITY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAML2_SUBJECT_LOCALITY (lasso_saml2_subject_locality_get_type()) +#define LASSO_SAML2_SUBJECT_LOCALITY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAML2_SUBJECT_LOCALITY, \ + LassoSaml2SubjectLocality)) +#define LASSO_SAML2_SUBJECT_LOCALITY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAML2_SUBJECT_LOCALITY, \ + LassoSaml2SubjectLocalityClass)) +#define LASSO_IS_SAML2_SUBJECT_LOCALITY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAML2_SUBJECT_LOCALITY)) +#define LASSO_IS_SAML2_SUBJECT_LOCALITY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAML2_SUBJECT_LOCALITY)) +#define LASSO_SAML2_SUBJECT_LOCALITY_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAML2_SUBJECT_LOCALITY, \ + LassoSaml2SubjectLocalityClass)) + +typedef struct _LassoSaml2SubjectLocality LassoSaml2SubjectLocality; +typedef struct _LassoSaml2SubjectLocalityClass LassoSaml2SubjectLocalityClass; + + +struct _LassoSaml2SubjectLocality { + LassoNode parent; + + /*< public >*/ + /* attributes */ + char *Address; + char *DNSName; +}; + + +struct _LassoSaml2SubjectLocalityClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_saml2_subject_locality_get_type(void); +LASSO_EXPORT LassoNode* lasso_saml2_subject_locality_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_SUBJECT_LOCALITY_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_artifact_resolve.c b/lasso/xml/saml-2.0/samlp2_artifact_resolve.c new file mode 100644 index 00000000..522ed196 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_artifact_resolve.c @@ -0,0 +1,140 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_artifact_resolve.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="ArtifactResolveType"> + * <complexContent> + * <extension base="samlp:RequestAbstractType"> + * <sequence> + * <element ref="samlp:Artifact"/> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Artifact", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2ArtifactResolve, Artifact) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +static gchar* +build_query(LassoNode *node) +{ + char *ret, *deflated_message; + + deflated_message = lasso_node_build_deflated_query(node); + ret = g_strdup_printf("SAMLRequest=%s", deflated_message); + /* XXX: must support RelayState (which profiles?) */ + g_free(deflated_message); + return ret; +} + + +static gboolean +init_from_query(LassoNode *node, char **query_fields) +{ + gboolean rc; + char *relay_state = NULL; + rc = lasso_node_init_from_saml2_query_fields(node, query_fields, &relay_state); + if (rc && relay_state != NULL) { + /* XXX: support RelayState? */ + } + return rc; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2ArtifactResolve *node) +{ + node->Artifact = NULL; +} + +static void +class_init(LassoSamlp2ArtifactResolveClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->build_query = build_query; + nclass->init_from_query = init_from_query; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "ArtifactResolve"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_artifact_resolve_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2ArtifactResolveClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2ArtifactResolve), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, + "LassoSamlp2ArtifactResolve", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_artifact_resolve_new: + * + * Creates a new #LassoSamlp2ArtifactResolve object. + * + * Return value: a newly created #LassoSamlp2ArtifactResolve object + **/ +LassoNode* +lasso_samlp2_artifact_resolve_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_ARTIFACT_RESOLVE, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_artifact_resolve.h b/lasso/xml/saml-2.0/samlp2_artifact_resolve.h new file mode 100644 index 00000000..6b3578ea --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_artifact_resolve.h @@ -0,0 +1,75 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_ARTIFACT_RESOLVE_H__ +#define __LASSO_SAMLP2_ARTIFACT_RESOLVE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_request_abstract.h" + +#define LASSO_TYPE_SAMLP2_ARTIFACT_RESOLVE (lasso_samlp2_artifact_resolve_get_type()) +#define LASSO_SAMLP2_ARTIFACT_RESOLVE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_ARTIFACT_RESOLVE, \ + LassoSamlp2ArtifactResolve)) +#define LASSO_SAMLP2_ARTIFACT_RESOLVE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_ARTIFACT_RESOLVE, \ + LassoSamlp2ArtifactResolveClass)) +#define LASSO_IS_SAMLP2_ARTIFACT_RESOLVE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_ARTIFACT_RESOLVE)) +#define LASSO_IS_SAMLP2_ARTIFACT_RESOLVE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_ARTIFACT_RESOLVE)) +#define LASSO_SAMLP2_ARTIFACT_RESOLVE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_ARTIFACT_RESOLVE, \ + LassoSamlp2ArtifactResolveClass)) + +typedef struct _LassoSamlp2ArtifactResolve LassoSamlp2ArtifactResolve; +typedef struct _LassoSamlp2ArtifactResolveClass LassoSamlp2ArtifactResolveClass; + + +struct _LassoSamlp2ArtifactResolve { + LassoSamlp2RequestAbstract parent; + + /*< public >*/ + /* elements */ + char *Artifact; +}; + + +struct _LassoSamlp2ArtifactResolveClass { + LassoSamlp2RequestAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_artifact_resolve_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_artifact_resolve_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_ARTIFACT_RESOLVE_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_artifact_response.c b/lasso/xml/saml-2.0/samlp2_artifact_response.c new file mode 100644 index 00000000..c7fcebb6 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_artifact_response.c @@ -0,0 +1,112 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_artifact_response.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="ArtifactResponseType"> + * <complexContent> + * <extension base="samlp:StatusResponseType"> + * <sequence> + * <any namespace="##any" processContents="lax" minOccurs="0"/> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "any", SNIPPET_NODE | SNIPPET_ANY, + G_STRUCT_OFFSET(LassoSamlp2ArtifactResponse, any) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2ArtifactResponse *node) +{ + node->any = NULL; +} + +static void +class_init(LassoSamlp2ArtifactResponseClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "ArtifactResponse"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_artifact_response_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2ArtifactResponseClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2ArtifactResponse), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_STATUS_RESPONSE, + "LassoSamlp2ArtifactResponse", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_artifact_response_new: + * + * Creates a new #LassoSamlp2ArtifactResponse object. + * + * Return value: a newly created #LassoSamlp2ArtifactResponse object + **/ +LassoNode* +lasso_samlp2_artifact_response_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_ARTIFACT_RESPONSE, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_artifact_response.h b/lasso/xml/saml-2.0/samlp2_artifact_response.h new file mode 100644 index 00000000..c4644473 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_artifact_response.h @@ -0,0 +1,75 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_ARTIFACT_RESPONSE_H__ +#define __LASSO_SAMLP2_ARTIFACT_RESPONSE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_status_response.h" + +#define LASSO_TYPE_SAMLP2_ARTIFACT_RESPONSE (lasso_samlp2_artifact_response_get_type()) +#define LASSO_SAMLP2_ARTIFACT_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_ARTIFACT_RESPONSE, \ + LassoSamlp2ArtifactResponse)) +#define LASSO_SAMLP2_ARTIFACT_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_ARTIFACT_RESPONSE, \ + LassoSamlp2ArtifactResponseClass)) +#define LASSO_IS_SAMLP2_ARTIFACT_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_ARTIFACT_RESPONSE)) +#define LASSO_IS_SAMLP2_ARTIFACT_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_ARTIFACT_RESPONSE)) +#define LASSO_SAMLP2_ARTIFACT_RESPONSE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_ARTIFACT_RESPONSE, \ + LassoSamlp2ArtifactResponseClass)) + +typedef struct _LassoSamlp2ArtifactResponse LassoSamlp2ArtifactResponse; +typedef struct _LassoSamlp2ArtifactResponseClass LassoSamlp2ArtifactResponseClass; + + +struct _LassoSamlp2ArtifactResponse { + LassoSamlp2StatusResponse parent; + + /*< public >*/ + /* elements */ + LassoNode *any; +}; + + +struct _LassoSamlp2ArtifactResponseClass { + LassoSamlp2StatusResponseClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_artifact_response_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_artifact_response_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_ARTIFACT_RESPONSE_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_assertion_idrequest.c b/lasso/xml/saml-2.0/samlp2_assertion_idrequest.c new file mode 100644 index 00000000..9852aa0c --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_assertion_idrequest.c @@ -0,0 +1,140 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_assertion_idrequest.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="AssertionIDRequestType"> + * <complexContent> + * <extension base="samlp:RequestAbstractType"> + * <sequence> + * <element ref="saml:AssertionIDRef" maxOccurs="unbounded"/> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "AssertionIDRef", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2AssertionIDRequest, AssertionIDRef) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +static gchar* +build_query(LassoNode *node) +{ + char *ret, *deflated_message; + + deflated_message = lasso_node_build_deflated_query(node); + ret = g_strdup_printf("SAMLRequest=%s", deflated_message); + /* XXX: must support RelayState (which profiles?) */ + g_free(deflated_message); + return ret; +} + + +static gboolean +init_from_query(LassoNode *node, char **query_fields) +{ + gboolean rc; + char *relay_state = NULL; + rc = lasso_node_init_from_saml2_query_fields(node, query_fields, &relay_state); + if (rc && relay_state != NULL) { + /* XXX: support RelayState? */ + } + return rc; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2AssertionIDRequest *node) +{ + node->AssertionIDRef = NULL; +} + +static void +class_init(LassoSamlp2AssertionIDRequestClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->build_query = build_query; + nclass->init_from_query = init_from_query; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AssertionIDRequest"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_assertion_idrequest_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2AssertionIDRequestClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2AssertionIDRequest), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, + "LassoSamlp2AssertionIDRequest", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_assertion_idrequest_new: + * + * Creates a new #LassoSamlp2AssertionIDRequest object. + * + * Return value: a newly created #LassoSamlp2AssertionIDRequest object + **/ +LassoNode* +lasso_samlp2_assertion_idrequest_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_ASSERTION_IDREQUEST, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_assertion_idrequest.h b/lasso/xml/saml-2.0/samlp2_assertion_idrequest.h new file mode 100644 index 00000000..b7dd1891 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_assertion_idrequest.h @@ -0,0 +1,75 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_ASSERTION_IDREQUEST_H__ +#define __LASSO_SAMLP2_ASSERTION_IDREQUEST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_request_abstract.h" + +#define LASSO_TYPE_SAMLP2_ASSERTION_IDREQUEST (lasso_samlp2_assertion_idrequest_get_type()) +#define LASSO_SAMLP2_ASSERTION_IDREQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_ASSERTION_IDREQUEST, \ + LassoSamlp2AssertionIDRequest)) +#define LASSO_SAMLP2_ASSERTION_IDREQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_ASSERTION_IDREQUEST, \ + LassoSamlp2AssertionIDRequestClass)) +#define LASSO_IS_SAMLP2_ASSERTION_IDREQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_ASSERTION_IDREQUEST)) +#define LASSO_IS_SAMLP2_ASSERTION_IDREQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_ASSERTION_IDREQUEST)) +#define LASSO_SAMLP2_ASSERTION_IDREQUEST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_ASSERTION_IDREQUEST, \ + LassoSamlp2AssertionIDRequestClass)) + +typedef struct _LassoSamlp2AssertionIDRequest LassoSamlp2AssertionIDRequest; +typedef struct _LassoSamlp2AssertionIDRequestClass LassoSamlp2AssertionIDRequestClass; + + +struct _LassoSamlp2AssertionIDRequest { + LassoSamlp2RequestAbstract parent; + + /*< public >*/ + /* elements */ + char *AssertionIDRef; +}; + + +struct _LassoSamlp2AssertionIDRequestClass { + LassoSamlp2RequestAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_assertion_idrequest_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_assertion_idrequest_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_ASSERTION_IDREQUEST_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_attribute_query.c b/lasso/xml/saml-2.0/samlp2_attribute_query.c new file mode 100644 index 00000000..02e4b755 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_attribute_query.c @@ -0,0 +1,112 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_attribute_query.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="AttributeQueryType"> + * <complexContent> + * <extension base="samlp:SubjectQueryAbstractType"> + * <sequence> + * <element ref="saml:Attribute" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Attribute", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AttributeQuery, Attribute) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2AttributeQuery *node) +{ + node->Attribute = NULL; +} + +static void +class_init(LassoSamlp2AttributeQueryClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AttributeQuery"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_attribute_query_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2AttributeQueryClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2AttributeQuery), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT, + "LassoSamlp2AttributeQuery", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_attribute_query_new: + * + * Creates a new #LassoSamlp2AttributeQuery object. + * + * Return value: a newly created #LassoSamlp2AttributeQuery object + **/ +LassoNode* +lasso_samlp2_attribute_query_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_ATTRIBUTE_QUERY, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_attribute_query.h b/lasso/xml/saml-2.0/samlp2_attribute_query.h new file mode 100644 index 00000000..fc057505 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_attribute_query.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_ATTRIBUTE_QUERY_H__ +#define __LASSO_SAMLP2_ATTRIBUTE_QUERY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_subject_query_abstract.h" +#include "saml2_attribute.h" + +#define LASSO_TYPE_SAMLP2_ATTRIBUTE_QUERY (lasso_samlp2_attribute_query_get_type()) +#define LASSO_SAMLP2_ATTRIBUTE_QUERY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_ATTRIBUTE_QUERY, \ + LassoSamlp2AttributeQuery)) +#define LASSO_SAMLP2_ATTRIBUTE_QUERY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_ATTRIBUTE_QUERY, \ + LassoSamlp2AttributeQueryClass)) +#define LASSO_IS_SAMLP2_ATTRIBUTE_QUERY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_ATTRIBUTE_QUERY)) +#define LASSO_IS_SAMLP2_ATTRIBUTE_QUERY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_ATTRIBUTE_QUERY)) +#define LASSO_SAMLP2_ATTRIBUTE_QUERY_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_ATTRIBUTE_QUERY, \ + LassoSamlp2AttributeQueryClass)) + +typedef struct _LassoSamlp2AttributeQuery LassoSamlp2AttributeQuery; +typedef struct _LassoSamlp2AttributeQueryClass LassoSamlp2AttributeQueryClass; + + +struct _LassoSamlp2AttributeQuery { + LassoSamlp2SubjectQueryAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2Attribute *Attribute; +}; + + +struct _LassoSamlp2AttributeQueryClass { + LassoSamlp2SubjectQueryAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_attribute_query_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_attribute_query_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_ATTRIBUTE_QUERY_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_authn_query.c b/lasso/xml/saml-2.0/samlp2_authn_query.c new file mode 100644 index 00000000..8e50bd1f --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_authn_query.c @@ -0,0 +1,116 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_authn_query.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="AuthnQueryType"> + * <complexContent> + * <extension base="samlp:SubjectQueryAbstractType"> + * <sequence> + * <element ref="samlp:RequestedAuthnContext" minOccurs="0"/> + * </sequence> + * <attribute name="SessionIndex" type="string" use="optional"/> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "RequestedAuthnContext", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AuthnQuery, RequestedAuthnContext) }, + { "SessionIndex", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2AuthnQuery, SessionIndex) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2AuthnQuery *node) +{ + node->RequestedAuthnContext = NULL; + node->SessionIndex = NULL; +} + +static void +class_init(LassoSamlp2AuthnQueryClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AuthnQuery"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_authn_query_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2AuthnQueryClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2AuthnQuery), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT, + "LassoSamlp2AuthnQuery", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_authn_query_new: + * + * Creates a new #LassoSamlp2AuthnQuery object. + * + * Return value: a newly created #LassoSamlp2AuthnQuery object + **/ +LassoNode* +lasso_samlp2_authn_query_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_AUTHN_QUERY, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_authn_query.h b/lasso/xml/saml-2.0/samlp2_authn_query.h new file mode 100644 index 00000000..6d6e0926 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_authn_query.h @@ -0,0 +1,78 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_AUTHN_QUERY_H__ +#define __LASSO_SAMLP2_AUTHN_QUERY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_requested_authn_context.h" +#include "samlp2_subject_query_abstract.h" + +#define LASSO_TYPE_SAMLP2_AUTHN_QUERY (lasso_samlp2_authn_query_get_type()) +#define LASSO_SAMLP2_AUTHN_QUERY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_AUTHN_QUERY, \ + LassoSamlp2AuthnQuery)) +#define LASSO_SAMLP2_AUTHN_QUERY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_AUTHN_QUERY, \ + LassoSamlp2AuthnQueryClass)) +#define LASSO_IS_SAMLP2_AUTHN_QUERY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_AUTHN_QUERY)) +#define LASSO_IS_SAMLP2_AUTHN_QUERY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_AUTHN_QUERY)) +#define LASSO_SAMLP2_AUTHN_QUERY_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_AUTHN_QUERY, \ + LassoSamlp2AuthnQueryClass)) + +typedef struct _LassoSamlp2AuthnQuery LassoSamlp2AuthnQuery; +typedef struct _LassoSamlp2AuthnQueryClass LassoSamlp2AuthnQueryClass; + + +struct _LassoSamlp2AuthnQuery { + LassoSamlp2SubjectQueryAbstract parent; + + /*< public >*/ + /* elements */ + LassoSamlp2RequestedAuthnContext *RequestedAuthnContext; + /* attributes */ + char *SessionIndex; +}; + + +struct _LassoSamlp2AuthnQueryClass { + LassoSamlp2SubjectQueryAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_authn_query_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_authn_query_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_AUTHN_QUERY_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_authn_request.c b/lasso/xml/saml-2.0/samlp2_authn_request.c new file mode 100644 index 00000000..11203b6d --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_authn_request.c @@ -0,0 +1,184 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_authn_request.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="AuthnRequestType"> + * <complexContent> + * <extension base="samlp:RequestAbstractType"> + * <sequence> + * <element ref="saml:Subject" minOccurs="0"/> + * <element ref="samlp:NameIDPolicy" minOccurs="0"/> + * <element ref="saml:Conditions" minOccurs="0"/> + * <element ref="samlp:RequestedAuthnContext" minOccurs="0"/> + * <element ref="samlp:Scoping" minOccurs="0"/> + * </sequence> + * <attribute name="ForceAuthn" type="boolean" use="optional"/> + * <attribute name="IsPassive" type="boolean" use="optional"/> + * <attribute name="ProtocolBinding" type="anyURI" use="optional"/> + * <attribute name="AssertionConsumerServiceIndex" type="unsignedShort" use="optional"/> + * <attribute name="AssertionConsumerServiceURL" type="anyURI" use="optional"/> + * <attribute name="AttributeConsumingServiceIndex" type="unsignedShort" use="optional"/> + * <attribute name="ProviderName" type="string" use="optional"/> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Subject", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, Subject) }, + { "NameIDPolicy", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, NameIDPolicy) }, + { "Conditions", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, Conditions) }, + { "RequestedAuthnContext", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, RequestedAuthnContext) }, + { "Scoping", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, Scoping) }, + { "ForceAuthn", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, ForceAuthn) }, + { "IsPassive", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, IsPassive) }, + { "ProtocolBinding", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, ProtocolBinding) }, + { "AssertionConsumerServiceIndex", SNIPPET_ATTRIBUTE | SNIPPET_INTEGER, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, AssertionConsumerServiceIndex) }, + { "AssertionConsumerServiceURL", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, AssertionConsumerServiceURL) }, + { "AttributeConsumingServiceIndex", SNIPPET_ATTRIBUTE | SNIPPET_INTEGER, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, AttributeConsumingServiceIndex) }, + { "ProviderName", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2AuthnRequest, ProviderName) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +static gchar* +build_query(LassoNode *node) +{ + char *ret, *deflated_message; + + deflated_message = lasso_node_build_deflated_query(node); + ret = g_strdup_printf("SAMLRequest=%s", deflated_message); + /* XXX: must support RelayState (which profiles?) */ + g_free(deflated_message); + return ret; +} + + +static gboolean +init_from_query(LassoNode *node, char **query_fields) +{ + gboolean rc; + char *relay_state = NULL; + rc = lasso_node_init_from_saml2_query_fields(node, query_fields, &relay_state); + if (rc && relay_state != NULL) { + /* XXX: support RelayState? */ + } + return rc; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2AuthnRequest *node) +{ + node->Subject = NULL; + node->NameIDPolicy = NULL; + node->Conditions = NULL; + node->RequestedAuthnContext = NULL; + node->Scoping = NULL; + node->ForceAuthn = FALSE; + node->IsPassive = FALSE; + node->ProtocolBinding = NULL; + node->AssertionConsumerServiceIndex = 0; + node->AssertionConsumerServiceURL = NULL; + node->AttributeConsumingServiceIndex = 0; + node->ProviderName = NULL; +} + +static void +class_init(LassoSamlp2AuthnRequestClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->build_query = build_query; + nclass->init_from_query = init_from_query; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AuthnRequest"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_authn_request_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2AuthnRequestClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2AuthnRequest), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, + "LassoSamlp2AuthnRequest", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_authn_request_new: + * + * Creates a new #LassoSamlp2AuthnRequest object. + * + * Return value: a newly created #LassoSamlp2AuthnRequest object + **/ +LassoNode* +lasso_samlp2_authn_request_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_AUTHN_REQUEST, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_authn_request.h b/lasso/xml/saml-2.0/samlp2_authn_request.h new file mode 100644 index 00000000..f1b70250 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_authn_request.h @@ -0,0 +1,92 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_AUTHN_REQUEST_H__ +#define __LASSO_SAMLP2_AUTHN_REQUEST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_request_abstract.h" +#include "saml2_conditions.h" +#include "samlp2_requested_authn_context.h" +#include "saml2_subject.h" +#include "samlp2_scoping.h" +#include "samlp2_name_id_policy.h" + +#define LASSO_TYPE_SAMLP2_AUTHN_REQUEST (lasso_samlp2_authn_request_get_type()) +#define LASSO_SAMLP2_AUTHN_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_AUTHN_REQUEST, \ + LassoSamlp2AuthnRequest)) +#define LASSO_SAMLP2_AUTHN_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_AUTHN_REQUEST, \ + LassoSamlp2AuthnRequestClass)) +#define LASSO_IS_SAMLP2_AUTHN_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_AUTHN_REQUEST)) +#define LASSO_IS_SAMLP2_AUTHN_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_AUTHN_REQUEST)) +#define LASSO_SAMLP2_AUTHN_REQUEST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_AUTHN_REQUEST, \ + LassoSamlp2AuthnRequestClass)) + +typedef struct _LassoSamlp2AuthnRequest LassoSamlp2AuthnRequest; +typedef struct _LassoSamlp2AuthnRequestClass LassoSamlp2AuthnRequestClass; + + +struct _LassoSamlp2AuthnRequest { + LassoSamlp2RequestAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2Subject *Subject; + LassoSamlp2NameIDPolicy *NameIDPolicy; + LassoSaml2Conditions *Conditions; + LassoSamlp2RequestedAuthnContext *RequestedAuthnContext; + LassoSamlp2Scoping *Scoping; + /* attributes */ + gboolean ForceAuthn; + gboolean IsPassive; + char *ProtocolBinding; + int AssertionConsumerServiceIndex; + char *AssertionConsumerServiceURL; + int AttributeConsumingServiceIndex; + char *ProviderName; +}; + + +struct _LassoSamlp2AuthnRequestClass { + LassoSamlp2RequestAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_authn_request_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_authn_request_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_AUTHN_REQUEST_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_authz_decision_query.c b/lasso/xml/saml-2.0/samlp2_authz_decision_query.c new file mode 100644 index 00000000..dbe439d1 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_authz_decision_query.c @@ -0,0 +1,120 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_authz_decision_query.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="AuthzDecisionQueryType"> + * <complexContent> + * <extension base="samlp:SubjectQueryAbstractType"> + * <sequence> + * <element ref="saml:Action" maxOccurs="unbounded"/> + * <element ref="saml:Evidence" minOccurs="0"/> + * </sequence> + * <attribute name="Resource" type="anyURI" use="required"/> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Action", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AuthzDecisionQuery, Action) }, + { "Evidence", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2AuthzDecisionQuery, Evidence) }, + { "Resource", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2AuthzDecisionQuery, Resource) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2AuthzDecisionQuery *node) +{ + node->Action = NULL; + node->Evidence = NULL; + node->Resource = NULL; +} + +static void +class_init(LassoSamlp2AuthzDecisionQueryClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "AuthzDecisionQuery"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_authz_decision_query_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2AuthzDecisionQueryClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2AuthzDecisionQuery), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT, + "LassoSamlp2AuthzDecisionQuery", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_authz_decision_query_new: + * + * Creates a new #LassoSamlp2AuthzDecisionQuery object. + * + * Return value: a newly created #LassoSamlp2AuthzDecisionQuery object + **/ +LassoNode* +lasso_samlp2_authz_decision_query_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_AUTHZ_DECISION_QUERY, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_authz_decision_query.h b/lasso/xml/saml-2.0/samlp2_authz_decision_query.h new file mode 100644 index 00000000..5b18ce05 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_authz_decision_query.h @@ -0,0 +1,80 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_AUTHZ_DECISION_QUERY_H__ +#define __LASSO_SAMLP2_AUTHZ_DECISION_QUERY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_action.h" +#include "saml2_evidence.h" +#include "samlp2_subject_query_abstract.h" + +#define LASSO_TYPE_SAMLP2_AUTHZ_DECISION_QUERY (lasso_samlp2_authz_decision_query_get_type()) +#define LASSO_SAMLP2_AUTHZ_DECISION_QUERY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_AUTHZ_DECISION_QUERY, \ + LassoSamlp2AuthzDecisionQuery)) +#define LASSO_SAMLP2_AUTHZ_DECISION_QUERY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_AUTHZ_DECISION_QUERY, \ + LassoSamlp2AuthzDecisionQueryClass)) +#define LASSO_IS_SAMLP2_AUTHZ_DECISION_QUERY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_AUTHZ_DECISION_QUERY)) +#define LASSO_IS_SAMLP2_AUTHZ_DECISION_QUERY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_AUTHZ_DECISION_QUERY)) +#define LASSO_SAMLP2_AUTHZ_DECISION_QUERY_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_AUTHZ_DECISION_QUERY, \ + LassoSamlp2AuthzDecisionQueryClass)) + +typedef struct _LassoSamlp2AuthzDecisionQuery LassoSamlp2AuthzDecisionQuery; +typedef struct _LassoSamlp2AuthzDecisionQueryClass LassoSamlp2AuthzDecisionQueryClass; + + +struct _LassoSamlp2AuthzDecisionQuery { + LassoSamlp2SubjectQueryAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2Action *Action; + LassoSaml2Evidence *Evidence; + /* attributes */ + char *Resource; +}; + + +struct _LassoSamlp2AuthzDecisionQueryClass { + LassoSamlp2SubjectQueryAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_authz_decision_query_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_authz_decision_query_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_AUTHZ_DECISION_QUERY_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_extensions.c b/lasso/xml/saml-2.0/samlp2_extensions.c new file mode 100644 index 00000000..08e8af3f --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_extensions.c @@ -0,0 +1,105 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_extensions.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="ExtensionsType"> + * <sequence> + * <any namespace="##other" processContents="lax" maxOccurs="unbounded"/> + * </sequence> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2Extensions *node) +{ +} + +static void +class_init(LassoSamlp2ExtensionsClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Extensions"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_extensions_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2ExtensionsClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2Extensions), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2Extensions", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_extensions_new: + * + * Creates a new #LassoSamlp2Extensions object. + * + * Return value: a newly created #LassoSamlp2Extensions object + **/ +LassoNode* +lasso_samlp2_extensions_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_EXTENSIONS, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_extensions.h b/lasso/xml/saml-2.0/samlp2_extensions.h new file mode 100644 index 00000000..c7f9289c --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_extensions.h @@ -0,0 +1,73 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_EXTENSIONS_H__ +#define __LASSO_SAMLP2_EXTENSIONS_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAMLP2_EXTENSIONS (lasso_samlp2_extensions_get_type()) +#define LASSO_SAMLP2_EXTENSIONS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_EXTENSIONS, \ + LassoSamlp2Extensions)) +#define LASSO_SAMLP2_EXTENSIONS_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_EXTENSIONS, \ + LassoSamlp2ExtensionsClass)) +#define LASSO_IS_SAMLP2_EXTENSIONS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_EXTENSIONS)) +#define LASSO_IS_SAMLP2_EXTENSIONS_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_EXTENSIONS)) +#define LASSO_SAMLP2_EXTENSIONS_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_EXTENSIONS, \ + LassoSamlp2ExtensionsClass)) + +typedef struct _LassoSamlp2Extensions LassoSamlp2Extensions; +typedef struct _LassoSamlp2ExtensionsClass LassoSamlp2ExtensionsClass; + + +struct _LassoSamlp2Extensions { + LassoNode parent; + + /*< public >*/ +}; + + +struct _LassoSamlp2ExtensionsClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_extensions_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_extensions_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_EXTENSIONS_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_idp_entry.c b/lasso/xml/saml-2.0/samlp2_idp_entry.c new file mode 100644 index 00000000..6e833188 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_idp_entry.c @@ -0,0 +1,114 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_idp_entry.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="IDPEntryType"> + * <attribute name="ProviderID" type="anyURI" use="required"/> + * <attribute name="Name" type="string" use="optional"/> + * <attribute name="Loc" type="anyURI" use="optional"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "ProviderID", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2IDPEntry, ProviderID) }, + { "Name", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2IDPEntry, Name) }, + { "Loc", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2IDPEntry, Loc) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2IDPEntry *node) +{ + node->ProviderID = NULL; + node->Name = NULL; + node->Loc = NULL; +} + +static void +class_init(LassoSamlp2IDPEntryClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "IDPEntry"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_idp_entry_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2IDPEntryClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2IDPEntry), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2IDPEntry", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_idp_entry_new: + * + * Creates a new #LassoSamlp2IDPEntry object. + * + * Return value: a newly created #LassoSamlp2IDPEntry object + **/ +LassoNode* +lasso_samlp2_idp_entry_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_IDP_ENTRY, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_idp_entry.h b/lasso/xml/saml-2.0/samlp2_idp_entry.h new file mode 100644 index 00000000..6bfd0eaa --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_idp_entry.h @@ -0,0 +1,77 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_IDP_ENTRY_H__ +#define __LASSO_SAMLP2_IDP_ENTRY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAMLP2_IDP_ENTRY (lasso_samlp2_idp_entry_get_type()) +#define LASSO_SAMLP2_IDP_ENTRY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_IDP_ENTRY, \ + LassoSamlp2IDPEntry)) +#define LASSO_SAMLP2_IDP_ENTRY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_IDP_ENTRY, \ + LassoSamlp2IDPEntryClass)) +#define LASSO_IS_SAMLP2_IDP_ENTRY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_IDP_ENTRY)) +#define LASSO_IS_SAMLP2_IDP_ENTRY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_IDP_ENTRY)) +#define LASSO_SAMLP2_IDP_ENTRY_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_IDP_ENTRY, \ + LassoSamlp2IDPEntryClass)) + +typedef struct _LassoSamlp2IDPEntry LassoSamlp2IDPEntry; +typedef struct _LassoSamlp2IDPEntryClass LassoSamlp2IDPEntryClass; + + +struct _LassoSamlp2IDPEntry { + LassoNode parent; + + /*< public >*/ + /* attributes */ + char *ProviderID; + char *Name; + char *Loc; +}; + + +struct _LassoSamlp2IDPEntryClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_idp_entry_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_idp_entry_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_IDP_ENTRY_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_idp_list.c b/lasso/xml/saml-2.0/samlp2_idp_list.c new file mode 100644 index 00000000..71d8341d --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_idp_list.c @@ -0,0 +1,112 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_idp_list.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="IDPListType"> + * <sequence> + * <element ref="samlp:IDPEntry" maxOccurs="unbounded"/> + * <element ref="samlp:GetComplete" minOccurs="0"/> + * </sequence> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "IDPEntry", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2IDPList, IDPEntry) }, + { "GetComplete", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2IDPList, GetComplete) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2IDPList *node) +{ + node->IDPEntry = NULL; + node->GetComplete = NULL; +} + +static void +class_init(LassoSamlp2IDPListClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "IDPList"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_idp_list_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2IDPListClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2IDPList), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2IDPList", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_idp_list_new: + * + * Creates a new #LassoSamlp2IDPList object. + * + * Return value: a newly created #LassoSamlp2IDPList object + **/ +LassoNode* +lasso_samlp2_idp_list_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_IDP_LIST, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_idp_list.h b/lasso/xml/saml-2.0/samlp2_idp_list.h new file mode 100644 index 00000000..ca56f876 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_idp_list.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_IDP_LIST_H__ +#define __LASSO_SAMLP2_IDP_LIST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_idp_entry.h" + +#define LASSO_TYPE_SAMLP2_IDP_LIST (lasso_samlp2_idp_list_get_type()) +#define LASSO_SAMLP2_IDP_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_IDP_LIST, \ + LassoSamlp2IDPList)) +#define LASSO_SAMLP2_IDP_LIST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_IDP_LIST, \ + LassoSamlp2IDPListClass)) +#define LASSO_IS_SAMLP2_IDP_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_IDP_LIST)) +#define LASSO_IS_SAMLP2_IDP_LIST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_IDP_LIST)) +#define LASSO_SAMLP2_IDP_LIST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_IDP_LIST, \ + LassoSamlp2IDPListClass)) + +typedef struct _LassoSamlp2IDPList LassoSamlp2IDPList; +typedef struct _LassoSamlp2IDPListClass LassoSamlp2IDPListClass; + + +struct _LassoSamlp2IDPList { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSamlp2IDPEntry *IDPEntry; + char *GetComplete; +}; + + +struct _LassoSamlp2IDPListClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_idp_list_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_idp_list_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_IDP_LIST_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_logout_request.c b/lasso/xml/saml-2.0/samlp2_logout_request.c new file mode 100644 index 00000000..8f1d29a8 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_logout_request.c @@ -0,0 +1,163 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_logout_request.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="LogoutRequestType"> + * <complexContent> + * <extension base="samlp:RequestAbstractType"> + * <sequence> + * <choice> + * <element ref="saml:BaseID"/> + * <element ref="saml:NameID"/> + * <element ref="saml:EncryptedID"/> + * </choice> + * <element ref="samlp:SessionIndex" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * <attribute name="Reason" type="string" use="optional"/> + * <attribute name="NotOnOrAfter" type="dateTime" use="optional"/> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "BaseID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2LogoutRequest, BaseID) }, + { "NameID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2LogoutRequest, NameID) }, + { "EncryptedID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2LogoutRequest, EncryptedID), + "LassoSaml2EncryptedElement" }, + { "SessionIndex", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2LogoutRequest, SessionIndex) }, + { "Reason", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2LogoutRequest, Reason) }, + { "NotOnOrAfter", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2LogoutRequest, NotOnOrAfter) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +static gchar* +build_query(LassoNode *node) +{ + char *ret, *deflated_message; + + deflated_message = lasso_node_build_deflated_query(node); + ret = g_strdup_printf("SAMLRequest=%s", deflated_message); + /* XXX: must support RelayState (which profiles?) */ + g_free(deflated_message); + return ret; +} + + +static gboolean +init_from_query(LassoNode *node, char **query_fields) +{ + gboolean rc; + char *relay_state = NULL; + rc = lasso_node_init_from_saml2_query_fields(node, query_fields, &relay_state); + if (rc && relay_state != NULL) { + /* XXX: support RelayState? */ + } + return rc; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2LogoutRequest *node) +{ + node->BaseID = NULL; + node->NameID = NULL; + node->EncryptedID = NULL; + node->SessionIndex = NULL; + node->Reason = NULL; + node->NotOnOrAfter = NULL; +} + +static void +class_init(LassoSamlp2LogoutRequestClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->build_query = build_query; + nclass->init_from_query = init_from_query; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "LogoutRequest"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_logout_request_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2LogoutRequestClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2LogoutRequest), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, + "LassoSamlp2LogoutRequest", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_logout_request_new: + * + * Creates a new #LassoSamlp2LogoutRequest object. + * + * Return value: a newly created #LassoSamlp2LogoutRequest object + **/ +LassoNode* +lasso_samlp2_logout_request_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_LOGOUT_REQUEST, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_logout_request.h b/lasso/xml/saml-2.0/samlp2_logout_request.h new file mode 100644 index 00000000..572f738e --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_logout_request.h @@ -0,0 +1,84 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_LOGOUT_REQUEST_H__ +#define __LASSO_SAMLP2_LOGOUT_REQUEST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_request_abstract.h" +#include "saml2_encrypted_element.h" +#include "saml2_name_id.h" +#include "saml2_base_idabstract.h" + +#define LASSO_TYPE_SAMLP2_LOGOUT_REQUEST (lasso_samlp2_logout_request_get_type()) +#define LASSO_SAMLP2_LOGOUT_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_LOGOUT_REQUEST, \ + LassoSamlp2LogoutRequest)) +#define LASSO_SAMLP2_LOGOUT_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_LOGOUT_REQUEST, \ + LassoSamlp2LogoutRequestClass)) +#define LASSO_IS_SAMLP2_LOGOUT_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_LOGOUT_REQUEST)) +#define LASSO_IS_SAMLP2_LOGOUT_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_LOGOUT_REQUEST)) +#define LASSO_SAMLP2_LOGOUT_REQUEST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_LOGOUT_REQUEST, \ + LassoSamlp2LogoutRequestClass)) + +typedef struct _LassoSamlp2LogoutRequest LassoSamlp2LogoutRequest; +typedef struct _LassoSamlp2LogoutRequestClass LassoSamlp2LogoutRequestClass; + + +struct _LassoSamlp2LogoutRequest { + LassoSamlp2RequestAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2BaseIDAbstract *BaseID; + LassoSaml2NameID *NameID; + LassoSaml2EncryptedElement *EncryptedID; + char *SessionIndex; + /* attributes */ + char *Reason; + char *NotOnOrAfter; +}; + + +struct _LassoSamlp2LogoutRequestClass { + LassoSamlp2RequestAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_logout_request_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_logout_request_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_LOGOUT_REQUEST_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_manage_name_id_request.c b/lasso/xml/saml-2.0/samlp2_manage_name_id_request.c new file mode 100644 index 00000000..a6a61e20 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_manage_name_id_request.c @@ -0,0 +1,162 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_manage_name_id_request.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="ManageNameIDRequestType"> + * <complexContent> + * <extension base="samlp:RequestAbstractType"> + * <sequence> + * <choice> + * <element ref="saml:NameID"/> + * <element ref="saml:EncryptedID"/> + * </choice> + * <choice> + * <element ref="samlp:NewID"/> + * <element ref="samlp:NewEncryptedID"/> + * <element ref="samlp:Terminate"/> + * </choice> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "NameID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2ManageNameIDRequest, NameID) }, + { "EncryptedID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2ManageNameIDRequest, EncryptedID), + "LassoSaml2EncryptedElement" }, + { "NewID", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2ManageNameIDRequest, NewID) }, + { "NewEncryptedID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2ManageNameIDRequest, NewEncryptedID), + "LassoSaml2EncryptedElement" }, + { "Terminate", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2ManageNameIDRequest, Terminate) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +static gchar* +build_query(LassoNode *node) +{ + char *ret, *deflated_message; + + deflated_message = lasso_node_build_deflated_query(node); + ret = g_strdup_printf("SAMLRequest=%s", deflated_message); + /* XXX: must support RelayState (which profiles?) */ + g_free(deflated_message); + return ret; +} + + +static gboolean +init_from_query(LassoNode *node, char **query_fields) +{ + gboolean rc; + char *relay_state = NULL; + rc = lasso_node_init_from_saml2_query_fields(node, query_fields, &relay_state); + if (rc && relay_state != NULL) { + /* XXX: support RelayState? */ + } + return rc; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2ManageNameIDRequest *node) +{ + node->NameID = NULL; + node->EncryptedID = NULL; + node->NewID = NULL; + node->NewEncryptedID = NULL; + node->Terminate = NULL; +} + +static void +class_init(LassoSamlp2ManageNameIDRequestClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->build_query = build_query; + nclass->init_from_query = init_from_query; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "ManageNameIDRequest"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_manage_name_id_request_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2ManageNameIDRequestClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2ManageNameIDRequest), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, + "LassoSamlp2ManageNameIDRequest", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_manage_name_id_request_new: + * + * Creates a new #LassoSamlp2ManageNameIDRequest object. + * + * Return value: a newly created #LassoSamlp2ManageNameIDRequest object + **/ +LassoNode* +lasso_samlp2_manage_name_id_request_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_MANAGE_NAME_ID_REQUEST, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_manage_name_id_request.h b/lasso/xml/saml-2.0/samlp2_manage_name_id_request.h new file mode 100644 index 00000000..ac353779 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_manage_name_id_request.h @@ -0,0 +1,82 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST_H__ +#define __LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_request_abstract.h" +#include "samlp2_terminate.h" +#include "saml2_encrypted_element.h" +#include "saml2_name_id.h" + +#define LASSO_TYPE_SAMLP2_MANAGE_NAME_ID_REQUEST (lasso_samlp2_manage_name_id_request_get_type()) +#define LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_MANAGE_NAME_ID_REQUEST, \ + LassoSamlp2ManageNameIDRequest)) +#define LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_MANAGE_NAME_ID_REQUEST, \ + LassoSamlp2ManageNameIDRequestClass)) +#define LASSO_IS_SAMLP2_MANAGE_NAME_ID_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_MANAGE_NAME_ID_REQUEST)) +#define LASSO_IS_SAMLP2_MANAGE_NAME_ID_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_MANAGE_NAME_ID_REQUEST)) +#define LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_MANAGE_NAME_ID_REQUEST, \ + LassoSamlp2ManageNameIDRequestClass)) + +typedef struct _LassoSamlp2ManageNameIDRequest LassoSamlp2ManageNameIDRequest; +typedef struct _LassoSamlp2ManageNameIDRequestClass LassoSamlp2ManageNameIDRequestClass; + + +struct _LassoSamlp2ManageNameIDRequest { + LassoSamlp2RequestAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2NameID *NameID; + LassoSaml2EncryptedElement *EncryptedID; + char *NewID; + LassoSaml2EncryptedElement *NewEncryptedID; + LassoSamlp2Terminate *Terminate; +}; + + +struct _LassoSamlp2ManageNameIDRequestClass { + LassoSamlp2RequestAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_manage_name_id_request_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_manage_name_id_request_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_name_id_mapping_request.c b/lasso/xml/saml-2.0/samlp2_name_id_mapping_request.c new file mode 100644 index 00000000..848bff58 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_name_id_mapping_request.c @@ -0,0 +1,155 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_name_id_mapping_request.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="NameIDMappingRequestType"> + * <complexContent> + * <extension base="samlp:RequestAbstractType"> + * <sequence> + * <choice> + * <element ref="saml:BaseID"/> + * <element ref="saml:NameID"/> + * <element ref="saml:EncryptedID"/> + * </choice> + * <element ref="samlp:NameIDPolicy"/> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "BaseID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2NameIDMappingRequest, BaseID) }, + { "NameID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2NameIDMappingRequest, NameID) }, + { "EncryptedID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2NameIDMappingRequest, EncryptedID), + "LassoSaml2EncryptedElement" }, + { "NameIDPolicy", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2NameIDMappingRequest, NameIDPolicy) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +static gchar* +build_query(LassoNode *node) +{ + char *ret, *deflated_message; + + deflated_message = lasso_node_build_deflated_query(node); + ret = g_strdup_printf("SAMLRequest=%s", deflated_message); + /* XXX: must support RelayState (which profiles?) */ + g_free(deflated_message); + return ret; +} + + +static gboolean +init_from_query(LassoNode *node, char **query_fields) +{ + gboolean rc; + char *relay_state = NULL; + rc = lasso_node_init_from_saml2_query_fields(node, query_fields, &relay_state); + if (rc && relay_state != NULL) { + /* XXX: support RelayState? */ + } + return rc; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2NameIDMappingRequest *node) +{ + node->BaseID = NULL; + node->NameID = NULL; + node->EncryptedID = NULL; + node->NameIDPolicy = NULL; +} + +static void +class_init(LassoSamlp2NameIDMappingRequestClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->build_query = build_query; + nclass->init_from_query = init_from_query; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "NameIDMappingRequest"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_name_id_mapping_request_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2NameIDMappingRequestClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2NameIDMappingRequest), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, + "LassoSamlp2NameIDMappingRequest", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_name_id_mapping_request_new: + * + * Creates a new #LassoSamlp2NameIDMappingRequest object. + * + * Return value: a newly created #LassoSamlp2NameIDMappingRequest object + **/ +LassoNode* +lasso_samlp2_name_id_mapping_request_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_REQUEST, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_name_id_mapping_request.h b/lasso/xml/saml-2.0/samlp2_name_id_mapping_request.h new file mode 100644 index 00000000..18660256 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_name_id_mapping_request.h @@ -0,0 +1,82 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_NAME_ID_MAPPING_REQUEST_H__ +#define __LASSO_SAMLP2_NAME_ID_MAPPING_REQUEST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_request_abstract.h" +#include "saml2_encrypted_element.h" +#include "saml2_name_id.h" +#include "saml2_base_idabstract.h" +#include "samlp2_name_id_policy.h" + +#define LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_REQUEST (lasso_samlp2_name_id_mapping_request_get_type()) +#define LASSO_SAMLP2_NAME_ID_MAPPING_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_REQUEST, \ + LassoSamlp2NameIDMappingRequest)) +#define LASSO_SAMLP2_NAME_ID_MAPPING_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_REQUEST, \ + LassoSamlp2NameIDMappingRequestClass)) +#define LASSO_IS_SAMLP2_NAME_ID_MAPPING_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_REQUEST)) +#define LASSO_IS_SAMLP2_NAME_ID_MAPPING_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_REQUEST)) +#define LASSO_SAMLP2_NAME_ID_MAPPING_REQUEST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_REQUEST, \ + LassoSamlp2NameIDMappingRequestClass)) + +typedef struct _LassoSamlp2NameIDMappingRequest LassoSamlp2NameIDMappingRequest; +typedef struct _LassoSamlp2NameIDMappingRequestClass LassoSamlp2NameIDMappingRequestClass; + + +struct _LassoSamlp2NameIDMappingRequest { + LassoSamlp2RequestAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2BaseIDAbstract *BaseID; + LassoSaml2NameID *NameID; + LassoSaml2EncryptedElement *EncryptedID; + LassoSamlp2NameIDPolicy *NameIDPolicy; +}; + + +struct _LassoSamlp2NameIDMappingRequestClass { + LassoSamlp2RequestAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_name_id_mapping_request_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_name_id_mapping_request_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_NAME_ID_MAPPING_REQUEST_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_name_id_mapping_response.c b/lasso/xml/saml-2.0/samlp2_name_id_mapping_response.c new file mode 100644 index 00000000..bc497df6 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_name_id_mapping_response.c @@ -0,0 +1,117 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_name_id_mapping_response.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="NameIDMappingResponseType"> + * <complexContent> + * <extension base="samlp:StatusResponseType"> + * <choice> + * <element ref="saml:NameID"/> + * <element ref="saml:EncryptedID"/> + * </choice> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "NameID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2NameIDMappingResponse, NameID) }, + { "EncryptedID", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2NameIDMappingResponse, EncryptedID), + "LassoSaml2EncryptedElement" }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2NameIDMappingResponse *node) +{ + node->NameID = NULL; + node->EncryptedID = NULL; +} + +static void +class_init(LassoSamlp2NameIDMappingResponseClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "NameIDMappingResponse"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_name_id_mapping_response_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2NameIDMappingResponseClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2NameIDMappingResponse), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_STATUS_RESPONSE, + "LassoSamlp2NameIDMappingResponse", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_name_id_mapping_response_new: + * + * Creates a new #LassoSamlp2NameIDMappingResponse object. + * + * Return value: a newly created #LassoSamlp2NameIDMappingResponse object + **/ +LassoNode* +lasso_samlp2_name_id_mapping_response_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_RESPONSE, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_name_id_mapping_response.h b/lasso/xml/saml-2.0/samlp2_name_id_mapping_response.h new file mode 100644 index 00000000..3021ca66 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_name_id_mapping_response.h @@ -0,0 +1,79 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_NAME_ID_MAPPING_RESPONSE_H__ +#define __LASSO_SAMLP2_NAME_ID_MAPPING_RESPONSE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_status_response.h" +#include "saml2_encrypted_element.h" +#include "saml2_name_id.h" + +#define LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_RESPONSE \ + (lasso_samlp2_name_id_mapping_response_get_type()) +#define LASSO_SAMLP2_NAME_ID_MAPPING_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_RESPONSE, \ + LassoSamlp2NameIDMappingResponse)) +#define LASSO_SAMLP2_NAME_ID_MAPPING_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_RESPONSE, \ + LassoSamlp2NameIDMappingResponseClass)) +#define LASSO_IS_SAMLP2_NAME_ID_MAPPING_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_RESPONSE)) +#define LASSO_IS_SAMLP2_NAME_ID_MAPPING_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_RESPONSE)) +#define LASSO_SAMLP2_NAME_ID_MAPPING_RESPONSE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_NAME_ID_MAPPING_RESPONSE, \ + LassoSamlp2NameIDMappingResponseClass)) + +typedef struct _LassoSamlp2NameIDMappingResponse LassoSamlp2NameIDMappingResponse; +typedef struct _LassoSamlp2NameIDMappingResponseClass LassoSamlp2NameIDMappingResponseClass; + + +struct _LassoSamlp2NameIDMappingResponse { + LassoSamlp2StatusResponse parent; + + /*< public >*/ + /* elements */ + LassoSaml2NameID *NameID; + LassoSaml2EncryptedElement *EncryptedID; +}; + + +struct _LassoSamlp2NameIDMappingResponseClass { + LassoSamlp2StatusResponseClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_name_id_mapping_response_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_name_id_mapping_response_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_NAME_ID_MAPPING_RESPONSE_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_name_id_policy.c b/lasso/xml/saml-2.0/samlp2_name_id_policy.c new file mode 100644 index 00000000..e55c153f --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_name_id_policy.c @@ -0,0 +1,114 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_name_id_policy.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="NameIDPolicyType"> + * <attribute name="Format" type="anyURI" use="optional"/> + * <attribute name="SPNameQualifier" type="string" use="optional"/> + * <attribute name="AllowCreate" type="boolean" use="optional"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Format", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2NameIDPolicy, Format) }, + { "SPNameQualifier", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2NameIDPolicy, SPNameQualifier) }, + { "AllowCreate", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN, + G_STRUCT_OFFSET(LassoSamlp2NameIDPolicy, AllowCreate) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2NameIDPolicy *node) +{ + node->Format = NULL; + node->SPNameQualifier = NULL; + node->AllowCreate = FALSE; +} + +static void +class_init(LassoSamlp2NameIDPolicyClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "NameIDPolicy"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_name_id_policy_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2NameIDPolicyClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2NameIDPolicy), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2NameIDPolicy", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_name_id_policy_new: + * + * Creates a new #LassoSamlp2NameIDPolicy object. + * + * Return value: a newly created #LassoSamlp2NameIDPolicy object + **/ +LassoNode* +lasso_samlp2_name_id_policy_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_NAME_ID_POLICY, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_name_id_policy.h b/lasso/xml/saml-2.0/samlp2_name_id_policy.h new file mode 100644 index 00000000..af6462ca --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_name_id_policy.h @@ -0,0 +1,77 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_NAME_ID_POLICY_H__ +#define __LASSO_SAMLP2_NAME_ID_POLICY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAMLP2_NAME_ID_POLICY (lasso_samlp2_name_id_policy_get_type()) +#define LASSO_SAMLP2_NAME_ID_POLICY(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_NAME_ID_POLICY, \ + LassoSamlp2NameIDPolicy)) +#define LASSO_SAMLP2_NAME_ID_POLICY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_NAME_ID_POLICY, \ + LassoSamlp2NameIDPolicyClass)) +#define LASSO_IS_SAMLP2_NAME_ID_POLICY(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_NAME_ID_POLICY)) +#define LASSO_IS_SAMLP2_NAME_ID_POLICY_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_NAME_ID_POLICY)) +#define LASSO_SAMLP2_NAME_ID_POLICY_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_NAME_ID_POLICY, \ + LassoSamlp2NameIDPolicyClass)) + +typedef struct _LassoSamlp2NameIDPolicy LassoSamlp2NameIDPolicy; +typedef struct _LassoSamlp2NameIDPolicyClass LassoSamlp2NameIDPolicyClass; + + +struct _LassoSamlp2NameIDPolicy { + LassoNode parent; + + /*< public >*/ + /* attributes */ + char *Format; + char *SPNameQualifier; + gboolean AllowCreate; +}; + + +struct _LassoSamlp2NameIDPolicyClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_name_id_policy_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_name_id_policy_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_NAME_ID_POLICY_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_request_abstract.c b/lasso/xml/saml-2.0/samlp2_request_abstract.c new file mode 100644 index 00000000..6957e736 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_request_abstract.c @@ -0,0 +1,167 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 <xmlsec/xmldsig.h> +#include <xmlsec/templates.h> + +#include "samlp2_request_abstract.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="RequestAbstractType" abstract="true"> + * <sequence> + * <element ref="saml:Issuer" minOccurs="0"/> + * <element ref="ds:Signature" minOccurs="0"/> + * <element ref="samlp:Extensions" minOccurs="0"/> + * </sequence> + * <attribute name="ID" type="ID" use="required"/> + * <attribute name="Version" type="string" use="required"/> + * <attribute name="IssueInstant" type="dateTime" use="required"/> + * <attribute name="Destination" type="anyURI" use="optional"/> + * <attribute name="Consent" type="anyURI" use="optional"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Issuer", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2RequestAbstract, Issuer), + "LassoSaml2NameID" }, + { "Extensions", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2RequestAbstract, Extensions) }, + { "ID", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2RequestAbstract, ID) }, + { "Version", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2RequestAbstract, Version) }, + { "IssueInstant", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2RequestAbstract, IssueInstant) }, + { "Destination", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2RequestAbstract, Destination) }, + { "Consent", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2RequestAbstract, Consent) }, + { "Signature", SNIPPET_SIGNATURE, + G_STRUCT_OFFSET(LassoSamlp2RequestAbstract, ID) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + + +static xmlNode* +get_xmlNode(LassoNode *node, gboolean lasso_dump) +{ + LassoSamlp2RequestAbstract *request = LASSO_SAMLP2_REQUEST_ABSTRACT(node); + xmlNode *xmlnode; + int rc; + + xmlnode = parent_class->get_xmlNode(node, lasso_dump); + + if (lasso_dump == FALSE && request->sign_type) { + rc = lasso_sign_node(xmlnode, "ID", request->ID, + request->private_key_file, request->certificate_file); + /* signature may have failed; what to do ? */ + } + + return xmlnode; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2RequestAbstract *node) +{ + node->Issuer = NULL; + node->Extensions = NULL; + node->ID = NULL; + node->Version = NULL; + node->IssueInstant = NULL; + node->Destination = NULL; + node->Consent = NULL; + node->sign_type = LASSO_SIGNATURE_TYPE_NONE; +} + +static void +class_init(LassoSamlp2RequestAbstractClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->get_xmlNode = get_xmlNode; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "RequestAbstract"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); + + nclass->node_data->sign_type_offset = G_STRUCT_OFFSET( + LassoSamlp2RequestAbstract, sign_type); + nclass->node_data->sign_method_offset = G_STRUCT_OFFSET( + LassoSamlp2RequestAbstract, sign_method); +} + +GType +lasso_samlp2_request_abstract_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2RequestAbstractClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2RequestAbstract), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2RequestAbstract", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_request_abstract_new: + * + * Creates a new #LassoSamlp2RequestAbstract object. + * + * Return value: a newly created #LassoSamlp2RequestAbstract object + **/ +LassoNode* +lasso_samlp2_request_abstract_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_request_abstract.h b/lasso/xml/saml-2.0/samlp2_request_abstract.h new file mode 100644 index 00000000..ae56f877 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_request_abstract.h @@ -0,0 +1,90 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_REQUEST_ABSTRACT_H__ +#define __LASSO_SAMLP2_REQUEST_ABSTRACT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "saml2_name_id.h" +#include "samlp2_extensions.h" + +#define LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT (lasso_samlp2_request_abstract_get_type()) +#define LASSO_SAMLP2_REQUEST_ABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, \ + LassoSamlp2RequestAbstract)) +#define LASSO_SAMLP2_REQUEST_ABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, \ + LassoSamlp2RequestAbstractClass)) +#define LASSO_IS_SAMLP2_REQUEST_ABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT)) +#define LASSO_IS_SAMLP2_REQUEST_ABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT)) +#define LASSO_SAMLP2_REQUEST_ABSTRACT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, \ + LassoSamlp2RequestAbstractClass)) + +typedef struct _LassoSamlp2RequestAbstract LassoSamlp2RequestAbstract; +typedef struct _LassoSamlp2RequestAbstractClass LassoSamlp2RequestAbstractClass; + + +struct _LassoSamlp2RequestAbstract { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSaml2NameID *Issuer; + LassoSamlp2Extensions *Extensions; + /* attributes */ + char *ID; + char *Version; + char *IssueInstant; + char *Destination; + char *Consent; + /*< private >*/ + /* ds:Signature stuffs */ + LassoSignatureType sign_type; + LassoSignatureMethod sign_method; + char *private_key_file; + char *certificate_file; + +}; + + +struct _LassoSamlp2RequestAbstractClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_request_abstract_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_request_abstract_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_REQUEST_ABSTRACT_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_requested_authn_context.c b/lasso/xml/saml-2.0/samlp2_requested_authn_context.c new file mode 100644 index 00000000..06748591 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_requested_authn_context.c @@ -0,0 +1,115 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_requested_authn_context.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="RequestedAuthnContextType"> + * <choice> + * <element ref="saml:AuthnContextClassRef" maxOccurs="unbounded"/> + * <element ref="saml:AuthnContextDeclRef" maxOccurs="unbounded"/> + * </choice> + * <attribute name="Comparison" type="samlp:AuthnContextComparisonType" use="optional"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "AuthnContextClassRef", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2RequestedAuthnContext, AuthnContextClassRef) }, + { "AuthnContextDeclRef", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2RequestedAuthnContext, AuthnContextDeclRef) }, + { "Comparison", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2RequestedAuthnContext, Comparison) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2RequestedAuthnContext *node) +{ + node->AuthnContextClassRef = NULL; + node->AuthnContextDeclRef = NULL; +} + +static void +class_init(LassoSamlp2RequestedAuthnContextClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "RequestedAuthnContext"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_requested_authn_context_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2RequestedAuthnContextClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2RequestedAuthnContext), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2RequestedAuthnContext", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_requested_authn_context_new: + * + * Creates a new #LassoSamlp2RequestedAuthnContext object. + * + * Return value: a newly created #LassoSamlp2RequestedAuthnContext object + **/ +LassoNode* +lasso_samlp2_requested_authn_context_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_REQUESTED_AUTHN_CONTEXT, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_requested_authn_context.h b/lasso/xml/saml-2.0/samlp2_requested_authn_context.h new file mode 100644 index 00000000..60c21954 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_requested_authn_context.h @@ -0,0 +1,78 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_REQUESTED_AUTHN_CONTEXT_H__ +#define __LASSO_SAMLP2_REQUESTED_AUTHN_CONTEXT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAMLP2_REQUESTED_AUTHN_CONTEXT (lasso_samlp2_requested_authn_context_get_type()) +#define LASSO_SAMLP2_REQUESTED_AUTHN_CONTEXT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_REQUESTED_AUTHN_CONTEXT, \ + LassoSamlp2RequestedAuthnContext)) +#define LASSO_SAMLP2_REQUESTED_AUTHN_CONTEXT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_REQUESTED_AUTHN_CONTEXT, \ + LassoSamlp2RequestedAuthnContextClass)) +#define LASSO_IS_SAMLP2_REQUESTED_AUTHN_CONTEXT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_REQUESTED_AUTHN_CONTEXT)) +#define LASSO_IS_SAMLP2_REQUESTED_AUTHN_CONTEXT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_REQUESTED_AUTHN_CONTEXT)) +#define LASSO_SAMLP2_REQUESTED_AUTHN_CONTEXT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_REQUESTED_AUTHN_CONTEXT, \ + LassoSamlp2RequestedAuthnContextClass)) + +typedef struct _LassoSamlp2RequestedAuthnContext LassoSamlp2RequestedAuthnContext; +typedef struct _LassoSamlp2RequestedAuthnContextClass LassoSamlp2RequestedAuthnContextClass; + + +struct _LassoSamlp2RequestedAuthnContext { + LassoNode parent; + + /*< public >*/ + /* elements */ + char *AuthnContextClassRef; + char *AuthnContextDeclRef; + /* attributes */ + char *Comparison; +}; + + +struct _LassoSamlp2RequestedAuthnContextClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_requested_authn_context_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_requested_authn_context_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_REQUESTED_AUTHN_CONTEXT_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_response.c b/lasso/xml/saml-2.0/samlp2_response.c new file mode 100644 index 00000000..b2bf27f8 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_response.c @@ -0,0 +1,116 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_response.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="ResponseType"> + * <complexContent> + * <extension base="samlp:StatusResponseType"> + * <choice minOccurs="0" maxOccurs="unbounded"> + * <element ref="saml:Assertion"/> + * <element ref="saml:EncryptedAssertion"/> + * </choice> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Assertion", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSamlp2Response, Assertion) }, + { "EncryptedAssertion", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSamlp2Response, EncryptedAssertion) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2Response *node) +{ + node->Assertion = NULL; + node->EncryptedAssertion = NULL; +} + +static void +class_init(LassoSamlp2ResponseClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Response"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_response_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2ResponseClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2Response), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_STATUS_RESPONSE, + "LassoSamlp2Response", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_response_new: + * + * Creates a new #LassoSamlp2Response object. + * + * Return value: a newly created #LassoSamlp2Response object + **/ +LassoNode* +lasso_samlp2_response_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_RESPONSE, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_response.h b/lasso/xml/saml-2.0/samlp2_response.h new file mode 100644 index 00000000..5e2576c6 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_response.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_RESPONSE_H__ +#define __LASSO_SAMLP2_RESPONSE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_status_response.h" + +#define LASSO_TYPE_SAMLP2_RESPONSE (lasso_samlp2_response_get_type()) +#define LASSO_SAMLP2_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_RESPONSE, \ + LassoSamlp2Response)) +#define LASSO_SAMLP2_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_RESPONSE, \ + LassoSamlp2ResponseClass)) +#define LASSO_IS_SAMLP2_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_RESPONSE)) +#define LASSO_IS_SAMLP2_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_RESPONSE)) +#define LASSO_SAMLP2_RESPONSE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_RESPONSE, \ + LassoSamlp2ResponseClass)) + +typedef struct _LassoSamlp2Response LassoSamlp2Response; +typedef struct _LassoSamlp2ResponseClass LassoSamlp2ResponseClass; + + +struct _LassoSamlp2Response { + LassoSamlp2StatusResponse parent; + + /*< public >*/ + /* elements */ + GList *Assertion; /* of LassoSaml2Assertion */ + GList *EncryptedAssertion; /* of LassoSaml2EncryptedElement */ +}; + + +struct _LassoSamlp2ResponseClass { + LassoSamlp2StatusResponseClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_response_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_response_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_RESPONSE_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_scoping.c b/lasso/xml/saml-2.0/samlp2_scoping.c new file mode 100644 index 00000000..d515c3a9 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_scoping.c @@ -0,0 +1,115 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_scoping.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="ScopingType"> + * <sequence> + * <element ref="samlp:IDPList" minOccurs="0"/> + * <element ref="samlp:RequesterID" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * <attribute name="ProxyCount" type="nonNegativeInteger" use="optional"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "IDPList", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2Scoping, IDPList) }, + { "RequesterID", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2Scoping, RequesterID) }, + { "ProxyCount", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2Scoping, ProxyCount) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2Scoping *node) +{ + node->IDPList = NULL; + node->RequesterID = NULL; +} + +static void +class_init(LassoSamlp2ScopingClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Scoping"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_scoping_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2ScopingClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2Scoping), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2Scoping", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_scoping_new: + * + * Creates a new #LassoSamlp2Scoping object. + * + * Return value: a newly created #LassoSamlp2Scoping object + **/ +LassoNode* +lasso_samlp2_scoping_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_SCOPING, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_scoping.h b/lasso/xml/saml-2.0/samlp2_scoping.h new file mode 100644 index 00000000..01a61812 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_scoping.h @@ -0,0 +1,78 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_SCOPING_H__ +#define __LASSO_SAMLP2_SCOPING_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_idp_list.h" + +#define LASSO_TYPE_SAMLP2_SCOPING (lasso_samlp2_scoping_get_type()) +#define LASSO_SAMLP2_SCOPING(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_SCOPING, \ + LassoSamlp2Scoping)) +#define LASSO_SAMLP2_SCOPING_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_SCOPING, \ + LassoSamlp2ScopingClass)) +#define LASSO_IS_SAMLP2_SCOPING(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_SCOPING)) +#define LASSO_IS_SAMLP2_SCOPING_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_SCOPING)) +#define LASSO_SAMLP2_SCOPING_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_SCOPING, \ + LassoSamlp2ScopingClass)) + +typedef struct _LassoSamlp2Scoping LassoSamlp2Scoping; +typedef struct _LassoSamlp2ScopingClass LassoSamlp2ScopingClass; + + +struct _LassoSamlp2Scoping { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSamlp2IDPList *IDPList; + char *RequesterID; + /* attributes */ + char *ProxyCount; +}; + + +struct _LassoSamlp2ScopingClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_scoping_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_scoping_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_SCOPING_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_status.c b/lasso/xml/saml-2.0/samlp2_status.c new file mode 100644 index 00000000..93893b4a --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_status.c @@ -0,0 +1,116 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_status.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="StatusType"> + * <sequence> + * <element ref="samlp:StatusCode"/> + * <element ref="samlp:StatusMessage" minOccurs="0"/> + * <element ref="samlp:StatusDetail" minOccurs="0"/> + * </sequence> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "StatusCode", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2Status, StatusCode) }, + { "StatusMessage", SNIPPET_CONTENT, + G_STRUCT_OFFSET(LassoSamlp2Status, StatusMessage) }, + { "StatusDetail", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2Status, StatusDetail) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2Status *node) +{ + node->StatusCode = NULL; + node->StatusMessage = NULL; + node->StatusDetail = NULL; +} + +static void +class_init(LassoSamlp2StatusClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Status"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_status_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2StatusClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2Status), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2Status", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_status_new: + * + * Creates a new #LassoSamlp2Status object. + * + * Return value: a newly created #LassoSamlp2Status object + **/ +LassoNode* +lasso_samlp2_status_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_STATUS, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_status.h b/lasso/xml/saml-2.0/samlp2_status.h new file mode 100644 index 00000000..bd2bfd0e --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_status.h @@ -0,0 +1,78 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_STATUS_H__ +#define __LASSO_SAMLP2_STATUS_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_status_code.h" +#include "samlp2_status_detail.h" + +#define LASSO_TYPE_SAMLP2_STATUS (lasso_samlp2_status_get_type()) +#define LASSO_SAMLP2_STATUS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_STATUS, \ + LassoSamlp2Status)) +#define LASSO_SAMLP2_STATUS_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_STATUS, \ + LassoSamlp2StatusClass)) +#define LASSO_IS_SAMLP2_STATUS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_STATUS)) +#define LASSO_IS_SAMLP2_STATUS_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_STATUS)) +#define LASSO_SAMLP2_STATUS_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_STATUS, \ + LassoSamlp2StatusClass)) + +typedef struct _LassoSamlp2Status LassoSamlp2Status; +typedef struct _LassoSamlp2StatusClass LassoSamlp2StatusClass; + + +struct _LassoSamlp2Status { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSamlp2StatusCode *StatusCode; + char *StatusMessage; + LassoSamlp2StatusDetail *StatusDetail; +}; + + +struct _LassoSamlp2StatusClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_status_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_status_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_STATUS_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_status_code.c b/lasso/xml/saml-2.0/samlp2_status_code.c new file mode 100644 index 00000000..fceac3f4 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_status_code.c @@ -0,0 +1,112 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_status_code.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="StatusCodeType"> + * <sequence> + * <element ref="samlp:StatusCode" minOccurs="0"/> + * </sequence> + * <attribute name="Value" type="anyURI" use="required"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "StatusCode", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2StatusCode, StatusCode) }, + { "Value", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2StatusCode, Value) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2StatusCode *node) +{ + node->StatusCode = NULL; + node->Value = NULL; +} + +static void +class_init(LassoSamlp2StatusCodeClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "StatusCode"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_status_code_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2StatusCodeClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2StatusCode), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2StatusCode", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_status_code_new: + * + * Creates a new #LassoSamlp2StatusCode object. + * + * Return value: a newly created #LassoSamlp2StatusCode object + **/ +LassoNode* +lasso_samlp2_status_code_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_STATUS_CODE, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_status_code.h b/lasso/xml/saml-2.0/samlp2_status_code.h new file mode 100644 index 00000000..4f8a4792 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_status_code.h @@ -0,0 +1,77 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_STATUS_CODE_H__ +#define __LASSO_SAMLP2_STATUS_CODE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAMLP2_STATUS_CODE (lasso_samlp2_status_code_get_type()) +#define LASSO_SAMLP2_STATUS_CODE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_STATUS_CODE, \ + LassoSamlp2StatusCode)) +#define LASSO_SAMLP2_STATUS_CODE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_STATUS_CODE, \ + LassoSamlp2StatusCodeClass)) +#define LASSO_IS_SAMLP2_STATUS_CODE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_STATUS_CODE)) +#define LASSO_IS_SAMLP2_STATUS_CODE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_STATUS_CODE)) +#define LASSO_SAMLP2_STATUS_CODE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_STATUS_CODE, \ + LassoSamlp2StatusCodeClass)) + +typedef struct _LassoSamlp2StatusCode LassoSamlp2StatusCode; +typedef struct _LassoSamlp2StatusCodeClass LassoSamlp2StatusCodeClass; + + +struct _LassoSamlp2StatusCode { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSamlp2StatusCode *StatusCode; + /* attributes */ + char *Value; +}; + + +struct _LassoSamlp2StatusCodeClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_status_code_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_status_code_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_STATUS_CODE_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_status_detail.c b/lasso/xml/saml-2.0/samlp2_status_detail.c new file mode 100644 index 00000000..eb70b7f8 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_status_detail.c @@ -0,0 +1,105 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_status_detail.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="StatusDetailType"> + * <sequence> + * <any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> + * </sequence> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2StatusDetail *node) +{ +} + +static void +class_init(LassoSamlp2StatusDetailClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "StatusDetail"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_status_detail_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2StatusDetailClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2StatusDetail), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2StatusDetail", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_status_detail_new: + * + * Creates a new #LassoSamlp2StatusDetail object. + * + * Return value: a newly created #LassoSamlp2StatusDetail object + **/ +LassoNode* +lasso_samlp2_status_detail_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_STATUS_DETAIL, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_status_detail.h b/lasso/xml/saml-2.0/samlp2_status_detail.h new file mode 100644 index 00000000..c8f729eb --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_status_detail.h @@ -0,0 +1,73 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_STATUS_DETAIL_H__ +#define __LASSO_SAMLP2_STATUS_DETAIL_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAMLP2_STATUS_DETAIL (lasso_samlp2_status_detail_get_type()) +#define LASSO_SAMLP2_STATUS_DETAIL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_STATUS_DETAIL, \ + LassoSamlp2StatusDetail)) +#define LASSO_SAMLP2_STATUS_DETAIL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_STATUS_DETAIL, \ + LassoSamlp2StatusDetailClass)) +#define LASSO_IS_SAMLP2_STATUS_DETAIL(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_STATUS_DETAIL)) +#define LASSO_IS_SAMLP2_STATUS_DETAIL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_STATUS_DETAIL)) +#define LASSO_SAMLP2_STATUS_DETAIL_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_STATUS_DETAIL, \ + LassoSamlp2StatusDetailClass)) + +typedef struct _LassoSamlp2StatusDetail LassoSamlp2StatusDetail; +typedef struct _LassoSamlp2StatusDetailClass LassoSamlp2StatusDetailClass; + + +struct _LassoSamlp2StatusDetail { + LassoNode parent; + + /*< public >*/ +}; + + +struct _LassoSamlp2StatusDetailClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_status_detail_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_status_detail_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_STATUS_DETAIL_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_status_response.c b/lasso/xml/saml-2.0/samlp2_status_response.c new file mode 100644 index 00000000..2fa79fb3 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_status_response.c @@ -0,0 +1,175 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 <xmlsec/xmldsig.h> +#include <xmlsec/templates.h> + +#include "samlp2_status_response.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="StatusResponseType"> + * <sequence> + * <element ref="saml:Issuer" minOccurs="0"/> + * <element ref="ds:Signature" minOccurs="0"/> + * <element ref="samlp:Extensions" minOccurs="0"/> + * <element ref="samlp:Status"/> + * </sequence> + * <attribute name="ID" type="ID" use="required"/> + * <attribute name="InResponseTo" type="NCName" use="optional"/> + * <attribute name="Version" type="string" use="required"/> + * <attribute name="IssueInstant" type="dateTime" use="required"/> + * <attribute name="Destination" type="anyURI" use="optional"/> + * <attribute name="Consent" type="anyURI" use="optional"/> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Issuer", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, Issuer), + "LassoSaml2NameID" }, + { "Extensions", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, Extensions) }, + { "Status", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, Status) }, + { "ID", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, ID) }, + { "InResponseTo", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, InResponseTo) }, + { "Version", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, Version) }, + { "IssueInstant", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, IssueInstant) }, + { "Destination", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, Destination) }, + { "Consent", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, Consent) }, + { "Signature", SNIPPET_SIGNATURE, + G_STRUCT_OFFSET(LassoSamlp2StatusResponse, ID) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + + +static xmlNode* +get_xmlNode(LassoNode *node, gboolean lasso_dump) +{ + LassoSamlp2StatusResponse *request = LASSO_SAMLP2_STATUS_RESPONSE(node); + xmlNode *xmlnode; + int rc; + + xmlnode = parent_class->get_xmlNode(node, lasso_dump); + + if (lasso_dump == FALSE && request->sign_type) { + rc = lasso_sign_node(xmlnode, "ID", request->ID, + request->private_key_file, request->certificate_file); + /* signature may have failed; what to do ? */ + } + + return xmlnode; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2StatusResponse *node) +{ + node->Issuer = NULL; + node->Extensions = NULL; + node->Status = NULL; + node->ID = NULL; + node->InResponseTo = NULL; + node->Version = NULL; + node->IssueInstant = NULL; + node->Destination = NULL; + node->Consent = NULL; + node->sign_type = LASSO_SIGNATURE_TYPE_NONE; +} + +static void +class_init(LassoSamlp2StatusResponseClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->get_xmlNode = get_xmlNode; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "StatusResponse"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); + + nclass->node_data->sign_type_offset = G_STRUCT_OFFSET( + LassoSamlp2StatusResponse, sign_type); + nclass->node_data->sign_method_offset = G_STRUCT_OFFSET( + LassoSamlp2StatusResponse, sign_method); +} + +GType +lasso_samlp2_status_response_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2StatusResponseClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2StatusResponse), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2StatusResponse", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_status_response_new: + * + * Creates a new #LassoSamlp2StatusResponse object. + * + * Return value: a newly created #LassoSamlp2StatusResponse object + **/ +LassoNode* +lasso_samlp2_status_response_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_STATUS_RESPONSE, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_status_response.h b/lasso/xml/saml-2.0/samlp2_status_response.h new file mode 100644 index 00000000..fe714c89 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_status_response.h @@ -0,0 +1,93 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_STATUS_RESPONSE_H__ +#define __LASSO_SAMLP2_STATUS_RESPONSE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_status.h" +#include "saml2_name_id.h" +#include "samlp2_extensions.h" + +#define LASSO_TYPE_SAMLP2_STATUS_RESPONSE (lasso_samlp2_status_response_get_type()) +#define LASSO_SAMLP2_STATUS_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_STATUS_RESPONSE, \ + LassoSamlp2StatusResponse)) +#define LASSO_SAMLP2_STATUS_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_STATUS_RESPONSE, \ + LassoSamlp2StatusResponseClass)) +#define LASSO_IS_SAMLP2_STATUS_RESPONSE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_STATUS_RESPONSE)) +#define LASSO_IS_SAMLP2_STATUS_RESPONSE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_STATUS_RESPONSE)) +#define LASSO_SAMLP2_STATUS_RESPONSE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_STATUS_RESPONSE, \ + LassoSamlp2StatusResponseClass)) + +typedef struct _LassoSamlp2StatusResponse LassoSamlp2StatusResponse; +typedef struct _LassoSamlp2StatusResponseClass LassoSamlp2StatusResponseClass; + + +struct _LassoSamlp2StatusResponse { + LassoNode parent; + + /*< public >*/ + /* elements */ + LassoSaml2NameID *Issuer; + LassoSamlp2Extensions *Extensions; + LassoSamlp2Status *Status; + /* attributes */ + char *ID; + char *InResponseTo; + char *Version; + char *IssueInstant; + char *Destination; + char *Consent; + /*< private >*/ + /* ds:Signature stuffs */ + LassoSignatureType sign_type; + LassoSignatureMethod sign_method; + char *private_key_file; + char *certificate_file; + +}; + + +struct _LassoSamlp2StatusResponseClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_status_response_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_status_response_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_STATUS_RESPONSE_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_subject_query_abstract.c b/lasso/xml/saml-2.0/samlp2_subject_query_abstract.c new file mode 100644 index 00000000..cc64943b --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_subject_query_abstract.c @@ -0,0 +1,140 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_subject_query_abstract.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="SubjectQueryAbstractType" abstract="true"> + * <complexContent> + * <extension base="samlp:RequestAbstractType"> + * <sequence> + * <element ref="saml:Subject"/> + * </sequence> + * </extension> + * </complexContent> + * </complexType> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + { "Subject", SNIPPET_NODE, + G_STRUCT_OFFSET(LassoSamlp2SubjectQueryAbstract, Subject) }, + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +static gchar* +build_query(LassoNode *node) +{ + char *ret, *deflated_message; + + deflated_message = lasso_node_build_deflated_query(node); + ret = g_strdup_printf("SAMLRequest=%s", deflated_message); + /* XXX: must support RelayState (which profiles?) */ + g_free(deflated_message); + return ret; +} + + +static gboolean +init_from_query(LassoNode *node, char **query_fields) +{ + gboolean rc; + char *relay_state = NULL; + rc = lasso_node_init_from_saml2_query_fields(node, query_fields, &relay_state); + if (rc && relay_state != NULL) { + /* XXX: support RelayState? */ + } + return rc; +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2SubjectQueryAbstract *node) +{ + node->Subject = NULL; +} + +static void +class_init(LassoSamlp2SubjectQueryAbstractClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->build_query = build_query; + nclass->init_from_query = init_from_query; + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "SubjectQueryAbstract"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_subject_query_abstract_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2SubjectQueryAbstractClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2SubjectQueryAbstract), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_SAMLP2_REQUEST_ABSTRACT, + "LassoSamlp2SubjectQueryAbstract", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_subject_query_abstract_new: + * + * Creates a new #LassoSamlp2SubjectQueryAbstract object. + * + * Return value: a newly created #LassoSamlp2SubjectQueryAbstract object + **/ +LassoNode* +lasso_samlp2_subject_query_abstract_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_subject_query_abstract.h b/lasso/xml/saml-2.0/samlp2_subject_query_abstract.h new file mode 100644 index 00000000..88a986a9 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_subject_query_abstract.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT_H__ +#define __LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_request_abstract.h" +#include "saml2_subject.h" + +#define LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT (lasso_samlp2_subject_query_abstract_get_type()) +#define LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT, \ + LassoSamlp2SubjectQueryAbstract)) +#define LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT, \ + LassoSamlp2SubjectQueryAbstractClass)) +#define LASSO_IS_SAMLP2_SUBJECT_QUERY_ABSTRACT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT)) +#define LASSO_IS_SAMLP2_SUBJECT_QUERY_ABSTRACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT)) +#define LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_SUBJECT_QUERY_ABSTRACT, \ + LassoSamlp2SubjectQueryAbstractClass)) + +typedef struct _LassoSamlp2SubjectQueryAbstract LassoSamlp2SubjectQueryAbstract; +typedef struct _LassoSamlp2SubjectQueryAbstractClass LassoSamlp2SubjectQueryAbstractClass; + + +struct _LassoSamlp2SubjectQueryAbstract { + LassoSamlp2RequestAbstract parent; + + /*< public >*/ + /* elements */ + LassoSaml2Subject *Subject; +}; + + +struct _LassoSamlp2SubjectQueryAbstractClass { + LassoSamlp2RequestAbstractClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_subject_query_abstract_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_subject_query_abstract_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_terminate.c b/lasso/xml/saml-2.0/samlp2_terminate.c new file mode 100644 index 00000000..d3fa95fb --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_terminate.c @@ -0,0 +1,101 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 "samlp2_terminate.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * <complexType name="TerminateType"/> + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + + +static struct XmlSnippet schema_snippets[] = { + {NULL, 0, 0} +}; + +static LassoNodeClass *parent_class = NULL; + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSamlp2Terminate *node) +{ +} + +static void +class_init(LassoSamlp2TerminateClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Terminate"); + lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_samlp2_terminate_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSamlp2TerminateClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSamlp2Terminate), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSamlp2Terminate", &this_info, 0); + } + return this_type; +} + +/** + * lasso_samlp2_terminate_new: + * + * Creates a new #LassoSamlp2Terminate object. + * + * Return value: a newly created #LassoSamlp2Terminate object + **/ +LassoNode* +lasso_samlp2_terminate_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_TERMINATE, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_terminate.h b/lasso/xml/saml-2.0/samlp2_terminate.h new file mode 100644 index 00000000..c24c3831 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_terminate.h @@ -0,0 +1,73 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * 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 + */ + +#ifndef __LASSO_SAMLP2_TERMINATE_H__ +#define __LASSO_SAMLP2_TERMINATE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SAMLP2_TERMINATE (lasso_samlp2_terminate_get_type()) +#define LASSO_SAMLP2_TERMINATE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_TERMINATE, \ + LassoSamlp2Terminate)) +#define LASSO_SAMLP2_TERMINATE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_TERMINATE, \ + LassoSamlp2TerminateClass)) +#define LASSO_IS_SAMLP2_TERMINATE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_TERMINATE)) +#define LASSO_IS_SAMLP2_TERMINATE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_TERMINATE)) +#define LASSO_SAMLP2_TERMINATE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_TERMINATE, \ + LassoSamlp2TerminateClass)) + +typedef struct _LassoSamlp2Terminate LassoSamlp2Terminate; +typedef struct _LassoSamlp2TerminateClass LassoSamlp2TerminateClass; + + +struct _LassoSamlp2Terminate { + LassoNode parent; + + /*< public >*/ +}; + + +struct _LassoSamlp2TerminateClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_samlp2_terminate_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_terminate_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_TERMINATE_H__ */ diff --git a/lasso/xml/samlp_response.c b/lasso/xml/samlp_response.c index 71f21088..388efee7 100644 --- a/lasso/xml/samlp_response.c +++ b/lasso/xml/samlp_response.c @@ -151,7 +151,7 @@ lasso_samlp_response_get_type() * * Return value: a newly created #LassoSamlpResponse object **/ -LassoSamlpResponseAbstract* +LassoNode* lasso_samlp_response_new() { LassoSamlpResponseAbstract *response; @@ -172,5 +172,5 @@ lasso_samlp_response_new() status->StatusCode = status_code; LASSO_SAMLP_RESPONSE(response)->Status = status; - return response; + return LASSO_NODE(response); } diff --git a/lasso/xml/samlp_response.h b/lasso/xml/samlp_response.h index c587d4af..739bf53d 100644 --- a/lasso/xml/samlp_response.h +++ b/lasso/xml/samlp_response.h @@ -63,7 +63,7 @@ struct _LassoSamlpResponseClass { }; LASSO_EXPORT GType lasso_samlp_response_get_type(void); -LASSO_EXPORT LassoSamlpResponseAbstract* lasso_samlp_response_new(void); +LASSO_EXPORT LassoNode* lasso_samlp_response_new(void); #ifdef __cplusplus diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c index 2e305418..3275e8f7 100644 --- a/lasso/xml/tools.c +++ b/lasso/xml/tools.c @@ -37,6 +37,8 @@ #include <xmlsec/xmldsig.h> #include <xmlsec/xmltree.h> +#include <zlib.h> + #include <lasso/xml/xml.h> /** @@ -657,3 +659,128 @@ lasso_sign_node(xmlNode *xmlnode, const char *id_attr_name, const char *id_value return 0; } +gchar* +lasso_node_build_deflated_query(LassoNode *node) +{ + /* actually deflated and b64'ed and url-escaped */ + xmlNode *message; + xmlOutputBufferPtr buf; + xmlCharEncodingHandlerPtr handler = NULL; + xmlChar *buffer; + xmlChar *ret, *orig_ret, *b64_ret; + z_stream zstr; + int z_err; + int buf_size; + char *rret; + + message = lasso_node_get_xmlNode(node, FALSE); + + handler = xmlFindCharEncodingHandler("utf-8"); + buf = xmlAllocOutputBuffer(handler); + xmlNodeDumpOutput(buf, NULL, message, 0, 0, "utf-8"); + xmlOutputBufferFlush(buf); + buffer = buf->conv ? buf->conv->content : buf->buffer->content; + + + zstr.zalloc = NULL; + zstr.zfree = NULL; + zstr.opaque = NULL; + + zstr.avail_in = strlen((char*)buffer); + buf_size = zstr.avail_in*2; + ret = orig_ret = g_malloc(buf_size); + /* deflating should never increase the required size but we are + * more conservative than that. Twice the size should be + * enough. */ + zstr.next_in = buffer; + zstr.total_in = 0; + zstr.next_out = ret; + + z_err = deflateInit(&zstr, 6); + if (z_err != Z_OK) { + message(G_LOG_LEVEL_CRITICAL, "Failed to deflateInit"); + return NULL; + } + do { + z_err = deflate(&zstr, Z_FINISH); + if (z_err == Z_OK) { + buf_size *= 2; + ret = g_realloc(ret, buf_size); + zstr.next_out = (xmlChar*) orig_ret-zstr.next_out+ret; + orig_ret = ret; + } + } while (z_err == Z_OK); + if (z_err != Z_STREAM_END) { + message(G_LOG_LEVEL_CRITICAL, "Failed to deflate"); + return NULL; + } + + b64_ret = xmlSecBase64Encode(ret, zstr.total_out, 0); + xmlOutputBufferClose(buf); + free(ret); + + ret = xmlURIEscapeStr(b64_ret, NULL); + rret = g_strdup((char*)ret); + xmlFree(b64_ret); + xmlFree(ret); + + return rret; +} + +gboolean +lasso_node_init_from_deflated_query_part(LassoNode *node, char *deflate_string) +{ + int len; + xmlChar *b64_zre, *zre, *re; + z_stream zstr; + int z_err; + xmlDoc *doc; + xmlNode *root; + + b64_zre = (xmlChar*)xmlURIUnescapeString(deflate_string, 0, NULL); + len = strlen((char*)b64_zre); + zre = xmlMalloc(len*4); + len = xmlSecBase64Decode(b64_zre, zre, len*4); + xmlFree(b64_zre); + + zstr.zalloc = NULL; + zstr.zfree = NULL; + zstr.opaque = NULL; + + zstr.avail_in = len; + re = xmlMalloc(len*10); + zstr.next_in = (xmlChar*)zre; + zstr.total_in = 0; + zstr.avail_out = len*10; + zstr.total_out = 0; + zstr.next_out = re; + + z_err = inflateInit(&zstr); + if (z_err != Z_OK) { + message(G_LOG_LEVEL_CRITICAL, "Failed to inflateInit"); + xmlFree(zre); + xmlFree(re); + return FALSE; + } + + z_err = inflate(&zstr, Z_FINISH); + if (z_err != Z_STREAM_END) { + message(G_LOG_LEVEL_CRITICAL, "Failed to inflate"); + inflateEnd(&zstr); + xmlFree(zre); + xmlFree(re); + return FALSE; + } + re[zstr.total_out] = 0; + inflateEnd(&zstr); + xmlFree(zre); + + doc = xmlParseMemory((char*)re, strlen((char*)re)); + xmlFree(re); + root = xmlDocGetRootElement(doc); + lasso_node_init_from_xml(node, root); + xmlFreeDoc(doc); + + return TRUE; +} + diff --git a/swig/Lasso.i b/swig/Lasso.i index d0c2900c..ff88d3b2 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -40,6 +40,11 @@ #define LASSO_WSF_ENABLED #endif +#ifndef SWIGPHP4 +%rename(SAML2_SUPPORT) LASSO_SAML2_SUPPORT; +#endif +%include Lasso-saml2.i + %{ #if defined(SWIGRUBY) || defined (PHP_VERSION) @@ -518,7 +523,7 @@ typedef struct node_info { #endif } node_info; -static node_info node_infos[100]; /* FIXME: Size should be computed */ +static node_info node_infos[250]; /* FIXME: Size should be computed */ /* Cast a LassoNode into the appropriate derivated class. */ static swig_type_info *dynamic_cast_node(void **nodePointer) { @@ -649,6 +654,7 @@ DYNAMIC_CAST(SWIGTYPE_p_LassoSamlpResponseAbstract, dynamic_cast_node); SET_NODE_INFO(Node, DowncastableNode) %include inheritance.h +%include saml-2.0/inheritance.h #else /* ifdef SWIGCSHARP */ @@ -663,6 +669,7 @@ SET_NODE_INFO(Node, DowncastableNode) SET_NODE_INFO(Node, DowncastableNode) %include inheritance.h +%include saml-2.0/inheritance.h #else /* ifdef SWIGJAVA */ @@ -684,6 +691,7 @@ SET_NODE_INFO(Node, DowncastableNode) #endif #include <swig/inheritance.h> +#include <swig/saml-2.0/inheritance.h> info->name = NULL; info->swig = NULL; @@ -716,6 +724,8 @@ SET_NODE_INFO(Node, DowncastableNode) %rename(HTTP_METHOD_POST) LASSO_HTTP_METHOD_POST; %rename(HTTP_METHOD_REDIRECT) LASSO_HTTP_METHOD_REDIRECT; %rename(HTTP_METHOD_SOAP) LASSO_HTTP_METHOD_SOAP; +%rename(HTTP_METHOD_ARTIFACT_GET) LASSO_HTTP_METHOD_ARTIFACT_GET; +%rename(HTTP_METHOD_ARTIFACT_POST) LASSO_HTTP_METHOD_ARTIFACT_POST; %rename(HttpMethod) LassoHttpMethod; #endif typedef enum { @@ -725,7 +735,9 @@ typedef enum { LASSO_HTTP_METHOD_GET, LASSO_HTTP_METHOD_POST, LASSO_HTTP_METHOD_REDIRECT, - LASSO_HTTP_METHOD_SOAP + LASSO_HTTP_METHOD_SOAP, + LASSO_HTTP_METHOD_ARTIFACT_GET, + LASSO_HTTP_METHOD_ARTIFACT_POST } LassoHttpMethod; /* Consent */ @@ -816,6 +828,21 @@ typedef enum { LASSO_PROVIDER_ROLE_IDP } LassoProviderRole; +/* ProtocolConformance */ +#ifndef SWIGPHP4 +%rename(PROTOCOL_LIBERTY_1_0) LASSO_PROTOCOL_LIBERTY_1_0; +%rename(PROTOCOL_LIBERTY_1_1) LASSO_PROTOCOL_LIBERTY_1_1; +%rename(PROTOCOL_LIBERTY_1_2) LASSO_PROTOCOL_LIBERTY_1_2; +%rename(PROTOCOL_SAML_2_0) LASSO_PROTOCOL_SAML_2_0; +%rename(ProtocolConformance) LassoProtocolConformance; +#endif +typedef enum { + LASSO_PROTOCOL_LIBERTY_1_0, + LASSO_PROTOCOL_LIBERTY_1_1, + LASSO_PROTOCOL_LIBERTY_1_2, + LASSO_PROTOCOL_SAML_2_0 +} LassoProtocolConformance; + /* RequestType */ #ifndef SWIGPHP4 %rename(REQUEST_TYPE_INVALID) LASSO_REQUEST_TYPE_INVALID; @@ -4903,7 +4930,7 @@ typedef struct { char* getOrganization(); LassoHttpMethod getFirstHttpMethod( - LassoProvider *remote_provider, LassoMdProtocolType protocol_type); + LassoProvider *remote_provider, int protocol_type); // FIXME: GList* lasso_provider_get_metadata_list(char *name); @@ -4911,6 +4938,8 @@ typedef struct { char* getMetadataOne(char *name); gboolean hasProtocolProfile(LassoMdProtocolType protocol_type, char *protocol_profile); + + LassoProtocolConformance getProtocolConformance(); } %{ @@ -4936,9 +4965,11 @@ typedef struct { #define LassoProvider_getBase64SuccinctId lasso_provider_get_base64_succinct_id #define LassoProvider_getFirstHttpMethod lasso_provider_get_first_http_method #define LassoProvider_getMetadataOne lasso_provider_get_metadata_one +#define LassoProvider_getProtocolConformance lasso_provider_get_protocol_conformance #define LassoProvider_hasProtocolProfile lasso_provider_has_protocol_profile #define LassoProvider_getOrganization(self) get_xml_string(lasso_provider_get_organization(self)) + %} @@ -5027,7 +5058,7 @@ typedef struct { char* getOrganization(); LassoHttpMethod getFirstHttpMethod( - LassoProvider *remote_provider, LassoMdProtocolType protocol_type); + LassoProvider *remote_provider, int protocol_type); // FIXME: GList* lasso_provider_get_metadata_list(char *name); @@ -5036,6 +5067,8 @@ typedef struct { gboolean hasProtocolProfile(LassoMdProtocolType protocol_type, char *protocol_profile); + LassoProtocolConformance getProtocolConformance(); + /* Methods */ THROW_ERROR @@ -5120,6 +5153,7 @@ LassoStringList *LassoServer_providerIds_get(LassoServer *self) { #define LassoServer_getBase64SuccinctId(server) lasso_provider_get_base64_succinct_id(LASSO_PROVIDER(server)) #define LassoServer_getFirstHttpMethod(server, remote_provider, protocol_type) lasso_provider_get_first_http_method(LASSO_PROVIDER(server), remote_provider, protocol_type) #define LassoServer_getMetadataOne(server, name) lasso_provider_get_metadata_one(LASSO_PROVIDER(server), name) +#define LassoServer_getProtocolConformance(server) lasso_provider_get_protocol_conformance(LASSO_PROVIDER(server)) #define LassoServer_hasProtocolProfile(server, protocol_type, protocol_profile) lasso_provider_has_protocol_profile(LASSO_PROVIDER(server), protocol_type, protocol_profile) #define LassoServer_getOrganization(server) get_xml_string(lasso_provider_get_organization(LASSO_PROVIDER(server))) @@ -5157,13 +5191,13 @@ typedef struct { %rename(localNameIdentifier) local_nameIdentifier; #endif %newobject local_nameIdentifier_get; - LassoSamlNameIdentifier *local_nameIdentifier; + LassoNode *local_nameIdentifier; #ifndef SWIGPHP4 %rename(remoteNameIdentifier) remote_nameIdentifier; #endif %newobject remote_nameIdentifier_get; - LassoSamlNameIdentifier *remote_nameIdentifier; + LassoNode *remote_nameIdentifier; /* Constructor, Destructor & Static Methods */ @@ -5435,6 +5469,10 @@ typedef struct { } LassoDefederation; %extend LassoDefederation { /* Attributes inherited from Profile */ + %immutable artifact; + char *artifact; + + char *artifactMessage; %newobject identity_get; LassoIdentity *identity; @@ -5455,15 +5493,15 @@ typedef struct { char *msgUrl; %newobject nameIdentifier_get; - LassoSamlNameIdentifier *nameIdentifier; + LassoNode *nameIdentifier; char *remoteProviderId; %newobject request_get; - LassoSamlpRequestAbstract *request; + LassoNode *request; %newobject response_get; - LassoSamlpResponseAbstract *response; + LassoNode *response; %newobject server_get; LassoServer *server; @@ -5517,6 +5555,16 @@ typedef struct { #define LassoDefederation_set_identity(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) #define LassoDefederation_identity_set(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) +/* artifact */ +#define LassoDefederation_get_artifact(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) +#define LassoDefederation_artifact_get(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) + +/* artifactMessage */ +#define LassoDefederation_get_artifactMessage(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoDefederation_artifactMessage_get(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoDefederation_set_artifactMessage(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) +#define LassoDefederation_artifactMessage_set(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) + /* isIdentityDirty */ #define LassoDefederation_get_isIdentityDirty(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) #define LassoDefederation_isIdentityDirty_get(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) @@ -5617,6 +5665,10 @@ typedef struct { } LassoLogin; %extend LassoLogin { /* Attributes inherited from Profile */ + %immutable artifact; + char *artifact; + + char *artifactMessage; %newobject identity_get; LassoIdentity *identity; @@ -5637,15 +5689,15 @@ typedef struct { char *msgUrl; %newobject nameIdentifier_get; - LassoSamlNameIdentifier *nameIdentifier; + LassoNode *nameIdentifier; char *remoteProviderId; %newobject request_get; - LassoSamlpRequestAbstract *request; + LassoNode *request; %newobject response_get; - LassoSamlpResponseAbstract *response; + LassoNode *response; %newobject server_get; LassoServer *server; @@ -5766,6 +5818,16 @@ typedef struct { #define LassoLogin_set_identity(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) #define LassoLogin_identity_set(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) +/* artifact */ +#define LassoLogin_get_artifact(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) +#define LassoLogin_artifact_get(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) + +/* artifactMessage */ +#define LassoLogin_get_artifactMessage(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoLogin_artifactMessage_get(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoLogin_set_artifactMessage(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) +#define LassoLogin_artifactMessage_set(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) + /* isIdentityDirty */ #define LassoLogin_get_isIdentityDirty(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) #define LassoLogin_isIdentityDirty_get(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) @@ -5880,6 +5942,10 @@ typedef struct { } LassoLogout; %extend LassoLogout { /* Attributes inherited from Profile */ + %immutable artifact; + char *artifact; + + char *artifactMessage; %newobject identity_get; LassoIdentity *identity; @@ -5900,15 +5966,15 @@ typedef struct { char *msgUrl; %newobject nameIdentifier_get; - LassoSamlNameIdentifier *nameIdentifier; + LassoNode *nameIdentifier; char *remoteProviderId; %newobject request_get; - LassoSamlpRequestAbstract *request; + LassoNode *request; %newobject response_get; - LassoSamlpResponseAbstract *response; + LassoNode *response; %newobject server_get; LassoServer *server; @@ -5983,6 +6049,16 @@ typedef struct { #define LassoLogout_set_identity(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) #define LassoLogout_identity_set(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) +/* artifact */ +#define LassoLogout_get_artifact(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) +#define LassoLogout_artifact_get(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) + +/* artifactMessage */ +#define LassoLogout_get_artifactMessage(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoLogout_artifactMessage_get(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoLogout_set_artifactMessage(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) +#define LassoLogout_artifactMessage_set(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) + /* isIdentityDirty */ #define LassoLogout_get_isIdentityDirty(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) #define LassoLogout_isIdentityDirty_get(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) @@ -6089,6 +6165,10 @@ typedef struct { } LassoLecp; %extend LassoLecp { /* Attributes inherited from Profile */ + %immutable artifact; + char *artifact; + + char *artifactMessage; %newobject identity_get; LassoIdentity *identity; @@ -6109,15 +6189,15 @@ typedef struct { char *msgUrl; %newobject nameIdentifier_get; - LassoSamlNameIdentifier *nameIdentifier; + LassoNode *nameIdentifier; char *remoteProviderId; %newobject request_get; - LassoSamlpRequestAbstract *request; + LassoNode *request; %newobject response_get; - LassoSamlpResponseAbstract *response; + LassoNode *response; %newobject server_get; LassoServer *server; @@ -6208,6 +6288,16 @@ typedef struct { #define LassoLecp_set_identity(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) #define LassoLecp_identity_set(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) +/* artifact */ +#define LassoLecp_get_artifact(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) +#define LassoLecp_artifact_get(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) + +/* artifactMessage */ +#define LassoLecp_get_artifactMessage(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoLecp_artifactMessage_get(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoLecp_set_artifactMessage(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) +#define LassoLecp_artifactMessage_set(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) + /* isIdentityDirty */ #define LassoLecp_get_isIdentityDirty(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) #define LassoLecp_isIdentityDirty_get(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) @@ -6333,6 +6423,10 @@ typedef struct { } LassoNameIdentifierMapping; %extend LassoNameIdentifierMapping { /* Attributes inherited from Profile */ + %immutable artifact; + char *artifact; + + char *artifactMessage; %newobject identity_get; LassoIdentity *identity; @@ -6350,15 +6444,15 @@ typedef struct { char *msgUrl; %newobject nameIdentifier_get; - LassoSamlNameIdentifier *nameIdentifier; + LassoNode *nameIdentifier; char *remoteProviderId; %newobject request_get; - LassoSamlpRequestAbstract *request; + LassoNode *request; %newobject response_get; - LassoSamlpResponseAbstract *response; + LassoNode *response; %newobject server_get; LassoServer *server; @@ -6419,6 +6513,16 @@ typedef struct { #define LassoNameIdentifierMapping_set_identity(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) #define LassoNameIdentifierMapping_identity_set(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) +/* artifact */ +#define LassoNameIdentifierMapping_get_artifact(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) +#define LassoNameIdentifierMapping_artifact_get(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) + +/* artifactMessage */ +#define LassoNameIdentifierMapping_get_artifactMessage(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoNameIdentifierMapping_artifactMessage_get(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoNameIdentifierMapping_set_artifactMessage(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) +#define LassoNameIdentifierMapping_artifactMessage_set(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) + /* isIdentityDirty */ #define LassoNameIdentifierMapping_get_isIdentityDirty(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) #define LassoNameIdentifierMapping_isIdentityDirty_get(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) @@ -6514,6 +6618,10 @@ typedef struct { } LassoNameRegistration; %extend LassoNameRegistration { /* Attributes inherited from Profile */ + %immutable artifact; + char *artifact; + + char *artifactMessage; %newobject identity_get; LassoIdentity *identity; @@ -6534,15 +6642,15 @@ typedef struct { char *msgUrl; %newobject nameIdentifier_get; - LassoSamlNameIdentifier *nameIdentifier; + LassoNode *nameIdentifier; char *remoteProviderId; %newobject request_get; - LassoSamlpRequestAbstract *request; + LassoNode *request; %newobject response_get; - LassoSamlpResponseAbstract *response; + LassoNode *response; %newobject server_get; LassoServer *server; @@ -6615,6 +6723,16 @@ typedef struct { #define LassoNameRegistration_set_identity(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) #define LassoNameRegistration_identity_set(self, value) set_node((gpointer *) &LASSO_PROFILE(self)->identity, (value)) +/* artifact */ +#define LassoNameRegistration_get_artifact(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) +#define LassoNameRegistration_artifact_get(self) lasso_profile_get_artifact(LASSO_PROFILE(self)) + +/* artifactMessage */ +#define LassoNameRegistration_get_artifactMessage(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoNameRegistration_artifactMessage_get(self) lasso_profile_get_artifact_message(LASSO_PROFILE(self)) +#define LassoNameRegistration_set_artifactMessage(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) +#define LassoNameRegistration_artifactMessage_set(self, value) lasso_profile_set_artifact_message(LASSO_PROFILE(self), value) + /* isIdentityDirty */ #define LassoNameRegistration_get_isIdentityDirty(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) #define LassoNameRegistration_isIdentityDirty_get(self) lasso_profile_is_identity_dirty(LASSO_PROFILE(self)) @@ -6715,3 +6833,5 @@ int LassoNameRegistration_setSessionFromDump(LassoNameRegistration *self, char * %include Lasso-wsf.i #endif +%include saml-2.0/main.h + diff --git a/swig/Makefile.am b/swig/Makefile.am index dc138d72..2062d6fa 100644 --- a/swig/Makefile.am +++ b/swig/Makefile.am @@ -3,3 +3,4 @@ EXTRA_DIST = Lasso.i Lasso-wsf.i Lasso-wsf-disco.i Lasso-wsf-dst.i \ Lasso-wsf-is.i Lasso-wsf-sa.i Lasso-wsf-soap.i inheritance.h \ wsf-support.i.in +SUBDIRS = saml-2.0 diff --git a/swig/saml-2.0/Makefile.am b/swig/saml-2.0/Makefile.am new file mode 100644 index 00000000..7a670b90 --- /dev/null +++ b/swig/saml-2.0/Makefile.am @@ -0,0 +1,54 @@ + +EXTRA_DIST = \ + inheritance.h \ + main.h \ + Makefile.am \ + saml2_action.i \ + saml2_advice.i \ + saml2_assertion.i \ + saml2_attribute.i \ + saml2_attribute_statement.i \ + saml2_audience_restriction.i \ + saml2_authn_context.i \ + saml2_authn_statement.i \ + saml2_authz_decision_statement.i \ + saml2_base_idabstract.i \ + saml2_condition_abstract.i \ + saml2_conditions.i \ + saml2_encrypted_element.i \ + saml2_evidence.i \ + saml2_key_info_confirmation_data.i \ + saml2_name_id.i \ + saml2_one_time_use.i \ + saml2_proxy_restriction.i \ + saml2_statement_abstract.i \ + saml2_subject_confirmation_data.i \ + saml2_subject_confirmation.i \ + saml2_subject.i \ + saml2_subject_locality.i \ + samlp2_artifact_resolve.i \ + samlp2_artifact_response.i \ + samlp2_assertion_idrequest.i \ + samlp2_attribute_query.i \ + samlp2_authn_query.i \ + samlp2_authn_request.i \ + samlp2_authz_decision_query.i \ + samlp2_extensions.i \ + samlp2_idp_entry.i \ + samlp2_idp_list.i \ + samlp2_logout_request.i \ + samlp2_manage_name_id_request.i \ + samlp2_name_id_mapping_request.i \ + samlp2_name_id_mapping_response.i \ + samlp2_name_id_policy.i \ + samlp2_request_abstract.i \ + samlp2_requested_authn_context.i \ + samlp2_response.i \ + samlp2_scoping.i \ + samlp2_status_code.i \ + samlp2_status_detail.i \ + samlp2_status.i \ + samlp2_status_response.i \ + samlp2_subject_query_abstract.i \ + samlp2_terminate.i + diff --git a/swig/saml-2.0/saml2_action.i b/swig/saml-2.0/saml2_action.i new file mode 100644 index 00000000..a4a5f7b3 --- /dev/null +++ b/swig/saml-2.0/saml2_action.i @@ -0,0 +1,34 @@ + +#ifndef SWIGPHP4 +%rename(Saml2Action) LassoSaml2Action; +#endif +typedef struct { + char *content; + char *Namespace; +} LassoSaml2Action; +%extend LassoSaml2Action { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2Action(); + ~LassoSaml2Action(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2Action lasso_saml2_action_new +#define delete_LassoSaml2Action(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2Action_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_advice.i b/swig/saml-2.0/saml2_advice.i new file mode 100644 index 00000000..fe70c0d5 --- /dev/null +++ b/swig/saml-2.0/saml2_advice.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Saml2Advice) LassoSaml2Advice; +#endif +typedef struct { +} LassoSaml2Advice; +%extend LassoSaml2Advice { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2Advice(); + ~LassoSaml2Advice(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2Advice lasso_saml2_advice_new +#define delete_LassoSaml2Advice(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2Advice_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_assertion.i b/swig/saml-2.0/saml2_assertion.i new file mode 100644 index 00000000..0206003b --- /dev/null +++ b/swig/saml-2.0/saml2_assertion.i @@ -0,0 +1,91 @@ + +#ifndef SWIGPHP4 +%rename(Saml2Assertion) LassoSaml2Assertion; +#endif +typedef struct { + char *Version; + char *ID; + char *IssueInstant; +} LassoSaml2Assertion; +%extend LassoSaml2Assertion { + +#ifndef SWIGPHP4 + %rename(issuer) Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(subject) Subject; +#endif + %newobject *Subject_get; + LassoSaml2Subject *Subject; + +#ifndef SWIGPHP4 + %rename(conditions) Conditions; +#endif + %newobject *Conditions_get; + LassoSaml2Conditions *Conditions; + +#ifndef SWIGPHP4 + %rename(advice) Advice; +#endif + %newobject *Advice_get; + LassoSaml2Advice *Advice; + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2Assertion(); + ~LassoSaml2Assertion(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* Issuer */ + +#define LassoSaml2Assertion_get_Issuer(self) get_node((self)->Issuer) +#define LassoSaml2Assertion_Issuer_get(self) get_node((self)->Issuer) +#define LassoSaml2Assertion_set_Issuer(self,value) set_node((gpointer*)&(self)->Issuer, (value)) +#define LassoSaml2Assertion_Issuer_set(self,value) set_node((gpointer*)&(self)->Issuer, (value)) + + +/* Subject */ + +#define LassoSaml2Assertion_get_Subject(self) get_node((self)->Subject) +#define LassoSaml2Assertion_Subject_get(self) get_node((self)->Subject) +#define LassoSaml2Assertion_set_Subject(self,value) set_node((gpointer*)&(self)->Subject, (value)) +#define LassoSaml2Assertion_Subject_set(self,value) set_node((gpointer*)&(self)->Subject, (value)) + + +/* Conditions */ + +#define LassoSaml2Assertion_get_Conditions(self) get_node((self)->Conditions) +#define LassoSaml2Assertion_Conditions_get(self) get_node((self)->Conditions) +#define LassoSaml2Assertion_set_Conditions(self,value) set_node((gpointer*)&(self)->Conditions, (value)) +#define LassoSaml2Assertion_Conditions_set(self,value) set_node((gpointer*)&(self)->Conditions, (value)) + + +/* Advice */ + +#define LassoSaml2Assertion_get_Advice(self) get_node((self)->Advice) +#define LassoSaml2Assertion_Advice_get(self) get_node((self)->Advice) +#define LassoSaml2Assertion_set_Advice(self,value) set_node((gpointer*)&(self)->Advice, (value)) +#define LassoSaml2Assertion_Advice_set(self,value) set_node((gpointer*)&(self)->Advice, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2Assertion lasso_saml2_assertion_new +#define delete_LassoSaml2Assertion(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2Assertion_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_attribute.i b/swig/saml-2.0/saml2_attribute.i new file mode 100644 index 00000000..522636cb --- /dev/null +++ b/swig/saml-2.0/saml2_attribute.i @@ -0,0 +1,35 @@ + +#ifndef SWIGPHP4 +%rename(Saml2Attribute) LassoSaml2Attribute; +#endif +typedef struct { + char *Name; + char *NameFormat; + char *FriendlyName; +} LassoSaml2Attribute; +%extend LassoSaml2Attribute { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2Attribute(); + ~LassoSaml2Attribute(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2Attribute lasso_saml2_attribute_new +#define delete_LassoSaml2Attribute(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2Attribute_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_attribute_statement.i b/swig/saml-2.0/saml2_attribute_statement.i new file mode 100644 index 00000000..0eaa3eab --- /dev/null +++ b/swig/saml-2.0/saml2_attribute_statement.i @@ -0,0 +1,33 @@ + +#ifndef SWIGPHP4 +%rename(Saml2AttributeStatement) LassoSaml2AttributeStatement; +#endif +typedef struct { +} LassoSaml2AttributeStatement; +%extend LassoSaml2AttributeStatement { + + /* inherited from Saml2StatementAbstract */ + + /* Constructor, Destructor & Static Methods */ + LassoSaml2AttributeStatement(); + ~LassoSaml2AttributeStatement(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2AttributeStatement lasso_saml2_attribute_statement_new +#define delete_LassoSaml2AttributeStatement(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2AttributeStatement_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_audience_restriction.i b/swig/saml-2.0/saml2_audience_restriction.i new file mode 100644 index 00000000..5b635ce8 --- /dev/null +++ b/swig/saml-2.0/saml2_audience_restriction.i @@ -0,0 +1,34 @@ + +#ifndef SWIGPHP4 +%rename(Saml2AudienceRestriction) LassoSaml2AudienceRestriction; +#endif +typedef struct { + char *Audience; +} LassoSaml2AudienceRestriction; +%extend LassoSaml2AudienceRestriction { + + /* inherited from Saml2ConditionAbstract */ + + /* Constructor, Destructor & Static Methods */ + LassoSaml2AudienceRestriction(); + ~LassoSaml2AudienceRestriction(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2AudienceRestriction lasso_saml2_audience_restriction_new +#define delete_LassoSaml2AudienceRestriction(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2AudienceRestriction_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_authn_context.i b/swig/saml-2.0/saml2_authn_context.i new file mode 100644 index 00000000..db3d5391 --- /dev/null +++ b/swig/saml-2.0/saml2_authn_context.i @@ -0,0 +1,35 @@ + +#ifndef SWIGPHP4 +%rename(Saml2AuthnContext) LassoSaml2AuthnContext; +#endif +typedef struct { + char *AuthnContextClassRef; + char *AuthnContextDeclRef; + char *AuthenticatingAuthority; +} LassoSaml2AuthnContext; +%extend LassoSaml2AuthnContext { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2AuthnContext(); + ~LassoSaml2AuthnContext(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2AuthnContext lasso_saml2_authn_context_new +#define delete_LassoSaml2AuthnContext(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2AuthnContext_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_authn_statement.i b/swig/saml-2.0/saml2_authn_statement.i new file mode 100644 index 00000000..76583356 --- /dev/null +++ b/swig/saml-2.0/saml2_authn_statement.i @@ -0,0 +1,64 @@ + +#ifndef SWIGPHP4 +%rename(Saml2AuthnStatement) LassoSaml2AuthnStatement; +#endif +typedef struct { + char *AuthnInstant; + char *SessionIndex; + char *SessionNotOnOrAfter; +} LassoSaml2AuthnStatement; +%extend LassoSaml2AuthnStatement { + +#ifndef SWIGPHP4 + %rename(subjectLocality) SubjectLocality; +#endif + %newobject *SubjectLocality_get; + LassoSaml2SubjectLocality *SubjectLocality; + +#ifndef SWIGPHP4 + %rename(authnContext) AuthnContext; +#endif + %newobject *AuthnContext_get; + LassoSaml2AuthnContext *AuthnContext; + + /* inherited from Saml2StatementAbstract */ + + /* Constructor, Destructor & Static Methods */ + LassoSaml2AuthnStatement(); + ~LassoSaml2AuthnStatement(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* SubjectLocality */ + +#define LassoSaml2AuthnStatement_get_SubjectLocality(self) get_node((self)->SubjectLocality) +#define LassoSaml2AuthnStatement_SubjectLocality_get(self) get_node((self)->SubjectLocality) +#define LassoSaml2AuthnStatement_set_SubjectLocality(self,value) set_node((gpointer*)&(self)->SubjectLocality, (value)) +#define LassoSaml2AuthnStatement_SubjectLocality_set(self,value) set_node((gpointer*)&(self)->SubjectLocality, (value)) + + +/* AuthnContext */ + +#define LassoSaml2AuthnStatement_get_AuthnContext(self) get_node((self)->AuthnContext) +#define LassoSaml2AuthnStatement_AuthnContext_get(self) get_node((self)->AuthnContext) +#define LassoSaml2AuthnStatement_set_AuthnContext(self,value) set_node((gpointer*)&(self)->AuthnContext, (value)) +#define LassoSaml2AuthnStatement_AuthnContext_set(self,value) set_node((gpointer*)&(self)->AuthnContext, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2AuthnStatement lasso_saml2_authn_statement_new +#define delete_LassoSaml2AuthnStatement(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2AuthnStatement_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_authz_decision_statement.i b/swig/saml-2.0/saml2_authz_decision_statement.i new file mode 100644 index 00000000..956b7e2d --- /dev/null +++ b/swig/saml-2.0/saml2_authz_decision_statement.i @@ -0,0 +1,63 @@ + +#ifndef SWIGPHP4 +%rename(Saml2AuthzDecisionStatement) LassoSaml2AuthzDecisionStatement; +#endif +typedef struct { + char *Resource; + char *Decision; +} LassoSaml2AuthzDecisionStatement; +%extend LassoSaml2AuthzDecisionStatement { + +#ifndef SWIGPHP4 + %rename(action) Action; +#endif + %newobject *Action_get; + LassoSaml2Action *Action; + +#ifndef SWIGPHP4 + %rename(evidence) Evidence; +#endif + %newobject *Evidence_get; + LassoSaml2Evidence *Evidence; + + /* inherited from Saml2StatementAbstract */ + + /* Constructor, Destructor & Static Methods */ + LassoSaml2AuthzDecisionStatement(); + ~LassoSaml2AuthzDecisionStatement(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* Action */ + +#define LassoSaml2AuthzDecisionStatement_get_Action(self) get_node((self)->Action) +#define LassoSaml2AuthzDecisionStatement_Action_get(self) get_node((self)->Action) +#define LassoSaml2AuthzDecisionStatement_set_Action(self,value) set_node((gpointer*)&(self)->Action, (value)) +#define LassoSaml2AuthzDecisionStatement_Action_set(self,value) set_node((gpointer*)&(self)->Action, (value)) + + +/* Evidence */ + +#define LassoSaml2AuthzDecisionStatement_get_Evidence(self) get_node((self)->Evidence) +#define LassoSaml2AuthzDecisionStatement_Evidence_get(self) get_node((self)->Evidence) +#define LassoSaml2AuthzDecisionStatement_set_Evidence(self,value) set_node((gpointer*)&(self)->Evidence, (value)) +#define LassoSaml2AuthzDecisionStatement_Evidence_set(self,value) set_node((gpointer*)&(self)->Evidence, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2AuthzDecisionStatement lasso_saml2_authz_decision_statement_new +#define delete_LassoSaml2AuthzDecisionStatement(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2AuthzDecisionStatement_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_base_idabstract.i b/swig/saml-2.0/saml2_base_idabstract.i new file mode 100644 index 00000000..05919ac9 --- /dev/null +++ b/swig/saml-2.0/saml2_base_idabstract.i @@ -0,0 +1,34 @@ + +#ifndef SWIGPHP4 +%rename(Saml2BaseIDAbstract) LassoSaml2BaseIDAbstract; +#endif +typedef struct { + char *NameQualifier; + char *SPNameQualifier; +} LassoSaml2BaseIDAbstract; +%extend LassoSaml2BaseIDAbstract { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2BaseIDAbstract(); + ~LassoSaml2BaseIDAbstract(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2BaseIDAbstract lasso_saml2_base_idabstract_new +#define delete_LassoSaml2BaseIDAbstract(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2BaseIDAbstract_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_condition_abstract.i b/swig/saml-2.0/saml2_condition_abstract.i new file mode 100644 index 00000000..117b3676 --- /dev/null +++ b/swig/saml-2.0/saml2_condition_abstract.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Saml2ConditionAbstract) LassoSaml2ConditionAbstract; +#endif +typedef struct { +} LassoSaml2ConditionAbstract; +%extend LassoSaml2ConditionAbstract { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2ConditionAbstract(); + ~LassoSaml2ConditionAbstract(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2ConditionAbstract lasso_saml2_condition_abstract_new +#define delete_LassoSaml2ConditionAbstract(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2ConditionAbstract_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_conditions.i b/swig/saml-2.0/saml2_conditions.i new file mode 100644 index 00000000..30cc9daf --- /dev/null +++ b/swig/saml-2.0/saml2_conditions.i @@ -0,0 +1,34 @@ + +#ifndef SWIGPHP4 +%rename(Saml2Conditions) LassoSaml2Conditions; +#endif +typedef struct { + char *NotBefore; + char *NotOnOrAfter; +} LassoSaml2Conditions; +%extend LassoSaml2Conditions { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2Conditions(); + ~LassoSaml2Conditions(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2Conditions lasso_saml2_conditions_new +#define delete_LassoSaml2Conditions(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2Conditions_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_encrypted_element.i b/swig/saml-2.0/saml2_encrypted_element.i new file mode 100644 index 00000000..d8f3cde7 --- /dev/null +++ b/swig/saml-2.0/saml2_encrypted_element.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Saml2EncryptedElement) LassoSaml2EncryptedElement; +#endif +typedef struct { +} LassoSaml2EncryptedElement; +%extend LassoSaml2EncryptedElement { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2EncryptedElement(); + ~LassoSaml2EncryptedElement(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2EncryptedElement lasso_saml2_encrypted_element_new +#define delete_LassoSaml2EncryptedElement(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2EncryptedElement_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_evidence.i b/swig/saml-2.0/saml2_evidence.i new file mode 100644 index 00000000..fa5f42f1 --- /dev/null +++ b/swig/saml-2.0/saml2_evidence.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Saml2Evidence) LassoSaml2Evidence; +#endif +typedef struct { +} LassoSaml2Evidence; +%extend LassoSaml2Evidence { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2Evidence(); + ~LassoSaml2Evidence(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2Evidence lasso_saml2_evidence_new +#define delete_LassoSaml2Evidence(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2Evidence_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_key_info_confirmation_data.i b/swig/saml-2.0/saml2_key_info_confirmation_data.i new file mode 100644 index 00000000..e8bd1f30 --- /dev/null +++ b/swig/saml-2.0/saml2_key_info_confirmation_data.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Saml2KeyInfoConfirmationData) LassoSaml2KeyInfoConfirmationData; +#endif +typedef struct { +} LassoSaml2KeyInfoConfirmationData; +%extend LassoSaml2KeyInfoConfirmationData { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2KeyInfoConfirmationData(); + ~LassoSaml2KeyInfoConfirmationData(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2KeyInfoConfirmationData lasso_saml2_key_info_confirmation_data_new +#define delete_LassoSaml2KeyInfoConfirmationData(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2KeyInfoConfirmationData_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_name_id.i b/swig/saml-2.0/saml2_name_id.i new file mode 100644 index 00000000..832a5417 --- /dev/null +++ b/swig/saml-2.0/saml2_name_id.i @@ -0,0 +1,37 @@ + +#ifndef SWIGPHP4 +%rename(Saml2NameID) LassoSaml2NameID; +#endif +typedef struct { + char *content; + char *Format; + char *SPProvidedID; + char *NameQualifier; + char *SPNameQualifier; +} LassoSaml2NameID; +%extend LassoSaml2NameID { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2NameID(); + ~LassoSaml2NameID(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2NameID lasso_saml2_name_id_new +#define delete_LassoSaml2NameID(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2NameID_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_one_time_use.i b/swig/saml-2.0/saml2_one_time_use.i new file mode 100644 index 00000000..4dd7d5f4 --- /dev/null +++ b/swig/saml-2.0/saml2_one_time_use.i @@ -0,0 +1,33 @@ + +#ifndef SWIGPHP4 +%rename(Saml2OneTimeUse) LassoSaml2OneTimeUse; +#endif +typedef struct { +} LassoSaml2OneTimeUse; +%extend LassoSaml2OneTimeUse { + + /* inherited from Saml2ConditionAbstract */ + + /* Constructor, Destructor & Static Methods */ + LassoSaml2OneTimeUse(); + ~LassoSaml2OneTimeUse(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2OneTimeUse lasso_saml2_one_time_use_new +#define delete_LassoSaml2OneTimeUse(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2OneTimeUse_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_proxy_restriction.i b/swig/saml-2.0/saml2_proxy_restriction.i new file mode 100644 index 00000000..84604473 --- /dev/null +++ b/swig/saml-2.0/saml2_proxy_restriction.i @@ -0,0 +1,35 @@ + +#ifndef SWIGPHP4 +%rename(Saml2ProxyRestriction) LassoSaml2ProxyRestriction; +#endif +typedef struct { + char *Audience; + char *Count; +} LassoSaml2ProxyRestriction; +%extend LassoSaml2ProxyRestriction { + + /* inherited from Saml2ConditionAbstract */ + + /* Constructor, Destructor & Static Methods */ + LassoSaml2ProxyRestriction(); + ~LassoSaml2ProxyRestriction(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2ProxyRestriction lasso_saml2_proxy_restriction_new +#define delete_LassoSaml2ProxyRestriction(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2ProxyRestriction_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_statement_abstract.i b/swig/saml-2.0/saml2_statement_abstract.i new file mode 100644 index 00000000..5cbecb35 --- /dev/null +++ b/swig/saml-2.0/saml2_statement_abstract.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Saml2StatementAbstract) LassoSaml2StatementAbstract; +#endif +typedef struct { +} LassoSaml2StatementAbstract; +%extend LassoSaml2StatementAbstract { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2StatementAbstract(); + ~LassoSaml2StatementAbstract(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2StatementAbstract lasso_saml2_statement_abstract_new +#define delete_LassoSaml2StatementAbstract(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2StatementAbstract_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_subject.i b/swig/saml-2.0/saml2_subject.i new file mode 100644 index 00000000..0cb7b943 --- /dev/null +++ b/swig/saml-2.0/saml2_subject.i @@ -0,0 +1,88 @@ + +#ifndef SWIGPHP4 +%rename(Saml2Subject) LassoSaml2Subject; +#endif +typedef struct { +} LassoSaml2Subject; +%extend LassoSaml2Subject { + +#ifndef SWIGPHP4 + %rename(baseID) BaseID; +#endif + %newobject *BaseID_get; + LassoSaml2BaseIDAbstract *BaseID; + +#ifndef SWIGPHP4 + %rename(nameID) NameID; +#endif + %newobject *NameID_get; + LassoSaml2NameID *NameID; + +#ifndef SWIGPHP4 + %rename(encryptedID) EncryptedID; +#endif + %newobject *EncryptedID_get; + LassoSaml2EncryptedElement *EncryptedID; + +#ifndef SWIGPHP4 + %rename(subjectConfirmation) SubjectConfirmation; +#endif + %newobject *SubjectConfirmation_get; + LassoSaml2SubjectConfirmation *SubjectConfirmation; + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2Subject(); + ~LassoSaml2Subject(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* BaseID */ + +#define LassoSaml2Subject_get_BaseID(self) get_node((self)->BaseID) +#define LassoSaml2Subject_BaseID_get(self) get_node((self)->BaseID) +#define LassoSaml2Subject_set_BaseID(self,value) set_node((gpointer*)&(self)->BaseID, (value)) +#define LassoSaml2Subject_BaseID_set(self,value) set_node((gpointer*)&(self)->BaseID, (value)) + + +/* NameID */ + +#define LassoSaml2Subject_get_NameID(self) get_node((self)->NameID) +#define LassoSaml2Subject_NameID_get(self) get_node((self)->NameID) +#define LassoSaml2Subject_set_NameID(self,value) set_node((gpointer*)&(self)->NameID, (value)) +#define LassoSaml2Subject_NameID_set(self,value) set_node((gpointer*)&(self)->NameID, (value)) + + +/* EncryptedID */ + +#define LassoSaml2Subject_get_EncryptedID(self) get_node((self)->EncryptedID) +#define LassoSaml2Subject_EncryptedID_get(self) get_node((self)->EncryptedID) +#define LassoSaml2Subject_set_EncryptedID(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) +#define LassoSaml2Subject_EncryptedID_set(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) + + +/* SubjectConfirmation */ + +#define LassoSaml2Subject_get_SubjectConfirmation(self) get_node((self)->SubjectConfirmation) +#define LassoSaml2Subject_SubjectConfirmation_get(self) get_node((self)->SubjectConfirmation) +#define LassoSaml2Subject_set_SubjectConfirmation(self,value) set_node((gpointer*)&(self)->SubjectConfirmation, (value)) +#define LassoSaml2Subject_SubjectConfirmation_set(self,value) set_node((gpointer*)&(self)->SubjectConfirmation, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2Subject lasso_saml2_subject_new +#define delete_LassoSaml2Subject(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2Subject_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_subject_confirmation.i b/swig/saml-2.0/saml2_subject_confirmation.i new file mode 100644 index 00000000..55a6ea4c --- /dev/null +++ b/swig/saml-2.0/saml2_subject_confirmation.i @@ -0,0 +1,89 @@ + +#ifndef SWIGPHP4 +%rename(Saml2SubjectConfirmation) LassoSaml2SubjectConfirmation; +#endif +typedef struct { + char *Method; +} LassoSaml2SubjectConfirmation; +%extend LassoSaml2SubjectConfirmation { + +#ifndef SWIGPHP4 + %rename(baseID) BaseID; +#endif + %newobject *BaseID_get; + LassoSaml2BaseIDAbstract *BaseID; + +#ifndef SWIGPHP4 + %rename(nameID) NameID; +#endif + %newobject *NameID_get; + LassoSaml2NameID *NameID; + +#ifndef SWIGPHP4 + %rename(encryptedID) EncryptedID; +#endif + %newobject *EncryptedID_get; + LassoSaml2EncryptedElement *EncryptedID; + +#ifndef SWIGPHP4 + %rename(subjectConfirmationData) SubjectConfirmationData; +#endif + %newobject *SubjectConfirmationData_get; + LassoSaml2SubjectConfirmationData *SubjectConfirmationData; + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2SubjectConfirmation(); + ~LassoSaml2SubjectConfirmation(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* BaseID */ + +#define LassoSaml2SubjectConfirmation_get_BaseID(self) get_node((self)->BaseID) +#define LassoSaml2SubjectConfirmation_BaseID_get(self) get_node((self)->BaseID) +#define LassoSaml2SubjectConfirmation_set_BaseID(self,value) set_node((gpointer*)&(self)->BaseID, (value)) +#define LassoSaml2SubjectConfirmation_BaseID_set(self,value) set_node((gpointer*)&(self)->BaseID, (value)) + + +/* NameID */ + +#define LassoSaml2SubjectConfirmation_get_NameID(self) get_node((self)->NameID) +#define LassoSaml2SubjectConfirmation_NameID_get(self) get_node((self)->NameID) +#define LassoSaml2SubjectConfirmation_set_NameID(self,value) set_node((gpointer*)&(self)->NameID, (value)) +#define LassoSaml2SubjectConfirmation_NameID_set(self,value) set_node((gpointer*)&(self)->NameID, (value)) + + +/* EncryptedID */ + +#define LassoSaml2SubjectConfirmation_get_EncryptedID(self) get_node((self)->EncryptedID) +#define LassoSaml2SubjectConfirmation_EncryptedID_get(self) get_node((self)->EncryptedID) +#define LassoSaml2SubjectConfirmation_set_EncryptedID(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) +#define LassoSaml2SubjectConfirmation_EncryptedID_set(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) + + +/* SubjectConfirmationData */ + +#define LassoSaml2SubjectConfirmation_get_SubjectConfirmationData(self) get_node((self)->SubjectConfirmationData) +#define LassoSaml2SubjectConfirmation_SubjectConfirmationData_get(self) get_node((self)->SubjectConfirmationData) +#define LassoSaml2SubjectConfirmation_set_SubjectConfirmationData(self,value) set_node((gpointer*)&(self)->SubjectConfirmationData, (value)) +#define LassoSaml2SubjectConfirmation_SubjectConfirmationData_set(self,value) set_node((gpointer*)&(self)->SubjectConfirmationData, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2SubjectConfirmation lasso_saml2_subject_confirmation_new +#define delete_LassoSaml2SubjectConfirmation(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2SubjectConfirmation_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_subject_confirmation_data.i b/swig/saml-2.0/saml2_subject_confirmation_data.i new file mode 100644 index 00000000..db587cd5 --- /dev/null +++ b/swig/saml-2.0/saml2_subject_confirmation_data.i @@ -0,0 +1,37 @@ + +#ifndef SWIGPHP4 +%rename(Saml2SubjectConfirmationData) LassoSaml2SubjectConfirmationData; +#endif +typedef struct { + char *NotBefore; + char *NotOnOrAfter; + char *Recipient; + char *InResponseTo; + char *Address; +} LassoSaml2SubjectConfirmationData; +%extend LassoSaml2SubjectConfirmationData { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2SubjectConfirmationData(); + ~LassoSaml2SubjectConfirmationData(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2SubjectConfirmationData lasso_saml2_subject_confirmation_data_new +#define delete_LassoSaml2SubjectConfirmationData(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2SubjectConfirmationData_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/saml2_subject_locality.i b/swig/saml-2.0/saml2_subject_locality.i new file mode 100644 index 00000000..f51cdbb3 --- /dev/null +++ b/swig/saml-2.0/saml2_subject_locality.i @@ -0,0 +1,34 @@ + +#ifndef SWIGPHP4 +%rename(Saml2SubjectLocality) LassoSaml2SubjectLocality; +#endif +typedef struct { + char *Address; + char *DNSName; +} LassoSaml2SubjectLocality; +%extend LassoSaml2SubjectLocality { + + + /* Constructor, Destructor & Static Methods */ + LassoSaml2SubjectLocality(); + ~LassoSaml2SubjectLocality(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSaml2SubjectLocality lasso_saml2_subject_locality_new +#define delete_LassoSaml2SubjectLocality(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSaml2SubjectLocality_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_artifact_resolve.i b/swig/saml-2.0/samlp2_artifact_resolve.i new file mode 100644 index 00000000..111f447a --- /dev/null +++ b/swig/saml-2.0/samlp2_artifact_resolve.i @@ -0,0 +1,124 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2ArtifactResolve) LassoSamlp2ArtifactResolve; +#endif +typedef struct { + char *Artifact; +} LassoSamlp2ArtifactResolve; +%extend LassoSamlp2ArtifactResolve { + + /* inherited from Samlp2RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2ArtifactResolve(); + ~LassoSamlp2ArtifactResolve(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2ArtifactResolve_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2ArtifactResolve_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2ArtifactResolve_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2ArtifactResolve_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2ArtifactResolve_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2ArtifactResolve_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2ArtifactResolve_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2ArtifactResolve_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2ArtifactResolve_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2ArtifactResolve_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2ArtifactResolve_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2ArtifactResolve_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2ArtifactResolve_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2ArtifactResolve_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2ArtifactResolve_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2ArtifactResolve_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2ArtifactResolve_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2ArtifactResolve_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2ArtifactResolve_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2ArtifactResolve_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2ArtifactResolve_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2ArtifactResolve_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2ArtifactResolve_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2ArtifactResolve_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2ArtifactResolve_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2ArtifactResolve_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2ArtifactResolve_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2ArtifactResolve_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2ArtifactResolve lasso_samlp2_artifact_resolve_new +#define delete_LassoSamlp2ArtifactResolve(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2ArtifactResolve_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_artifact_response.i b/swig/saml-2.0/samlp2_artifact_response.i new file mode 100644 index 00000000..2e2ecbf9 --- /dev/null +++ b/swig/saml-2.0/samlp2_artifact_response.i @@ -0,0 +1,160 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2ArtifactResponse) LassoSamlp2ArtifactResponse; +#endif +typedef struct { +} LassoSamlp2ArtifactResponse; +%extend LassoSamlp2ArtifactResponse { + + %newobject *any_get; + LassoNode *any; + + /* inherited from Samlp2StatusResponse */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(status) *Status; +#endif + %newobject *Status_get; + LassoSamlp2Status *Status; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(inResponseTo) *InResponseTo; +#endif + char *InResponseTo; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2ArtifactResponse(); + ~LassoSamlp2ArtifactResponse(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* any */ + +#define LassoSamlp2ArtifactResponse_get_any(self) get_node((self)->any) +#define LassoSamlp2ArtifactResponse_any_get(self) get_node((self)->any) +#define LassoSamlp2ArtifactResponse_set_any(self,value) set_node((gpointer*)&(self)->any, (value)) +#define LassoSamlp2ArtifactResponse_any_set(self,value) set_node((gpointer*)&(self)->any, (value)) + + +/* inherited from StatusResponse */ + +/* Issuer */ + +#define LassoSamlp2ArtifactResponse_get_Issuer(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer) +#define LassoSamlp2ArtifactResponse_Issuer_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer) +#define LassoSamlp2ArtifactResponse_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer, (value)) +#define LassoSamlp2ArtifactResponse_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2ArtifactResponse_get_Extensions(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions) +#define LassoSamlp2ArtifactResponse_Extensions_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions) +#define LassoSamlp2ArtifactResponse_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions, (value)) +#define LassoSamlp2ArtifactResponse_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions, (value)) + + +/* Status */ + +#define LassoSamlp2ArtifactResponse_get_Status(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Status) +#define LassoSamlp2ArtifactResponse_Status_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Status) +#define LassoSamlp2ArtifactResponse_set_Status(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Status, (value)) +#define LassoSamlp2ArtifactResponse_Status_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Status, (value)) + + +/* ID */ + +#define LassoSamlp2ArtifactResponse_get_ID(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->ID +#define LassoSamlp2ArtifactResponse_ID_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->ID + +#define LassoSamlp2ArtifactResponse_set_ID(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->ID, (value)) +#define LassoSamlp2ArtifactResponse_ID_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->ID, (value)) + +/* InResponseTo */ + +#define LassoSamlp2ArtifactResponse_get_InResponseTo(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo +#define LassoSamlp2ArtifactResponse_InResponseTo_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo + +#define LassoSamlp2ArtifactResponse_set_InResponseTo(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo, (value)) +#define LassoSamlp2ArtifactResponse_InResponseTo_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo, (value)) + +/* Version */ + +#define LassoSamlp2ArtifactResponse_get_Version(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Version +#define LassoSamlp2ArtifactResponse_Version_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Version + +#define LassoSamlp2ArtifactResponse_set_Version(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Version, (value)) +#define LassoSamlp2ArtifactResponse_Version_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2ArtifactResponse_get_IssueInstant(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant +#define LassoSamlp2ArtifactResponse_IssueInstant_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant + +#define LassoSamlp2ArtifactResponse_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant, (value)) +#define LassoSamlp2ArtifactResponse_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2ArtifactResponse_get_Destination(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination +#define LassoSamlp2ArtifactResponse_Destination_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination + +#define LassoSamlp2ArtifactResponse_set_Destination(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination, (value)) +#define LassoSamlp2ArtifactResponse_Destination_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2ArtifactResponse_get_Consent(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent +#define LassoSamlp2ArtifactResponse_Consent_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent + +#define LassoSamlp2ArtifactResponse_set_Consent(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent, (value)) +#define LassoSamlp2ArtifactResponse_Consent_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2ArtifactResponse lasso_samlp2_artifact_response_new +#define delete_LassoSamlp2ArtifactResponse(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2ArtifactResponse_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_assertion_idrequest.i b/swig/saml-2.0/samlp2_assertion_idrequest.i new file mode 100644 index 00000000..a95d6d5b --- /dev/null +++ b/swig/saml-2.0/samlp2_assertion_idrequest.i @@ -0,0 +1,124 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2AssertionIDRequest) LassoSamlp2AssertionIDRequest; +#endif +typedef struct { + char *AssertionIDRef; +} LassoSamlp2AssertionIDRequest; +%extend LassoSamlp2AssertionIDRequest { + + /* inherited from Samlp2RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2AssertionIDRequest(); + ~LassoSamlp2AssertionIDRequest(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2AssertionIDRequest_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AssertionIDRequest_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AssertionIDRequest_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2AssertionIDRequest_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2AssertionIDRequest_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AssertionIDRequest_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AssertionIDRequest_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2AssertionIDRequest_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2AssertionIDRequest_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2AssertionIDRequest_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2AssertionIDRequest_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2AssertionIDRequest_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2AssertionIDRequest_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2AssertionIDRequest_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2AssertionIDRequest_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2AssertionIDRequest_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2AssertionIDRequest_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2AssertionIDRequest_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2AssertionIDRequest_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2AssertionIDRequest_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2AssertionIDRequest_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2AssertionIDRequest_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2AssertionIDRequest_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2AssertionIDRequest_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2AssertionIDRequest_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2AssertionIDRequest_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2AssertionIDRequest_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2AssertionIDRequest_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2AssertionIDRequest lasso_samlp2_assertion_idrequest_new +#define delete_LassoSamlp2AssertionIDRequest(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2AssertionIDRequest_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_attribute_query.i b/swig/saml-2.0/samlp2_attribute_query.i new file mode 100644 index 00000000..02685136 --- /dev/null +++ b/swig/saml-2.0/samlp2_attribute_query.i @@ -0,0 +1,154 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2AttributeQuery) LassoSamlp2AttributeQuery; +#endif +typedef struct { +} LassoSamlp2AttributeQuery; +%extend LassoSamlp2AttributeQuery { + +#ifndef SWIGPHP4 + %rename(attribute) Attribute; +#endif + %newobject *Attribute_get; + LassoSaml2Attribute *Attribute; + + /* inherited from Samlp2SubjectQueryAbstract */ +#ifndef SWIGPHP4 + %rename(subject) *Subject; +#endif + %newobject *Subject_get; + LassoSaml2Subject *Subject; + + /* inherited from RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2AttributeQuery(); + ~LassoSamlp2AttributeQuery(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* Attribute */ + +#define LassoSamlp2AttributeQuery_get_Attribute(self) get_node((self)->Attribute) +#define LassoSamlp2AttributeQuery_Attribute_get(self) get_node((self)->Attribute) +#define LassoSamlp2AttributeQuery_set_Attribute(self,value) set_node((gpointer*)&(self)->Attribute, (value)) +#define LassoSamlp2AttributeQuery_Attribute_set(self,value) set_node((gpointer*)&(self)->Attribute, (value)) + + +/* inherited from SubjectQueryAbstract */ + +/* Subject */ + +#define LassoSamlp2AttributeQuery_get_Subject(self) get_node(LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject) +#define LassoSamlp2AttributeQuery_Subject_get(self) get_node(LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject) +#define LassoSamlp2AttributeQuery_set_Subject(self,value) set_node((gpointer*)&LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject, (value)) +#define LassoSamlp2AttributeQuery_Subject_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject, (value)) + + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2AttributeQuery_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AttributeQuery_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AttributeQuery_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2AttributeQuery_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2AttributeQuery_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AttributeQuery_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AttributeQuery_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2AttributeQuery_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2AttributeQuery_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2AttributeQuery_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2AttributeQuery_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2AttributeQuery_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2AttributeQuery_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2AttributeQuery_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2AttributeQuery_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2AttributeQuery_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2AttributeQuery_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2AttributeQuery_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2AttributeQuery_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2AttributeQuery_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2AttributeQuery_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2AttributeQuery_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2AttributeQuery_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2AttributeQuery_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2AttributeQuery_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2AttributeQuery_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2AttributeQuery_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2AttributeQuery_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2AttributeQuery lasso_samlp2_attribute_query_new +#define delete_LassoSamlp2AttributeQuery(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2AttributeQuery_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_authn_query.i b/swig/saml-2.0/samlp2_authn_query.i new file mode 100644 index 00000000..279531f1 --- /dev/null +++ b/swig/saml-2.0/samlp2_authn_query.i @@ -0,0 +1,155 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2AuthnQuery) LassoSamlp2AuthnQuery; +#endif +typedef struct { + char *SessionIndex; +} LassoSamlp2AuthnQuery; +%extend LassoSamlp2AuthnQuery { + +#ifndef SWIGPHP4 + %rename(requestedAuthnContext) RequestedAuthnContext; +#endif + %newobject *RequestedAuthnContext_get; + LassoSamlp2RequestedAuthnContext *RequestedAuthnContext; + + /* inherited from Samlp2SubjectQueryAbstract */ +#ifndef SWIGPHP4 + %rename(subject) *Subject; +#endif + %newobject *Subject_get; + LassoSaml2Subject *Subject; + + /* inherited from Samlp2RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2AuthnQuery(); + ~LassoSamlp2AuthnQuery(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* RequestedAuthnContext */ + +#define LassoSamlp2AuthnQuery_get_RequestedAuthnContext(self) get_node((self)->RequestedAuthnContext) +#define LassoSamlp2AuthnQuery_RequestedAuthnContext_get(self) get_node((self)->RequestedAuthnContext) +#define LassoSamlp2AuthnQuery_set_RequestedAuthnContext(self,value) set_node((gpointer*)&(self)->RequestedAuthnContext, (value)) +#define LassoSamlp2AuthnQuery_RequestedAuthnContext_set(self,value) set_node((gpointer*)&(self)->RequestedAuthnContext, (value)) + + +/* inherited from SubjectQueryAbstract */ + +/* Subject */ + +#define LassoSamlp2AuthnQuery_get_Subject(self) get_node(LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject) +#define LassoSamlp2AuthnQuery_Subject_get(self) get_node(LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject) +#define LassoSamlp2AuthnQuery_set_Subject(self,value) set_node((gpointer*)&LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject, (value)) +#define LassoSamlp2AuthnQuery_Subject_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject, (value)) + + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2AuthnQuery_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AuthnQuery_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AuthnQuery_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2AuthnQuery_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2AuthnQuery_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AuthnQuery_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AuthnQuery_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2AuthnQuery_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2AuthnQuery_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2AuthnQuery_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2AuthnQuery_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2AuthnQuery_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2AuthnQuery_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2AuthnQuery_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2AuthnQuery_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2AuthnQuery_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2AuthnQuery_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2AuthnQuery_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2AuthnQuery_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2AuthnQuery_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2AuthnQuery_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2AuthnQuery_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2AuthnQuery_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2AuthnQuery_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2AuthnQuery_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2AuthnQuery_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2AuthnQuery_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2AuthnQuery_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2AuthnQuery lasso_samlp2_authn_query_new +#define delete_LassoSamlp2AuthnQuery(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2AuthnQuery_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_authn_request.i b/swig/saml-2.0/samlp2_authn_request.i new file mode 100644 index 00000000..a0b4193c --- /dev/null +++ b/swig/saml-2.0/samlp2_authn_request.i @@ -0,0 +1,212 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2AuthnRequest) LassoSamlp2AuthnRequest; +#endif +typedef struct { +#ifndef SWIGPHP4 + %rename(forceAuthn) ForceAuthn; +#endif + gboolean ForceAuthn; +#ifndef SWIGPHP4 + %rename(isPassive) IsPassive; +#endif + gboolean IsPassive; + char *ProtocolBinding; +#ifndef SWIGPHP4 + %rename(assertionConsumerServiceIndex) AssertionConsumerServiceIndex; +#endif + int AssertionConsumerServiceIndex; + char *AssertionConsumerServiceURL; +#ifndef SWIGPHP4 + %rename(attributeConsumingServiceIndex) AttributeConsumingServiceIndex; +#endif + int AttributeConsumingServiceIndex; + char *ProviderName; +} LassoSamlp2AuthnRequest; +%extend LassoSamlp2AuthnRequest { + +#ifndef SWIGPHP4 + %rename(subject) Subject; +#endif + %newobject *Subject_get; + LassoSaml2Subject *Subject; + +#ifndef SWIGPHP4 + %rename(nameIDPolicy) NameIDPolicy; +#endif + %newobject *NameIDPolicy_get; + LassoSamlp2NameIDPolicy *NameIDPolicy; + +#ifndef SWIGPHP4 + %rename(conditions) Conditions; +#endif + %newobject *Conditions_get; + LassoSaml2Conditions *Conditions; + +#ifndef SWIGPHP4 + %rename(requestedAuthnContext) RequestedAuthnContext; +#endif + %newobject *RequestedAuthnContext_get; + LassoSamlp2RequestedAuthnContext *RequestedAuthnContext; + +#ifndef SWIGPHP4 + %rename(scoping) Scoping; +#endif + %newobject *Scoping_get; + LassoSamlp2Scoping *Scoping; + + /* inherited from Samlp2RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2AuthnRequest(); + ~LassoSamlp2AuthnRequest(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* Subject */ + +#define LassoSamlp2AuthnRequest_get_Subject(self) get_node((self)->Subject) +#define LassoSamlp2AuthnRequest_Subject_get(self) get_node((self)->Subject) +#define LassoSamlp2AuthnRequest_set_Subject(self,value) set_node((gpointer*)&(self)->Subject, (value)) +#define LassoSamlp2AuthnRequest_Subject_set(self,value) set_node((gpointer*)&(self)->Subject, (value)) + + +/* NameIDPolicy */ + +#define LassoSamlp2AuthnRequest_get_NameIDPolicy(self) get_node((self)->NameIDPolicy) +#define LassoSamlp2AuthnRequest_NameIDPolicy_get(self) get_node((self)->NameIDPolicy) +#define LassoSamlp2AuthnRequest_set_NameIDPolicy(self,value) set_node((gpointer*)&(self)->NameIDPolicy, (value)) +#define LassoSamlp2AuthnRequest_NameIDPolicy_set(self,value) set_node((gpointer*)&(self)->NameIDPolicy, (value)) + + +/* Conditions */ + +#define LassoSamlp2AuthnRequest_get_Conditions(self) get_node((self)->Conditions) +#define LassoSamlp2AuthnRequest_Conditions_get(self) get_node((self)->Conditions) +#define LassoSamlp2AuthnRequest_set_Conditions(self,value) set_node((gpointer*)&(self)->Conditions, (value)) +#define LassoSamlp2AuthnRequest_Conditions_set(self,value) set_node((gpointer*)&(self)->Conditions, (value)) + + +/* RequestedAuthnContext */ + +#define LassoSamlp2AuthnRequest_get_RequestedAuthnContext(self) get_node((self)->RequestedAuthnContext) +#define LassoSamlp2AuthnRequest_RequestedAuthnContext_get(self) get_node((self)->RequestedAuthnContext) +#define LassoSamlp2AuthnRequest_set_RequestedAuthnContext(self,value) set_node((gpointer*)&(self)->RequestedAuthnContext, (value)) +#define LassoSamlp2AuthnRequest_RequestedAuthnContext_set(self,value) set_node((gpointer*)&(self)->RequestedAuthnContext, (value)) + + +/* Scoping */ + +#define LassoSamlp2AuthnRequest_get_Scoping(self) get_node((self)->Scoping) +#define LassoSamlp2AuthnRequest_Scoping_get(self) get_node((self)->Scoping) +#define LassoSamlp2AuthnRequest_set_Scoping(self,value) set_node((gpointer*)&(self)->Scoping, (value)) +#define LassoSamlp2AuthnRequest_Scoping_set(self,value) set_node((gpointer*)&(self)->Scoping, (value)) + + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2AuthnRequest_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AuthnRequest_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AuthnRequest_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2AuthnRequest_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2AuthnRequest_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AuthnRequest_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AuthnRequest_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2AuthnRequest_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2AuthnRequest_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2AuthnRequest_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2AuthnRequest_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2AuthnRequest_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2AuthnRequest_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2AuthnRequest_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2AuthnRequest_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2AuthnRequest_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2AuthnRequest_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2AuthnRequest_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2AuthnRequest_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2AuthnRequest_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2AuthnRequest_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2AuthnRequest_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2AuthnRequest_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2AuthnRequest_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2AuthnRequest_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2AuthnRequest_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2AuthnRequest_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2AuthnRequest_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2AuthnRequest lasso_samlp2_authn_request_new +#define delete_LassoSamlp2AuthnRequest(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2AuthnRequest_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_authz_decision_query.i b/swig/saml-2.0/samlp2_authz_decision_query.i new file mode 100644 index 00000000..d69222ff --- /dev/null +++ b/swig/saml-2.0/samlp2_authz_decision_query.i @@ -0,0 +1,169 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2AuthzDecisionQuery) LassoSamlp2AuthzDecisionQuery; +#endif +typedef struct { + char *Resource; +} LassoSamlp2AuthzDecisionQuery; +%extend LassoSamlp2AuthzDecisionQuery { + +#ifndef SWIGPHP4 + %rename(action) Action; +#endif + %newobject *Action_get; + LassoSaml2Action *Action; + +#ifndef SWIGPHP4 + %rename(evidence) Evidence; +#endif + %newobject *Evidence_get; + LassoSaml2Evidence *Evidence; + + /* inherited from Samlp2SubjectQueryAbstract */ +#ifndef SWIGPHP4 + %rename(subject) *Subject; +#endif + %newobject *Subject_get; + LassoSaml2Subject *Subject; + + /* inherited from RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2AuthzDecisionQuery(); + ~LassoSamlp2AuthzDecisionQuery(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* Action */ + +#define LassoSamlp2AuthzDecisionQuery_get_Action(self) get_node((self)->Action) +#define LassoSamlp2AuthzDecisionQuery_Action_get(self) get_node((self)->Action) +#define LassoSamlp2AuthzDecisionQuery_set_Action(self,value) set_node((gpointer*)&(self)->Action, (value)) +#define LassoSamlp2AuthzDecisionQuery_Action_set(self,value) set_node((gpointer*)&(self)->Action, (value)) + + +/* Evidence */ + +#define LassoSamlp2AuthzDecisionQuery_get_Evidence(self) get_node((self)->Evidence) +#define LassoSamlp2AuthzDecisionQuery_Evidence_get(self) get_node((self)->Evidence) +#define LassoSamlp2AuthzDecisionQuery_set_Evidence(self,value) set_node((gpointer*)&(self)->Evidence, (value)) +#define LassoSamlp2AuthzDecisionQuery_Evidence_set(self,value) set_node((gpointer*)&(self)->Evidence, (value)) + + +/* inherited from SubjectQueryAbstract */ + +/* Subject */ + +#define LassoSamlp2AuthzDecisionQuery_get_Subject(self) get_node(LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject) +#define LassoSamlp2AuthzDecisionQuery_Subject_get(self) get_node(LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject) +#define LassoSamlp2AuthzDecisionQuery_set_Subject(self,value) set_node((gpointer*)&LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject, (value)) +#define LassoSamlp2AuthzDecisionQuery_Subject_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_SUBJECT_QUERY_ABSTRACT(self)->Subject, (value)) + + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2AuthzDecisionQuery_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AuthzDecisionQuery_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2AuthzDecisionQuery_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2AuthzDecisionQuery_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2AuthzDecisionQuery_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AuthzDecisionQuery_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2AuthzDecisionQuery_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2AuthzDecisionQuery_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2AuthzDecisionQuery_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2AuthzDecisionQuery_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2AuthzDecisionQuery_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2AuthzDecisionQuery_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2AuthzDecisionQuery_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2AuthzDecisionQuery_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2AuthzDecisionQuery_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2AuthzDecisionQuery_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2AuthzDecisionQuery_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2AuthzDecisionQuery_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2AuthzDecisionQuery_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2AuthzDecisionQuery_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2AuthzDecisionQuery_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2AuthzDecisionQuery_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2AuthzDecisionQuery_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2AuthzDecisionQuery_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2AuthzDecisionQuery_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2AuthzDecisionQuery_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2AuthzDecisionQuery_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2AuthzDecisionQuery_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2AuthzDecisionQuery lasso_samlp2_authz_decision_query_new +#define delete_LassoSamlp2AuthzDecisionQuery(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2AuthzDecisionQuery_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_extensions.i b/swig/saml-2.0/samlp2_extensions.i new file mode 100644 index 00000000..9b9c887d --- /dev/null +++ b/swig/saml-2.0/samlp2_extensions.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2Extensions) LassoSamlp2Extensions; +#endif +typedef struct { +} LassoSamlp2Extensions; +%extend LassoSamlp2Extensions { + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2Extensions(); + ~LassoSamlp2Extensions(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2Extensions lasso_samlp2_extensions_new +#define delete_LassoSamlp2Extensions(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2Extensions_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_idp_entry.i b/swig/saml-2.0/samlp2_idp_entry.i new file mode 100644 index 00000000..b4c9f8ea --- /dev/null +++ b/swig/saml-2.0/samlp2_idp_entry.i @@ -0,0 +1,35 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2IDPEntry) LassoSamlp2IDPEntry; +#endif +typedef struct { + char *ProviderID; + char *Name; + char *Loc; +} LassoSamlp2IDPEntry; +%extend LassoSamlp2IDPEntry { + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2IDPEntry(); + ~LassoSamlp2IDPEntry(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2IDPEntry lasso_samlp2_idp_entry_new +#define delete_LassoSamlp2IDPEntry(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2IDPEntry_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_idp_list.i b/swig/saml-2.0/samlp2_idp_list.i new file mode 100644 index 00000000..f7b3260a --- /dev/null +++ b/swig/saml-2.0/samlp2_idp_list.i @@ -0,0 +1,47 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2IDPList) LassoSamlp2IDPList; +#endif +typedef struct { + char *GetComplete; +} LassoSamlp2IDPList; +%extend LassoSamlp2IDPList { + +#ifndef SWIGPHP4 + %rename(iDPEntry) IDPEntry; +#endif + %newobject *IDPEntry_get; + LassoSamlp2IDPEntry *IDPEntry; + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2IDPList(); + ~LassoSamlp2IDPList(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* IDPEntry */ + +#define LassoSamlp2IDPList_get_IDPEntry(self) get_node((self)->IDPEntry) +#define LassoSamlp2IDPList_IDPEntry_get(self) get_node((self)->IDPEntry) +#define LassoSamlp2IDPList_set_IDPEntry(self,value) set_node((gpointer*)&(self)->IDPEntry, (value)) +#define LassoSamlp2IDPList_IDPEntry_set(self,value) set_node((gpointer*)&(self)->IDPEntry, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2IDPList lasso_samlp2_idp_list_new +#define delete_LassoSamlp2IDPList(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2IDPList_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_logout_request.i b/swig/saml-2.0/samlp2_logout_request.i new file mode 100644 index 00000000..53916300 --- /dev/null +++ b/swig/saml-2.0/samlp2_logout_request.i @@ -0,0 +1,168 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2LogoutRequest) LassoSamlp2LogoutRequest; +#endif +typedef struct { + char *SessionIndex; + char *Reason; + char *NotOnOrAfter; +} LassoSamlp2LogoutRequest; +%extend LassoSamlp2LogoutRequest { + +#ifndef SWIGPHP4 + %rename(baseID) BaseID; +#endif + %newobject *BaseID_get; + LassoSaml2BaseIDAbstract *BaseID; + +#ifndef SWIGPHP4 + %rename(nameID) NameID; +#endif + %newobject *NameID_get; + LassoSaml2NameID *NameID; + +#ifndef SWIGPHP4 + %rename(encryptedID) EncryptedID; +#endif + %newobject *EncryptedID_get; + LassoSaml2EncryptedElement *EncryptedID; + + /* inherited from Samlp2RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2LogoutRequest(); + ~LassoSamlp2LogoutRequest(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* BaseID */ + +#define LassoSamlp2LogoutRequest_get_BaseID(self) get_node((self)->BaseID) +#define LassoSamlp2LogoutRequest_BaseID_get(self) get_node((self)->BaseID) +#define LassoSamlp2LogoutRequest_set_BaseID(self,value) set_node((gpointer*)&(self)->BaseID, (value)) +#define LassoSamlp2LogoutRequest_BaseID_set(self,value) set_node((gpointer*)&(self)->BaseID, (value)) + + +/* NameID */ + +#define LassoSamlp2LogoutRequest_get_NameID(self) get_node((self)->NameID) +#define LassoSamlp2LogoutRequest_NameID_get(self) get_node((self)->NameID) +#define LassoSamlp2LogoutRequest_set_NameID(self,value) set_node((gpointer*)&(self)->NameID, (value)) +#define LassoSamlp2LogoutRequest_NameID_set(self,value) set_node((gpointer*)&(self)->NameID, (value)) + + +/* EncryptedID */ + +#define LassoSamlp2LogoutRequest_get_EncryptedID(self) get_node((self)->EncryptedID) +#define LassoSamlp2LogoutRequest_EncryptedID_get(self) get_node((self)->EncryptedID) +#define LassoSamlp2LogoutRequest_set_EncryptedID(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) +#define LassoSamlp2LogoutRequest_EncryptedID_set(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) + + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2LogoutRequest_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2LogoutRequest_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2LogoutRequest_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2LogoutRequest_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2LogoutRequest_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2LogoutRequest_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2LogoutRequest_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2LogoutRequest_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2LogoutRequest_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2LogoutRequest_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2LogoutRequest_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2LogoutRequest_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2LogoutRequest_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2LogoutRequest_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2LogoutRequest_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2LogoutRequest_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2LogoutRequest_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2LogoutRequest_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2LogoutRequest_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2LogoutRequest_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2LogoutRequest_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2LogoutRequest_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2LogoutRequest_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2LogoutRequest_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2LogoutRequest_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2LogoutRequest_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2LogoutRequest_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2LogoutRequest_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2LogoutRequest lasso_samlp2_logout_request_new +#define delete_LassoSamlp2LogoutRequest(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2LogoutRequest_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_manage_name_id_request.i b/swig/saml-2.0/samlp2_manage_name_id_request.i new file mode 100644 index 00000000..5832508c --- /dev/null +++ b/swig/saml-2.0/samlp2_manage_name_id_request.i @@ -0,0 +1,180 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2ManageNameIDRequest) LassoSamlp2ManageNameIDRequest; +#endif +typedef struct { + char *NewID; +} LassoSamlp2ManageNameIDRequest; +%extend LassoSamlp2ManageNameIDRequest { + +#ifndef SWIGPHP4 + %rename(nameID) NameID; +#endif + %newobject *NameID_get; + LassoSaml2NameID *NameID; + +#ifndef SWIGPHP4 + %rename(encryptedID) EncryptedID; +#endif + %newobject *EncryptedID_get; + LassoSaml2EncryptedElement *EncryptedID; + +#ifndef SWIGPHP4 + %rename(newEncryptedID) NewEncryptedID; +#endif + %newobject *NewEncryptedID_get; + LassoSaml2EncryptedElement *NewEncryptedID; + +#ifndef SWIGPHP4 + %rename(terminate) Terminate; +#endif + %newobject *Terminate_get; + LassoSamlp2Terminate *Terminate; + + /* inherited from Samlp2RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2ManageNameIDRequest(); + ~LassoSamlp2ManageNameIDRequest(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* NameID */ + +#define LassoSamlp2ManageNameIDRequest_get_NameID(self) get_node((self)->NameID) +#define LassoSamlp2ManageNameIDRequest_NameID_get(self) get_node((self)->NameID) +#define LassoSamlp2ManageNameIDRequest_set_NameID(self,value) set_node((gpointer*)&(self)->NameID, (value)) +#define LassoSamlp2ManageNameIDRequest_NameID_set(self,value) set_node((gpointer*)&(self)->NameID, (value)) + + +/* EncryptedID */ + +#define LassoSamlp2ManageNameIDRequest_get_EncryptedID(self) get_node((self)->EncryptedID) +#define LassoSamlp2ManageNameIDRequest_EncryptedID_get(self) get_node((self)->EncryptedID) +#define LassoSamlp2ManageNameIDRequest_set_EncryptedID(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) +#define LassoSamlp2ManageNameIDRequest_EncryptedID_set(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) + + +/* NewEncryptedID */ + +#define LassoSamlp2ManageNameIDRequest_get_NewEncryptedID(self) get_node((self)->NewEncryptedID) +#define LassoSamlp2ManageNameIDRequest_NewEncryptedID_get(self) get_node((self)->NewEncryptedID) +#define LassoSamlp2ManageNameIDRequest_set_NewEncryptedID(self,value) set_node((gpointer*)&(self)->NewEncryptedID, (value)) +#define LassoSamlp2ManageNameIDRequest_NewEncryptedID_set(self,value) set_node((gpointer*)&(self)->NewEncryptedID, (value)) + + +/* Terminate */ + +#define LassoSamlp2ManageNameIDRequest_get_Terminate(self) get_node((self)->Terminate) +#define LassoSamlp2ManageNameIDRequest_Terminate_get(self) get_node((self)->Terminate) +#define LassoSamlp2ManageNameIDRequest_set_Terminate(self,value) set_node((gpointer*)&(self)->Terminate, (value)) +#define LassoSamlp2ManageNameIDRequest_Terminate_set(self,value) set_node((gpointer*)&(self)->Terminate, (value)) + + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2ManageNameIDRequest_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2ManageNameIDRequest_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2ManageNameIDRequest_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2ManageNameIDRequest_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2ManageNameIDRequest_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2ManageNameIDRequest_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2ManageNameIDRequest_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2ManageNameIDRequest_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2ManageNameIDRequest_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2ManageNameIDRequest_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2ManageNameIDRequest_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2ManageNameIDRequest_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2ManageNameIDRequest_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2ManageNameIDRequest_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2ManageNameIDRequest_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2ManageNameIDRequest_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2ManageNameIDRequest_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2ManageNameIDRequest_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2ManageNameIDRequest_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2ManageNameIDRequest_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2ManageNameIDRequest_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2ManageNameIDRequest_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2ManageNameIDRequest_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2ManageNameIDRequest_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2ManageNameIDRequest_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2ManageNameIDRequest_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2ManageNameIDRequest_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2ManageNameIDRequest_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2ManageNameIDRequest lasso_samlp2_manage_name_id_request_new +#define delete_LassoSamlp2ManageNameIDRequest(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2ManageNameIDRequest_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_name_id_mapping_request.i b/swig/saml-2.0/samlp2_name_id_mapping_request.i new file mode 100644 index 00000000..9bcfa686 --- /dev/null +++ b/swig/saml-2.0/samlp2_name_id_mapping_request.i @@ -0,0 +1,179 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2NameIDMappingRequest) LassoSamlp2NameIDMappingRequest; +#endif +typedef struct { +} LassoSamlp2NameIDMappingRequest; +%extend LassoSamlp2NameIDMappingRequest { + +#ifndef SWIGPHP4 + %rename(baseID) BaseID; +#endif + %newobject *BaseID_get; + LassoSaml2BaseIDAbstract *BaseID; + +#ifndef SWIGPHP4 + %rename(nameID) NameID; +#endif + %newobject *NameID_get; + LassoSaml2NameID *NameID; + +#ifndef SWIGPHP4 + %rename(encryptedID) EncryptedID; +#endif + %newobject *EncryptedID_get; + LassoSaml2EncryptedElement *EncryptedID; + +#ifndef SWIGPHP4 + %rename(nameIDPolicy) NameIDPolicy; +#endif + %newobject *NameIDPolicy_get; + LassoSamlp2NameIDPolicy *NameIDPolicy; + + /* inherited from Samlp2RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2NameIDMappingRequest(); + ~LassoSamlp2NameIDMappingRequest(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* BaseID */ + +#define LassoSamlp2NameIDMappingRequest_get_BaseID(self) get_node((self)->BaseID) +#define LassoSamlp2NameIDMappingRequest_BaseID_get(self) get_node((self)->BaseID) +#define LassoSamlp2NameIDMappingRequest_set_BaseID(self,value) set_node((gpointer*)&(self)->BaseID, (value)) +#define LassoSamlp2NameIDMappingRequest_BaseID_set(self,value) set_node((gpointer*)&(self)->BaseID, (value)) + + +/* NameID */ + +#define LassoSamlp2NameIDMappingRequest_get_NameID(self) get_node((self)->NameID) +#define LassoSamlp2NameIDMappingRequest_NameID_get(self) get_node((self)->NameID) +#define LassoSamlp2NameIDMappingRequest_set_NameID(self,value) set_node((gpointer*)&(self)->NameID, (value)) +#define LassoSamlp2NameIDMappingRequest_NameID_set(self,value) set_node((gpointer*)&(self)->NameID, (value)) + + +/* EncryptedID */ + +#define LassoSamlp2NameIDMappingRequest_get_EncryptedID(self) get_node((self)->EncryptedID) +#define LassoSamlp2NameIDMappingRequest_EncryptedID_get(self) get_node((self)->EncryptedID) +#define LassoSamlp2NameIDMappingRequest_set_EncryptedID(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) +#define LassoSamlp2NameIDMappingRequest_EncryptedID_set(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) + + +/* NameIDPolicy */ + +#define LassoSamlp2NameIDMappingRequest_get_NameIDPolicy(self) get_node((self)->NameIDPolicy) +#define LassoSamlp2NameIDMappingRequest_NameIDPolicy_get(self) get_node((self)->NameIDPolicy) +#define LassoSamlp2NameIDMappingRequest_set_NameIDPolicy(self,value) set_node((gpointer*)&(self)->NameIDPolicy, (value)) +#define LassoSamlp2NameIDMappingRequest_NameIDPolicy_set(self,value) set_node((gpointer*)&(self)->NameIDPolicy, (value)) + + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2NameIDMappingRequest_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2NameIDMappingRequest_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2NameIDMappingRequest_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2NameIDMappingRequest_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2NameIDMappingRequest_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2NameIDMappingRequest_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2NameIDMappingRequest_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2NameIDMappingRequest_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2NameIDMappingRequest_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2NameIDMappingRequest_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2NameIDMappingRequest_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2NameIDMappingRequest_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2NameIDMappingRequest_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2NameIDMappingRequest_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2NameIDMappingRequest_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2NameIDMappingRequest_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2NameIDMappingRequest_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2NameIDMappingRequest_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2NameIDMappingRequest_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2NameIDMappingRequest_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2NameIDMappingRequest_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2NameIDMappingRequest_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2NameIDMappingRequest_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2NameIDMappingRequest_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2NameIDMappingRequest_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2NameIDMappingRequest_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2NameIDMappingRequest_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2NameIDMappingRequest_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2NameIDMappingRequest lasso_samlp2_name_id_mapping_request_new +#define delete_LassoSamlp2NameIDMappingRequest(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2NameIDMappingRequest_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_name_id_mapping_response.i b/swig/saml-2.0/samlp2_name_id_mapping_response.i new file mode 100644 index 00000000..96999068 --- /dev/null +++ b/swig/saml-2.0/samlp2_name_id_mapping_response.i @@ -0,0 +1,177 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2NameIDMappingResponse) LassoSamlp2NameIDMappingResponse; +#endif +typedef struct { +} LassoSamlp2NameIDMappingResponse; +%extend LassoSamlp2NameIDMappingResponse { + +#ifndef SWIGPHP4 + %rename(nameID) NameID; +#endif + %newobject *NameID_get; + LassoSaml2NameID *NameID; + +#ifndef SWIGPHP4 + %rename(encryptedID) EncryptedID; +#endif + %newobject *EncryptedID_get; + LassoSaml2EncryptedElement *EncryptedID; + + /* inherited from Samlp2StatusResponse */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(status) *Status; +#endif + %newobject *Status_get; + LassoSamlp2Status *Status; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(inResponseTo) *InResponseTo; +#endif + char *InResponseTo; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2NameIDMappingResponse(); + ~LassoSamlp2NameIDMappingResponse(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* NameID */ + +#define LassoSamlp2NameIDMappingResponse_get_NameID(self) get_node((self)->NameID) +#define LassoSamlp2NameIDMappingResponse_NameID_get(self) get_node((self)->NameID) +#define LassoSamlp2NameIDMappingResponse_set_NameID(self,value) set_node((gpointer*)&(self)->NameID, (value)) +#define LassoSamlp2NameIDMappingResponse_NameID_set(self,value) set_node((gpointer*)&(self)->NameID, (value)) + + +/* EncryptedID */ + +#define LassoSamlp2NameIDMappingResponse_get_EncryptedID(self) get_node((self)->EncryptedID) +#define LassoSamlp2NameIDMappingResponse_EncryptedID_get(self) get_node((self)->EncryptedID) +#define LassoSamlp2NameIDMappingResponse_set_EncryptedID(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) +#define LassoSamlp2NameIDMappingResponse_EncryptedID_set(self,value) set_node((gpointer*)&(self)->EncryptedID, (value)) + + +/* inherited from StatusResponse */ + +/* Issuer */ + +#define LassoSamlp2NameIDMappingResponse_get_Issuer(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer) +#define LassoSamlp2NameIDMappingResponse_Issuer_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer) +#define LassoSamlp2NameIDMappingResponse_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer, (value)) +#define LassoSamlp2NameIDMappingResponse_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2NameIDMappingResponse_get_Extensions(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions) +#define LassoSamlp2NameIDMappingResponse_Extensions_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions) +#define LassoSamlp2NameIDMappingResponse_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions, (value)) +#define LassoSamlp2NameIDMappingResponse_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions, (value)) + + +/* Status */ + +#define LassoSamlp2NameIDMappingResponse_get_Status(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Status) +#define LassoSamlp2NameIDMappingResponse_Status_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Status) +#define LassoSamlp2NameIDMappingResponse_set_Status(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Status, (value)) +#define LassoSamlp2NameIDMappingResponse_Status_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Status, (value)) + + +/* ID */ + +#define LassoSamlp2NameIDMappingResponse_get_ID(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->ID +#define LassoSamlp2NameIDMappingResponse_ID_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->ID + +#define LassoSamlp2NameIDMappingResponse_set_ID(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->ID, (value)) +#define LassoSamlp2NameIDMappingResponse_ID_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->ID, (value)) + +/* InResponseTo */ + +#define LassoSamlp2NameIDMappingResponse_get_InResponseTo(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo +#define LassoSamlp2NameIDMappingResponse_InResponseTo_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo + +#define LassoSamlp2NameIDMappingResponse_set_InResponseTo(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo, (value)) +#define LassoSamlp2NameIDMappingResponse_InResponseTo_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo, (value)) + +/* Version */ + +#define LassoSamlp2NameIDMappingResponse_get_Version(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Version +#define LassoSamlp2NameIDMappingResponse_Version_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Version + +#define LassoSamlp2NameIDMappingResponse_set_Version(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Version, (value)) +#define LassoSamlp2NameIDMappingResponse_Version_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2NameIDMappingResponse_get_IssueInstant(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant +#define LassoSamlp2NameIDMappingResponse_IssueInstant_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant + +#define LassoSamlp2NameIDMappingResponse_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant, (value)) +#define LassoSamlp2NameIDMappingResponse_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2NameIDMappingResponse_get_Destination(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination +#define LassoSamlp2NameIDMappingResponse_Destination_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination + +#define LassoSamlp2NameIDMappingResponse_set_Destination(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination, (value)) +#define LassoSamlp2NameIDMappingResponse_Destination_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2NameIDMappingResponse_get_Consent(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent +#define LassoSamlp2NameIDMappingResponse_Consent_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent + +#define LassoSamlp2NameIDMappingResponse_set_Consent(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent, (value)) +#define LassoSamlp2NameIDMappingResponse_Consent_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2NameIDMappingResponse lasso_samlp2_name_id_mapping_response_new +#define delete_LassoSamlp2NameIDMappingResponse(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2NameIDMappingResponse_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_name_id_policy.i b/swig/saml-2.0/samlp2_name_id_policy.i new file mode 100644 index 00000000..5f573b4d --- /dev/null +++ b/swig/saml-2.0/samlp2_name_id_policy.i @@ -0,0 +1,38 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2NameIDPolicy) LassoSamlp2NameIDPolicy; +#endif +typedef struct { + char *Format; + char *SPNameQualifier; +#ifndef SWIGPHP4 + %rename(allowCreate) AllowCreate; +#endif + gboolean AllowCreate; +} LassoSamlp2NameIDPolicy; +%extend LassoSamlp2NameIDPolicy { + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2NameIDPolicy(); + ~LassoSamlp2NameIDPolicy(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2NameIDPolicy lasso_samlp2_name_id_policy_new +#define delete_LassoSamlp2NameIDPolicy(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2NameIDPolicy_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_request_abstract.i b/swig/saml-2.0/samlp2_request_abstract.i new file mode 100644 index 00000000..2b4aa582 --- /dev/null +++ b/swig/saml-2.0/samlp2_request_abstract.i @@ -0,0 +1,65 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2RequestAbstract) LassoSamlp2RequestAbstract; +#endif +typedef struct { + char *ID; + char *Version; + char *IssueInstant; + char *Destination; + char *Consent; +} LassoSamlp2RequestAbstract; +%extend LassoSamlp2RequestAbstract { + +#ifndef SWIGPHP4 + %rename(issuer) Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2RequestAbstract(); + ~LassoSamlp2RequestAbstract(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* Issuer */ + +#define LassoSamlp2RequestAbstract_get_Issuer(self) get_node((self)->Issuer) +#define LassoSamlp2RequestAbstract_Issuer_get(self) get_node((self)->Issuer) +#define LassoSamlp2RequestAbstract_set_Issuer(self,value) set_node((gpointer*)&(self)->Issuer, (value)) +#define LassoSamlp2RequestAbstract_Issuer_set(self,value) set_node((gpointer*)&(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2RequestAbstract_get_Extensions(self) get_node((self)->Extensions) +#define LassoSamlp2RequestAbstract_Extensions_get(self) get_node((self)->Extensions) +#define LassoSamlp2RequestAbstract_set_Extensions(self,value) set_node((gpointer*)&(self)->Extensions, (value)) +#define LassoSamlp2RequestAbstract_Extensions_set(self,value) set_node((gpointer*)&(self)->Extensions, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2RequestAbstract lasso_samlp2_request_abstract_new +#define delete_LassoSamlp2RequestAbstract(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2RequestAbstract_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_requested_authn_context.i b/swig/saml-2.0/samlp2_requested_authn_context.i new file mode 100644 index 00000000..6fc3d75d --- /dev/null +++ b/swig/saml-2.0/samlp2_requested_authn_context.i @@ -0,0 +1,35 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2RequestedAuthnContext) LassoSamlp2RequestedAuthnContext; +#endif +typedef struct { + char *AuthnContextClassRef; + char *AuthnContextDeclRef; + char *Comparison; +} LassoSamlp2RequestedAuthnContext; +%extend LassoSamlp2RequestedAuthnContext { + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2RequestedAuthnContext(); + ~LassoSamlp2RequestedAuthnContext(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2RequestedAuthnContext lasso_samlp2_requested_authn_context_new +#define delete_LassoSamlp2RequestedAuthnContext(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2RequestedAuthnContext_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_response.i b/swig/saml-2.0/samlp2_response.i new file mode 100644 index 00000000..81c93156 --- /dev/null +++ b/swig/saml-2.0/samlp2_response.i @@ -0,0 +1,149 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2Response) LassoSamlp2Response; +#endif +typedef struct { +} LassoSamlp2Response; +%extend LassoSamlp2Response { + + /* inherited from Samlp2StatusResponse */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(status) *Status; +#endif + %newobject *Status_get; + LassoSamlp2Status *Status; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(inResponseTo) *InResponseTo; +#endif + char *InResponseTo; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2Response(); + ~LassoSamlp2Response(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* inherited from StatusResponse */ + +/* Issuer */ + +#define LassoSamlp2Response_get_Issuer(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer) +#define LassoSamlp2Response_Issuer_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer) +#define LassoSamlp2Response_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer, (value)) +#define LassoSamlp2Response_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2Response_get_Extensions(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions) +#define LassoSamlp2Response_Extensions_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions) +#define LassoSamlp2Response_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions, (value)) +#define LassoSamlp2Response_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Extensions, (value)) + + +/* Status */ + +#define LassoSamlp2Response_get_Status(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Status) +#define LassoSamlp2Response_Status_get(self) get_node(LASSO_SAMLP2_STATUS_RESPONSE(self)->Status) +#define LassoSamlp2Response_set_Status(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Status, (value)) +#define LassoSamlp2Response_Status_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_STATUS_RESPONSE(self)->Status, (value)) + + +/* ID */ + +#define LassoSamlp2Response_get_ID(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->ID +#define LassoSamlp2Response_ID_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->ID + +#define LassoSamlp2Response_set_ID(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->ID, (value)) +#define LassoSamlp2Response_ID_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->ID, (value)) + +/* InResponseTo */ + +#define LassoSamlp2Response_get_InResponseTo(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo +#define LassoSamlp2Response_InResponseTo_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo + +#define LassoSamlp2Response_set_InResponseTo(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo, (value)) +#define LassoSamlp2Response_InResponseTo_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->InResponseTo, (value)) + +/* Version */ + +#define LassoSamlp2Response_get_Version(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Version +#define LassoSamlp2Response_Version_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Version + +#define LassoSamlp2Response_set_Version(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Version, (value)) +#define LassoSamlp2Response_Version_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2Response_get_IssueInstant(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant +#define LassoSamlp2Response_IssueInstant_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant + +#define LassoSamlp2Response_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant, (value)) +#define LassoSamlp2Response_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2Response_get_Destination(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination +#define LassoSamlp2Response_Destination_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination + +#define LassoSamlp2Response_set_Destination(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination, (value)) +#define LassoSamlp2Response_Destination_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2Response_get_Consent(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent +#define LassoSamlp2Response_Consent_get(self) LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent + +#define LassoSamlp2Response_set_Consent(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent, (value)) +#define LassoSamlp2Response_Consent_set(self,value) set_string(&LASSO_SAMLP2_STATUS_RESPONSE(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2Response lasso_samlp2_response_new +#define delete_LassoSamlp2Response(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2Response_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_scoping.i b/swig/saml-2.0/samlp2_scoping.i new file mode 100644 index 00000000..109a18d4 --- /dev/null +++ b/swig/saml-2.0/samlp2_scoping.i @@ -0,0 +1,48 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2Scoping) LassoSamlp2Scoping; +#endif +typedef struct { + char *RequesterID; + char *ProxyCount; +} LassoSamlp2Scoping; +%extend LassoSamlp2Scoping { + +#ifndef SWIGPHP4 + %rename(iDPList) IDPList; +#endif + %newobject *IDPList_get; + LassoSamlp2IDPList *IDPList; + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2Scoping(); + ~LassoSamlp2Scoping(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* IDPList */ + +#define LassoSamlp2Scoping_get_IDPList(self) get_node((self)->IDPList) +#define LassoSamlp2Scoping_IDPList_get(self) get_node((self)->IDPList) +#define LassoSamlp2Scoping_set_IDPList(self,value) set_node((gpointer*)&(self)->IDPList, (value)) +#define LassoSamlp2Scoping_IDPList_set(self,value) set_node((gpointer*)&(self)->IDPList, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2Scoping lasso_samlp2_scoping_new +#define delete_LassoSamlp2Scoping(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2Scoping_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_status.i b/swig/saml-2.0/samlp2_status.i new file mode 100644 index 00000000..f78f7329 --- /dev/null +++ b/swig/saml-2.0/samlp2_status.i @@ -0,0 +1,61 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2Status) LassoSamlp2Status; +#endif +typedef struct { + char *StatusMessage; +} LassoSamlp2Status; +%extend LassoSamlp2Status { + +#ifndef SWIGPHP4 + %rename(statusCode) StatusCode; +#endif + %newobject *StatusCode_get; + LassoSamlp2StatusCode *StatusCode; + +#ifndef SWIGPHP4 + %rename(statusDetail) StatusDetail; +#endif + %newobject *StatusDetail_get; + LassoSamlp2StatusDetail *StatusDetail; + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2Status(); + ~LassoSamlp2Status(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* StatusCode */ + +#define LassoSamlp2Status_get_StatusCode(self) get_node((self)->StatusCode) +#define LassoSamlp2Status_StatusCode_get(self) get_node((self)->StatusCode) +#define LassoSamlp2Status_set_StatusCode(self,value) set_node((gpointer*)&(self)->StatusCode, (value)) +#define LassoSamlp2Status_StatusCode_set(self,value) set_node((gpointer*)&(self)->StatusCode, (value)) + + +/* StatusDetail */ + +#define LassoSamlp2Status_get_StatusDetail(self) get_node((self)->StatusDetail) +#define LassoSamlp2Status_StatusDetail_get(self) get_node((self)->StatusDetail) +#define LassoSamlp2Status_set_StatusDetail(self,value) set_node((gpointer*)&(self)->StatusDetail, (value)) +#define LassoSamlp2Status_StatusDetail_set(self,value) set_node((gpointer*)&(self)->StatusDetail, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2Status lasso_samlp2_status_new +#define delete_LassoSamlp2Status(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2Status_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_status_code.i b/swig/saml-2.0/samlp2_status_code.i new file mode 100644 index 00000000..d6e89205 --- /dev/null +++ b/swig/saml-2.0/samlp2_status_code.i @@ -0,0 +1,47 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2StatusCode) LassoSamlp2StatusCode; +#endif +typedef struct { + char *Value; +} LassoSamlp2StatusCode; +%extend LassoSamlp2StatusCode { + +#ifndef SWIGPHP4 + %rename(statusCode) StatusCode; +#endif + %newobject *StatusCode_get; + LassoSamlp2StatusCode *StatusCode; + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2StatusCode(); + ~LassoSamlp2StatusCode(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* StatusCode */ + +#define LassoSamlp2StatusCode_get_StatusCode(self) get_node((self)->StatusCode) +#define LassoSamlp2StatusCode_StatusCode_get(self) get_node((self)->StatusCode) +#define LassoSamlp2StatusCode_set_StatusCode(self,value) set_node((gpointer*)&(self)->StatusCode, (value)) +#define LassoSamlp2StatusCode_StatusCode_set(self,value) set_node((gpointer*)&(self)->StatusCode, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2StatusCode lasso_samlp2_status_code_new +#define delete_LassoSamlp2StatusCode(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2StatusCode_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_status_detail.i b/swig/saml-2.0/samlp2_status_detail.i new file mode 100644 index 00000000..05e18847 --- /dev/null +++ b/swig/saml-2.0/samlp2_status_detail.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2StatusDetail) LassoSamlp2StatusDetail; +#endif +typedef struct { +} LassoSamlp2StatusDetail; +%extend LassoSamlp2StatusDetail { + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2StatusDetail(); + ~LassoSamlp2StatusDetail(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2StatusDetail lasso_samlp2_status_detail_new +#define delete_LassoSamlp2StatusDetail(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2StatusDetail_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_status_response.i b/swig/saml-2.0/samlp2_status_response.i new file mode 100644 index 00000000..8c64aac5 --- /dev/null +++ b/swig/saml-2.0/samlp2_status_response.i @@ -0,0 +1,80 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2StatusResponse) LassoSamlp2StatusResponse; +#endif +typedef struct { + char *ID; + char *InResponseTo; + char *Version; + char *IssueInstant; + char *Destination; + char *Consent; +} LassoSamlp2StatusResponse; +%extend LassoSamlp2StatusResponse { + +#ifndef SWIGPHP4 + %rename(issuer) Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(status) Status; +#endif + %newobject *Status_get; + LassoSamlp2Status *Status; + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2StatusResponse(); + ~LassoSamlp2StatusResponse(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* Issuer */ + +#define LassoSamlp2StatusResponse_get_Issuer(self) get_node((self)->Issuer) +#define LassoSamlp2StatusResponse_Issuer_get(self) get_node((self)->Issuer) +#define LassoSamlp2StatusResponse_set_Issuer(self,value) set_node((gpointer*)&(self)->Issuer, (value)) +#define LassoSamlp2StatusResponse_Issuer_set(self,value) set_node((gpointer*)&(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2StatusResponse_get_Extensions(self) get_node((self)->Extensions) +#define LassoSamlp2StatusResponse_Extensions_get(self) get_node((self)->Extensions) +#define LassoSamlp2StatusResponse_set_Extensions(self,value) set_node((gpointer*)&(self)->Extensions, (value)) +#define LassoSamlp2StatusResponse_Extensions_set(self,value) set_node((gpointer*)&(self)->Extensions, (value)) + + +/* Status */ + +#define LassoSamlp2StatusResponse_get_Status(self) get_node((self)->Status) +#define LassoSamlp2StatusResponse_Status_get(self) get_node((self)->Status) +#define LassoSamlp2StatusResponse_set_Status(self,value) set_node((gpointer*)&(self)->Status, (value)) +#define LassoSamlp2StatusResponse_Status_set(self,value) set_node((gpointer*)&(self)->Status, (value)) + + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2StatusResponse lasso_samlp2_status_response_new +#define delete_LassoSamlp2StatusResponse(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2StatusResponse_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_subject_query_abstract.i b/swig/saml-2.0/samlp2_subject_query_abstract.i new file mode 100644 index 00000000..38da1580 --- /dev/null +++ b/swig/saml-2.0/samlp2_subject_query_abstract.i @@ -0,0 +1,137 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2SubjectQueryAbstract) LassoSamlp2SubjectQueryAbstract; +#endif +typedef struct { +} LassoSamlp2SubjectQueryAbstract; +%extend LassoSamlp2SubjectQueryAbstract { + +#ifndef SWIGPHP4 + %rename(subject) Subject; +#endif + %newobject *Subject_get; + LassoSaml2Subject *Subject; + + /* inherited from Samlp2RequestAbstract */ +#ifndef SWIGPHP4 + %rename(issuer) *Issuer; +#endif + %newobject *Issuer_get; + LassoSaml2NameID *Issuer; + +#ifndef SWIGPHP4 + %rename(extensions) *Extensions; +#endif + %newobject *Extensions_get; + LassoSamlp2Extensions *Extensions; + +#ifndef SWIGPHP4 + %rename(iD) *ID; +#endif + char *ID; +#ifndef SWIGPHP4 + %rename(version) *Version; +#endif + char *Version; +#ifndef SWIGPHP4 + %rename(issueInstant) *IssueInstant; +#endif + char *IssueInstant; +#ifndef SWIGPHP4 + %rename(destination) *Destination; +#endif + char *Destination; +#ifndef SWIGPHP4 + %rename(consent) *Consent; +#endif + char *Consent; + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2SubjectQueryAbstract(); + ~LassoSamlp2SubjectQueryAbstract(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + +/* Subject */ + +#define LassoSamlp2SubjectQueryAbstract_get_Subject(self) get_node((self)->Subject) +#define LassoSamlp2SubjectQueryAbstract_Subject_get(self) get_node((self)->Subject) +#define LassoSamlp2SubjectQueryAbstract_set_Subject(self,value) set_node((gpointer*)&(self)->Subject, (value)) +#define LassoSamlp2SubjectQueryAbstract_Subject_set(self,value) set_node((gpointer*)&(self)->Subject, (value)) + + +/* inherited from RequestAbstract */ + +/* Issuer */ + +#define LassoSamlp2SubjectQueryAbstract_get_Issuer(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2SubjectQueryAbstract_Issuer_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer) +#define LassoSamlp2SubjectQueryAbstract_set_Issuer(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) +#define LassoSamlp2SubjectQueryAbstract_Issuer_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Issuer, (value)) + + +/* Extensions */ + +#define LassoSamlp2SubjectQueryAbstract_get_Extensions(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2SubjectQueryAbstract_Extensions_get(self) get_node(LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions) +#define LassoSamlp2SubjectQueryAbstract_set_Extensions(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) +#define LassoSamlp2SubjectQueryAbstract_Extensions_set(self,value) set_node((gpointer*)&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Extensions, (value)) + + +/* ID */ + +#define LassoSamlp2SubjectQueryAbstract_get_ID(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID +#define LassoSamlp2SubjectQueryAbstract_ID_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID + +#define LassoSamlp2SubjectQueryAbstract_set_ID(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) +#define LassoSamlp2SubjectQueryAbstract_ID_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->ID, (value)) + +/* Version */ + +#define LassoSamlp2SubjectQueryAbstract_get_Version(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version +#define LassoSamlp2SubjectQueryAbstract_Version_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version + +#define LassoSamlp2SubjectQueryAbstract_set_Version(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) +#define LassoSamlp2SubjectQueryAbstract_Version_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Version, (value)) + +/* IssueInstant */ + +#define LassoSamlp2SubjectQueryAbstract_get_IssueInstant(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant +#define LassoSamlp2SubjectQueryAbstract_IssueInstant_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant + +#define LassoSamlp2SubjectQueryAbstract_set_IssueInstant(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) +#define LassoSamlp2SubjectQueryAbstract_IssueInstant_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->IssueInstant, (value)) + +/* Destination */ + +#define LassoSamlp2SubjectQueryAbstract_get_Destination(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination +#define LassoSamlp2SubjectQueryAbstract_Destination_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination + +#define LassoSamlp2SubjectQueryAbstract_set_Destination(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) +#define LassoSamlp2SubjectQueryAbstract_Destination_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Destination, (value)) + +/* Consent */ + +#define LassoSamlp2SubjectQueryAbstract_get_Consent(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent +#define LassoSamlp2SubjectQueryAbstract_Consent_get(self) LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent + +#define LassoSamlp2SubjectQueryAbstract_set_Consent(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) +#define LassoSamlp2SubjectQueryAbstract_Consent_set(self,value) set_string(&LASSO_SAMLP2_REQUEST_ABSTRACT(self)->Consent, (value)) + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2SubjectQueryAbstract lasso_samlp2_subject_query_abstract_new +#define delete_LassoSamlp2SubjectQueryAbstract(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2SubjectQueryAbstract_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + diff --git a/swig/saml-2.0/samlp2_terminate.i b/swig/saml-2.0/samlp2_terminate.i new file mode 100644 index 00000000..48228e87 --- /dev/null +++ b/swig/saml-2.0/samlp2_terminate.i @@ -0,0 +1,32 @@ + +#ifndef SWIGPHP4 +%rename(Samlp2Terminate) LassoSamlp2Terminate; +#endif +typedef struct { +} LassoSamlp2Terminate; +%extend LassoSamlp2Terminate { + + + /* Constructor, Destructor & Static Methods */ + LassoSamlp2Terminate(); + ~LassoSamlp2Terminate(); + + /* Method inherited from LassoNode */ + %newobject dump; + char* dump(); +} + +%{ + + +/* Constructors, destructors & static methods implementations */ + +#define new_LassoSamlp2Terminate lasso_samlp2_terminate_new +#define delete_LassoSamlp2Terminate(self) lasso_node_destroy(LASSO_NODE(self)) + +/* Implementations of methods inherited from LassoNode */ + +#define LassoSamlp2Terminate_dump(self) lasso_node_dump(LASSO_NODE(self)) + +%} + |