<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pysaml2.git/tests/test_50_server.py, branch assert_deletion</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>Differentiate between metadata NameIDFormat and AuthnRequest NameIDPolicy Format</title>
<updated>2020-07-10T17:10:51+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2020-07-07T10:38:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=0c1873da1f280d4921b9c9b3da9126388d75e701'/>
<id>0c1873da1f280d4921b9c9b3da9126388d75e701</id>
<content type='text'>
The `name_id_format` configuration option is used to define

1. the value of the `&lt;NameIDFormat&gt;` metadata element
2. and the value of the `&lt;NameIDPolicy&gt;` `Format` attribute in an `AuthnRequest`

The configuration option to set what the value of `&lt;NameIDFormat&gt;` element is in the
metadata should be different from the configuration option to specify what should be
requested in an `AuthnRequest` through the `&lt;NameIDPolicy Format="..."&gt;` attribute.

Introduce a new option (`name_id_policy_format`), or use the same name but scoped in a
specific section for metadata and AuthnRequest.

On the side of this, pysaml2 defaults to _transient_ as the `&lt;NameIDPolicy
Format="..."&gt;` attribute value. To omit requesting a value for the `&lt;NameIDPolicy
Format=""&gt;` attribute the value `"None"` (a string) must be set in the configuration.
This is unintuitive. It is better to be explicit and set transient to request a
transient NameID, than not setting a value and requesting transient by default. If no
value is set, no specific `&lt;NameIDPolicy Format="..."&gt;` should be requested.

- Refactor the name_id_format usage
- Add name_id_policy_format configuration option
- Remove the "None" convention value

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_id_format` configuration option is used to define

1. the value of the `&lt;NameIDFormat&gt;` metadata element
2. and the value of the `&lt;NameIDPolicy&gt;` `Format` attribute in an `AuthnRequest`

The configuration option to set what the value of `&lt;NameIDFormat&gt;` element is in the
metadata should be different from the configuration option to specify what should be
requested in an `AuthnRequest` through the `&lt;NameIDPolicy Format="..."&gt;` attribute.

Introduce a new option (`name_id_policy_format`), or use the same name but scoped in a
specific section for metadata and AuthnRequest.

On the side of this, pysaml2 defaults to _transient_ as the `&lt;NameIDPolicy
Format="..."&gt;` attribute value. To omit requesting a value for the `&lt;NameIDPolicy
Format=""&gt;` attribute the value `"None"` (a string) must be set in the configuration.
This is unintuitive. It is better to be explicit and set transient to request a
transient NameID, than not setting a value and requesting transient by default. If no
value is set, no specific `&lt;NameIDPolicy Format="..."&gt;` should be requested.

- Refactor the name_id_format usage
- Add name_id_policy_format configuration option
- Remove the "None" convention value

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>Read from env var PYSAML2_DELETE_TMPFILES</title>
<updated>2019-11-26T12:02:27+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2019-09-01T19:17:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=2109a65b1a233d42da84cc2aad982bf8a4b49816'/>
<id>2109a65b1a233d42da84cc2aad982bf8a4b49816</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 tests to be compatible with latest pytest</title>
<updated>2019-07-08T18:14:54+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2019-07-08T18:14:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=124376b3a707edf354fcc2e7311a86af864cf647'/>
<id>124376b3a707edf354fcc2e7311a86af864cf647</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>update tests with regards to AllowCreate</title>
<updated>2019-05-08T16:39:43+00:00</updated>
<author>
<name>Fredrik Thulin</name>
<email>fredrik@thulin.net</email>
</author>
<published>2019-05-08T16:39:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=aa5c4207a828b94cfd90b6ecc78566632a324852'/>
<id>aa5c4207a828b94cfd90b6ecc78566632a324852</id>
<content type='text'>
AllowCreate is not supposed to be present for transient Name IDs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
AllowCreate is not supposed to be present for transient Name IDs.
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert exception expectation to with-raises idiom</title>
<updated>2019-01-14T13:29:44+00:00</updated>
<author>
<name>Ivan Kanakarakis</name>
<email>ivan.kanak@gmail.com</email>
</author>
<published>2019-01-10T20:53:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=cb760c81ce6739821782040b648ce42527b22b21'/>
<id>cb760c81ce6739821782040b648ce42527b22b21</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>Duplicated tests and added non ascii characters</title>
<updated>2018-10-04T13:00:56+00:00</updated>
<author>
<name>Johan Lundberg</name>
<email>lundberg@sunet.se</email>
</author>
<published>2018-10-04T13:00:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=47c61dfdc4bdb4a58a0b308ad2a7a0786f42de0e'/>
<id>47c61dfdc4bdb4a58a0b308ad2a7a0786f42de0e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Updated test cases</title>
<updated>2017-06-13T09:04:51+00:00</updated>
<author>
<name>Ioannis Kakavas</name>
<email>ikakavas@noc.grnet.gr</email>
</author>
<published>2017-06-13T09:04:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=695e2f0a98d4df6f690e12226283577920e5406f'/>
<id>695e2f0a98d4df6f690e12226283577920e5406f</id>
<content type='text'>
As explained in
https://github.com/rohe/pysaml2/pull/423#issuecomment-308053607 , ava
cannot contain an 'surName' key, it should be named 'sn'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As explained in
https://github.com/rohe/pysaml2/pull/423#issuecomment-308053607 , ava
cannot contain an 'surName' key, it should be named 'sn'
</pre>
</div>
</content>
</entry>
<entry>
<title>Language correction.</title>
<updated>2016-02-11T10:08:04+00:00</updated>
<author>
<name>Roland Hedberg</name>
<email>roland.hedberg@adm.umu.se</email>
</author>
<published>2016-02-11T10:08:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=0515de9fa8b7f339baba826f87eedc8c922dfa7f'/>
<id>0515de9fa8b7f339baba826f87eedc8c922dfa7f</id>
<content type='text'>
Deal with case where people want to JSON serialize session information.
Carry over more parameters in create_attribute_response.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Deal with case where people want to JSON serialize session information.
Carry over more parameters in create_attribute_response.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'upstream/master'</title>
<updated>2015-11-06T12:01:21+00:00</updated>
<author>
<name>Hans Hörberg</name>
<email>hans.horberg@umu.se</email>
</author>
<published>2015-11-06T12:01:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/pysaml2.git/commit/?id=bc93176fa6b4f15090a7d2d335727d60c6ffe2c3'/>
<id>bc93176fa6b4f15090a7d2d335727d60c6ffe2c3</id>
<content type='text'>
# Conflicts:
#	src/saml2/entity.py

digest algorithm added to the same functions as sign alg.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
# Conflicts:
#	src/saml2/entity.py

digest algorithm added to the same functions as sign alg.
</pre>
</div>
</content>
</entry>
</feed>
