1
/* $Id: saml_advice.c,v 1.5 2004/08/13 15:16:13 fpeters Exp $
3
* Lasso - A free implementation of the Samlerty Alliance specifications.
5
* Copyright (C) 2004 Entr'ouvert
6
* http://lasso.entrouvert.org
8
* Authors: Nicolas Clapies <nclapies@entrouvert.com>
9
* Valery Febvre <vfebvre@easter-eggs.com>
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version.
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with this program; if not, write to the Free Software
23
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
#include <lasso/xml/saml_advice.h>
29
The schema fragment (oasis-sstc-saml-schema-assertion-1.0.xsd):
31
<element name="Advice" type="saml:AdviceType"/>
32
<complexType name="AdviceType">
33
<choice minOccurs="0" maxOccurs="unbounded">
34
<element ref="saml:AssertionIDReference"/>
35
<element ref="saml:Assertion"/>
36
<any namespace="##other" processContents="lax"/>
40
<element name="AssertionIDReference" type="saml:IDReferenceType"/>
41
<simpleType name="IDReferenceType">
42
<restriction base="string"/>
46
/*****************************************************************************/
48
/*****************************************************************************/
51
lasso_saml_advice_add_assertionIDReference(LassoSamlAdvice *node,
52
const xmlChar *assertionIDReference)
54
LassoNodeClass *class;
55
g_assert(LASSO_IS_SAML_ADVICE(node));
56
g_assert(assertionIDReference != NULL);
58
class = LASSO_NODE_GET_CLASS(node);
59
class->new_child(LASSO_NODE (node),
60
"AssertionIDReference",
66
lasso_saml_advice_add_assertion(LassoSamlAdvice *node,
69
LassoNodeClass *class;
70
g_assert(LASSO_IS_SAML_ADVICE(node));
71
/* g_assert(LASSO_IS_SAML_ASSERTION(assertion)); */
73
class = LASSO_NODE_GET_CLASS(node);
74
class->add_child(LASSO_NODE (node), LASSO_NODE (assertion), TRUE);
77
/*****************************************************************************/
78
/* instance and class init functions */
79
/*****************************************************************************/
82
lasso_saml_advice_instance_init(LassoSamlAdvice *node)
84
LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
86
class->set_ns(LASSO_NODE(node), lassoSamlAssertionHRef,
87
lassoSamlAssertionPrefix);
88
class->set_name(LASSO_NODE(node), "Advice");
92
lasso_saml_advice_class_init(LassoSamlAdviceClass *klass) {
95
GType lasso_saml_advice_get_type() {
96
static GType this_type = 0;
99
static const GTypeInfo this_info = {
100
sizeof (LassoSamlAdviceClass),
103
(GClassInitFunc) lasso_saml_advice_class_init,
106
sizeof(LassoSamlAdvice),
108
(GInstanceInitFunc) lasso_saml_advice_instance_init,
111
this_type = g_type_register_static(LASSO_TYPE_NODE,
119
* lasso_saml_advice_new:
121
* Creates a new <saml:Advice> node object.
123
* The <Advice> element contains any additional information that the issuer
124
* wishes to provide. This information MAY be ignored by applications without
125
* affecting either the semantics or the validity of the assertion.
126
* The <Advice> element contains a mixture of zero or more <Assertion>
127
* elements, <AssertionIDReference> elements and elements in other namespaces,
128
* with lax schema validation in effect for these other elements.
129
* Following are some potential uses of the <Advice> element:
131
* - Include evidence supporting the assertion claims to be cited, either
132
* directly (through incorporating the claims) or indirectly (by reference to
133
* the supporting assertions).
135
* - State a proof of the assertion claims.
137
* - Specify the timing and distribution points for updates to the assertion.
139
* Return value: the new @LassoSamlAdvice
141
LassoNode* lasso_saml_advice_new()
143
return LASSO_NODE(g_object_new(LASSO_TYPE_SAML_ADVICE, NULL));