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

fix(permissions): fetch permissions return an exception when the server doesn't return an 200 response #635

Merged
merged 5 commits into from
Oct 23, 2023

Conversation

matthv
Copy link
Member

@matthv matthv commented Oct 23, 2023

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

@matthv matthv changed the title Fix/call permissions fix(permissions): fetch permissions return an exception when the server doesn't return an 200 response Oct 23, 2023
@matthv
Copy link
Member Author

matthv commented Oct 23, 2023

if response.is_a?(Net::HTTPOK)
JSON.parse(response.body)
else
raise ForestLiana::Errors::HTTP403Error.new("Permission could not be retrieved")
Copy link
Member

Choose a reason for hiding this comment

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

👌 Better <3

@@ -6,7 +6,7 @@ module Ability
module Permission
include Fetch

TTL = (ENV['FOREST_PERMISSIONS_EXPIRATION_IN_SECONDS'] || 1).to_i.second
Copy link
Member

Choose a reason for hiding this comment

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

hihi

Thenkei
Thenkei previously approved these changes Oct 23, 2023
Copy link
Member

@Thenkei Thenkei left a comment

Choose a reason for hiding this comment

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

🙏 Thank you guys. 🔥

@codeclimate
Copy link

codeclimate bot commented Oct 23, 2023

Code Climate has analyzed commit af78c98 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (55% is the threshold).

This pull request will bring the total coverage in the repository to 48.7%.

View more on Code Climate.

@matthv matthv merged commit 9a7590b into main Oct 23, 2023
6 checks passed
@matthv matthv deleted the fix/call-permissions branch October 23, 2023 14:46
forest-bot added a commit that referenced this pull request Oct 23, 2023
## [8.0.15](v8.0.14...v8.0.15) (2023-10-23)

### Bug Fixes

* **permissions:** fetch permissions return an exception when the server doesn't return an 200 response ([#635](#635)) ([9a7590b](9a7590b))
@forest-bot
Copy link
Member

🎉 This PR is included in version 8.0.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

Watanabe1011 added a commit to Watanabe1011/Forest-Rails that referenced this pull request Jun 3, 2024
## [8.0.15](ForestAdmin/forest-rails@v8.0.14...v8.0.15) (2023-10-23)

### Bug Fixes

* **permissions:** fetch permissions return an exception when the server doesn't return an 200 response ([#635](ForestAdmin/forest-rails#635)) ([9a7590b](ForestAdmin/forest-rails@9a7590b))
montedev0516 added a commit to montedev0516/Artizyou-Platform that referenced this pull request Nov 7, 2024
## [8.0.15](ForestAdmin/forest-rails@v8.0.14...v8.0.15) (2023-10-23)

### Bug Fixes

* **permissions:** fetch permissions return an exception when the server doesn't return an 200 response ([#635](ForestAdmin/forest-rails#635)) ([9a7590b](ForestAdmin/forest-rails@9a7590b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants