wiki.techinc.nl/includes/session
Tim Starling c75eef91bf Introduce $wgForceHTTPS
Add $wgForceHTTPS. When set to true:

* It makes the HTTP to HTTPS redirect unconditional and suppresses the
  forceHTTPS cookie.
* It makes session cookies be secure.
* In the Action API, it triggers the existing deprecation warning and
  avoids more expensive user/session checks.
* In login and signup, it suppresses the old hidden form fields for
  protocol switching.
* It hides the prefershttps user preference.

Other changes:

* Factor out the HTTPS redirect in MediaWiki::main() into
  maybeDoHttpsRedirect() and shouldDoHttpRedirect(). Improve
  documentation.
* User::requiresHTTPS() reflects $wgForceHTTPS whereas the Session
  concept of "force HTTPS" does not. The documentation of
  User::requiresHTTPS() says that it includes configuration, and
  retaining this definition was beneficial for some callers. Whereas
  Session::shouldForceHTTPS() was used fairly narrowly as the value
  of the forceHTTPS cookie, and injecting configuration into it is not
  so easy or beneficial, so I left it as it was, except for clarifying
  the documentation.
* Deprecate the following hooks: BeforeHttpsRedirect, UserRequiresHTTPS,
  CanIPUseHTTPS. No known extension uses them, and they're not compatible
  with the long-term goal of ending support for mixed-protocol wikis.
  BeforeHttpsRedirect was documented as unstable from its inception.
  CanIPUseHTTPS was a WMF config hack now superseded by GFOC's SNI
  sniffing.
* For tests which failed with $wgForceHTTPS=true, I mostly split the
  tests, testing each configuration value separately.
* Add ArrayUtils::cartesianProduct() as a helper for generating
  combinations of boolean options in the session tests.

Bug: T256095

Change-Id: Iefb5ba55af35350dfc7c050f9fb8f4e8a79751cb
2020-06-30 15:38:11 +10:00
..
Hook Hook interface doc comment followup 2020-04-21 09:12:23 +10:00
BotPasswordSessionProvider.php Fix new phan errors, part 7 2019-10-21 22:10:20 +00:00
CookieSessionProvider.php Introduce $wgForceHTTPS 2020-06-30 15:38:11 +10:00
ImmutableSessionProviderWithCookie.php Introduce $wgForceHTTPS 2020-06-30 15:38:11 +10:00
MetadataMergeException.php Remove duplicate variable name from class property PHPDocs 2019-12-02 12:58:29 +00:00
PHPSessionHandler.php Use @internal instead of @private per policy 2020-06-26 14:14:23 +02:00
Session.php Introduce $wgForceHTTPS 2020-06-30 15:38:11 +10:00
SessionBackend.php Replace @protected tag 2020-06-26 14:31:16 +02:00
SessionId.php Use @internal instead of @private per policy 2020-06-26 14:14:23 +02:00
SessionInfo.php Introduce $wgForceHTTPS 2020-06-30 15:38:11 +10:00
SessionManager.php Replace @protected tag 2020-06-26 14:31:16 +02:00
SessionManagerInterface.php
SessionOverflowException.php Set method visibility for various constructors 2019-12-03 20:17:30 +01:00
SessionProvider.php Replace @protected tag 2020-06-26 14:31:16 +02:00
SessionProviderInterface.php Allow SessionProviderInterface to say if it is safe against CSRF 2020-03-11 10:39:54 -05:00
Token.php Fix numerous PSR12.Properties.ConstantVisibility.NotFound 2020-05-11 01:36:36 +01:00
UserInfo.php Unsuppress PhanParamReqAfterOpt, use PHP71 nullable types 2019-10-10 11:53:58 +02:00