summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-04-26 09:55:25 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-04-26 09:55:25 +0000
commit79d9ddce35751928fe1b48df00a293b40c8c0db4 (patch)
tree9d8f7a1cf4615dec12d02fe4ae3981c5d98111b0
parent8aa5c00cea4b2ad6b88cd9f65f704e5f6bdea0cb (diff)
downloadlasso-79d9ddce35751928fe1b48df00a293b40c8c0db4.tar.gz
lasso-79d9ddce35751928fe1b48df00a293b40c8c0db4.tar.xz
lasso-79d9ddce35751928fe1b48df00a293b40c8c0db4.zip
add federation termination notification high level class
-rw-r--r--lasso/Attic/protocols/Makefile.am12
-rw-r--r--lasso/Attic/protocols/federation_termination_notification.c157
-rw-r--r--lasso/Attic/protocols/federation_termination_notification.h54
3 files changed, 137 insertions, 86 deletions
diff --git a/lasso/Attic/protocols/Makefile.am b/lasso/Attic/protocols/Makefile.am
index c730c01c..2ff8a973 100644
--- a/lasso/Attic/protocols/Makefile.am
+++ b/lasso/Attic/protocols/Makefile.am
@@ -13,16 +13,18 @@ INCLUDES = \
noinst_LTLIBRARIES = liblasso-protocols.la
liblasso_protocols_la_SOURCES = \
- protocol.c \
+ federation_termination_notification.c \
logout_request.c \
logout_response.c \
register_name_identifier_response.c \
- register_name_identifier_request.c
+ register_name_identifier_request.c \
+ protocol.c
liblassoinclude_HEADERS = \
- protocols.h \
- protocol.h \
+ federation_termination_notification.h \
logout_request.h \
logout_response.h \
register_name_identifier_response.h \
- register_name_identifier_request.h
+ register_name_identifier_request.h \
+ protocols.h \
+ protocol.h \ No newline at end of file
diff --git a/lasso/Attic/protocols/federation_termination_notification.c b/lasso/Attic/protocols/federation_termination_notification.c
index 31d4f0a0..4da6d1c8 100644
--- a/lasso/Attic/protocols/federation_termination_notification.c
+++ b/lasso/Attic/protocols/federation_termination_notification.c
@@ -1,79 +1,106 @@
+/* $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/federation_termination_notification.h>
+#include <lasso/xml/saml_name_identifier.h>
-LassoNode *lasso_build_full_federationTerminationNotification(const xmlChar *requestID,
- const xmlChar *majorVersion,
- const xmlChar *minorVersion,
- const xmlChar *issueInstant,
- const xmlChar *providerID,
- LassoNode *nameIdentifier,
- const xmlChar *consent)
-{
- LassoNode *notification;
- notification = lasso_lib_federation_termination_notification_new();
+/*****************************************************************************/
+/* public methods */
+/*****************************************************************************/
- if(requestID!=NULL){
- lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(notification),
- requestID);
- }
- else{
- lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(notification),
- (const xmlChar *)lasso_build_unique_id(32));
- }
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
- if(majorVersion!=NULL){
- lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(notification),
- majorVersion);
- }
- else{
- lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(notification),
- lassoLibMajorVersion);
- }
+static void
+lasso_federation_termination_notification_instance_init(LassoFederationTerminationNotification *request)
+{
+}
- if(minorVersion!=NULL){
- lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(notification),
- minorVersion);
- }
- else{
- lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(notification),
- lassoLibMinorVersion);
- }
+static void
+lasso_federation_termination_notification_class_init(LassoFederationTerminationNotificationClass *class)
+{
+}
- if(issueInstant!=NULL){
- lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(notification),
- issueInstant);
- }
- else{
- lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(notification),
- lasso_get_current_time());
- }
+GType lasso_federation_termination_notification_get_type() {
+ static GType this_type = 0;
- lasso_lib_federation_termination_notification_set_providerID(LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(notification),
- providerID);
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof (LassoFederationTerminationNotificationClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) lasso_federation_termination_notification_class_init,
+ NULL,
+ NULL,
+ sizeof(LassoFederationTerminationNotification),
+ 0,
+ (GInstanceInitFunc) lasso_federation_termination_notification_instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_LIB_FEDERATION_TERMINATION_NOTIFICATION,
+ "LassoFederationTerminationNotification",
+ &this_info, 0);
+ }
+ return this_type;
+}
- lasso_lib_federation_termination_notification_set_nameIdentifier(LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(notification),
- LASSO_SAML_NAME_IDENTIFIER(nameIdentifier));
+LassoNode*
+lasso_federation_termination_notification_new(const xmlChar *providerID,
+ const xmlChar *nameIdentifier,
+ const xmlChar *nameQualifier,
+ const xmlChar *format)
+{
+ LassoNode *request, *identifier;
- if(consent){
- lasso_lib_federation_termination_notification_set_consent(LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(notification),
- consent);
- }
+ request = LASSO_NODE(g_object_new(LASSO_TYPE_FEDERATION_TERMINATION_NOTIFICATION, 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_federation_termination_notification_set_providerID(LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(request),
+ providerID);
- return(notification);
-}
+ identifier = lasso_saml_name_identifier_new(nameIdentifier);
+ lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(identifier),nameQualifier);
+ lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(identifier), format);
-LassoNode *lasso_build_federationTerminationNotification(const xmlChar *providerID,
- LassoNode *nameIdentifier,
- const xmlChar *consent)
-{
- LassoNode *notification;
+ lasso_lib_federation_termination_notification_set_nameIdentifier(LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(request),
+ LASSO_SAML_NAME_IDENTIFIER(identifier));
- notification = lasso_build_full_federationTerminationNotification(NULL,
- NULL,
- NULL,
- NULL,
- providerID,
- nameIdentifier,
- consent);
- return(notification);
+ return (request);
}
diff --git a/lasso/Attic/protocols/federation_termination_notification.h b/lasso/Attic/protocols/federation_termination_notification.h
index f7a90a0a..79239966 100644
--- a/lasso/Attic/protocols/federation_termination_notification.h
+++ b/lasso/Attic/protocols/federation_termination_notification.h
@@ -6,6 +6,7 @@
* http://lasso.entrouvert.org
*
* Author: 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
@@ -19,25 +20,46 @@
*
* 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 Templ
-e Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef __FEDERATION_TERMINATION_NOTIFICATION_H__
-#define __FEDERATION_TERMINATION_NOTIFICATION_H__
+#ifndef __LASSO_FEDERATION_TERMINATION_NOTIFICATION_H__
+#define __LASSO_FEDERATION_TERMINATION_NOTIFICATION_H__
-#include <lasso/protocols/protocols.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
-LassoNode *lasso_build_full_federationTerminationNotification(const xmlChar *requestID,
- const xmlChar *majorVersion,
- const xmlChar *minorVersion,
- const xmlChar *issueInstant,
- const xmlChar *providerID,
- LassoNode *nameIdentifier,
- const xmlChar *consent);
+#include <lasso/xml/lib_federation_termination_notification.h>
-LassoNode *lasso_build_federationTerminationNotification(const xmlChar *providerID,
- LassoNode *nameIdentifier,
- const xmlChar *consent);
+#define LASSO_TYPE_FEDERATION_TERMINATION_NOTIFICATION (lasso_federation_termination_notification_get_type())
+#define LASSO_FEDERATION_TERMINATION_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_FEDERATION_TERMINATION_NOTIFICATION, LassoFederationTerminationNotification))
+#define LASSO_FEDERATION_TERMINATION_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_FEDERATION_TERMINATION_NOTIFICATION, LassoFederationTerminationNotificationClass))
+#define LASSO_IS_FEDERATION_TERMINATION_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_FEDERATION_TERMINATION_NOTIFICATION))
+#define LASSP_IS_FEDERATION_TERMINATION_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_FEDERATION_TERMINATION_NOTIFICATION))
+#define LASSO_FEDERATION_TERMINATION_NOTIFICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_FEDERATION_TERMINATION_NOTIFICATION, LassoFederationTerminationNotificationClass))
-#endif /* __FEDERATION_TERMINATION_NOTIFICATION_H__ */
+typedef struct _LassoFederationTerminationNotification LassoFederationTerminationNotification;
+typedef struct _LassoFederationTerminationNotificationClass LassoFederationTerminationNotificationClass;
+
+struct _LassoFederationTerminationNotification {
+ LassoLibFederationTerminationNotification parent;
+ /*< public >*/
+ /*< private >*/
+};
+
+struct _LassoFederationTerminationNotificationClass {
+ LassoLibFederationTerminationNotificationClass parent;
+};
+
+LASSO_EXPORT GType lasso_federation_termination_notification_get_type (void);
+LASSO_EXPORT LassoNode* lasso_federation_termination_notification_new (const xmlChar *providerID,
+ const xmlChar *nameIdentifier,
+ const xmlChar *nameQualifier,
+ const xmlChar *format);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_FEDERATION_TERMINATION_NOTIFICATION_H__ */