Skip to content

Fixed #33060 -- Added BaseCache.make_and_validate_key() hook.#14802

Merged
felixxm merged 3 commits intodjango:mainfrom
ngnpope:ticket-33060
Sep 7, 2021
Merged

Fixed #33060 -- Added BaseCache.make_and_validate_key() hook.#14802
felixxm merged 3 commits intodjango:mainfrom
ngnpope:ticket-33060

Conversation

@ngnpope
Copy link
Copy Markdown
Member

@ngnpope ngnpope commented Aug 26, 2021

ticket-33060

Following on from #14437 (comment).

Copy link
Copy Markdown
Contributor

@cjerdonek cjerdonek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments.

@ngnpope ngnpope force-pushed the ticket-33060 branch 2 times, most recently from 42a14ad to 97e570a Compare August 26, 2021 23:20
@felixxm
Copy link
Copy Markdown
Member

felixxm commented Sep 2, 2021

@ngnpope I found one more case and merged the first commit in b8824e8.

@felixxm
Copy link
Copy Markdown
Member

felixxm commented Sep 3, 2021

Merged the 3rd commit in 68b8eda.

@felixxm
Copy link
Copy Markdown
Member

felixxm commented Sep 3, 2021

@ngnpope Thanks 👍

I rebased and pushed edits to tests.

@felixxm felixxm requested a review from a team September 3, 2021 09:44
@felixxm felixxm changed the title Fixed #33060 -- Added .make_and_validate_key() to base cache backend. Fixed #33060 -- Added BaseCache.make_and_validate_key() hook. Sep 3, 2021
Copy link
Copy Markdown
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this looks neat. Thanks all!

Commit message niggle — Not sure about ...which will be stored here:

Refs #33060 -- Ensured cache backends validate keys which will be stored.

felixxm and others added 3 commits September 7, 2021 11:57
The validate_key() function should be called after make_key() to ensure
that the validation is performed on the key that will actually be
stored in the cache.

Co-authored-by: Mariusz Felisiak <[email protected]>
This helper function reduces the amount of duplicated code and makes it
easier to ensure that we always validate the keys.
@felixxm
Copy link
Copy Markdown
Member

felixxm commented Sep 7, 2021

@carltongibson Thanks for the review 👍 Suggestions applied.

@felixxm felixxm merged commit 42dfa97 into django:main Sep 7, 2021
@ngnpope ngnpope deleted the ticket-33060 branch September 7, 2021 10:39
@ngnpope
Copy link
Copy Markdown
Member Author

ngnpope commented Sep 7, 2021

Thanks for polishing this off @felixxm 🦸🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants