Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20687 closed Cleanup/optimization (fixed)

Document that the max_age argument of TimeStampSigner.unsign should be a number of seconds

Reported by: Baptiste Mispelon Owned by: nobody
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: tomas.ehrlich@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Currently, neither the documentation [1] or the code [2] are very explicit about what kind of value max_age is supposed to receive (a timedelta, a datetime, ...?).

It's only by looking at the error message that you can guess it's expecting seconds.

[1] https://docs.djangoproject.com/en/dev/topics/signing/#verifying-timestamped-values
[2] https://github.com/django/django/blob/master/django/core/signing.py#L185

Attachments (2)

ticket-20687.patch (2.8 KB ) - added by Tomáš Ehrlich 11 years ago.
ticket-20687-1.patch (1.8 KB ) - added by Tomáš Ehrlich 11 years ago.
Fixed typo and rephrased.

Download all attachments as: .zip

Change History (9)

comment:1 by Claude Paroz, 11 years ago

Triage Stage: UnreviewedAccepted

by Tomáš Ehrlich, 11 years ago

Attachment: ticket-20687.patch added

comment:2 by Tomáš Ehrlich, 11 years ago

Cc: tomas.ehrlich@… added
Has patch: set

I was looking for it this morning. Added documentation for signing data structures too (wasn't mentioned, it uses TimestampSigner neither).

https://github.com/django/django/pull/1323

comment:3 by Tim Graham, 11 years ago

Patch needs improvement: set

Left a couple comments on the PR.

by Tomáš Ehrlich, 11 years ago

Attachment: ticket-20687-1.patch added

Fixed typo and rephrased.

comment:4 by Tomáš Ehrlich, 11 years ago

Patch needs improvement: unset

comment:5 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In c5bc98d7e1779263dc870843cab296f052e9a318:

Fixed #20687 -- Added documentation for django.core.signing API.

Thanks Baptiste Mispelon for the suggestion.

comment:6 by Tim Graham <timograham@…>, 11 years ago

In 2f9e5483f6e65bcc0364833517fdae26f1b8c885:

[1.6.x] Fixed #20687 -- Added documentation for django.core.signing API.

Thanks Baptiste Mispelon for the suggestion.

Backport of c5bc98d7e1 from master.

comment:7 by Tim Graham <timograham@…>, 11 years ago

In 6151fdf930c9a513597e94fe8e8aee5e88c69ca1:

[1.5.x] Fixed #20687 -- Added documentation for django.core.signing API.

Thanks Baptiste Mispelon for the suggestion.

Backport of c5bc98d7e1 from master.

Note: See TracTickets for help on using tickets.
Back to Top