26
25
#include <lasso/xml/saml_advice.h>
26
#include <lasso/xml/saml_assertion.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);
29
* 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
/*****************************************************************************/
50
static struct XmlSnippet schema_snippets[] = {
51
{ "AssertionIDReference", SNIPPET_LIST_CONTENT,
52
G_STRUCT_OFFSET(LassoSamlAdvice, AssertionIDReference) },
53
{ "Assertion", SNIPPET_NODE, G_STRUCT_OFFSET(LassoSamlAdvice, Assertion) },
77
57
/*****************************************************************************/
78
58
/* instance and class init functions */
79
59
/*****************************************************************************/
82
lasso_saml_advice_instance_init(LassoSamlAdvice *node)
62
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");
64
node->AssertionIDReference = NULL;
65
node->Assertion = NULL;
92
lasso_saml_advice_class_init(LassoSamlAdviceClass *klass) {
69
class_init(LassoSamlAdviceClass *klass)
71
LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
73
nclass->node_data = g_new0(LassoNodeClassData, 1);
74
lasso_node_class_set_nodename(nclass, "Advice");
75
lasso_node_class_set_ns(nclass, LASSO_SAML_ASSERTION_HREF, LASSO_SAML_ASSERTION_PREFIX);
76
lasso_node_class_add_snippets(nclass, schema_snippets);
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,
80
lasso_saml_advice_get_type()
82
static GType this_type = 0;
85
static const GTypeInfo this_info = {
86
sizeof (LassoSamlAdviceClass),
89
(GClassInitFunc) class_init,
92
sizeof(LassoSamlAdvice),
94
(GInstanceInitFunc) instance_init,
97
this_type = g_type_register_static(LASSO_TYPE_NODE,
98
"LassoSamlAdvice", &this_info, 0);
119
104
* 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
106
* Creates a new #LassoSamlAdvice object.
108
* Return value: a newly created #LassoSamlAdvice
141
LassoNode* lasso_saml_advice_new()
111
lasso_saml_advice_new()
143
return LASSO_NODE(g_object_new(LASSO_TYPE_SAML_ADVICE, NULL));
113
return g_object_new(LASSO_TYPE_SAML_ADVICE, NULL);