1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 01:32:42 +01:00
phorge-phorge/src/docs/contributor
epriestley 5dec03af32 Make OAuth scope handling more flexible
Summary:
Ref T7303. Currently, our handling of "scope" is fairly rigid and adheres to the spec, but some of these behaviors don't make much sense in practice.

Soften some behaviors and make them more flexible:

**Soft Failure on Unknown Permissions**: If a client asks for a permission we don't know about, just warn that we don't recognize it instead of fataling. In particular, I plan to make `offline_access` and `whoami` implicit. Older clients that request these permissions will still work fine as long as we don't hard-fatal.

**Move `user.whoami` to ALWAYS scope**: Make `whoami` a default permission. We've already done this, in effect; this just formalizes it.

**Tokens no longer expire**: Make `offline_access` (infinite-duration tokens) a default permission. I think the OAuth model doesn't map well to reality. It is common for other providers to issue "temporary" tokens with a duration of multiple years, and the refesh workflow is sort of silly. We can add a "temporary" scope later if we need temporary tokens.

This flow was potentially extra silly with the "log out of Phacility" use case, where we might need to have you log in again before we could log you out, which is bizarre and senseless. Avoid this nonsense.

**Move away from granular permissions**: Users currently get to pick-and-choose which permissions they grant, but this likely rarely/never works in practice and is fairly hostile since applications can't communicate which permissions they need. Applications which can actually operate with only some subset of permissions can make separate requests (e.g., when you activate "cool feature X", it asks for X permission). I think applications that do this are rare; pretty much everything just asks for tons of permissions and everyone grants them.

Making this all-or-nothing is better for well-behaved applications and better for users. It's also slightly better for overzealous applications that ask for more than they need, but whatever. Users can make an informed decision, hopefully, and I plan to let administrators force applications to a subset of permissions once we introduce meaningful scopes.

Test Plan:
  - Generated tokens.
  - Used tokens.
  - Authorized an instance.
  - Faked some bogus scopes, got clean authorization.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7303

Differential Revision: https://secure.phabricator.com/D15621
2016-04-05 13:53:33 -07:00
..
adding_new_classes.diviner Update the translations document 2015-06-20 05:25:08 -07:00
adding_new_css_and_js.diviner Change monospace text formatting 2015-05-31 10:07:45 +10:00
assistive_technologies.diviner Document the aural attribute and __aural__ preview mode 2014-05-01 07:54:29 -07:00
bug_reports.diviner Provide "Reproduction Steps" docs and separate "Version" doc 2016-03-24 08:57:29 -07:00
cla.diviner Minor spelling/wordsmith on CLA doc 2015-11-27 13:45:13 -08:00
contrib_intro.diviner Update support documentation for modern times 2015-10-19 13:29:24 -07:00
contributing_code.diviner Write bug report, feature request and code contribution guides 2014-11-01 09:22:12 -07:00
css_coding_standards.diviner Add language specification to code blocks 2015-06-15 07:32:13 +10:00
database.diviner Write "Why does Phabricator need so many databases?" 2016-02-11 13:01:04 -08:00
describing_problems.diviner Provide documentation explicitly describing what a "root problem" is 2015-12-08 13:01:32 -08:00
feature_requests.diviner Delete old Maniphest edit controller 2015-12-08 17:56:31 -08:00
general_coding_standards.diviner Fix line lengths in documentation and lint *.book files as JSON. 2014-06-24 04:26:06 +10:00
internationalization.diviner Fix some links to "Adding New Classes" in docs 2015-09-30 07:44:54 -07:00
javascript_coding_standards.diviner Change monospace text formatting 2015-05-31 10:07:45 +10:00
n_plus_one.diviner Change monospace text formatting 2015-05-31 10:07:45 +10:00
phabricator_code_layout.diviner Remove some low-hanging buildStandardPageResponse() methods 2015-11-03 10:11:36 -08:00
php_coding_standards.diviner Add language specification to code blocks 2015-06-15 07:32:13 +10:00
rendering_html.diviner Divide Phabricator documentation into four books 2014-03-05 13:00:24 -08:00
reproduction_steps.diviner Fix a typo 2016-03-24 09:12:34 -07:00
running_builtin_php_webserver.diviner Divide Phabricator documentation into four books 2014-03-05 13:00:24 -08:00
unit_tests.diviner Change monospace text formatting 2015-05-31 10:07:45 +10:00
using_edges.diviner Remove @group annotations 2014-07-10 08:12:48 +10:00
using_oauthserver.diviner Make OAuth scope handling more flexible 2016-04-05 13:53:33 -07:00
version.diviner Provide "Reproduction Steps" docs and separate "Version" doc 2016-03-24 08:57:29 -07:00