diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2006-12-16 09:47:16 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2006-12-16 09:47:16 +0000 |
commit | e87094e76a943711957910f450cfb36f1fe560ba (patch) | |
tree | 8d39d61f9f693a1759152b1fbb9a253647b4f882 | |
parent | 48b682c74636deb6036669ae04dc3c1a3ab0de02 (diff) | |
download | lasso-e87094e76a943711957910f450cfb36f1fe560ba.tar.gz lasso-e87094e76a943711957910f450cfb36f1fe560ba.tar.xz lasso-e87094e76a943711957910f450cfb36f1fe560ba.zip |
Added (and documented) new members to snippet, necessary to fix namespace for
saml:AuthnContextClassRef used in samlp:RequestedAuthnContext
-rw-r--r-- | docs/reference/snippet-types.rst | 6 | ||||
-rw-r--r-- | lasso/xml/private.h | 2 | ||||
-rw-r--r-- | lasso/xml/saml-2.0/samlp2_requested_authn_context.c | 6 | ||||
-rw-r--r-- | lasso/xml/saml-2.0/samlp2_requested_authn_context.h | 4 | ||||
-rw-r--r-- | lasso/xml/xml.c | 8 |
5 files changed, 20 insertions, 6 deletions
diff --git a/docs/reference/snippet-types.rst b/docs/reference/snippet-types.rst index 88b7736b..9f03f942 100644 --- a/docs/reference/snippet-types.rst +++ b/docs/reference/snippet-types.rst @@ -26,7 +26,7 @@ SNIPPET_TEXT_CHILD SNIPPET_NAME_IDENTIFIER - (same result as SNIPPET_NODE) + (same result as SNIPPET_NODE (with Value forced as a LassoSamlNameIdentifier)) SNIPPET_ATTRIBUTE @@ -64,6 +64,10 @@ SNIPPET_LIST_CONTENT <Name>Value-n</Name> </Parent> +[note: Name will be in the same namespace as Parent by default but it is + possible to set 4th and 5th members of snippet to get a different namespace + (name, uri).] + SNIPPET_LIST_XMLNODES <Parent> diff --git a/lasso/xml/private.h b/lasso/xml/private.h index 4345bd03..be3f766a 100644 --- a/lasso/xml/private.h +++ b/lasso/xml/private.h @@ -61,6 +61,8 @@ struct XmlSnippet { SnippetType type; guint offset; char *class_name; + char *ns_name; + char *ns_uri; }; struct QuerySnippet { diff --git a/lasso/xml/saml-2.0/samlp2_requested_authn_context.c b/lasso/xml/saml-2.0/samlp2_requested_authn_context.c index 428c827b..06d22ef6 100644 --- a/lasso/xml/saml-2.0/samlp2_requested_authn_context.c +++ b/lasso/xml/saml-2.0/samlp2_requested_authn_context.c @@ -43,9 +43,11 @@ static struct XmlSnippet schema_snippets[] = { { "AuthnContextClassRef", SNIPPET_LIST_CONTENT, - G_STRUCT_OFFSET(LassoSamlp2RequestedAuthnContext, AuthnContextClassRef) }, + G_STRUCT_OFFSET(LassoSamlp2RequestedAuthnContext, AuthnContextClassRef), + NULL, LASSO_SAML2_ASSERTION_PREFIX, LASSO_SAML2_ASSERTION_HREF }, { "AuthnContextDeclRef", SNIPPET_LIST_CONTENT, - G_STRUCT_OFFSET(LassoSamlp2RequestedAuthnContext, AuthnContextDeclRef) }, + G_STRUCT_OFFSET(LassoSamlp2RequestedAuthnContext, AuthnContextDeclRef), + NULL, LASSO_SAML2_ASSERTION_PREFIX, LASSO_SAML2_ASSERTION_HREF }, { "Comparison", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoSamlp2RequestedAuthnContext, Comparison) }, {NULL, 0, 0} diff --git a/lasso/xml/saml-2.0/samlp2_requested_authn_context.h b/lasso/xml/saml-2.0/samlp2_requested_authn_context.h index e8ccc6a2..6886f31b 100644 --- a/lasso/xml/saml-2.0/samlp2_requested_authn_context.h +++ b/lasso/xml/saml-2.0/samlp2_requested_authn_context.h @@ -55,8 +55,8 @@ struct _LassoSamlp2RequestedAuthnContext { /*< public >*/ /* elements */ - GList *AuthnContextClassRef; - GList *AuthnContextDeclRef; + GList *AuthnContextClassRef; /* of strings */ + GList *AuthnContextDeclRef; /* of strings */ /* attributes */ char *Comparison; }; diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 388a7188..72795847 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -1565,7 +1565,13 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, * no attrs, just content) */ elem = (GList *)value; while (elem) { - xmlNewTextChild(xmlnode, NULL, (xmlChar*)snippet->name, + xmlNs *content_ns = NULL; + if (snippet->ns_name) { + content_ns = xmlNewNs(xmlnode, + snippet->ns_uri, snippet->ns_name); + } + xmlNewTextChild(xmlnode, content_ns, + (xmlChar*)snippet->name, (xmlChar*)(elem->data)); elem = g_list_next(elem); } |