<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/cryptography.git/tests/test_fernet.py, branch dependabot/github_actions/actions/setup-python-v2.2.1</title>
<subtitle>github.com: pyca/cryptography.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/'/>
<entry>
<title>Complete removal of py2 (#5533)</title>
<updated>2020-12-09T15:13:48+00:00</updated>
<author>
<name>Alex Gaynor</name>
<email>alex.gaynor@gmail.com</email>
</author>
<published>2020-12-09T15:13:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=e66db8079d3fbd0110e87ece1fd48f4bfd9e48b9'/>
<id>e66db8079d3fbd0110e87ece1fd48f4bfd9e48b9</id>
<content type='text'>
* Drop Python 2

* Black everything</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Drop Python 2

* Black everything</pre>
</div>
</content>
</entry>
<entry>
<title>Remove __future__ import from our code (#5610)</title>
<updated>2020-12-09T06:35:11+00:00</updated>
<author>
<name>Alex Gaynor</name>
<email>alex.gaynor@gmail.com</email>
</author>
<published>2020-12-09T06:35:11+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=e0477596f7117845aa2d8768bf1b75162b3d915b'/>
<id>e0477596f7117845aa2d8768bf1b75162b3d915b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Switch black to py36 as the minimum version (#5608)</title>
<updated>2020-12-09T05:40:21+00:00</updated>
<author>
<name>Alex Gaynor</name>
<email>alex.gaynor@gmail.com</email>
</author>
<published>2020-12-09T05:40:21+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=7d4e567e16521288197aed23506f9370beadef66'/>
<id>7d4e567e16521288197aed23506f9370beadef66</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>new black, actually slightly different than the old black (#5429)</title>
<updated>2020-08-27T02:59:43+00:00</updated>
<author>
<name>Paul Kehrer</name>
<email>paul.l.kehrer@gmail.com</email>
</author>
<published>2020-08-27T02:59:43+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=bda138768ae1231481a1c9a2f6afcbf016d934f1'/>
<id>bda138768ae1231481a1c9a2f6afcbf016d934f1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Paint it Black by the Rolling Stones (#5324)</title>
<updated>2020-07-20T18:06:29+00:00</updated>
<author>
<name>Alex Gaynor</name>
<email>alex.gaynor@gmail.com</email>
</author>
<published>2020-07-20T18:06:29+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=60aa04481fb187334a783c2d9facc3fe814af5d1'/>
<id>60aa04481fb187334a783c2d9facc3fe814af5d1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Disallow ttl=None in (Multi)Fernet.decrypt_at_time() (#5280)</title>
<updated>2020-06-25T01:51:54+00:00</updated>
<author>
<name>Jakub Stasiak</name>
<email>jakub@stasiak.at</email>
</author>
<published>2020-06-25T01:51:54+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=97193752945cd62eef4371f7c8c04e7806d9e37b'/>
<id>97193752945cd62eef4371f7c8c04e7806d9e37b</id>
<content type='text'>
* Disallow ttl=None in (Multi)Fernet.decrypt_at_time()

Since the introduction of the _at_time() methods in #5256[1] there's
been this little voice in the back of my mind telling me that maybe it's
not the best idea to allow ttl=None in decrypt_at_time(). It's been like
this for convenience and code reuse reasons.

Then I submitted a patch for cryptography stubs in typeshed[2] and I had
to decide whether to define decrypt_at_time()'s ttl as int and be
incompatible with cryptography's behavior or Optional[int] and advertise
an API that can be misused much too easily. I went ahead with int.

Considering the above I decided to propose this patch. Some amount of
redundancy (and a new test to properly cover the
MultiFernet.decrypt_at_time() implementation) is a price to prevent
clients from shooting themselves in the foot with the tll=None gun since
setting ttl to None disabled timestamp checks even if current_time was
provided.

[1] https://github.com/pyca/cryptography/pull/5256
[2] https://github.com/python/typeshed/pull/4238

* Actually test the return value here

* Fix formatting</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Disallow ttl=None in (Multi)Fernet.decrypt_at_time()

Since the introduction of the _at_time() methods in #5256[1] there's
been this little voice in the back of my mind telling me that maybe it's
not the best idea to allow ttl=None in decrypt_at_time(). It's been like
this for convenience and code reuse reasons.

Then I submitted a patch for cryptography stubs in typeshed[2] and I had
to decide whether to define decrypt_at_time()'s ttl as int and be
incompatible with cryptography's behavior or Optional[int] and advertise
an API that can be misused much too easily. I went ahead with int.

Considering the above I decided to propose this patch. Some amount of
redundancy (and a new test to properly cover the
MultiFernet.decrypt_at_time() implementation) is a price to prevent
clients from shooting themselves in the foot with the tll=None gun since
setting ttl to None disabled timestamp checks even if current_time was
provided.

[1] https://github.com/pyca/cryptography/pull/5256
[2] https://github.com/python/typeshed/pull/4238

* Actually test the return value here

* Fix formatting</pre>
</div>
</content>
</entry>
<entry>
<title>Add a way to pass current time to Fernet (#5256)</title>
<updated>2020-06-14T18:30:18+00:00</updated>
<author>
<name>Jakub Stasiak</name>
<email>jakub@stasiak.at</email>
</author>
<published>2020-06-14T18:30:18+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=0d0d70bd78f432397b91eee4d9743000686037a6'/>
<id>0d0d70bd78f432397b91eee4d9743000686037a6</id>
<content type='text'>
* Add a way to pass current time to Fernet

The motivation behind this is to be able to unit test code using Fernet
easily without having to monkey patch global state.

* Reformat to satisfy flake8

* Trigger a Fernet.encrypt() branch missing from coverage

* Revert specifying explicit current time in MultiFernet.rotate()

Message's timestamp is not verified anyway since ttl is None.

* Change the Fernet's explicit current time API slightly

This's been suggested in code review.

* Fix a typo

* Fix a typo

* Restore full MultiFernet test coverage and fix a typo

* Restore more coverage

time.time() is not called by MultiFernet.rotate() anymore so the monkey
patching and lambda need to go, because the patched function is not used
and coverage calculation will rightfully notice it.

* Remove an unused import

* Document when the *_at_time Fernet methods were added</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add a way to pass current time to Fernet

The motivation behind this is to be able to unit test code using Fernet
easily without having to monkey patch global state.

* Reformat to satisfy flake8

* Trigger a Fernet.encrypt() branch missing from coverage

* Revert specifying explicit current time in MultiFernet.rotate()

Message's timestamp is not verified anyway since ttl is None.

* Change the Fernet's explicit current time API slightly

This's been suggested in code review.

* Fix a typo

* Fix a typo

* Restore full MultiFernet test coverage and fix a typo

* Restore more coverage

time.time() is not called by MultiFernet.rotate() anymore so the monkey
patching and lambda need to go, because the patched function is not used
and coverage calculation will rightfully notice it.

* Remove an unused import

* Document when the *_at_time Fernet methods were added</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for extracting timestamp from a Fernet token (#4229)</title>
<updated>2018-05-12T15:57:32+00:00</updated>
<author>
<name>Paul Kehrer</name>
<email>paul.l.kehrer@gmail.com</email>
</author>
<published>2018-05-12T15:57:32+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=36ad98fd5e4b7358dc2aa903b6d51569bf19c5f8'/>
<id>36ad98fd5e4b7358dc2aa903b6d51569bf19c5f8</id>
<content type='text'>
* Add API for retrieving the seconds-to-expiry for the token, given a TTL.

* Process PR feedback:

* Do compute the TTL, but just the age of the token. The caller
can decided what to do next.

* Factored out the HMAC signature verification to a separate function.

* Fixed a copy&amp;paste mistake in the test cases

* Tests cleanup.

* `struct` no longer needed

* Document `def age()`

* typo in `age()` documentation

* token, not data

* remove test for TTL expiry that is already covered by the parameterized `test_invalid()`.

* let's call this extract_timestamp and just return timestamp

* review comments

* it's UNIX I know this
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add API for retrieving the seconds-to-expiry for the token, given a TTL.

* Process PR feedback:

* Do compute the TTL, but just the age of the token. The caller
can decided what to do next.

* Factored out the HMAC signature verification to a separate function.

* Fixed a copy&amp;paste mistake in the test cases

* Tests cleanup.

* `struct` no longer needed

* Document `def age()`

* typo in `age()` documentation

* token, not data

* remove test for TTL expiry that is already covered by the parameterized `test_invalid()`.

* let's call this extract_timestamp and just return timestamp

* review comments

* it's UNIX I know this
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Multifernet.rotate method (#3979)</title>
<updated>2017-10-18T19:23:53+00:00</updated>
<author>
<name>Chris Wolfe</name>
<email>chriswwolfe@gmail.com</email>
</author>
<published>2017-10-18T19:23:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=af6f9900647c36224130270dab385d323ff7534d'/>
<id>af6f9900647c36224130270dab385d323ff7534d</id>
<content type='text'>
* add rotate method

* add some more tests for the failure modes

* start adding some documentation for the rotate method

* operate on a single token at a time, leave lists to the caller

* add versionadded
add versionadded, drop rotate from class doctest

* give rotate a doctest

* single level, not aligned

* add changelog for mf.rotate

* show that, once rotated, the old fernet instance can no longer decrypt the token

* add the instead of just the how

* update docs to reflect removal of ttl from rotate

* update tests

* refactor internal methods so that we can extract the timestamp

* implement rotate

* update wordlist (case sensitive?)

* lints

* consistent naming

* get_token_data/get_unverified_token_data -&gt; better name

* doc changes

* use the static method, do not treat as imethod

* move up to MultiFernet docs

* add to authors

* alter wording

* monkeypatch time to make it less possible for the test to pass simply due to calls occuring in less than one second

* set the time after encryption to make sure that the time is preserved as part of re-encryption
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* add rotate method

* add some more tests for the failure modes

* start adding some documentation for the rotate method

* operate on a single token at a time, leave lists to the caller

* add versionadded
add versionadded, drop rotate from class doctest

* give rotate a doctest

* single level, not aligned

* add changelog for mf.rotate

* show that, once rotated, the old fernet instance can no longer decrypt the token

* add the instead of just the how

* update docs to reflect removal of ttl from rotate

* update tests

* refactor internal methods so that we can extract the timestamp

* implement rotate

* update wordlist (case sensitive?)

* lints

* consistent naming

* get_token_data/get_unverified_token_data -&gt; better name

* doc changes

* use the static method, do not treat as imethod

* move up to MultiFernet docs

* add to authors

* alter wording

* monkeypatch time to make it less possible for the test to pass simply due to calls occuring in less than one second

* set the time after encryption to make sure that the time is preserved as part of re-encryption
</pre>
</div>
</content>
</entry>
<entry>
<title>pass bytes to modes/algorithms like we should</title>
<updated>2016-03-07T13:11:51+00:00</updated>
<author>
<name>Paul Kehrer</name>
<email>paul.l.kehrer@gmail.com</email>
</author>
<published>2016-03-07T13:11:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/cryptography.git/commit/?id=4fc597d9990bdf17f714ae1a3a3f759e4039e4a9'/>
<id>4fc597d9990bdf17f714ae1a3a3f759e4039e4a9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
