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

Drop support for ruby < 2.3.0 and update dev dependencies #16

Merged
merged 1 commit into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,12 @@ 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
script: bundle exec rspec

# 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"
deploy:
provider: rubygems
gem: mauth-client
Expand Down
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