1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-21 17:58:47 +02:00
phorge-phorge/src/applications/people
epriestley e5b923743a Make CSRF salt per-user instead of per-request
Summary:
Fixes T8326. This removes calls to PhabricatorStartup from places that daemons may access.

This salt doesn't need to be global; it's embedded in the token we return. It's fine if we use a different salt every time. In practice, we always use the same viewer, so this change causes little or no behavioral change.

Ref T8424. For Spaces, I need a per-request cache for all spaces, because they have unusual access patterns and require repeated access, in some cases by multiple viewers.

We don't currently have a per-request in-process cache that we, e.g., clear in the daemons.

We do have a weak/theoretical/forward-looking attempt at this in `PhabricatorStartup::getGlobal()` but I'm going to throw that away (it's kind of junky, partly because of T8326) and replace it with a more formal mechanism.

Test Plan:
  - Submitted some forms.
  - Grepped for `csrf.salt`.
  - Viewed page source, saw nice CSRF tokens with salt.
  - All the salts are still the same on every page I checked, but it doesn't matter if this isn't true everywhere.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8326, T8424

Differential Revision: https://secure.phabricator.com/D13151
2015-06-04 17:26:23 -07:00
..
application Implement a scope selector for the global search 2015-04-22 14:31:36 -07:00
capability People - refine permissions on creating new users 2015-02-05 16:47:09 -08:00
conduit Add "Mailing List" users 2015-06-03 18:42:33 -07:00
config Add getGroup to ConfigOptions 2015-02-09 13:10:56 -08:00
controller Add "Mailing List" users 2015-06-03 18:42:33 -07:00
customfield Add "Mailing List" users 2015-06-03 18:42:33 -07:00
editor Add "Mailing List" users 2015-06-03 18:42:33 -07:00
event People - fix hovercards for people 2015-05-18 15:39:34 -07:00
garbagecollector Add a GC for user logs 2014-02-03 10:51:41 -08:00
lipsum Rename PhutilRealnameContextFreeGrammar for consistency 2015-01-06 12:04:19 +11:00
markup Replace user "status" with "availability" 2015-05-14 11:15:04 -07:00
phid Add "Mailing List" users 2015-06-03 18:42:33 -07:00
query Add "Mailing List" users 2015-06-03 18:42:33 -07:00
search Rename PHIDType classes 2014-07-24 08:05:46 +10:00
storage Make CSRF salt per-user instead of per-request 2015-06-04 17:26:23 -07:00
typeahead Add "Mailing List" users 2015-06-03 18:42:33 -07:00
view Let users review their own account activity logs 2014-04-27 17:32:09 -07:00