summaryrefslogtreecommitdiffstats
path: root/lasso/xml/lib_assertion.c
diff options
context:
space:
mode:
Diffstat (limited to 'lasso/xml/lib_assertion.c')
-rw-r--r--lasso/xml/lib_assertion.c70
1 files changed, 63 insertions, 7 deletions
diff --git a/lasso/xml/lib_assertion.c b/lasso/xml/lib_assertion.c
index bf9e3859..cdda46b0 100644
--- a/lasso/xml/lib_assertion.c
+++ b/lasso/xml/lib_assertion.c
@@ -71,17 +71,65 @@ lasso_lib_assertion_set_inResponseTo(LassoLibAssertion *node,
/* instance and class init functions */
/*****************************************************************************/
+enum {
+ LASSO_LIB_ASSERTION_USE_XSITYPE = 1
+};
+
static void
-lasso_lib_assertion_instance_init(LassoLibAssertion *node)
+lasso_lib_assertion_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
+ LassoLibAssertion *self = LASSO_LIB_ASSERTION(object);
+ LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(object));
- class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
- class->set_name(LASSO_NODE(node), "Assertion");
+ switch (property_id) {
+ case LASSO_LIB_ASSERTION_USE_XSITYPE:
+ self->use_xsitype = g_value_get_boolean (value);
+ if (self->use_xsitype == TRUE) {
+ /* namespace and name were already set in parent class
+ LassoSamlAssertion */
+ class->new_ns_prop(LASSO_NODE(object),
+ "type", "lib:AssertionType",
+ lassoXsiHRef, lassoXsiPrefix);
+ }
+ else {
+ /* node name was already set in parent class LassoSamlAssertion
+ just change ns */
+ class->set_ns(LASSO_NODE(object), lassoLibHRef, lassoLibPrefix);
+ }
+ break;
+ default:
+ /* We don't have any other property... */
+ g_assert (FALSE);
+ break;
+ }
+}
+
+static void
+lasso_lib_assertion_instance_init(LassoLibAssertion *node)
+{
}
static void
-lasso_lib_assertion_class_init(LassoLibAssertionClass *klass) {
+lasso_lib_assertion_class_init(LassoLibAssertionClass *g_class,
+ gpointer g_class_data)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
+ GParamSpec *pspec;
+
+ /* override parent class methods */
+ gobject_class->set_property = lasso_lib_assertion_set_property;
+
+ pspec = g_param_spec_boolean ("use_xsitype",
+ "use_xsitype",
+ "using xsi:type",
+ FALSE,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE);
+ g_object_class_install_property (gobject_class,
+ LASSO_LIB_ASSERTION_USE_XSITYPE,
+ pspec);
}
GType lasso_lib_assertion_get_type() {
@@ -107,6 +155,14 @@ GType lasso_lib_assertion_get_type() {
return this_type;
}
-LassoNode* lasso_lib_assertion_new() {
- return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_ASSERTION, NULL));
+LassoNode*
+lasso_lib_assertion_new(gboolean use_xsitype)
+{
+ LassoNode *node;
+
+ node = LASSO_NODE(g_object_new(LASSO_TYPE_LIB_ASSERTION,
+ "use_xsitype", use_xsitype,
+ NULL));
+
+ return (node);
}