~ubuntu-branches/ubuntu/intrepid/lasso/intrepid-updates

« back to all changes in this revision

Viewing changes to lasso/xml/saml-2.0/samlp2_logout_response.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-07-11 10:01:32 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060711100132-e50ymjc54bsizza6
Tags: 0.6.5-2ubuntu1
* Synchronize with Debian unstable.
* Convert to updated Python policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: samlp2_logout_response.c,v 1.1 2005/11/21 18:51:52 fpeters Exp $ 
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004, 2005 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 * 
 
8
 * Authors: See AUTHORS file in top-level directory.
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or modify
 
11
 * it under the terms of the GNU General Public License as published by
 
12
 * the Free Software Foundation; either version 2 of the License, or
 
13
 * (at your option) any later version.
 
14
 * 
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 * 
 
20
 * You should have received a copy of the GNU General Public License
 
21
 * along with this program; if not, write to the Free Software
 
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
23
 */
 
24
 
 
25
#include "samlp2_logout_response.h"
 
26
 
 
27
/*
 
28
 * Schema fragment (saml-schema-protocol-2.0.xsd):
 
29
 *
 
30
 * <element name="LogoutResponse" type="samlp:StatusResponseType"/>
 
31
 */
 
32
 
 
33
/*****************************************************************************/
 
34
/* private methods                                                           */
 
35
/*****************************************************************************/
 
36
 
 
37
 
 
38
static struct XmlSnippet schema_snippets[] = {
 
39
        {NULL, 0, 0}
 
40
};
 
41
 
 
42
static LassoNodeClass *parent_class = NULL;
 
43
 
 
44
 
 
45
static gchar*
 
46
build_query(LassoNode *node)
 
47
{
 
48
        char *ret, *deflated_message;
 
49
 
 
50
        deflated_message = lasso_node_build_deflated_query(node);
 
51
        ret = g_strdup_printf("SAMLResponse=%s", deflated_message);
 
52
        /* XXX: must support RelayState (which profiles?) */
 
53
        g_free(deflated_message);
 
54
        return ret;
 
55
}
 
56
 
 
57
 
 
58
static gboolean
 
59
init_from_query(LassoNode *node, char **query_fields)
 
60
{
 
61
        gboolean rc;
 
62
        char *relay_state = NULL;
 
63
        rc = lasso_node_init_from_saml2_query_fields(node, query_fields, &relay_state);
 
64
        if (rc && relay_state != NULL) {
 
65
                /* XXX: support RelayState? */
 
66
        }
 
67
        return rc;
 
68
}
 
69
 
 
70
 
 
71
/*****************************************************************************/
 
72
/* instance and class init functions                                         */
 
73
/*****************************************************************************/
 
74
 
 
75
static void
 
76
instance_init(LassoSamlp2LogoutResponse *node)
 
77
{
 
78
}
 
79
 
 
80
static void
 
81
class_init(LassoSamlp2LogoutResponseClass *klass)
 
82
{
 
83
        LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
 
84
 
 
85
        parent_class = g_type_class_peek_parent(klass);
 
86
        nclass->build_query = build_query;
 
87
        nclass->init_from_query = init_from_query;
 
88
        nclass->node_data = g_new0(LassoNodeClassData, 1);
 
89
        lasso_node_class_set_nodename(nclass, "LogoutResponse"); 
 
90
        lasso_node_class_set_ns(nclass, LASSO_SAML2_PROTOCOL_HREF, LASSO_SAML2_PROTOCOL_PREFIX);
 
91
        lasso_node_class_add_snippets(nclass, schema_snippets);
 
92
}
 
93
 
 
94
GType
 
95
lasso_samlp2_logout_response_get_type()
 
96
{
 
97
        static GType this_type = 0;
 
98
 
 
99
        if (!this_type) {
 
100
                static const GTypeInfo this_info = {
 
101
                        sizeof (LassoSamlp2LogoutResponseClass),
 
102
                        NULL,
 
103
                        NULL,
 
104
                        (GClassInitFunc) class_init,
 
105
                        NULL,
 
106
                        NULL,
 
107
                        sizeof(LassoSamlp2LogoutResponse),
 
108
                        0,
 
109
                        (GInstanceInitFunc) instance_init,
 
110
                };
 
111
 
 
112
                this_type = g_type_register_static(LASSO_TYPE_SAMLP2_STATUS_RESPONSE,
 
113
                                "LassoSamlp2LogoutResponse", &this_info, 0);
 
114
        }
 
115
        return this_type;
 
116
}
 
117
 
 
118
/**
 
119
 * lasso_samlp2_logout_response_new:
 
120
 *
 
121
 * Creates a new #LassoSamlp2LogoutResponse object.
 
122
 *
 
123
 * Return value: a newly created #LassoSamlp2LogoutResponse object
 
124
 **/
 
125
LassoNode*
 
126
lasso_samlp2_logout_response_new()
 
127
{
 
128
        return g_object_new(LASSO_TYPE_SAMLP2_LOGOUT_RESPONSE, NULL);
 
129
}