1
/* $Id: lib_scoping.c,v 1.5 2004/08/13 15:16:13 fpeters Exp $
3
* Lasso - A free implementation of the Liberty 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
27
#include <glib/gprintf.h>
29
#include <lasso/xml/lib_scoping.h>
32
Schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
34
<xs:complexType name="ScopingType">
36
<xs:element name="ProxyCount" type="xs:nonNegativeInteger" minOccurs="0"/>
37
<xs:element ref="IDPList" minOccurs="0"/>
40
<xs:element name="Scoping" type="ScopingType"/>
43
/*****************************************************************************/
45
/*****************************************************************************/
48
* lasso_lib_scoping_set_proxyCount:
49
* @node : the pointer to <lib:Scoping/> node object
50
* @proxyCount: the value of "ProxyCount" element (should be superior or equal
53
* Sets the "ProxyCount" element [optional].
55
* It's the upper limit on the number of proxying steps the requester wishes to
56
* specify for the authentication request.
59
lasso_lib_scoping_set_proxyCount(LassoLibScoping *node,
63
LassoNodeClass *class;
65
g_assert(LASSO_IS_LIB_SCOPING(node));
66
g_assert(proxyCount >= 0);
68
g_sprintf(str, "%d", proxyCount);
69
class = LASSO_NODE_GET_CLASS(node);
70
class->new_child(LASSO_NODE (node), "ProxyCount", str, FALSE);
74
* lasso_lib_scoping_set_idpList:
75
* @node : the pointer to <lib:Scoping/> node object
76
* @idpList: the value of "IDPList" element
78
* Sets the "IDPList" element [optional].
80
* It's an ordered list of identity providers which the requester prefers to
81
* use in authenticating the Principal. This list is a suggestion only, and may
82
* be ignored or added to by the recipient of the message.
85
lasso_lib_scoping_set_idpList(LassoLibScoping *node,
86
LassoLibIDPList *idpList)
88
LassoNodeClass *class;
89
g_assert(LASSO_IS_LIB_SCOPING(node));
90
g_assert(LASSO_IS_LIB_IDP_LIST(idpList));
92
class = LASSO_NODE_GET_CLASS(node);
93
class->add_child(LASSO_NODE (node), LASSO_NODE(idpList), FALSE);
96
/*****************************************************************************/
97
/* instance and class init functions */
98
/*****************************************************************************/
101
lasso_lib_scoping_instance_init(LassoLibScoping *node)
103
LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
105
class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
106
class->set_name(LASSO_NODE(node), "Scoping");
110
lasso_lib_scoping_class_init(LassoLibScopingClass *klass)
114
GType lasso_lib_scoping_get_type() {
115
static GType this_type = 0;
118
static const GTypeInfo this_info = {
119
sizeof (LassoLibScopingClass),
122
(GClassInitFunc) lasso_lib_scoping_class_init,
125
sizeof(LassoLibScoping),
127
(GInstanceInitFunc) lasso_lib_scoping_instance_init,
130
this_type = g_type_register_static(LASSO_TYPE_NODE,
138
* lasso_lib_scoping_new:
140
* Creates a new <lib:Scoping/> node object.
142
* Specifies any preferences on the number and specific identifiers of
143
* additional identity providers through which the authentication request may
144
* be proxied. The requester may also choose not to include this element, in
145
* which case, the recipient of the message MAY act as a proxy.
147
* Return value: a new @LassoLibScoping
149
LassoNode* lasso_lib_scoping_new()
151
return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_SCOPING, NULL));