-
Notifications
You must be signed in to change notification settings - Fork 7
Ace praxis support #4
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a very large amount of code duplication between AuthorizationInPraxisController
and AuthorizationInController
. I suspect that most of it is unnecessary for praxis. This is ok for testing, but before merging I would expect to see this refactored.
I think the best approach would be to have a base module with all of the shared functionality, then have subclasses for the rails controller / praxis controller cases.
Gemfile
Outdated
@@ -5,3 +5,6 @@ gemspec | |||
gem 'appraisal', '~> 2.1' | |||
gem 'mocha', '~> 1.0', require: false | |||
gem 'sqlite3' | |||
gem 'praxis', path: '/Users/zachwalker/Playground/praxis' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pointing to your home drive, probably shouldn't merge like this
|
||
# Returns the Authorization::Engine for the current controller. | ||
def authorization_engine | ||
@authorization_engine ||= Authorization::Engine.instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this existing code, or added? It seems very specific to our use case but this is supposed to be an open source library
include Praxis::Controller | ||
|
||
implements Endpoints::Foo | ||
# include Authorization::AuthorizationInPraxisController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we delete this commented code?
@@ -0,0 +1,449 @@ | |||
# Authorization::AuthorizationInController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment needs to be either updated or removed
test/praxis_dummy/design/api.rb
Outdated
consumes 'json' | ||
produces 'json' | ||
end | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be deleted?
action :action_group_action_2 do | ||
description 'action_group_action_2' | ||
routing {get '/action_group_action_2'} | ||
# params do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be deleted?
# Use Rack::ContentLength middleware | ||
application.middleware Rack::ContentLength | ||
|
||
# TODO: this is required for "at least" adding the identity_map in the controller methods... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still TODO?
6771f32
to
8659c2b
Compare
Removes params related to strong params which is a rails concept. Removes filter_resource_access from the praxis version as it isn't needed for our current use case and requires more work to convert over to praxis
…orization modules
8659c2b
to
582549d
Compare
Setting the current user sets a value in Thread.local which may impact ther results of other tests run in the same Thread since the value will persist between test executions. Prior to this change, there were some flakey tests that flaked depending on test execution order
This PR makes declarative authorization directives usable inside of controllers written using the Praxis framework.