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

Code refactoring #64

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

texpert
Copy link
Contributor

@texpert texpert commented Aug 9, 2016

Added the call to Doorkeeper's authenticate_admin initializer block to valid_doorkeeper_token? method.

This make it possible to define the block in such a way in config/initializers/doorkeeper.rb:

admin_authenticator do |doorkeeper_token|
    User.find(doorkeeper_token.resource_owner_id).admin?
end

@texpert
Copy link
Contributor Author

texpert commented Aug 9, 2016

Also, removed an obsolete string interpolation in set_auth_strategy method.

@texpert
Copy link
Contributor Author

texpert commented Aug 23, 2016

@antek-drzewiecki . did you have a chance to take a glance at this?

… 'false'. Particularily useful when using WineBouncer in the grape-swagger for hiding certain endpoints for different kind of users. In this case oauth2 'false' is set on the GET swagger_doc endpoint making the doorkeeper_access_token available further in the process of building API endpoints.
…16.2

Updated Grape, Rails and Doorkeeper default versions in the Gemfile.
…r's admin authenticator instead of the token.

Greatly simplified :swagger AuthStrategy methods.
…eys.

Restricted to Grape 0.16 minimum since the new router and syntax.
Also updated in README.md minimal version of Doorkeeper to tested 3.1.0.
@texpert
Copy link
Contributor Author

texpert commented Sep 30, 2016

@antek-drzewiecki , what do you think? This seems to be ready.

…t's not this gem's responsibility, no need to override and new exception classes.

Removed more obsolete auth_methods.
Modularized AuthStrategies instead of them being instantiated as Classes.
The configured auth_strategy is included now into the middleware on WineBouncer initialization, not on every request.
DRYed the middleware.
@texpert texpert changed the title Add analyzing user's admin role to token validation Code refactoring Oct 6, 2016
If auth_strategy is protected, inject Doorkeeper's default scopes into :security hash.
Set :protected boolean on the route to make it fast available on requests' processing.
Mark endpoint as protected if 'false' scope present.
On :protected auth_strategy and empty scopes, use Doorkeeper's default scopes.
Auth strategies could now coexist - configured as an array.
Made Rubocop happy.
Swagger 2.0 strategy implemented (specs not written yet).
@LeFnord
Copy link

LeFnord commented Jun 5, 2017

@antek-drzewiecki any progress on it?

@texpert
Copy link
Contributor Author

texpert commented Jun 5, 2017

@LeFnord , it's silence here since September, 2016.

Actually, with this merged PR to Doorkeeper, doorkeeper-gem/doorkeeper#915 , WneBouncer became redundant, indeed.

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

Successfully merging this pull request may close these issues.

2 participants