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

Authorized endpoints #133

Merged
merged 15 commits into from
Apr 8, 2016
Merged

Authorized endpoints #133

merged 15 commits into from
Apr 8, 2016

Conversation

cavis
Copy link
Member

@cavis cavis commented Apr 7, 2016

Adds some more authorized endpoints.

  • GET /authorization the current user
  • GET /authorization/accounts active and approved accounts of the user
  • GET /authorization/accounts/:id show account of the user by id
  • GET /authorization/accounts/:id/stories list ALL (including unpublished) stories of the account
  • POST /authorization/accounts/:id/stories create new story for the account
  • GET /authorization/stories/:id show any story of any of the users accounts
  • DELETE /authorization/stories/:id destroy any story

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 98.147% when pulling 9d13ed8 on feat/auth_stories into eaacdc3 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 98.267% when pulling d152d1a on feat/auth_stories into eaacdc3 on master.

@cavis cavis changed the title WIP Authorized endpoints Authorized endpoints Apr 8, 2016
@@ -1,3 +1,3 @@
ruby:
enabled: true
config_file: config/.rubocop.yml
config_file: .rubocop.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved rubocop to the top-level, so it gets auto-detected locally.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 98.267% when pulling b291467 on feat/auth_stories into eaacdc3 on master.

404
end
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we added this kind of not found handling to the extracted gem. This is fine for now, will have to refactor when we pull this in: https://github.com/PRX/hal_api-rails/pull/1/files

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I added this to catch some activerecord-not-found errors in very specific places, for the show/update/destroy actions. Hopefully specific enough that other unrelated model.find() errors won't trigger an incorrect 404.

@kookster
Copy link
Member

kookster commented Apr 8, 2016

@cavis I think that's it for my review - the :get vs. :as use is about all I see that could be changed (assuming I am right that :as can do what you need)

@kookster kookster assigned cavis and unassigned kookster Apr 8, 2016
@cavis cavis assigned kookster and unassigned cavis Apr 8, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 98.267% when pulling ebacd33 on feat/auth_stories into eaacdc3 on master.

@kookster kookster merged commit 8a1eabd into master Apr 8, 2016
@kookster kookster deleted the feat/auth_stories branch April 8, 2016 18:54
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.

3 participants