diff options
| author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-03-29 13:09:12 +0000 |
|---|---|---|
| committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-03-29 13:09:12 +0000 |
| commit | bc1c8677f43ea6779e1e9457d9e4212df864b928 (patch) | |
| tree | 4bf5df4d41e40f9fc744ad1ec2dfb6cef7b722d1 | |
| parent | 74a963be6a69c61c94beb8c827636d99c789272b (diff) | |
initial version
| -rw-r--r-- | lasso/Attic/protocols/federation_termination_notification.c | 34 | ||||
| -rw-r--r-- | lasso/Attic/protocols/federation_termination_notification.h | 37 | ||||
| -rw-r--r-- | lasso/Attic/protocols/logout.c | 86 | ||||
| -rw-r--r-- | lasso/Attic/protocols/logout.h | 20 | ||||
| -rw-r--r-- | lasso/Attic/protocols/protocols.h | 38 | ||||
| -rw-r--r-- | lasso/Attic/protocols/register_name_identifier.c | 81 | ||||
| -rw-r--r-- | lasso/Attic/protocols/register_name_identifier.h | 21 |
7 files changed, 317 insertions, 0 deletions
diff --git a/lasso/Attic/protocols/federation_termination_notification.c b/lasso/Attic/protocols/federation_termination_notification.c new file mode 100644 index 00000000..ac8bd82c --- /dev/null +++ b/lasso/Attic/protocols/federation_termination_notification.c @@ -0,0 +1,34 @@ +#include <lasso/protocols/federation_termination_notification.h> + +xmlChar *lasso_build_url_encoded_message_federationTerminationNotification(LassoNode *request) +{ + +} + +LassoNode *lasso_build_federationTerminationNotification(const char *metadata, + LassoNode *nameIdentifier, + const char *consent) +{ + LassoNode *notification; + + notification = lasso_lib_federation_termination_notification_new(); + + lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(notification), + (const xmlChar *)lasso_build_unique_id(32)); + lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(notification), + lassoLibMinorVersion); + lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(notification), + lasso_get_current_time()); + lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(notification), + lassoLibMajorVersion); + + lasso_lib_federation_termination_notification_set_providerID(LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(notification), "badproviderid.com"); // FIXME + + lasso_lib_federation_termination_notification_set_nameIdentifier(LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(notification), nameIdentifier); + + if(consent){ + lasso_lib_federation_termination_notification_set_consent(LASSO_LIB_FEDERATION_TERMINATION_NOTIFICATION(notification), consent); + } + + return(notification); +} diff --git a/lasso/Attic/protocols/federation_termination_notification.h b/lasso/Attic/protocols/federation_termination_notification.h new file mode 100644 index 00000000..53b0c4ad --- /dev/null +++ b/lasso/Attic/protocols/federation_termination_notification.h @@ -0,0 +1,37 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.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 Templ +e Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __FEDERATION_TERMINATION_NOTIFICATION_H__ +#define __FEDERATION_TERMINATION_NOTIFICATION_H__ + +#include <lasso/lasso.h> + +xmlChar *lasso_build_url_encoded_message_federationTerminationNotification(LassoNode *); + +LassoNode *lasso_build_federationTerminationNotification(const char *metadata, + LassoNode *nameIdentifier, + const char *consent); + +#endif /* __FEDERATION_TERMINATION_NOTIFICATION_H__ */ diff --git a/lasso/Attic/protocols/logout.c b/lasso/Attic/protocols/logout.c new file mode 100644 index 00000000..4105694b --- /dev/null +++ b/lasso/Attic/protocols/logout.c @@ -0,0 +1,86 @@ +#include <lasso/protocols/logout.h> + +xmlChar *lasso_build_url_encoded_message_logoutRequest(LassoNode *request) +{ + +} + +LassoNode *lasso_build_logoutRequest(const char *metadata, + LassoNode *nameIdentifier, + const char *sessionIndex, + const char *relayState, + const char *consent) +{ + LassoNode *request; + + request = lasso_lib_logout_request_new(); + + lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request), + (const xmlChar *)lasso_build_unique_id(32)); + lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request), + lassoLibMinorVersion); + lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(request), + lasso_get_current_time()); + lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request), + lassoLibMajorVersion); + + lasso_lib_logout_request_set_providerID(LASSO_LIB_LOGOUT_REQUEST(request), + "badproviderid.com"); // FIXME + + lasso_lib_logout_request_set_nameIdentifier(LASSO_LIB_LOGOUT_REQUEST(request), nameIdentifier); + + if(sessionIndex){ + lasso_lib_logout_request_set_sessionIndex(LASSO_LIB_LOGOUT_REQUEST(request), sessionIndex); + } + + if(relayState){ + lasso_lib_logout_request_set_relayState(LASSO_LIB_LOGOUT_REQUEST(request), + relayState); + } + + if(consent){ + lasso_lib_logout_request_set_consent(LASSO_LIB_LOGOUT_REQUEST(request), consent); + } + + return(request); + +} + + +xmlChar *lasso_build_url_encoded_message_logoutResponse(LassoNode *response) +{ + +} + +LassoNode *lasso_build_logoutResponse(LassoNode *request, + const char *statusCodeValue, + const char *relayState) +{ + LassoNode *response, *ss, *ssc; + + response = lasso_lib_logout_response_new(); + + lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + (const xmlChar *)lasso_build_unique_id(32)); + lasso_samlp_response_abstract_set_minorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + lassoLibMinorVersion); + lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + lassoLibMajorVersion); + lasso_samlp_response_abstract_set_issueInstance(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + lasso_get_current_time()); + + lasso_lib_status_response_set_providerID(LASSO_LIB_STATUS_RESPONSE(response), + "badproviderid.com"); // FIXME + + 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_samlp_response_set_status(LASSO_SAMLP_RESPONSE(response), LASSO_SAMLP_STATUS(ss)); + + if(relayState){ + lasso_lib_status_response_set_relayState(LASSO_LIB_STATUS_RESPONSE(response), relayState); + } + + return(response); +} diff --git a/lasso/Attic/protocols/logout.h b/lasso/Attic/protocols/logout.h new file mode 100644 index 00000000..11ddf6f6 --- /dev/null +++ b/lasso/Attic/protocols/logout.h @@ -0,0 +1,20 @@ +#ifndef __LOGOUT_H__ +#define __LOGOUT_H__ + +#include <lasso/lasso.h> + +xmlChar *lasso_build_url_encoded_message_logoutRequest(LassoNode *); + +LassoNode *lasso_build_logoutRequest(const char *metadata, + LassoNode *nameIdentifier, + const char *sessionIndex, + const char *relayState, + const char *consent); + +xmlChar *lasso_build_url_encoded_message_logoutResponse(LassoNode *); + +LassoNode *lasso_build_logoutResponse(LassoNode *request, + const char*codeValue, + const char*relayState); + +#endif /* __LOGOUT_H__ */ diff --git a/lasso/Attic/protocols/protocols.h b/lasso/Attic/protocols/protocols.h new file mode 100644 index 00000000..cc0a1618 --- /dev/null +++ b/lasso/Attic/protocols/protocols.h @@ -0,0 +1,38 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Author: Valery Febvre <vfebvre@easter-eggs.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_PROTOCOLS_H__ +#define __LASSO_PROTOCOLS_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/protocols/single_sign_on_and_federation.h> + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_PROTOCOLS_H__ */ diff --git a/lasso/Attic/protocols/register_name_identifier.c b/lasso/Attic/protocols/register_name_identifier.c new file mode 100644 index 00000000..4c555856 --- /dev/null +++ b/lasso/Attic/protocols/register_name_identifier.c @@ -0,0 +1,81 @@ +#include <lasso/protocols/register_name_identifier.h> + +xmlChar *lasso_build_url_encoded_message_registerNameIdentifierRequest(LassoNode *request) +{ + +} + +LassoNode *lasso_build_registerNameIdentifierRequest(const char *metadata, + LassoNode *idpProvidedNameIdentifer, + LassoNode *spProvidedNameIdentifier, + LassoNode *oldProvidedNameIdentifier, + const char *relayState) +{ + LassoNode *request; + + request = lasso_lib_register_name_identifier_request_new(); + + lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request), + (const xmlChar *)lasso_build_unique_id(32)); + lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request), + lassoLibMinorVersion); + lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(request), + lasso_get_current_time()); + lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request), + lassoLibMajorVersion); + + lasso_lib_register_name_identifier_request_set_providerID(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST( + request), + "badproviderid.com"); // FIXME + + lasso_lib_register_name_identifier_request_set_idp_provided_name_identifier(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request), idpProvidedNameIdentifer); + + lasso_lib_register_name_identifier_request_set_sp_provided_name_identifier(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request), spProvidedNameIdentifier); + + lasso_lib_register_name_identifier_request_set_old_provided_name_identifier(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request), oldProvidedNameIdentifier); + + if(relayState){ + lasso_lib_register_name_identifier_request_set_relayState(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request), relayState); + } + + return(request); + +} + +xmlChar *lasso_build_url_encoded_message_registerNameIdentifierResponse(LassoNode *response) +{ + +} + +LassoNode *lasso_build_registerNameIdentifierResponse(LassoNode *response, + const char *statusCodeValue, + const char *relayState) +{ + LassoNode *response, *ss, *ssc; + + response = lasso_lib_register_name_identifier_response_new(); + + lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + (const xmlChar *)lasso_build_unique_id(32)); + lasso_samlp_response_abstract_set_minorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + lassoLibMinorVersion); + lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + lassoLibMajorVersion); + lasso_samlp_response_abstract_set_issueInstance(LASSO_SAMLP_RESPONSE_ABSTRACT(response), + lasso_get_current_time()); + + lasso_lib_status_response_set_providerID(LASSO_LIB_STATUS_RESPONSE(response), + "badproviderid.com"); // FIXME + + 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_samlp_response_set_status(LASSO_SAMLP_RESPONSE(response), LASSO_SAMLP_STATUS(ss)); + + if(relayState){ + lasso_lib_status_response_set_relayState(LASSO_LIB_STATUS_RESPONSE(response), relayState); + } + + return(response); +} diff --git a/lasso/Attic/protocols/register_name_identifier.h b/lasso/Attic/protocols/register_name_identifier.h new file mode 100644 index 00000000..ccc7bd59 --- /dev/null +++ b/lasso/Attic/protocols/register_name_identifier.h @@ -0,0 +1,21 @@ +#ifndef __REGISTER_NAME_IDENTIFIER_H__ +#define __REGISTER_NAME_IDENTIFIER_H__ + +#include <lasso/lasso.h> + +xmlChar *lasso_build_url_encoded_message_registerNameIdentifierRequest(LassoNode *); + +LassoNode *lasso_build_registerNameIdentifierRequest(const char *metadata, + LassoNode *idpProvidedNameIdentifer, + LassoNode *spProvidedNameIdentifier, + LassoNode *oldProvidedNameIdentifier, + const char *relayState); + +xmlChar *lasso_build_url_encoded_message_registerNameIdentifierResponse(LassoNode *); + +LassoNode *lasso_build_registerNameIdentifierResponse(LassoNode *request, + const char*codeValue, + const char*relayState); + + +#endif /* __REGISTER_NAME_IDENTIFIER_H__ */ |
