<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pysaml2.git/src, branch feat-requested-attributes-per-request</title>
<subtitle>github.com: rohe/pysaml2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/'/>
<entry>
<title>Do not fix the configured requested_attributes</title>
<updated>2020-06-05T20:33:12+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-06-05T20:32:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=17b03f3c0468db58e116a0f0b669b50ff4559850'/>
<id>17b03f3c0468db58e116a0f0b669b50ff4559850</id>
<content type='text'>
This is always done on use, ie, on client_base.py::create_authn_request

Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is always done on use, ie, on client_base.py::create_authn_request

Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix attribute maps order</title>
<updated>2020-06-05T20:24:34+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-06-05T20:24:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=da5881c3b80104334cb1a2665bea774b74f908c3'/>
<id>da5881c3b80104334cb1a2665bea774b74f908c3</id>
<content type='text'>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Minor formatting changes</title>
<updated>2020-06-02T20:45:21+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-06-02T20:36:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=d2ab6631971c8278df0e7cd7f3c7e8c341c9d9c4'/>
<id>d2ab6631971c8278df0e7cd7f3c7e8c341c9d9c4</id>
<content type='text'>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix param documentation</title>
<updated>2020-06-02T20:45:08+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-06-02T20:36:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=71404900728223e8fa26cd37de212dd08d919f6b'/>
<id>71404900728223e8fa26cd37de212dd08d919f6b</id>
<content type='text'>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Requested fixes</title>
<updated>2020-05-28T10:00:06+00:00</updated>
<author>
<name>Nikos Sklikas</name>
<email>nsklikas@admin.grnet.gr</email>
</author>
<published>2020-05-28T09:55:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=bb01758480be04f8a8083310dca0f7d2bf8b5547'/>
<id>bb01758480be04f8a8083310dca0f7d2bf8b5547</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add requested_attributes param</title>
<updated>2020-05-28T10:00:06+00:00</updated>
<author>
<name>Nikos Sklikas</name>
<email>nsklikas@admin.grnet.gr</email>
</author>
<published>2020-05-05T11:12:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=531f6bd1eac3488987be0e153d847ff59f5bbfbf'/>
<id>531f6bd1eac3488987be0e153d847ff59f5bbfbf</id>
<content type='text'>
Add requested_attributes param to create_authn_request
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add requested_attributes param to create_authn_request
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove the id_attr_name configuration option</title>
<updated>2020-05-26T17:30:44+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-05-26T17:30:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=32ab8e68b48cb0f32b7299a1c72a36f25af3cc17'/>
<id>32ab8e68b48cb0f32b7299a1c72a36f25af3cc17</id>
<content type='text'>
The name of the id-attribute for signing, encrypting and decrypting an XML document is
well know for each of those operations. There is no need to define another.

Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The name of the id-attribute for signing, encrypting and decrypting an XML document is
well know for each of those operations. There is no need to define another.

Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix xmlsec1 --id-attr option</title>
<updated>2020-05-26T12:02:58+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-01-26T16:19:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=8d9c9a131edb5ee6f215a441ab1a75e3c8259ef4'/>
<id>8d9c9a131edb5ee6f215a441ab1a75e3c8259ef4</id>
<content type='text'>
We need to know _the name of the attribute_ that represents the identifier of the node
that is being signed, or encrypted, or verified. We guess the name -by trying `ID`, `Id`
and `id`- and pass it to `xmlsec1` using the `--id-attr` command line option.

_Why is this needed?_ Shouldn't the attribute names be specified by the corresponding
specifications? Let's look into the specs to find out.

* saml-core:
  * `StatusResponseType` uses `ID`
  * `RequestAbstractType` uses `ID`
  * `Assertion` uses `ID`

* xmldsig-core:
  * `SignatureType` uses `Id`

* xmlenc-core:
  * `EncryptedType` uses `Id`

So, the answer is _yes_ - the attribute names are defined and, instead of guessing, we
should be passing in the id-attribute names as defined by the specs.

_Note_: But, do we even need to do this? If the names are standardized, why do we bother
with this? In fact, the manual for `xmlsec1` explicitly says that

    --id-attr[:&lt;attr-name&gt;] [&lt;node-namespace-uri&gt;:]&lt;node-name&gt;

        adds attributes &lt;attr-name&gt; (default value "id") from all nodes
        with&lt;node-name&gt; and namespace &lt;node-namespace-uri&gt; to the list of
        known ID attributes; this is a hack and  if you can use DTD or schema
        to declare ID attributes instead (see "--dtd-file" option), I don't
        know what else might be broken in your application when you use this
        hack

However, it seems that `xmlsec1` by default will only look for an attribute with name
`id`. The right way to solve this is to pass in a DTD file. Then, `xmlsec1` will
understand that it needs to look up a different attribute name. Unfortunately, there are
no official DTDs (or even unofficial, to my knowledge) for SAML. The SAML specifications
instead provide XSD files. Even though `xmlsec1` mentions _schema_, there doesn't seem
to be a way to pass in an XSD file. So, we have to resort to this "hack".

When we sign a document, we need to point to the node that will be signed. The nodes
that we are signing are always SAML nodes (Assertion, StatusResponseType (Response,
etc), RequestAbstractType (AuthnRequest, etc)). All SAML nodes that will be signed use
`ID` as the attribute name. So, in order to sign and verify a signature, we need to pass
in `ID`.

When encrypting a document, we need to point to the node whose content will be
encrypted. Currently, we use XPath to point to that node, without the use of an id. But,
we could be using an identifier to locate the node, and if we did so, we would still be
using `ID`.

When decrypting a document, we need to point to the node that contains the encrypted
data. This is where things change. Since the SAML node itself is encrypted we cannot
point to an `ID` attribute, as we did in the other cases. Instead, it is specified that
a node named `EncryptedData` exists, that may have an `Id` attribute. This is where we
want to point to. So, we need to use `Id`.

Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need to know _the name of the attribute_ that represents the identifier of the node
that is being signed, or encrypted, or verified. We guess the name -by trying `ID`, `Id`
and `id`- and pass it to `xmlsec1` using the `--id-attr` command line option.

_Why is this needed?_ Shouldn't the attribute names be specified by the corresponding
specifications? Let's look into the specs to find out.

* saml-core:
  * `StatusResponseType` uses `ID`
  * `RequestAbstractType` uses `ID`
  * `Assertion` uses `ID`

* xmldsig-core:
  * `SignatureType` uses `Id`

* xmlenc-core:
  * `EncryptedType` uses `Id`

So, the answer is _yes_ - the attribute names are defined and, instead of guessing, we
should be passing in the id-attribute names as defined by the specs.

_Note_: But, do we even need to do this? If the names are standardized, why do we bother
with this? In fact, the manual for `xmlsec1` explicitly says that

    --id-attr[:&lt;attr-name&gt;] [&lt;node-namespace-uri&gt;:]&lt;node-name&gt;

        adds attributes &lt;attr-name&gt; (default value "id") from all nodes
        with&lt;node-name&gt; and namespace &lt;node-namespace-uri&gt; to the list of
        known ID attributes; this is a hack and  if you can use DTD or schema
        to declare ID attributes instead (see "--dtd-file" option), I don't
        know what else might be broken in your application when you use this
        hack

However, it seems that `xmlsec1` by default will only look for an attribute with name
`id`. The right way to solve this is to pass in a DTD file. Then, `xmlsec1` will
understand that it needs to look up a different attribute name. Unfortunately, there are
no official DTDs (or even unofficial, to my knowledge) for SAML. The SAML specifications
instead provide XSD files. Even though `xmlsec1` mentions _schema_, there doesn't seem
to be a way to pass in an XSD file. So, we have to resort to this "hack".

When we sign a document, we need to point to the node that will be signed. The nodes
that we are signing are always SAML nodes (Assertion, StatusResponseType (Response,
etc), RequestAbstractType (AuthnRequest, etc)). All SAML nodes that will be signed use
`ID` as the attribute name. So, in order to sign and verify a signature, we need to pass
in `ID`.

When encrypting a document, we need to point to the node whose content will be
encrypted. Currently, we use XPath to point to that node, without the use of an id. But,
we could be using an identifier to locate the node, and if we did so, we would still be
using `ID`.

When decrypting a document, we need to point to the node that contains the encrypted
data. This is where things change. Since the SAML node itself is encrypted we cannot
point to an `ID` attribute, as we did in the other cases. Instead, it is specified that
a node named `EncryptedData` exists, that may have an `Id` attribute. This is where we
want to point to. So, we need to use `Id`.

Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix call to urlencode</title>
<updated>2020-05-12T10:43:32+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-05-12T10:43:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=b8c9c2528b9da33e08f1778f90610554a3f04743'/>
<id>b8c9c2528b9da33e08f1778f90610554a3f04743</id>
<content type='text'>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unneeded string format</title>
<updated>2020-05-12T10:43:32+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-05-12T09:17:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=831e06e87e3f5514b1f626f6f5f5899b61920e1d'/>
<id>831e06e87e3f5514b1f626f6f5f5899b61920e1d</id>
<content type='text'>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ivan Kanakarakis &lt;ivan.kanak@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
