Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20687 closed Cleanup/optimization (fixed)

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

Reported by: bmispelon Owned by: nobody
Component: Core (Other) Version: master
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 Elvard 2 years ago.
ticket-20687-1.patch (1.8 KB) - added by Elvard 2 years ago.
Fixed typo and rephrased.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 2 years ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 2 years ago by Elvard

comment:2 Changed 2 years ago by Elvard

  • 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 Changed 2 years ago by timo

  • Patch needs improvement set

Left a couple comments on the PR.

Changed 2 years ago by Elvard

Fixed typo and rephrased.

comment:4 Changed 2 years ago by Elvard

  • Patch needs improvement unset

comment:5 Changed 2 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In c5bc98d7e1779263dc870843cab296f052e9a318:

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

Thanks Baptiste Mispelon for the suggestion.

comment:6 Changed 2 years ago by Tim Graham <timograham@…>

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 Changed 2 years ago by Tim Graham <timograham@…>

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