summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-04-26 09:36:55 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-04-26 09:36:55 +0000
commit3ebb322c720aeb2954cf22afec311eb96d9f1a75 (patch)
tree4889c3de2db2bf3a9e60200e98001c6043e4293a
parent1e702c7d5b797285359395f2e0914a1d26727fb4 (diff)
downloadlasso-3ebb322c720aeb2954cf22afec311eb96d9f1a75.tar.gz
lasso-3ebb322c720aeb2954cf22afec311eb96d9f1a75.tar.xz
lasso-3ebb322c720aeb2954cf22afec311eb96d9f1a75.zip
initial version
-rw-r--r--lasso/Attic/protocols/register_name_identifier_request.c117
-rw-r--r--lasso/Attic/protocols/register_name_identifier_request.h71
-rw-r--r--lasso/Attic/protocols/register_name_identifier_response.c112
-rw-r--r--lasso/Attic/protocols/register_name_identifier_response.h64
4 files changed, 364 insertions, 0 deletions
diff --git a/lasso/Attic/protocols/register_name_identifier_request.c b/lasso/Attic/protocols/register_name_identifier_request.c
new file mode 100644
index 00000000..f346701f
--- /dev/null
+++ b/lasso/Attic/protocols/register_name_identifier_request.c
@@ -0,0 +1,117 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <lasso/protocols/register_name_identifier_request.h>
+
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
+
+static void
+lasso_register_name_identifier_request_instance_init(LassoRegisterNameIdentifierRequest *request)
+{
+}
+
+static void
+lasso_register_name_identifier_request_class_init(LassoRegisterNameIdentifierRequestClass *class)
+{
+}
+
+GType lasso_register_name_identifier_request_get_type() {
+ static GType this_type = 0;
+
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof (LassoRegisterNameIdentifierRequestClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) lasso_register_name_identifier_request_class_init,
+ NULL,
+ NULL,
+ sizeof(LassoRegisterNameIdentifierRequest),
+ 0,
+ (GInstanceInitFunc) lasso_register_name_identifier_request_instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_LIB_REGISTER_NAME_IDENTIFIER_REQUEST,
+ "LassoRegisterNameIdentifierRequest",
+ &this_info, 0);
+ }
+ return this_type;
+}
+
+LassoNode*
+lasso_register_name_identifier_request_new(const xmlChar *providerID,
+ const xmlChar *idpProvidedNameIdentifier,
+ const xmlChar *idpNameQualifier,
+ const xmlChar *idpFormat,
+ const xmlChar *spProvidedNameIdentifier,
+ const xmlChar *spNameQualifier,
+ const xmlChar *spFormat,
+ const xmlChar *oldProvidedNameIdentifier,
+ const xmlChar *oldNameQualifier,
+ const xmlChar *oldFormat)
+{
+ LassoNode *request, *idpidentifier, *spidentifier, *oldidentifier;
+
+ request = LASSO_NODE(g_object_new(LASSO_TYPE_REGISTER_NAME_IDENTIFIER_REQUEST, NULL));
+
+ /* Set ONLY required elements/attributs */
+ /* RequestID */
+ lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
+ (const xmlChar *)lasso_build_unique_id(32));
+ /* MajorVersion */
+ lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
+ lassoLibMajorVersion);
+ /* MinorVersion */
+ lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
+ lassoLibMinorVersion);
+ /* IssueInstant */
+ lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(request),
+ lasso_get_current_time());
+ /* ProviderID */
+ lasso_lib_register_name_identifier_request_set_providerID(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request),
+ providerID);
+
+ idpidentifier = lasso_lib_idp_provided_name_identifier_new(idpProvidedNameIdentifier);
+ lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(idpidentifier), idpNameQualifier);
+ lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(idpidentifier), idpFormat);
+ lasso_lib_register_name_identifier_request_set_idpProvidedNameIdentifier(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request),
+ LASSO_LIB_IDP_PROVIDED_NAME_IDENTIFIER(idpidentifier));
+
+ spidentifier = lasso_lib_sp_provided_name_identifier_new(spProvidedNameIdentifier);
+ lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(spidentifier), spNameQualifier);
+ lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(spidentifier), spFormat);
+ lasso_lib_register_name_identifier_request_set_spProvidedNameIdentifier(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request),
+ LASSO_LIB_SP_PROVIDED_NAME_IDENTIFIER(spidentifier));
+
+ oldidentifier = lasso_lib_old_provided_name_identifier_new(oldProvidedNameIdentifier);
+ lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(oldidentifier), oldNameQualifier);
+ lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(oldidentifier), oldFormat);
+ lasso_lib_register_name_identifier_request_set_oldProvidedNameIdentifier(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request),
+ LASSO_LIB_OLD_PROVIDED_NAME_IDENTIFIER(oldidentifier));
+
+ return (request);
+}
diff --git a/lasso/Attic/protocols/register_name_identifier_request.h b/lasso/Attic/protocols/register_name_identifier_request.h
new file mode 100644
index 00000000..9b49d68c
--- /dev/null
+++ b/lasso/Attic/protocols/register_name_identifier_request.h
@@ -0,0 +1,71 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_REGISTER_NAME_IDENTIFIER_REQUEST_H__
+#define __LASSO_REGISTER_NAME_IDENTIFIER_REQUEST_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <lasso/xml/lib_register_name_identifier_request.h>
+
+#define LASSO_TYPE_REGISTER_NAME_IDENTIFIER_REQUEST (lasso_register_name_identifier_request_get_type())
+#define LASSO_REGISTER_NAME_IDENTIFIER_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_REQUEST, LassoAuthnRequest))
+#define LASSO_REGISTER_NAME_IDENTIFIER_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_REQUEST, LassoAuthnRequestClass))
+#define LASSO_IS_REGISTER_NAME_IDENTIFIER_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_REQUEST))
+#define LASSP_IS_REGISTER_NAME_IDENTIFIER_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_REQUEST))
+#define LASSO_REGISTER_NAME_IDENTIFIER_REQUEST_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_REQUEST, LassoAuthnRequestClass))
+
+typedef struct _LassoRegisterNameIdentifierRequest LassoRegisterNameIdentifierRequest;
+typedef struct _LassoRegisterNameIdentifierRequestClass LassoRegisterNameIdentifierRequestClass;
+
+struct _LassoRegisterNameIdentifierRequest {
+ LassoLibRegisterNameIdentifierRequest parent;
+ /*< public >*/
+ /*< private >*/
+};
+
+struct _LassoRegisterNameIdentifierRequestClass {
+ LassoLibRegisterNameIdentifierRequestClass parent;
+};
+
+LASSO_EXPORT GType lasso_register_name_identifier_request_get_type (void);
+LASSO_EXPORT LassoNode* lasso_register_name_identifier_request_new (const xmlChar *providerID,
+ const xmlChar *idpProvidedNameIdentifier,
+ const xmlChar *idpNameQualifier,
+ const xmlChar *idpFormat,
+ const xmlChar *spProvidedNameIdentifier,
+ const xmlChar *spNameQualifier,
+ const xmlChar *spFormat,
+ const xmlChar *oldProvidedNameIdentifier,
+ const xmlChar *oldNameQualifier,
+ const xmlChar *oldFormat);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_REGISTER_NAME_IDENTIFIER_REQUEST_H__ */
diff --git a/lasso/Attic/protocols/register_name_identifier_response.c b/lasso/Attic/protocols/register_name_identifier_response.c
new file mode 100644
index 00000000..255b34f7
--- /dev/null
+++ b/lasso/Attic/protocols/register_name_identifier_response.c
@@ -0,0 +1,112 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <lasso/protocols/register_name_identifier_response.h>
+
+/*****************************************************************************/
+/* public methods */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
+
+static void
+lasso_register_name_identifier_response_instance_init(LassoRegisterNameIdentifierResponse *response)
+{
+}
+
+static void
+lasso_register_name_identifier_response_class_init(LassoRegisterNameIdentifierResponseClass *class)
+{
+}
+
+GType lasso_register_name_identifier_response_get_type() {
+ static GType this_type = 0;
+
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof (LassoRegisterNameIdentifierResponseClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) lasso_register_name_identifier_response_class_init,
+ NULL,
+ NULL,
+ sizeof(LassoRegisterNameIdentifierResponse),
+ 0,
+ (GInstanceInitFunc) lasso_register_name_identifier_response_instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_LIB_REGISTER_NAME_IDENTIFIER_RESPONSE,
+ "LassoRegisterNameIdentifierResponse",
+ &this_info, 0);
+ }
+ return this_type;
+}
+
+LassoNode*
+lasso_register_name_identifier_response_new(const xmlChar *providerID,
+ const xmlChar *statusCodeValue,
+ LassoNode *request)
+{
+ LassoNode *response, *ss, *ssc;
+ xmlChar *inResponseTo, *recipient;
+
+ response = LASSO_NODE(g_object_new(LASSO_TYPE_REGISTER_NAME_IDENTIFIER_RESPONSE, NULL));
+
+ /* Set ONLY required elements/attributs */
+ /* ResponseID */
+ lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ (const xmlChar *)lasso_build_unique_id(32));
+ /* MajorVersion */
+ lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lassoLibMajorVersion);
+ /* MinorVersion */
+ lasso_samlp_response_abstract_set_minorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lassoLibMinorVersion);
+ /* IssueInstant */
+ lasso_samlp_response_abstract_set_issueInstance(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lasso_get_current_time());
+ /* ProviderID */
+ lasso_lib_status_response_set_providerID(LASSO_LIB_STATUS_RESPONSE(response),
+ providerID);
+
+ inResponseTo = xmlNodeGetContent((xmlNodePtr)lasso_node_get_attr(request, "RequestID"));
+ recipient = lasso_node_get_content(lasso_node_get_child(request, "ProviderID"));
+
+ lasso_samlp_response_abstract_set_inResponseTo(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ inResponseTo);
+
+ lasso_samlp_response_abstract_set_recipient(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ recipient);
+
+ ss = lasso_samlp_status_new();
+ ssc = lasso_samlp_status_code_new();
+ lasso_samlp_status_code_set_value(LASSO_SAMLP_STATUS_CODE(ssc), statusCodeValue);
+ lasso_samlp_status_set_statusCode(LASSO_SAMLP_STATUS(ss), LASSO_SAMLP_STATUS_CODE(ssc));
+ lasso_lib_status_response_set_status(LASSO_LIB_STATUS_RESPONSE(response), LASSO_SAMLP_STATUS(ss));
+
+ return (response);
+}
diff --git a/lasso/Attic/protocols/register_name_identifier_response.h b/lasso/Attic/protocols/register_name_identifier_response.h
new file mode 100644
index 00000000..d580eb2e
--- /dev/null
+++ b/lasso/Attic/protocols/register_name_identifier_response.h
@@ -0,0 +1,64 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE_H__
+#define __LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <lasso/xml/lib_register_name_identifier_response.h>
+
+#define LASSO_TYPE_REGISTER_NAME_IDENTIFIER_RESPONSE (lasso_register_name_identifier_response_get_type())
+#define LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_RESPONSE, LassoRegisterNameIdentifierResponse))
+#define LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_RESPONSE, LassoRegisterNameIdentifierResponseClass))
+#define LASSO_IS_REGISTER_NAME_IDENTIFIER_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_RESPONSE))
+#define LASSP_IS_REGISTER_NAME_IDENTIFIER_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_RESPONSE))
+#define LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_REGISTER_NAME_IDENTIFIER_RESPONSE, LassoRegisterNameIdentifierResponseClass))
+
+typedef struct _LassoRegisterNameIdentifierResponse LassoRegisterNameIdentifierResponse;
+typedef struct _LassoRegisterNameIdentifierResponseClass LassoRegisterNameIdentifierResponseClass;
+
+struct _LassoRegisterNameIdentifierResponse {
+ LassoLibRegisterNameIdentifierResponse parent;
+ /*< public >*/
+ /*< private >*/
+};
+
+struct _LassoRegisterNameIdentifierResponseClass {
+ LassoLibRegisterNameIdentifierResponseClass parent;
+};
+
+LASSO_EXPORT GType lasso_register_name_identifier_response_get_type (void);
+LASSO_EXPORT LassoNode* lasso_register_name_identifier_response_new (const xmlChar *providerID,
+ const xmlChar *statusCodeValue,
+ LassoNode *request);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE_H__ */