Skip to content

Commit

Permalink
Drop support for ruby < 2.3.0 and update dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jfeltesse-mdsol committed Sep 12, 2018
1 parent 9cc8398 commit 6578c3d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 33 deletions.
14 changes: 1 addition & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,8 @@ cache: bundler
sudo: false

rvm:
- 2.2.10
- 2.3.7
- 2.4.4
- 2.5.1

matrix:
include:
- rvm: 2.1.10
gemfile: gemfiles/ruby_2.1.gemfile

# https://github.com/travis-ci/travis-ci/issues/8978
before_install:
- gem update --system
- gem install bundler # https://github.com/travis-ci/travis-ci/issues/9383
- bundle --version

script: "bundle exec rspec"
script: bundle exec rspec
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# MAuth-Client History
## v4.1.0
- Drop support for Ruby < 2.3.0
- Update development dependencies

## v4.0.4
- Restore original behavior in the proxy of forwarding of headers that begin with HTTP_ (except for HTTP_HOST) but removing the HTTP_.
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'kender/tasks'

RSpec::Core::RakeTask.new(:spec)

Expand Down
5 changes: 0 additions & 5 deletions gemfiles/ruby_2.1.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion lib/mauth/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MAuth
VERSION = '4.0.4'.freeze
VERSION = '4.1.0'.freeze
end
14 changes: 6 additions & 8 deletions mauth-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.description = 'Client for signing and authentication of requests and responses with mAuth authentication. Includes middleware for Rack and Faraday for incoming and outgoing requests and responses.'
spec.homepage = 'https://github.com/mdsol/mauth-client-ruby'
spec.license = 'MIT'
spec.required_ruby_version = '>= 2.1.0'
spec.required_ruby_version = '>= 2.3.0'

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = 'exe'
Expand All @@ -27,11 +27,9 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'byebug'
spec.add_development_dependency 'kender', '~> 0.4'
spec.add_development_dependency 'rack-test', '~> 0.6.3'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.4'
spec.add_development_dependency 'simplecov', '~> 0.12.0'
spec.add_development_dependency 'timecop', '~> 0.8.1'
spec.add_development_dependency 'uuidtools', '~> 2.1.5'
spec.add_development_dependency 'rack-test', '~> 1.1.0'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rspec', '~> 3.8'
spec.add_development_dependency 'simplecov', '~> 0.16'
spec.add_development_dependency 'timecop', '~> 0.9'
end
11 changes: 8 additions & 3 deletions spec/mauth_client_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
require 'spec_helper'
require 'faraday'
require 'mauth/client'
require 'securerandom'

describe MAuth::Client do
let(:app_uuid) { SecureRandom.uuid }

describe '#initialize' do
it 'initializes without config' do
mc = MAuth::Client.new
Expand Down Expand Up @@ -91,24 +94,26 @@ def x_mws_authentication

describe '#signed' do
before { @request = TestSignableRequest.new(:verb => 'PUT', :request_url => '/', :body => 'himom') }

it 'adds X-MWS-Time and X-MWS-Authentication headers when signing' do
mc = MAuth::Client.new(:private_key => OpenSSL::PKey::RSA.generate(2048), :app_uuid => UUIDTools::UUID.random_create.to_s)
mc = MAuth::Client.new(:private_key => OpenSSL::PKey::RSA.generate(2048), :app_uuid => app_uuid)
signed_request = mc.signed(@request)
expect(signed_request.headers.keys).to include('X-MWS-Authentication')
expect(signed_request.headers.keys).to include('X-MWS-Time')
end
it "can't sign without a private key" do
mc = MAuth::Client.new(:app_uuid => UUIDTools::UUID.random_create.to_s)
mc = MAuth::Client.new(:app_uuid => app_uuid)
expect{mc.signed(@request)}.to raise_error(MAuth::UnableToSignError)
end
it "can't sign without an app uuid" do
mc = MAuth::Client.new(:private_key => OpenSSL::PKey::RSA.generate(2048))
expect{mc.signed(@request)}.to raise_error(MAuth::UnableToSignError)
end
end

describe '#signed_headers' do
it 'returns a hash with X-MWS-Time and X-MWS-Authentication headers' do
mc = MAuth::Client.new(:private_key => OpenSSL::PKey::RSA.generate(2048), :app_uuid => UUIDTools::UUID.random_create.to_s)
mc = MAuth::Client.new(:private_key => OpenSSL::PKey::RSA.generate(2048), :app_uuid => app_uuid)
signed_headers = mc.signed_headers(TestSignableRequest.new(:verb => 'PUT', :request_url => '/', :body => 'himom'))
expect(signed_headers.keys).to include('X-MWS-Authentication')
expect(signed_headers.keys).to include('X-MWS-Time')
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'timecop'
require 'uuidtools'
require 'json'
require 'rack/mock'

Expand Down

0 comments on commit 6578c3d

Please sign in to comment.