From 8ef81c06bb852dce0bd6679b1114fada231fd2cc Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Thu, 27 Dec 2007 15:18:29 +0000 Subject: renamed files according to their contents --- lasso/xml/saml-2.0/Makefile.am | 4 +- lasso/xml/saml-2.0/samlp2_assertion_id_request.c | 143 +++++++++++++++++++++++ lasso/xml/saml-2.0/samlp2_assertion_id_request.h | 75 ++++++++++++ lasso/xml/saml-2.0/samlp2_assertion_idrequest.c | 143 ----------------------- lasso/xml/saml-2.0/samlp2_assertion_idrequest.h | 75 ------------ 5 files changed, 220 insertions(+), 220 deletions(-) create mode 100644 lasso/xml/saml-2.0/samlp2_assertion_id_request.c create mode 100644 lasso/xml/saml-2.0/samlp2_assertion_id_request.h delete mode 100644 lasso/xml/saml-2.0/samlp2_assertion_idrequest.c delete mode 100644 lasso/xml/saml-2.0/samlp2_assertion_idrequest.h diff --git a/lasso/xml/saml-2.0/Makefile.am b/lasso/xml/saml-2.0/Makefile.am index 52d1ff7f..d3c4775c 100644 --- a/lasso/xml/saml-2.0/Makefile.am +++ b/lasso/xml/saml-2.0/Makefile.am @@ -35,7 +35,7 @@ liblasso_xml_saml2_la_SOURCES = \ saml2_subject_locality.c \ samlp2_artifact_resolve.c \ samlp2_artifact_response.c \ - samlp2_assertion_idrequest.c \ + samlp2_assertion_id_request.c \ samlp2_attribute_query.c \ samlp2_authn_query.c \ samlp2_authn_request.c \ @@ -88,7 +88,7 @@ liblassoinclude_HEADERS = \ saml2_subject_locality.h \ samlp2_artifact_resolve.h \ samlp2_artifact_response.h \ - samlp2_assertion_idrequest.h \ + samlp2_assertion_id_request.h \ samlp2_attribute_query.h \ samlp2_authn_query.h \ samlp2_authn_request.h \ diff --git a/lasso/xml/saml-2.0/samlp2_assertion_id_request.c b/lasso/xml/saml-2.0/samlp2_assertion_id_request.c new file mode 100644 index 00000000..f0b4c467 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_assertion_id_request.c @@ -0,0 +1,143 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004-2007 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_id_request.h" + +/* + * Schema fragment (saml-schema-protocol-2.0.xsd): + * + * + * + * + * + * + * + * + * + * + */ + +/*****************************************************************************/ +/* 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); + if (deflated_message == NULL) { + return NULL; + } + 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_id_request_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_id_request_new: + * + * Creates a new #LassoSamlp2AssertionIDRequest object. + * + * Return value: a newly created #LassoSamlp2AssertionIDRequest object + **/ +LassoNode* +lasso_samlp2_assertion_id_request_new() +{ + return g_object_new(LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST, NULL); +} diff --git a/lasso/xml/saml-2.0/samlp2_assertion_id_request.h b/lasso/xml/saml-2.0/samlp2_assertion_id_request.h new file mode 100644 index 00000000..a85ddc82 --- /dev/null +++ b/lasso/xml/saml-2.0/samlp2_assertion_id_request.h @@ -0,0 +1,75 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004-2007 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_ID_REQUEST_H__ +#define __LASSO_SAMLP2_ASSERTION_ID_REQUEST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "samlp2_request_abstract.h" + +#define LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST (lasso_samlp2_assertion_id_request_get_type()) +#define LASSO_SAMLP2_ASSERTION_ID_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST, \ + LassoSamlp2AssertionIDRequest)) +#define LASSO_SAMLP2_ASSERTION_ID_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST, \ + LassoSamlp2AssertionIDRequestClass)) +#define LASSO_IS_SAMLP2_ASSERTION_ID_REQUEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST)) +#define LASSO_IS_SAMLP2_ASSERTION_ID_REQUEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST)) +#define LASSO_SAMLP2_ASSERTION_ID_REQUEST_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST, \ + 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_id_request_get_type(void); +LASSO_EXPORT LassoNode* lasso_samlp2_assertion_id_request_new(void); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAMLP2_ASSERTION_ID_REQUEST_H__ */ diff --git a/lasso/xml/saml-2.0/samlp2_assertion_idrequest.c b/lasso/xml/saml-2.0/samlp2_assertion_idrequest.c deleted file mode 100644 index f0b4c467..00000000 --- a/lasso/xml/saml-2.0/samlp2_assertion_idrequest.c +++ /dev/null @@ -1,143 +0,0 @@ -/* $Id$ - * - * Lasso - A free implementation of the Liberty Alliance specifications. - * - * Copyright (C) 2004-2007 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_id_request.h" - -/* - * Schema fragment (saml-schema-protocol-2.0.xsd): - * - * - * - * - * - * - * - * - * - * - */ - -/*****************************************************************************/ -/* 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); - if (deflated_message == NULL) { - return NULL; - } - 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_id_request_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_id_request_new: - * - * Creates a new #LassoSamlp2AssertionIDRequest object. - * - * Return value: a newly created #LassoSamlp2AssertionIDRequest object - **/ -LassoNode* -lasso_samlp2_assertion_id_request_new() -{ - return g_object_new(LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST, NULL); -} diff --git a/lasso/xml/saml-2.0/samlp2_assertion_idrequest.h b/lasso/xml/saml-2.0/samlp2_assertion_idrequest.h deleted file mode 100644 index a85ddc82..00000000 --- a/lasso/xml/saml-2.0/samlp2_assertion_idrequest.h +++ /dev/null @@ -1,75 +0,0 @@ -/* $Id$ - * - * Lasso - A free implementation of the Liberty Alliance specifications. - * - * Copyright (C) 2004-2007 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_ID_REQUEST_H__ -#define __LASSO_SAMLP2_ASSERTION_ID_REQUEST_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "samlp2_request_abstract.h" - -#define LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST (lasso_samlp2_assertion_id_request_get_type()) -#define LASSO_SAMLP2_ASSERTION_ID_REQUEST(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST, \ - LassoSamlp2AssertionIDRequest)) -#define LASSO_SAMLP2_ASSERTION_ID_REQUEST_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST, \ - LassoSamlp2AssertionIDRequestClass)) -#define LASSO_IS_SAMLP2_ASSERTION_ID_REQUEST(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST)) -#define LASSO_IS_SAMLP2_ASSERTION_ID_REQUEST_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST)) -#define LASSO_SAMLP2_ASSERTION_ID_REQUEST_GET_CLASS(o) \ - (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_ASSERTION_ID_REQUEST, \ - 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_id_request_get_type(void); -LASSO_EXPORT LassoNode* lasso_samlp2_assertion_id_request_new(void); - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LASSO_SAMLP2_ASSERTION_ID_REQUEST_H__ */ -- cgit