forked from Shopify/oktakit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass HTTP status to
Oktakit::Error.from_response()
[description below]
This fixes [Shopify#59](Shopify#59) by modifying `Oktakit::Error.from_response()` method to accept and process client response and HTTP status. The reason behind these changes: ```ruby response, http_status = client.get_user('[email protected]') ``` This usage method is listed in the repo's README and works in most cases. However, it separates response from HTTP status. `response` is a `Sawyer::Resource` object and doesn't contain any data about the request (HTTP status, URL, method or headers). It only has a Hash with Okta error code, error summary, internal error link, error id and error causes, which causes a `TypeError` if we try to `raise Oktakit::Error.from_response(response) unless http_status == 200` in case the user is not found. With these changes implemented, we will gain the ability to process different response formats without causing errors on the client side.
- Loading branch information
1 parent
1c58db5
commit 6bad449
Showing
31 changed files
with
696 additions
and
602 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
# frozen_string_literal: true | ||
source 'https://rubygems.org' | ||
|
||
gem 'byebug' | ||
gem 'rake' | ||
gem 'yard' | ||
source "https://rubygems.org" | ||
|
||
gem "byebug" | ||
gem "rake" | ||
gem "yard" | ||
|
||
group :test do | ||
gem 'rubocop' | ||
gem 'rubocop-shopify', require: false | ||
gem 'rspec', '~> 3.10' | ||
gem 'vcr', '~> 6.0' | ||
gem "rubocop" | ||
gem "rubocop-shopify", require: false | ||
gem "rspec", "~> 3.10" | ||
gem "vcr", "~> 6.0" | ||
end | ||
|
||
gemspec |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
require 'bundler/gem_tasks' | ||
require "bundler/gem_tasks" | ||
|
||
require 'rspec/core/rake_task' | ||
require "rspec/core/rake_task" | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
require 'rubocop/rake_task' | ||
require "rubocop/rake_task" | ||
RuboCop::RakeTask.new | ||
|
||
task test: :spec | ||
task default: %i[spec rubocop] | ||
task default: [:spec, :rubocop] | ||
|
||
namespace :doc do | ||
require 'yard' | ||
require "yard" | ||
YARD::Rake::YardocTask.new do |task| | ||
task.files = %w[LICENSE.md lib/**/*.rb] | ||
task.options = %w[--output-dir doc/yard --markup markdown] | ||
task.files = ["LICENSE.md", "lib/**/*.rb"] | ||
task.options = ["--output-dir", "doc/yard", "--markup", "markdown"] | ||
end | ||
task default: :yard | ||
end |
This file contains 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 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 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 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 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 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 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 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 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 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 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 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
Oops, something went wrong.