1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 15:52:41 +01:00
phorge-phorge/src/applications/conduit/method
Bob Trahan af295e0b26 OAuth Server enhancements -- more complete access token response and groundwork
for scope

Summary:
this patch makes the access token response "complete" relative to spec by
returning when it expires AND that the token_type is in fact 'Bearer'.

This patch also lays the groundwork for scope by fixing the underlying data
model and adding the first scope checks for "offline_access" relative to expires
and the "whoami" method.   Further, conduit is augmented to open up individual
methods for access via OAuth generally to enable "whoami" access.   There's also
a tidy little scope class to keep track of all the various scopes we plan to
have as well as strings for display (T849 - work undone)

Somewhat of a hack but Conduit methods by default have SCOPE_NOT_ACCESSIBLE.  We
then don't even bother with the OAuth stuff within conduit if we're not supposed
to be accessing the method via Conduit.   Felt relatively clean to me in terms
of additional code complexity, etc.

Next up ends up being T848 (scope in OAuth) and T849 (let user's authorize
clients for specific scopes which kinds of needs T850).  There's also a bunch of
work that needs to be done to return the appropriate, well-formatted error
codes.  All in due time...!

Test Plan:
verified that an access_token with no scope doesn't let me see
anything anymore.  :(  verified that access_tokens made awhile ago expire.  :(

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Maniphest Tasks: T888, T848

Differential Revision: https://secure.phabricator.com/D1657
2012-02-21 16:33:06 -08:00
..
arcanist Fix exception when encoding is not defined 2011-11-02 21:41:29 -07:00
base OAuth Server enhancements -- more complete access token response and groundwork 2012-02-21 16:33:06 -08:00
chatlog Add a basic chatlog 2012-02-17 10:21:38 -08:00
conduit Bump Phabricator server version to 3 2011-12-22 06:44:48 -08:00
daemon These conduit methods SHOULD allow unguarded writes. 2011-08-16 13:38:14 -07:00
differential Reduce visibility of "Host" and "Path" Differential fields by default 2012-02-06 12:14:07 -08:00
diffusion Expose symbol information over Conduit 2011-12-22 06:44:55 -08:00
feed Add conduit feed.query method 2012-02-02 16:44:13 -08:00
file Add a 'file.info' Conduit method 2011-07-29 11:41:16 -07:00
maniphest Added conduit method to get maniphest transactions 2012-01-11 09:13:59 -08:00
paste Provide a paste.create Conduit method 2011-07-29 19:00:04 -07:00
path/getowners Provide basic Conduit documentation. 2011-07-04 12:03:36 -07:00
phid [conduit] create phid.query method 2012-02-15 11:17:20 -08:00
phriction Allow Phriction documents to be deleted 2011-12-17 11:45:25 -08:00
project Simplify Project status field 2012-02-07 14:59:38 -08:00
remarkup/process Add remarkup.process conduit method 2012-02-02 16:43:37 -08:00
slowvote/info Conduit method for slowvote.poll.info. 2011-07-13 20:00:50 -04:00
user OAuth Server enhancements -- more complete access token response and groundwork 2012-02-21 16:33:06 -08:00