1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00
phorge-phorge/src/applications/config
epriestley cdeea11fd3 Don't actually construct auth providers when checking for their existence
Summary:
A user reported this stack trace:

http://pastebin.com/6auGbZsE

...on this GitHub issue:

https://github.com/facebook/phabricator/issues/389#issuecomment-36612511

The problem is similar to the original report, but not identical. In this case, we're following a sequence of steps like:

  - Run setup checks.
    - Check for enabled providers, in order to raise "no providers configured yet" warning.
      - Try to generate login/redirect URIs.
  - Build the request.
  - Set the default base URI.
  - Run normal code.

Since we try to generate URIs before we provide a default, this fatals. Instead, don't try to build objects.

An alternative fix might be to try to set defaults earlier, but we depend on some config and on building the Request in order to be able to figure out if a request is HTTP or HTTPS right now. We could assume one, or guess, or use protocol-relative URIs (`///host.com`), but I think this fix is a little cleaner overall. If we keep hitting similar stuff, we could look into alternate fixes.

We could also set some kind of "setup mode" flag and make `getURI()` if it's called during setup mode to detect these during testing. I'd like to hit one more of these before doing that, though.

Test Plan: Reproduced the issue, applied the patch, verified this fixes it.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D8395
2014-03-04 16:11:28 -08:00
..
application Button to ignore setup issues + refractoring 2013-03-06 14:14:10 -08:00
check Don't actually construct auth providers when checking for their existence 2014-03-04 16:11:28 -08:00
controller Simplify PHUIObjectBoxViews handling of Save and Error states 2014-01-10 09:17:37 -08:00
custom Allow configuration to have custom UI types 2013-06-07 12:36:18 -07:00
editor Add a config setting for storing application settings 2013-10-03 12:39:30 -07:00
exception Allow configuration to be explicitly validated, including validation of complex attributes 2013-01-01 18:15:03 -08:00
issue Fixed T2630 2013-04-10 13:11:22 -07:00
json Mask remaining config values, and implement set type 2013-01-16 15:06:07 -08:00
management Extend all "ManagementWorkflow" classes from a base class 2013-12-27 13:15:40 -08:00
option Remove tokenizer.ondemand, and always load on demand 2014-02-14 10:24:40 -08:00
phid Remove many redundant implementations of canLoadNamedObject() 2013-12-18 12:00:01 -08:00
query Lock policy queries to their applications 2013-10-21 17:20:27 -07:00
response [SECURITY] Prevented PhabricatorSetupIssueView from exposing sensitive config options. 2013-04-06 00:39:53 -07:00
storage Various linter fixes. 2014-02-26 12:44:58 -08:00
view Fix php.net link to open in a new window 2014-01-17 10:54:04 -08:00