I have two proposals, one minor and one major.. So let's ease
into it, and start out with the minor one
1) Add 2-legged Support
Add support for 2-legged requests (known by some as
Tokenless Requests). The main concern is how the API should
be modified. You can either change OAuthServer
::verify_request( $req) to OAuthServer::verify_request( $req,
$require_token = true )
Or you can add a new method, OAuthServer
::verify_2legged_request( $req )
So what do we think about this? Personally I'm for the change of
::verify_request, instead of adding a new method.
---
2) Refactor Library with Interfaces and Type Hints
I think we should add at least two interfaces, one for tokens and
one for datastorages. We should then type-hint all methods
that takes one of these requests as arguments..
The main advantage of this is to use exitings ORM objects as
tokens in a well-documented way (it works as is now, as long
as you have the public properties "token" and "secret")
Currently there is the OAuthDataStorage class which kind of
works as a base for the datastorage-class you need. Except it
really isn't, because two of the methods are called the wrong
thing, in that OAuthServer calls the method by another name
(fetch_*_token vs new_*_token)
Having Interfaces with good docs would make it a bit easier
to actually implement the library in a server-functionality..
I wouldn't mind doing all the coding myself - but I would make
such changes without first checking if people would accept them.
(I will keep backwards-compatibility as much as can be expected)
So, let's count up the votes php-internals style (because that
always works reeeally well)
I'm
+1 for 2-legged with verify_request( $req, $require_token)
+1 for refactoring
Regards
Morten Fangel // fangel