1
/* $Id: lib_subject.c,v 1.7 2004/09/01 09:59:53 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/lib_subject.h>
29
The schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
31
<xs:complexType name="SubjectType">
33
<xs:extension base="saml:SubjectType">
35
<xs:element ref="IDPProvidedNameIdentifier"/>
40
<xs:element name="Subject" type="SubjectType" substitutionGroup="saml:Subject"/>
44
/*****************************************************************************/
46
/*****************************************************************************/
49
lasso_lib_subject_set_idpProvidedNameIdentifier(LassoLibSubject *node,
50
LassoLibIDPProvidedNameIdentifier *idpProvidedNameIdentifier)
52
LassoNodeClass *class;
53
g_assert(LASSO_IS_LIB_SUBJECT(node));
54
g_assert(LASSO_IS_LIB_IDP_PROVIDED_NAME_IDENTIFIER(idpProvidedNameIdentifier));
56
class = LASSO_NODE_GET_CLASS(node);
57
class->add_child(LASSO_NODE (node), LASSO_NODE(idpProvidedNameIdentifier), FALSE);
60
/*****************************************************************************/
61
/* instance and class init functions */
62
/*****************************************************************************/
65
LASSO_LIB_SUBJECT_USE_XSITYPE = 1
69
lasso_lib_subject_set_property (GObject *object,
74
LassoLibSubject *self = LASSO_LIB_SUBJECT(object);
75
LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(object));
77
switch (property_id) {
78
case LASSO_LIB_SUBJECT_USE_XSITYPE:
79
self->use_xsitype = g_value_get_boolean (value);
80
if (self->use_xsitype == TRUE) {
81
/* namespace and name were already set in parent class
83
class->new_ns_prop(LASSO_NODE(object),
84
"type", "lib:SubjectType",
85
lassoXsiHRef, lassoXsiPrefix);
88
/* node name was already set in parent class LassoSamlAssertion
90
class->set_ns(LASSO_NODE(object), lassoLibHRef, lassoLibPrefix);
94
/* We don't have any other property... */
101
lasso_lib_subject_instance_init(LassoLibSubject *node)
106
lasso_lib_subject_class_init(LassoLibSubjectClass *g_class,
107
gpointer g_class_data)
109
GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
112
/* override parent class methods */
113
gobject_class->set_property = lasso_lib_subject_set_property;
115
pspec = g_param_spec_boolean ("use_xsitype",
119
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE);
120
g_object_class_install_property (gobject_class,
121
LASSO_LIB_SUBJECT_USE_XSITYPE,
125
GType lasso_lib_subject_get_type() {
126
static GType this_type = 0;
129
static const GTypeInfo this_info = {
130
sizeof (LassoLibSubjectClass),
133
(GClassInitFunc) lasso_lib_subject_class_init,
136
sizeof(LassoLibSubject),
138
(GInstanceInitFunc) lasso_lib_subject_instance_init,
141
this_type = g_type_register_static(LASSO_TYPE_SAML_SUBJECT,
149
lasso_lib_subject_new(gboolean use_xsitype)
153
node = LASSO_NODE(g_object_new(LASSO_TYPE_LIB_SUBJECT,
154
"use_xsitype", use_xsitype,