diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-01-21 17:26:07 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-01-21 17:26:07 +0000 |
| commit | d1f422c55d3b00a8438e3088e684ee6434784b14 (patch) | |
| tree | f5bfa9b5ed2b5f22cccb5009d13356511440253e | |
| parent | b6e35e7db50a95126f8926eae9145d9acfc123f3 (diff) | |
| download | lasso-d1f422c55d3b00a8438e3088e684ee6434784b14.tar.gz lasso-d1f422c55d3b00a8438e3088e684ee6434784b14.tar.xz lasso-d1f422c55d3b00a8438e3088e684ee6434784b14.zip | |
adds samlp: prefix to statuscode qname if necessary
| -rw-r--r-- | lasso/xml/samlp_status_code.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lasso/xml/samlp_status_code.c b/lasso/xml/samlp_status_code.c index f2d8d9fb..1952f37b 100644 --- a/lasso/xml/samlp_status_code.c +++ b/lasso/xml/samlp_status_code.c @@ -47,6 +47,23 @@ static struct XmlSnippet schema_snippets[] = { { NULL, 0, 0} }; +static gboolean +init_from_query(LassoNode *node, char **query_fields) +{ + LassoSamlpStatusCode *code = LASSO_SAMLP_STATUS_CODE(node); + gboolean rc; + + rc = lasso_node_init_from_query_fields(node, query_fields); + if (code->Value && strchr(code->Value, ':') == NULL) { + char *s; /* if not a QName; add the samlp prefix */ + s = g_strdup_printf("samlp:%s", code->Value); + g_free(code->Value); + code->Value = s; + } + + return rc; +} + /*****************************************************************************/ /* instance and class init functions */ /*****************************************************************************/ @@ -63,6 +80,7 @@ class_init(LassoSamlpStatusCodeClass *klass) LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); nclass->node_data = g_new0(LassoNodeClassData, 1); + nclass->init_from_query = init_from_query; lasso_node_class_set_nodename(nclass, "StatusCode"); lasso_node_class_set_ns(nclass, LASSO_SAML_PROTOCOL_HREF, LASSO_SAML_PROTOCOL_PREFIX); lasso_node_class_add_snippets(nclass, schema_snippets); |
