Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in storage interfaces #675

Open
afilippov1985 opened this issue Dec 4, 2015 · 3 comments
Open

Inconsistency in storage interfaces #675

afilippov1985 opened this issue Dec 4, 2015 · 3 comments

Comments

@afilippov1985
Copy link
Contributor

Somewhere function must return false if value not exist (ClientInterface::getClientDetails())
Somewhere function must return null in such case (AuthorizationCodeInterface::getAuthorizationCode())
Somewhere behavior not defined (PublicKeyInterface::getPrivateKey())

I suggest to revise interfaces and
return null if value not exist (not defined)
return false on error

@bshaffer
Copy link
Owner

bshaffer commented Dec 4, 2015

This seems like a good idea. I seem to remember returning false for a specific reason, but it may have just been because Pdo returns false from its queries, which is not a real good reason.

@afilippov1985
Copy link
Contributor Author

Also, existing storages has functions to set data for unit tests (such as setClientDetails, setScope, setClientKey, unsetAccessToken, setUser). They should be added to corresponding storage interfaces.

@bshaffer
Copy link
Owner

bshaffer commented Dec 7, 2015

I disagree with this second request. These are convenience functions, and if you add your own storage classes, you are free to add these functions or not. The library classes require them for testing, but the actual OAuth server does not require them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants