-
Notifications
You must be signed in to change notification settings - Fork 60
Make compatible with jsonapi-resources 0.9 #52
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
fe6ab4b
allow any jsonapi-resources > 0.8.0.beta1
plantfansam e07a2ae
conditionally set callbacks based on method name in jsonapiresources
plantfansam 5e273f2
rework AuthorizingProcessor#authorize_remove_to_many_relationship
plantfansam 1afcadc
Do not attempt backwards compatibility in callback naming
plantfansam a2e55f3
depend on ~>0.9 in gemspec
plantfansam 9dbc640
fix stubs in remove_to_many_relationship setup
plantfansam 8097ae6
run travis against jsonapi-resources 0.9
plantfansam b055ac7
update replace_polymorphic_to_one_relationship callback syntax
plantfansam f306f09
remove new file
plantfansam 7280547
send batch of related records to authorizer instead of iterating
plantfansam a1dc9ed
&:(_model) instead of assigning block variable
plantfansam 34c4832
fix up exception syntax
plantfansam 6377da9
remove polymorphic callback
plantfansam b4b02f5
update authorized for remove_to_many_relationship spec to expect call…
plantfansam d2e3a57
do not expect 404 when authorized for remove_to_many_relationship
plantfansam 3731696
expect successful request in relationship operations remove_to_many_r…
plantfansam 6039d71
Merge branch 'master' into jsonapi-resources-0.9
valscion d4cbbd7
Use symbols for relationship_type in remove_to_many_relationships
valscion b8e397d
Expect exact models in stubbing operations in relationship specs
valscion 13924b7
Modify to-many relationship spec to only expect authorizer usage
valscion 2a5e67b
Remove unnecessary expect_operation authorization stub method
valscion a8e8df3
Update DefaultPunditAuthorizer#remove_to_many_relationship documentation
valscion 927dd20
Add comment to a bit strange successful scenario in specs
valscion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hmm what was the reason for this change? Is there a reason why it is needed?
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.
I didn't discover the reason in jsonapi-resources, but there are 22 failures if this is left out. In included_resources_spec, the failures look approximately like this:
"Param not allowed", "detail" : "id is not allowed."I can search for more details if you like!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.
Hmm I wonder if it has got to with @thibaudgg's PR #11 and the changes done to the dummy app
ArticleResourcein https://github.com/venuu/jsonapi-authorization/pull/11/files#diff-cc66704bb355f2769ceb1ed76d5f02b4I'm not really sure how the
self.verify_keyandid=methods work, and why exactly they were necessary to have. @thibaudgg do you have any insight to this?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.
Hi, I'll have a look next week and give a try to this branch with our app.
Thanks @handlers for all the work on that one! 👍
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks @thibaudgg! Let us know if you hit roadblocks.
These might be relevant to your testing, if you haven't updated in a while: #53 #40
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.
I'm waiting on @thibaudgg to be able to test this and confirm it works nicely :)
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.
🆒 thanks!
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.
I launched our test suite on our CI with jsonapi-resource 0.9 and this PR and we get a bunch of errors (unexpected
406 - Not Acceptableresponses). It's hard to tell right now if it's because of upgrading to JR 0.9 or this PR specifically.Sadly I didn't have much time to investigate more this week. I'll try to block an hour next week.
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.
Huh, that 406 error does indeed seem weird. It might very well be because of JR 0.9, too
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.
Ok turns out that these lines are indeed needed since v0.8.3 of JR as IDs are generated on the client side.
See https://github.com/cerebris/jsonapi-resources/releases/tag/v0.8.3