Hello community,
here is the log from the commit of package rubygem-mixlib-authentication for
openSUSE:Factory checked in at 2019-06-19 21:00:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-mixlib-authentication (Old)
and /work/SRC/openSUSE:Factory/.rubygem-mixlib-authentication.new.4811
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-mixlib-authentication"
Wed Jun 19 21:00:26 2019 rev:9 rq:706006 version:3.0.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-mixlib-authentication/rubygem-mixlib-authentication.changes
2018-07-18 22:50:20.223677697 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-mixlib-authentication.new.4811/rubygem-mixlib-authentication.changes
2019-06-19 21:00:29.370092590 +0200
@@ -1,0 +2,6 @@
+Sun May 5 09:34:33 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to version 3.0.1
+ no changelog found
+
+-------------------------------------------------------------------
Old:
----
mixlib-authentication-2.1.1.gem
New:
----
mixlib-authentication-3.0.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-mixlib-authentication.spec ++++++
--- /var/tmp/diff_new_pack.XgxWnk/_old 2019-06-19 21:00:30.150093245 +0200
+++ /var/tmp/diff_new_pack.XgxWnk/_new 2019-06-19 21:00:30.158093252 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-mixlib-authentication
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@@ -24,15 +24,15 @@
#
Name: rubygem-mixlib-authentication
-Version: 2.1.1
+Version: 3.0.1
Release: 0
%define mod_name mixlib-authentication
%define mod_full_name %{mod_name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: %{ruby >= 2.4}
BuildRequires: %{rubygem gem2rpm}
-BuildRequires: %{ruby}
BuildRequires: ruby-macros >= 5
-Url: https://www.chef.io
+Url: https://github.com/chef/mixlib-authentication
Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: Mixes in simple per-request authentication
@@ -48,7 +48,7 @@
%install
%gem_install \
- --doc-files="LICENSE README.md" \
+ --doc-files="LICENSE" \
-f
%gem_packages
++++++ mixlib-authentication-2.1.1.gem -> mixlib-authentication-3.0.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Gemfile new/Gemfile
--- old/Gemfile 2018-06-01 11:18:48.000000000 +0200
+++ new/Gemfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-gemspec
-
-group(:development) do
- gem "pry"
- gem "mixlib-log", "~> 2"
- gem "net-ssh"
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/NOTICE new/NOTICE
--- old/NOTICE 2018-06-01 11:18:48.000000000 +0200
+++ new/NOTICE 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-Mixlib::Authentication NOTICE
-=================
-
-Developed at Chef (https://www.chef.io/).
-
- * Copyright 2009-2016, Chef Software, Inc. <[email protected]>
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2018-06-01 11:18:48.000000000 +0200
+++ new/README.md 1970-01-01 01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-# Mixlib::Authentication
-[](https://travis-ci.org/chef/mixlib-authentication)
[](https://badge.fury.io/rb/mixlib-authentication)
-
-Mixlib::Authentication provides a class-based header signing authentication
object, like the one used in Chef.
-
-## License
-- Author:: Christopher Brown ([[email protected]](mailto:[email protected]))
-- Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
-- License:: Apache License, Version 2.0
-
-```text
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile 2018-06-01 11:18:48.000000000 +0200
+++ new/Rakefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,18 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
-
-begin
- require "chefstyle"
- require "rubocop/rake_task"
- RuboCop::RakeTask.new(:style) do |task|
- task.options += ["--display-cop-names", "--no-color"]
- end
-rescue LoadError
- puts "chefstyle/rubocop is not available."
-end
-
-task :ci => [:style, :spec]
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/mixlib/authentication/digester.rb
new/lib/mixlib/authentication/digester.rb
--- old/lib/mixlib/authentication/digester.rb 2018-06-01 11:18:48.000000000
+0200
+++ new/lib/mixlib/authentication/digester.rb 2019-04-23 21:01:32.000000000
+0200
@@ -1,6 +1,6 @@
#
-# Author:: Christopher Brown (<[email protected]>)
-# Copyright:: Copyright (c) 2009 Opscode, Inc.
+# Author:: Christopher Brown (<[email protected]>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/mixlib/authentication/http_authentication_request.rb
new/lib/mixlib/authentication/http_authentication_request.rb
--- old/lib/mixlib/authentication/http_authentication_request.rb
2018-06-01 11:18:48.000000000 +0200
+++ new/lib/mixlib/authentication/http_authentication_request.rb
2019-04-23 21:01:32.000000000 +0200
@@ -1,6 +1,6 @@
#
-# Author:: Daniel DeLeo (<[email protected]>)
-# Copyright:: Copyright (c) 2010 Opscode, Inc.
+# Author:: Daniel DeLeo (<[email protected]>)
+# Copyright:: Copyright (c) 2010-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/mixlib/authentication/signatureverification.rb
new/lib/mixlib/authentication/signatureverification.rb
--- old/lib/mixlib/authentication/signatureverification.rb 2018-06-01
11:18:48.000000000 +0200
+++ new/lib/mixlib/authentication/signatureverification.rb 2019-04-23
21:01:32.000000000 +0200
@@ -1,7 +1,7 @@
#
-# Author:: Christopher Brown (<[email protected]>)
-# Author:: Christopher Walters (<[email protected]>)
-# Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
+# Author:: Christopher Brown (<[email protected]>)
+# Author:: Christopher Walters (<[email protected]>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/mixlib/authentication/signedheaderauth.rb
new/lib/mixlib/authentication/signedheaderauth.rb
--- old/lib/mixlib/authentication/signedheaderauth.rb 2018-06-01
11:18:48.000000000 +0200
+++ new/lib/mixlib/authentication/signedheaderauth.rb 2019-04-23
21:01:32.000000000 +0200
@@ -1,7 +1,7 @@
#
-# Author:: Christopher Brown (<[email protected]>)
-# Author:: Christopher Walters (<[email protected]>)
-# Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
+# Author:: Christopher Brown (<[email protected]>)
+# Author:: Christopher Walters (<[email protected]>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/mixlib/authentication/version.rb
new/lib/mixlib/authentication/version.rb
--- old/lib/mixlib/authentication/version.rb 2018-06-01 11:18:48.000000000
+0200
+++ new/lib/mixlib/authentication/version.rb 2019-04-23 21:01:32.000000000
+0200
@@ -1,4 +1,5 @@
-# Copyright:: Copyright (c) 2010-2015 Chef Software, Inc.
+#
+# Copyright:: Copyright (c) 2010-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +16,6 @@
module Mixlib
module Authentication
- VERSION = "2.1.1"
+ VERSION = "3.0.1"
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/mixlib/authentication.rb
new/lib/mixlib/authentication.rb
--- old/lib/mixlib/authentication.rb 2018-06-01 11:18:48.000000000 +0200
+++ new/lib/mixlib/authentication.rb 2019-04-23 21:01:32.000000000 +0200
@@ -1,6 +1,6 @@
#
-# Author:: Christopher Brown (<[email protected]>)
-# Copyright:: Copyright (c) 2009 Opscode, Inc.
+# Author:: Christopher Brown (<[email protected]>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2018-06-01 11:18:48.000000000 +0200
+++ new/metadata 2019-04-23 21:01:32.000000000 +0200
@@ -1,96 +1,22 @@
--- !ruby/object:Gem::Specification
name: mixlib-authentication
version: !ruby/object:Gem::Version
- version: 2.1.1
+ version: 3.0.1
platform: ruby
authors:
- Chef Software, Inc.
autorequire:
bindir: bin
cert_chain: []
-date: 2018-06-01 00:00:00.000000000 Z
-dependencies:
-- !ruby/object:Gem::Dependency
- name: rspec-core
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '3.2'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '3.2'
-- !ruby/object:Gem::Dependency
- name: rspec-expectations
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '3.2'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '3.2'
-- !ruby/object:Gem::Dependency
- name: rspec-mocks
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '3.2'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '3.2'
-- !ruby/object:Gem::Dependency
- name: chefstyle
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
-- !ruby/object:Gem::Dependency
- name: rake
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '11'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '11'
+date: 2019-04-23 00:00:00.000000000 Z
+dependencies: []
description: Mixes in simple per-request authentication
email: [email protected]
executables: []
extensions: []
extra_rdoc_files: []
files:
-- Gemfile
- LICENSE
-- NOTICE
-- README.md
-- Rakefile
- lib/mixlib/authentication.rb
- lib/mixlib/authentication/digester.rb
- lib/mixlib/authentication/http_authentication_request.rb
@@ -98,13 +24,7 @@
- lib/mixlib/authentication/signatureverification.rb
- lib/mixlib/authentication/signedheaderauth.rb
- lib/mixlib/authentication/version.rb
-- mixlib-authentication.gemspec
-- spec/mixlib/authentication/digester_spec.rb
-- spec/mixlib/authentication/http_authentication_request_spec.rb
-- spec/mixlib/authentication/mixlib_authentication_spec.rb
-- spec/mixlib/authentication/mixlib_log_missing_spec.rb
-- spec/spec_helper.rb
-homepage: https://www.chef.io
+homepage: https://github.com/chef/mixlib-authentication
licenses:
- Apache-2.0
metadata: {}
@@ -116,15 +36,14 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '0'
+ version: '2.4'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubyforge_project:
-rubygems_version: 2.7.6
+rubygems_version: 3.0.3
signing_key:
specification_version: 4
summary: Mixes in simple per-request authentication
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/mixlib-authentication.gemspec
new/mixlib-authentication.gemspec
--- old/mixlib-authentication.gemspec 2018-06-01 11:18:48.000000000 +0200
+++ new/mixlib-authentication.gemspec 1970-01-01 01:00:00.000000000 +0100
@@ -1,22 +0,0 @@
-$:.unshift(File.dirname(__FILE__) + "/lib")
-require "mixlib/authentication/version"
-
-Gem::Specification.new do |s|
- s.name = "mixlib-authentication"
- s.version = Mixlib::Authentication::VERSION
- s.platform = Gem::Platform::RUBY
- s.summary = "Mixes in simple per-request authentication"
- s.description = s.summary
- s.license = "Apache-2.0"
- s.author = "Chef Software, Inc."
- s.email = "[email protected]"
- s.homepage = "https://www.chef.io"
-
- s.require_path = "lib"
- s.files = %w{LICENSE README.md Gemfile Rakefile NOTICE} +
Dir.glob("*.gemspec") +
- Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f|
File.directory?(f) }
-
- %w{rspec-core rspec-expectations rspec-mocks}.each { |gem|
s.add_development_dependency gem, "~> 3.2" }
- s.add_development_dependency "chefstyle"
- s.add_development_dependency "rake", "~> 11"
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/mixlib/authentication/digester_spec.rb
new/spec/mixlib/authentication/digester_spec.rb
--- old/spec/mixlib/authentication/digester_spec.rb 2018-06-01
11:18:48.000000000 +0200
+++ new/spec/mixlib/authentication/digester_spec.rb 1970-01-01
01:00:00.000000000 +0100
@@ -1,24 +0,0 @@
-require "mixlib/authentication/digester"
-
-describe Mixlib::Authentication::Digester do
- context "backcompat" do
- # The digester API should really have been private,
- # however oc-chef-pedant uses it.
- let(:test_string) { "hello" }
- let(:test_string_checksum) { "qvTGHdzF6KLavt4PO0gs2a6pQ00=" }
-
- describe "#hash_file" do
- it "should default to use SHA1" do
- expect(described_class.hash_file(StringIO.new(test_string))).to(
- eq(test_string_checksum))
- end
- end
-
- describe "#hash_string" do
- it "should default to use SHA1" do
- expect(described_class.hash_string(test_string)).to(
- eq(test_string_checksum))
- end
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/spec/mixlib/authentication/http_authentication_request_spec.rb
new/spec/mixlib/authentication/http_authentication_request_spec.rb
--- old/spec/mixlib/authentication/http_authentication_request_spec.rb
2018-06-01 11:18:48.000000000 +0200
+++ new/spec/mixlib/authentication/http_authentication_request_spec.rb
1970-01-01 01:00:00.000000000 +0100
@@ -1,132 +0,0 @@
-# Author:: Daniel DeLeo (<[email protected]>)
-# Copyright:: Copyright (c) 2010 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..",
"spec_helper"))
-
-require "mixlib/authentication"
-require "mixlib/authentication/http_authentication_request"
-require "ostruct"
-require "pp"
-
-describe Mixlib::Authentication::HTTPAuthenticationRequest do
- before do
- request = Struct.new(:env, :method, :path)
-
- @timestamp_iso8601 = "2009-01-01T12:00:00Z"
- @x_ops_content_hash = "DFteJZPVv6WKdQmMqZUQUumUyRs="
- @user_id = "spec-user"
- @http_x_ops_lines = [
- "jVHrNniWzpbez/eGWjFnO6lINRIuKOg40ZTIQudcFe47Z9e/HvrszfVXlKG4",
- "NMzYZgyooSvU85qkIUmKuCqgG2AIlvYa2Q/2ctrMhoaHhLOCWWoqYNMaEqPc",
- "3tKHE+CfvP+WuPdWk4jv4wpIkAz6ZLxToxcGhXmZbXpk56YTmqgBW2cbbw4O",
- "IWPZDHSiPcw//AYNgW1CCDptt+UFuaFYbtqZegcBd2n/jzcWODA7zL4KWEUy",
- "9q4rlh/+1tBReg60QdsmDRsw/cdO1GZrKtuCwbuD4+nbRdVBKv72rqHX9cu0",
- "utju9jzczCyB+sSAQWrxSsXB/b8vV2qs0l4VD2ML+w=="]
- @merb_headers = {
- # These are used by signatureverification. An arbitrary sampling of
non-HTTP_*
- # headers are in here to exercise that code path.
- "HTTP_HOST" => "127.0.0.1",
- "HTTP_X_OPS_SIGN" => "version=1.0",
- "HTTP_X_OPS_REQUESTID" => "127.0.0.1 1258566194.85386",
- "HTTP_X_OPS_TIMESTAMP" => @timestamp_iso8601,
- "HTTP_X_OPS_CONTENT_HASH" => @x_ops_content_hash,
- "HTTP_X_OPS_USERID" => @user_id,
- "HTTP_X_OPS_AUTHORIZATION_1" => @http_x_ops_lines[0],
- "HTTP_X_OPS_AUTHORIZATION_2" => @http_x_ops_lines[1],
- "HTTP_X_OPS_AUTHORIZATION_3" => @http_x_ops_lines[2],
- "HTTP_X_OPS_AUTHORIZATION_4" => @http_x_ops_lines[3],
- "HTTP_X_OPS_AUTHORIZATION_5" => @http_x_ops_lines[4],
- "HTTP_X_OPS_AUTHORIZATION_6" => @http_x_ops_lines[5],
-
- # Random sampling
- "REMOTE_ADDR" => "127.0.0.1",
- "PATH_INFO" => "/organizations/local-test-org/cookbooks",
- "REQUEST_PATH" => "/organizations/local-test-org/cookbooks",
- "CONTENT_TYPE" => "multipart/form-data;
boundary=----RubyMultipartClient6792ZZZZZ",
- "CONTENT_LENGTH" => "394",
- }
- @request = request.new(@merb_headers, "POST", "/nodes")
- @http_authentication_request =
Mixlib::Authentication::HTTPAuthenticationRequest.new(@request)
- end
-
- it "normalizes the headers to lowercase symbols" do
- expected = { :host => "127.0.0.1",
- :x_ops_sign => "version=1.0",
- :x_ops_requestid => "127.0.0.1 1258566194.85386",
- :x_ops_timestamp => "2009-01-01T12:00:00Z",
- :x_ops_content_hash => "DFteJZPVv6WKdQmMqZUQUumUyRs=",
- :x_ops_userid => "spec-user",
- :x_ops_authorization_1 =>
"jVHrNniWzpbez/eGWjFnO6lINRIuKOg40ZTIQudcFe47Z9e/HvrszfVXlKG4",
- :x_ops_authorization_2 =>
"NMzYZgyooSvU85qkIUmKuCqgG2AIlvYa2Q/2ctrMhoaHhLOCWWoqYNMaEqPc",
- :x_ops_authorization_3 =>
"3tKHE+CfvP+WuPdWk4jv4wpIkAz6ZLxToxcGhXmZbXpk56YTmqgBW2cbbw4O",
- :x_ops_authorization_4 =>
"IWPZDHSiPcw//AYNgW1CCDptt+UFuaFYbtqZegcBd2n/jzcWODA7zL4KWEUy",
- :x_ops_authorization_5 =>
"9q4rlh/+1tBReg60QdsmDRsw/cdO1GZrKtuCwbuD4+nbRdVBKv72rqHX9cu0",
- :x_ops_authorization_6 =>
"utju9jzczCyB+sSAQWrxSsXB/b8vV2qs0l4VD2ML+w==" }
- expect(@http_authentication_request.headers).to eq(expected)
- end
-
- it "raises an error when not all required headers are given" do
- @merb_headers.delete("HTTP_X_OPS_SIGN")
- exception = Mixlib::Authentication::MissingAuthenticationHeader
- expect { Mixlib::Authentication::HTTPAuthenticationRequest.new(@request)
}.to raise_error(exception)
- end
-
- it "extracts the path from the request" do
- expect(@http_authentication_request.path).to eq("/nodes")
- end
-
- it "extracts the request method from the request" do
- expect(@http_authentication_request.http_method).to eq("POST")
- end
-
- it "extracts the signing description from the request headers" do
- expect(@http_authentication_request.signing_description).to
eq("version=1.0")
- end
-
- it "extracts the user_id from the request headers" do
- expect(@http_authentication_request.user_id).to eq("spec-user")
- end
-
- it "extracts the timestamp from the request headers" do
- expect(@http_authentication_request.timestamp).to
eq("2009-01-01T12:00:00Z")
- end
-
- it "extracts the host from the request headers" do
- expect(@http_authentication_request.host).to eq("127.0.0.1")
- end
-
- it "extracts the content hash from the request headers" do
- expect(@http_authentication_request.content_hash).to
eq("DFteJZPVv6WKdQmMqZUQUumUyRs=")
- end
-
- it "rebuilds the request signature from the headers" do
- expected = <<-SIG
-jVHrNniWzpbez/eGWjFnO6lINRIuKOg40ZTIQudcFe47Z9e/HvrszfVXlKG4
-NMzYZgyooSvU85qkIUmKuCqgG2AIlvYa2Q/2ctrMhoaHhLOCWWoqYNMaEqPc
-3tKHE+CfvP+WuPdWk4jv4wpIkAz6ZLxToxcGhXmZbXpk56YTmqgBW2cbbw4O
-IWPZDHSiPcw//AYNgW1CCDptt+UFuaFYbtqZegcBd2n/jzcWODA7zL4KWEUy
-9q4rlh/+1tBReg60QdsmDRsw/cdO1GZrKtuCwbuD4+nbRdVBKv72rqHX9cu0
-utju9jzczCyB+sSAQWrxSsXB/b8vV2qs0l4VD2ML+w==
-SIG
- expect(@http_authentication_request.request_signature).to
eq(expected.chomp)
- end
-
- it "defaults to server api version 0" do
- expect(@http_authentication_request.server_api_version).to eq("0")
- end
-
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/spec/mixlib/authentication/mixlib_authentication_spec.rb
new/spec/mixlib/authentication/mixlib_authentication_spec.rb
--- old/spec/mixlib/authentication/mixlib_authentication_spec.rb
2018-06-01 11:18:48.000000000 +0200
+++ new/spec/mixlib/authentication/mixlib_authentication_spec.rb
1970-01-01 01:00:00.000000000 +0100
@@ -1,623 +0,0 @@
-#
-# Author:: Tim Hinderliter (<[email protected]>)
-# Author:: Christopher Walters (<[email protected]>)
-# Author:: Christopher Brown (<[email protected]>)
-# Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..",
"spec_helper"))
-require "rubygems"
-
-require "ostruct"
-require "openssl"
-require "mixlib/authentication/signatureverification"
-require "time"
-require "net/ssh"
-
-# TODO: should make these regular spec-based mock objects.
-class MockRequest
- attr_accessor :env, :params, :path, :raw_post
-
- def initialize(path, params, headers, raw_post)
- @path = path
- @params = params
- @env = headers
- @raw_post = raw_post
- end
-
- def method
- "POST"
- end
-end
-
-class MockFile
- def initialize
- @have_read = nil
- end
-
- def self.length
- BODY.length
- end
-
- def read(len, out_str)
- if @have_read.nil?
- @have_read = 1
- out_str[0..-1] = BODY
- BODY
- else
- nil
- end
- end
-end
-
-# Uncomment this to get some more info from the methods we're testing.
-#Mixlib::Authentication.logger.level = :trace
-
-describe "Mixlib::Authentication::SignedHeaderAuth" do
-
- # NOTE: Version 1.0 will be the default until Chef 11 is released.
-
- it "should generate the correct string to sign and signature, version 1.0
(default)" do
-
- expect(V1_0_SIGNING_OBJECT.canonicalize_request).to
eq(V1_0_CANONICAL_REQUEST)
-
- # If you need to regenerate the constants in this test spec, print out
- # the results of res.inspect and copy them as appropriate into the
- # the constants in this file.
- expect(V1_0_SIGNING_OBJECT.sign(PRIVATE_KEY)).to
eq(EXPECTED_SIGN_RESULT_V1_0)
- end
-
- it "should generate the correct string to sign and signature, version 1.1" do
- expect(V1_1_SIGNING_OBJECT.proto_version).to eq("1.1")
- expect(V1_1_SIGNING_OBJECT.canonicalize_request).to
eq(V1_1_CANONICAL_REQUEST)
-
- # If you need to regenerate the constants in this test spec, print out
- # the results of res.inspect and copy them as appropriate into the
- # the constants in this file.
- expect(V1_1_SIGNING_OBJECT.sign(PRIVATE_KEY)).to
eq(EXPECTED_SIGN_RESULT_V1_1)
- end
-
- it "should generate the correct string to sign and signature for version 1.3
with SHA256" do
- expect(V1_3_SHA256_SIGNING_OBJECT.proto_version).to eq("1.3")
- expect(V1_3_SHA256_SIGNING_OBJECT.algorithm).to eq("sha256")
- expect(V1_3_SHA256_SIGNING_OBJECT.server_api_version).to eq("1")
- expect(V1_3_SHA256_SIGNING_OBJECT.canonicalize_request).to
eq(V1_3_SHA256_CANONICAL_REQUEST)
-
- # If you need to regenerate the constants in this test spec, print out
- # the results of res.inspect and copy them as appropriate into the
- # the constants in this file.
- expect(V1_3_SHA256_SIGNING_OBJECT.sign(PRIVATE_KEY)).to
eq(EXPECTED_SIGN_RESULT_V1_3_SHA256)
- end
-
- it "should generate the correct string to sign and signature for version 1.3
with SHA256 via ssh-agent" do
- agent = double("ssh-agent")
- expect(Net::SSH::Authentication::Agent).to
receive(:connect).and_return(agent)
- expect(agent).to receive(:sign).and_return(SSH_AGENT_RESPONSE)
- expect(V1_3_SHA256_SIGNING_OBJECT.sign(PUBLIC_KEY, use_ssh_agent:
true)).to eq(EXPECTED_SIGN_RESULT_V1_3_SHA256)
- end
-
- it "should generate the correct string to sign and signature for non-default
proto version when used as a mixin" do
- algorithm = "sha1"
- version = "1.1"
-
- V1_1_SIGNING_OBJECT.proto_version = "1.0"
- expect(V1_1_SIGNING_OBJECT.proto_version).to eq("1.0")
- expect(V1_1_SIGNING_OBJECT.canonicalize_request(algorithm, version)).to
eq(V1_1_CANONICAL_REQUEST)
-
- # If you need to regenerate the constants in this test spec, print out
- # the results of res.inspect and copy them as appropriate into the
- # the constants in this file.
- expect(V1_1_SIGNING_OBJECT.sign(PRIVATE_KEY, algorithm, version)).to
eq(EXPECTED_SIGN_RESULT_V1_1)
- expect(V1_1_SIGNING_OBJECT.sign(PRIVATE_KEY, sign_algorithm: algorithm,
sign_version: version)).to eq(EXPECTED_SIGN_RESULT_V1_1)
- end
-
- it "should not choke when signing a request for a long user id with version
1.1" do
- expect { LONG_SIGNING_OBJECT.sign(PRIVATE_KEY, "sha1", "1.1") }.not_to
raise_error
- expect { LONG_SIGNING_OBJECT.sign(PRIVATE_KEY, sign_algorithm: "sha1",
sign_version: "1.1") }.not_to raise_error
- end
-
- it "should choke when signing a request for a long user id with version 1.0"
do
- expect { LONG_SIGNING_OBJECT.sign(PRIVATE_KEY, "sha1", "1.0") }.to
raise_error(OpenSSL::PKey::RSAError)
- expect { LONG_SIGNING_OBJECT.sign(PRIVATE_KEY, sign_algorithm: "sha1",
sign_version: "1.0") }.to raise_error(OpenSSL::PKey::RSAError)
- end
-
- it "should choke when signing a request with a bad version" do
- expect { V1_1_SIGNING_OBJECT.sign(PRIVATE_KEY, "sha1", "poo") }.to
raise_error(Mixlib::Authentication::AuthenticationError)
- end
-
- it "should choke when signing a request with a bad algorithm" do
- expect { V1_1_SIGNING_OBJECT.sign(PRIVATE_KEY, "sha_poo", "1.1") }.to
raise_error(Mixlib::Authentication::AuthenticationError)
- end
-
- it "should choke when signing a request via ssh-agent and ssh-agent is not
reachable with version 1.3" do
- expect(Net::SSH::Authentication::Agent).to
receive(:connect).and_raise(Net::SSH::Authentication::AgentNotAvailable)
- expect { V1_3_SHA256_SIGNING_OBJECT.sign(PUBLIC_KEY, use_ssh_agent: true)
}.to raise_error(Mixlib::Authentication::AuthenticationError)
- end
-
- it "should choke when signing a request via ssh-agent and the key is not
loaded with version 1.3" do
- agent = double("ssh-agent")
- expect(Net::SSH::Authentication::Agent).to
receive(:connect).and_return(agent)
- expect(agent).to
receive(:sign).and_raise(Net::SSH::Authentication::AgentError)
- expect { V1_3_SHA256_SIGNING_OBJECT.sign(PUBLIC_KEY, use_ssh_agent: true)
}.to raise_error(Mixlib::Authentication::AuthenticationError)
- end
-
-end
-
-describe "Mixlib::Authentication::SignatureVerification" do
-
- before(:each) do
- @user_private_key = PRIVATE_KEY
- end
-
- it "should authenticate a File-containing request V1.1 - Merb" do
- request_params = MERB_REQUEST_PARAMS.clone
- request_params["file"] =
- { "size" => MockFile.length, "content_type" =>
"application/octet-stream", "filename" => "zsh.tar.gz", "tempfile" =>
MockFile.new }
-
- mock_request = MockRequest.new(PATH, request_params, MERB_HEADERS_V1_1, "")
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- service = Mixlib::Authentication::SignatureVerification.new
- res = service.authenticate_user_request(mock_request, @user_private_key)
- expect(res).not_to be_nil
- end
-
- it "should authenticate a File-containing request V1.3 SHA256 - Merb" do
- request_params = MERB_REQUEST_PARAMS.clone
- request_params["file"] =
- { "size" => MockFile.length, "content_type" =>
"application/octet-stream", "filename" => "zsh.tar.gz", "tempfile" =>
MockFile.new }
-
- mock_request = MockRequest.new(PATH, request_params,
MERB_HEADERS_V1_3_SHA256, "")
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- service = Mixlib::Authentication::SignatureVerification.new
- res = service.authenticate_user_request(mock_request, @user_private_key)
- expect(res).not_to be_nil
- end
-
- it "should authenticate a File-containing request from a v1.0 client -
Passenger" do
- request_params = PASSENGER_REQUEST_PARAMS.clone
- request_params["tarball"] = MockFile.new
-
- mock_request = MockRequest.new(PATH, request_params,
PASSENGER_HEADERS_V1_0, "")
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- auth_req = Mixlib::Authentication::SignatureVerification.new
- res = auth_req.authenticate_user_request(mock_request, @user_private_key)
- expect(res).not_to be_nil
- end
-
- it "should authenticate a normal (post body) request v1.3 SHA256 - Merb" do
- mock_request = MockRequest.new(PATH, MERB_REQUEST_PARAMS,
MERB_HEADERS_V1_3_SHA256, BODY)
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- service = Mixlib::Authentication::SignatureVerification.new
- res = service.authenticate_user_request(mock_request, @user_private_key)
- expect(res).not_to be_nil
- end
-
- it "should authenticate a normal (post body) request v1.1 - Merb" do
- mock_request = MockRequest.new(PATH, MERB_REQUEST_PARAMS,
MERB_HEADERS_V1_1, BODY)
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- service = Mixlib::Authentication::SignatureVerification.new
- res = service.authenticate_user_request(mock_request, @user_private_key)
- expect(res).not_to be_nil
- end
-
- it "should authenticate a normal (post body) request from a v1.0 client -
Merb" do
- mock_request = MockRequest.new(PATH, MERB_REQUEST_PARAMS,
MERB_HEADERS_V1_0, BODY)
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- service = Mixlib::Authentication::SignatureVerification.new
- res = service.authenticate_user_request(mock_request, @user_private_key)
- expect(res).not_to be_nil
- end
-
- it "shouldn't authenticate if an Authorization header is missing" do
- headers = MERB_HEADERS_V1_1.clone
- headers.delete("HTTP_X_OPS_SIGN")
-
- mock_request = MockRequest.new(PATH, MERB_REQUEST_PARAMS, headers, BODY)
- allow(Time).to receive(:now).and_return(TIMESTAMP_OBJ)
- #Time.stub!(:now).and_return(TIMESTAMP_OBJ)
-
- auth_req = Mixlib::Authentication::SignatureVerification.new
- expect { auth_req.authenticate_user_request(mock_request,
@user_private_key) }.to raise_error(Mixlib::Authentication::AuthenticationError)
-
- expect(auth_req).not_to be_a_valid_request
- expect(auth_req).not_to be_a_valid_timestamp
- expect(auth_req).not_to be_a_valid_signature
- expect(auth_req).not_to be_a_valid_content_hash
- end
-
- it "shouldn't authenticate if Authorization header is wrong" do
- headers = MERB_HEADERS_V1_1.clone
- headers["HTTP_X_OPS_CONTENT_HASH"] += "_"
-
- mock_request = MockRequest.new(PATH, MERB_REQUEST_PARAMS, headers, BODY)
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- auth_req = Mixlib::Authentication::SignatureVerification.new
- res = auth_req.authenticate_user_request(mock_request, @user_private_key)
- expect(res).to be_nil
-
- expect(auth_req).not_to be_a_valid_request
- expect(auth_req).to be_a_valid_timestamp
- expect(auth_req).to be_a_valid_signature
- expect(auth_req).not_to be_a_valid_content_hash
- end
-
- it "shouldn't authenticate if the timestamp is not within bounds" do
- mock_request = MockRequest.new(PATH, MERB_REQUEST_PARAMS,
MERB_HEADERS_V1_1, BODY)
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ -
1000)
-
- auth_req = Mixlib::Authentication::SignatureVerification.new
- res = auth_req.authenticate_user_request(mock_request, @user_private_key)
- expect(res).to be_nil
- expect(auth_req).not_to be_a_valid_request
- expect(auth_req).not_to be_a_valid_timestamp
- expect(auth_req).to be_a_valid_signature
- expect(auth_req).to be_a_valid_content_hash
- end
-
- it "shouldn't authenticate if the signature is wrong" do
- headers = MERB_HEADERS_V1_1.dup
- headers["HTTP_X_OPS_AUTHORIZATION_1"] = "epicfail"
- mock_request = MockRequest.new(PATH, MERB_REQUEST_PARAMS, headers, BODY)
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- auth_req = Mixlib::Authentication::SignatureVerification.new
- res = auth_req.authenticate_user_request(mock_request, @user_private_key)
- expect(res).to be_nil
- expect(auth_req).not_to be_a_valid_request
- expect(auth_req).not_to be_a_valid_signature
- expect(auth_req).to be_a_valid_timestamp
- expect(auth_req).to be_a_valid_content_hash
- end
-
- it "shouldn't authenticate if the signature is wrong for v1.3 SHA256" do
- headers = MERB_HEADERS_V1_3_SHA256.dup
- headers["HTTP_X_OPS_AUTHORIZATION_1"] = "epicfail"
- mock_request = MockRequest.new(PATH, MERB_REQUEST_PARAMS, headers, BODY)
- expect(Time).to receive(:now).at_least(:once).and_return(TIMESTAMP_OBJ)
-
- auth_req = Mixlib::Authentication::SignatureVerification.new
- res = auth_req.authenticate_user_request(mock_request, @user_private_key)
- expect(res).to be_nil
- expect(auth_req).not_to be_a_valid_request
- expect(auth_req).not_to be_a_valid_signature
- expect(auth_req).to be_a_valid_timestamp
- expect(auth_req).to be_a_valid_content_hash
- end
-end
-
-USER_ID = "spec-user"
-DIGESTED_USER_ID = Base64.encode64(Digest::SHA1.new.digest(USER_ID)).chomp
-BODY = "Spec Body"
-HASHED_BODY = "DFteJZPVv6WKdQmMqZUQUumUyRs=" #
Base64.encode64(Digest::SHA1.digest("Spec Body")).chomp
-HASHED_BODY_SHA256 = "hDlKNZhIhgso3Fs0S0pZwJ0xyBWtR1RBaeHs1DrzOho="
-TIMESTAMP_ISO8601 = "2009-01-01T12:00:00Z"
-TIMESTAMP_OBJ = Time.parse("Thu Jan 01 12:00:00 -0000 2009")
-PATH = "/organizations/clownco"
-HASHED_CANONICAL_PATH = "YtBWDn1blGGuFIuKksdwXzHU9oE=" #
Base64.encode64(Digest::SHA1.digest("/organizations/clownco")).chomp
-
-V1_0_ARGS = {
- :body => BODY,
- :user_id => USER_ID,
- :http_method => :post,
- :timestamp => TIMESTAMP_ISO8601, # fixed timestamp so we get back the
same answer each time.
- :file => MockFile.new,
- :path => PATH,
-}
-
-V1_1_ARGS = {
- :body => BODY,
- :user_id => USER_ID,
- :http_method => :post,
- :timestamp => TIMESTAMP_ISO8601, # fixed timestamp so we get back the
same answer each time.
- :file => MockFile.new,
- :path => PATH,
- :proto_version => 1.1,
-}
-
-V1_3_ARGS_SHA256 = {
- :body => BODY,
- :user_id => USER_ID,
- :http_method => :post,
- :timestamp => TIMESTAMP_ISO8601, # fixed timestamp so we get back the
same answer each time.
- :file => MockFile.new,
- :path => PATH,
- :proto_version => "1.3",
- :headers => {
- "X-OpS-SeRvEr-ApI-VerSiOn" => "1",
- }
- # This defaults to sha256
-}
-
-LONG_PATH_LONG_USER_ARGS = {
- :body => BODY,
- :user_id => "A" * 200,
- :http_method => :put,
- :timestamp => TIMESTAMP_ISO8601, # fixed timestamp so we get back the same
answer each time.
- :file => MockFile.new,
- :path => PATH + "/nodes/#{"A" * 250}",
-}
-
-REQUESTING_ACTOR_ID = "c0f8a68c52bffa1020222a56b23cccfa"
-
-# Content hash is ???TODO
-X_OPS_CONTENT_HASH = "DFteJZPVv6WKdQmMqZUQUumUyRs="
-X_OPS_CONTENT_HASH_SHA256 = "hDlKNZhIhgso3Fs0S0pZwJ0xyBWtR1RBaeHs1DrzOho="
-
-X_OPS_AUTHORIZATION_LINES_V1_0 = [
-"jVHrNniWzpbez/eGWjFnO6lINRIuKOg40ZTIQudcFe47Z9e/HvrszfVXlKG4",
-"NMzYZgyooSvU85qkIUmKuCqgG2AIlvYa2Q/2ctrMhoaHhLOCWWoqYNMaEqPc",
-"3tKHE+CfvP+WuPdWk4jv4wpIkAz6ZLxToxcGhXmZbXpk56YTmqgBW2cbbw4O",
-"IWPZDHSiPcw//AYNgW1CCDptt+UFuaFYbtqZegcBd2n/jzcWODA7zL4KWEUy",
-"9q4rlh/+1tBReg60QdsmDRsw/cdO1GZrKtuCwbuD4+nbRdVBKv72rqHX9cu0",
-"utju9jzczCyB+sSAQWrxSsXB/b8vV2qs0l4VD2ML+w==",
-]
-
-X_OPS_AUTHORIZATION_LINES = [
-"UfZD9dRz6rFu6LbP5Mo1oNHcWYxpNIcUfFCffJS1FQa0GtfU/vkt3/O5HuCM",
-"1wIFl/U0f5faH9EWpXWY5NwKR031Myxcabw4t4ZLO69CIh/3qx1XnjcZvt2w",
-"c2R9bx/43IWA/r8w8Q6decuu0f6ZlNheJeJhaYPI8piX/aH+uHBH8zTACZu8",
-"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A#BV\xB0g\xA5\xEE\x92\x8BX\x14\xFC\x99~\xADyQH\xD6\xCB'\x81\xA5\x02\xB0\x0F\xB8\xBF{\xEA$\xD8%<\xC42f\xCBP\x89\xB7%\x16\"\xD3F\e\xD3R\x14\b\"\x9D#\xDD/R\xADG\x1C\xDBeLK\xBD\xDD\x86_A\xA2pG\x15\xE5\x1A@\x8D\xC0\x82^\x7F.=C6\x82
K\xB5^#\xB1\xE4\x99\xFE\xE0i\xA4\xAD\x97!\xFD\x1A\xCA\xF5\\\xD0Yx,\xFB"
-# We expect Mixlib::Authentication::SignedHeaderAuth#sign to return this
-# if passed the BODY above, based on version
-
-EXPECTED_SIGN_RESULT_V1_0 = {
- "X-Ops-Content-Hash" => X_OPS_CONTENT_HASH,
- "X-Ops-Userid" => USER_ID,
- "X-Ops-Sign" => "algorithm=sha1;version=1.0;",
- "X-Ops-Authorization-1" => X_OPS_AUTHORIZATION_LINES_V1_0[0],
- "X-Ops-Authorization-2" => X_OPS_AUTHORIZATION_LINES_V1_0[1],
- "X-Ops-Authorization-3" => X_OPS_AUTHORIZATION_LINES_V1_0[2],
- "X-Ops-Authorization-4" => X_OPS_AUTHORIZATION_LINES_V1_0[3],
- "X-Ops-Authorization-5" => X_OPS_AUTHORIZATION_LINES_V1_0[4],
- "X-Ops-Authorization-6" => X_OPS_AUTHORIZATION_LINES_V1_0[5],
- "X-Ops-Timestamp" => TIMESTAMP_ISO8601,
-}
-
-EXPECTED_SIGN_RESULT_V1_1 = {
- "X-Ops-Content-Hash" => X_OPS_CONTENT_HASH,
- "X-Ops-Userid" => USER_ID,
- "X-Ops-Sign" => "algorithm=sha1;version=1.1;",
- "X-Ops-Authorization-1" => X_OPS_AUTHORIZATION_LINES[0],
- "X-Ops-Authorization-2" => X_OPS_AUTHORIZATION_LINES[1],
- "X-Ops-Authorization-3" => X_OPS_AUTHORIZATION_LINES[2],
- "X-Ops-Authorization-4" => X_OPS_AUTHORIZATION_LINES[3],
- "X-Ops-Authorization-5" => X_OPS_AUTHORIZATION_LINES[4],
- "X-Ops-Authorization-6" => X_OPS_AUTHORIZATION_LINES[5],
- "X-Ops-Timestamp" => TIMESTAMP_ISO8601,
-}
-
-EXPECTED_SIGN_RESULT_V1_3_SHA256 = {
- "X-Ops-Content-Hash" => X_OPS_CONTENT_HASH_SHA256,
- "X-Ops-Userid" => USER_ID,
- "X-Ops-Sign" => "algorithm=sha256;version=1.3;",
- "X-Ops-Authorization-1" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[0],
- "X-Ops-Authorization-2" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[1],
- "X-Ops-Authorization-3" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[2],
- "X-Ops-Authorization-4" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[3],
- "X-Ops-Authorization-5" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[4],
- "X-Ops-Authorization-6" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[5],
- "X-Ops-Timestamp" => TIMESTAMP_ISO8601,
-}
-
-OTHER_HEADERS = {
- # An arbitrary sampling of non-HTTP_* headers are in here to
- # exercise that code path.
- "REMOTE_ADDR" => "127.0.0.1",
- "PATH_INFO" => "/organizations/local-test-org/cookbooks",
- "REQUEST_PATH" => "/organizations/local-test-org/cookbooks",
- "CONTENT_TYPE" => "multipart/form-data;
boundary=----RubyMultipartClient6792ZZZZZ",
- "CONTENT_LENGTH" => "394",
-}
-
-# This is what will be in request.params for the Merb case.
-MERB_REQUEST_PARAMS = {
- "name" => "zsh", "action" => "create", "controller" =>
"chef_server_api/cookbooks",
- "organization_id" => "local-test-org", "requesting_actor_id" =>
REQUESTING_ACTOR_ID
-}
-
-MERB_HEADERS_V1_3_SHA256 = {
- # These are used by signatureverification.
- "HTTP_HOST" => "127.0.0.1",
- "HTTP_X_OPS_SIGN" => "algorithm=sha256;version=1.3;",
- "HTTP_X_OPS_REQUESTID" => "127.0.0.1 1258566194.85386",
- "HTTP_X_OPS_TIMESTAMP" => TIMESTAMP_ISO8601,
- "HTTP_X_OPS_CONTENT_HASH" => X_OPS_CONTENT_HASH_SHA256,
- "HTTP_X_OPS_USERID" => USER_ID,
- "HTTP_X_OPS_SERVER_API_VERSION" => "1",
- "HTTP_X_OPS_AUTHORIZATION_1" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[0],
- "HTTP_X_OPS_AUTHORIZATION_2" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[1],
- "HTTP_X_OPS_AUTHORIZATION_3" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[2],
- "HTTP_X_OPS_AUTHORIZATION_4" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[3],
- "HTTP_X_OPS_AUTHORIZATION_5" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[4],
- "HTTP_X_OPS_AUTHORIZATION_6" => X_OPS_AUTHORIZATION_LINES_V1_3_SHA256[5],
-}.merge(OTHER_HEADERS)
-
-# Tis is what will be in request.env for the Merb case.
-MERB_HEADERS_V1_1 = {
- # These are used by signatureverification.
- "HTTP_HOST" => "127.0.0.1",
- "HTTP_X_OPS_SIGN" => "algorithm=sha1;version=1.1;",
- "HTTP_X_OPS_REQUESTID" => "127.0.0.1 1258566194.85386",
- "HTTP_X_OPS_TIMESTAMP" => TIMESTAMP_ISO8601,
- "HTTP_X_OPS_CONTENT_HASH" => X_OPS_CONTENT_HASH,
- "HTTP_X_OPS_USERID" => USER_ID,
- "HTTP_X_OPS_AUTHORIZATION_1" => X_OPS_AUTHORIZATION_LINES[0],
- "HTTP_X_OPS_AUTHORIZATION_2" => X_OPS_AUTHORIZATION_LINES[1],
- "HTTP_X_OPS_AUTHORIZATION_3" => X_OPS_AUTHORIZATION_LINES[2],
- "HTTP_X_OPS_AUTHORIZATION_4" => X_OPS_AUTHORIZATION_LINES[3],
- "HTTP_X_OPS_AUTHORIZATION_5" => X_OPS_AUTHORIZATION_LINES[4],
- "HTTP_X_OPS_AUTHORIZATION_6" => X_OPS_AUTHORIZATION_LINES[5],
-}.merge(OTHER_HEADERS)
-
-# Tis is what will be in request.env for the Merb case.
-MERB_HEADERS_V1_0 = {
- # These are used by signatureverification.
- "HTTP_HOST" => "127.0.0.1",
- "HTTP_X_OPS_SIGN" => "version=1.0",
- "HTTP_X_OPS_REQUESTID" => "127.0.0.1 1258566194.85386",
- "HTTP_X_OPS_TIMESTAMP" => TIMESTAMP_ISO8601,
- "HTTP_X_OPS_CONTENT_HASH" => X_OPS_CONTENT_HASH,
- "HTTP_X_OPS_USERID" => USER_ID,
- "HTTP_X_OPS_AUTHORIZATION_1" => X_OPS_AUTHORIZATION_LINES_V1_0[0],
- "HTTP_X_OPS_AUTHORIZATION_2" => X_OPS_AUTHORIZATION_LINES_V1_0[1],
- "HTTP_X_OPS_AUTHORIZATION_3" => X_OPS_AUTHORIZATION_LINES_V1_0[2],
- "HTTP_X_OPS_AUTHORIZATION_4" => X_OPS_AUTHORIZATION_LINES_V1_0[3],
- "HTTP_X_OPS_AUTHORIZATION_5" => X_OPS_AUTHORIZATION_LINES_V1_0[4],
- "HTTP_X_OPS_AUTHORIZATION_6" => X_OPS_AUTHORIZATION_LINES_V1_0[5],
-}.merge(OTHER_HEADERS)
-
-PASSENGER_REQUEST_PARAMS = {
- "action" => "create",
- #"tarball"=>#<File:/tmp/RackMultipart20091120-25570-mgq2sa-0>,
- "controller" => "api/v1/cookbooks",
- "cookbook" => "{\"category\":\"databases\"}",
-}
-
-PASSENGER_HEADERS_V1_1 = {
- # These are used by signatureverification.
- "HTTP_HOST" => "127.0.0.1",
- "HTTP_X_OPS_SIGN" => "algorithm=sha1;version=1.1;",
- "HTTP_X_OPS_REQUESTID" => "127.0.0.1 1258566194.85386",
- "HTTP_X_OPS_TIMESTAMP" => TIMESTAMP_ISO8601,
- "HTTP_X_OPS_CONTENT_HASH" => X_OPS_CONTENT_HASH,
- "HTTP_X_OPS_USERID" => USER_ID,
- "HTTP_X_OPS_AUTHORIZATION_1" => X_OPS_AUTHORIZATION_LINES[0],
- "HTTP_X_OPS_AUTHORIZATION_2" => X_OPS_AUTHORIZATION_LINES[1],
- "HTTP_X_OPS_AUTHORIZATION_3" => X_OPS_AUTHORIZATION_LINES[2],
- "HTTP_X_OPS_AUTHORIZATION_4" => X_OPS_AUTHORIZATION_LINES[3],
- "HTTP_X_OPS_AUTHORIZATION_5" => X_OPS_AUTHORIZATION_LINES[4],
- "HTTP_X_OPS_AUTHORIZATION_6" => X_OPS_AUTHORIZATION_LINES[5],
-}.merge(OTHER_HEADERS)
-
-PASSENGER_HEADERS_V1_0 = {
- # These are used by signatureverification.
- "HTTP_HOST" => "127.0.0.1",
- "HTTP_X_OPS_SIGN" => "version=1.0",
- "HTTP_X_OPS_REQUESTID" => "127.0.0.1 1258566194.85386",
- "HTTP_X_OPS_TIMESTAMP" => TIMESTAMP_ISO8601,
- "HTTP_X_OPS_CONTENT_HASH" => X_OPS_CONTENT_HASH,
- "HTTP_X_OPS_USERID" => USER_ID,
- "HTTP_X_OPS_AUTHORIZATION_1" => X_OPS_AUTHORIZATION_LINES_V1_0[0],
- "HTTP_X_OPS_AUTHORIZATION_2" => X_OPS_AUTHORIZATION_LINES_V1_0[1],
- "HTTP_X_OPS_AUTHORIZATION_3" => X_OPS_AUTHORIZATION_LINES_V1_0[2],
- "HTTP_X_OPS_AUTHORIZATION_4" => X_OPS_AUTHORIZATION_LINES_V1_0[3],
- "HTTP_X_OPS_AUTHORIZATION_5" => X_OPS_AUTHORIZATION_LINES_V1_0[4],
- "HTTP_X_OPS_AUTHORIZATION_6" => X_OPS_AUTHORIZATION_LINES_V1_0[5],
-}.merge(OTHER_HEADERS)
-
-# generated with
-# openssl genrsa -out private.pem 2048
-# openssl rsa -in private.pem -out public.pem -pubout
-PUBLIC_KEY_DATA = <<EOS
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ueqo76MXuP6XqZBILFz
-iH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EY_DATA)
-
-V1_0_CANONICAL_REQUEST_DATA = <<EOS
-Method:POST
-Hashed Path:#{HASHED_CANONICAL_PATH}
-X-Ops-Content-Hash:#{HASHED_BODY}
-X-Ops-Timestamp:#{TIMESTAMP_ISO8601}
-X-Ops-UserId:#{USER_ID}
-EOS
-V1_0_CANONICAL_REQUEST = V1_0_CANONICAL_REQUEST_DATA.chomp
-
-V1_1_CANONICAL_REQUEST_DATA = <<EOS
-Method:POST
-Hashed Path:#{HASHED_CANONICAL_PATH}
-X-Ops-Content-Hash:#{HASHED_BODY}
-X-Ops-Timestamp:#{TIMESTAMP_ISO8601}
-X-Ops-UserId:#{DIGESTED_USER_ID}
-EOS
-V1_1_CANONICAL_REQUEST = V1_1_CANONICAL_REQUEST_DATA.chomp
-
-V1_3_SHA256_CANONICAL_REQUEST_DATA = <<EOS
-Method:POST
-Path:#{PATH}
-X-Ops-Content-Hash:#{HASHED_BODY_SHA256}
-X-Ops-Sign:version=1.3
-X-Ops-Timestamp:#{TIMESTAMP_ISO8601}
-X-Ops-UserId:#{USER_ID}
-X-Ops-Server-API-Version:1
-EOS
-V1_3_SHA256_CANONICAL_REQUEST = V1_3_SHA256_CANONICAL_REQUEST_DATA.chomp
-
-V1_3_SHA256_SIGNING_OBJECT =
Mixlib::Authentication::SignedHeaderAuth.signing_object(V1_3_ARGS_SHA256)
-V1_1_SIGNING_OBJECT =
Mixlib::Authentication::SignedHeaderAuth.signing_object(V1_1_ARGS)
-V1_0_SIGNING_OBJECT =
Mixlib::Authentication::SignedHeaderAuth.signing_object(V1_0_ARGS)
-LONG_SIGNING_OBJECT =
Mixlib::Authentication::SignedHeaderAuth.signing_object(LONG_PATH_LONG_USER_ARGS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/spec/mixlib/authentication/mixlib_log_missing_spec.rb
new/spec/mixlib/authentication/mixlib_log_missing_spec.rb
--- old/spec/mixlib/authentication/mixlib_log_missing_spec.rb 2018-06-01
11:18:48.000000000 +0200
+++ new/spec/mixlib/authentication/mixlib_log_missing_spec.rb 1970-01-01
01:00:00.000000000 +0100
@@ -1,55 +0,0 @@
-describe "Mixlib::Authentication::Log" do
- before do
- Mixlib::Authentication.send(:remove_const, "DEFAULT_SERVER_API_VERSION")
- Mixlib::Authentication.send(:remove_const, "Log")
- end
-
- context "without mixlib-log" do
- before do
- @mixlib_path = $LOAD_PATH.find { |p| p.match("mixlib-log") }
- $LOAD_PATH.reject! { |p| p.match("mixlib-log") }
-
- load "mixlib/authentication.rb"
- end
-
- after do
- $LOAD_PATH.unshift(@mixlib_path)
- end
-
- it "uses MixlibLogMissing" do
- expect(Mixlib::Authentication::Log.singleton_class.included_modules)
- .to include(Mixlib::Authentication::NullLogger)
- end
-
- it "default log level is :error" do
- expect(Mixlib::Authentication::Log.level).to eq(:error)
- end
-
- %w{trace debug info warn error fatal}.each do |level|
- it "logs at level #{level}" do
- expect(Mixlib::Authentication::Log).to receive(level).with("foo")
-
- Mixlib::Authentication.logger.send(level, "foo")
- end
- end
- end
-
- context "with mixlib-log" do
- before do
- load "mixlib/authentication.rb"
- end
-
- it "uses Mixlib::Log" do
- expect(Mixlib::Authentication::Log.singleton_class.included_modules)
- .to include(Mixlib::Log)
- end
-
- %w{trace debug info warn error fatal}.each do |level|
- it "forward #{level} to mixlib-log" do
- expect_any_instance_of(Mixlib::Log).to receive(level).with("foo")
-
- Mixlib::Authentication.logger.send(level, "foo")
- end
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb
--- old/spec/spec_helper.rb 2018-06-01 11:18:48.000000000 +0200
+++ new/spec/spec_helper.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,22 +0,0 @@
-#
-# Author:: Tim Hinderliter (<[email protected]>)
-# Author:: Christopher Walters (<[email protected]>)
-# Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-$:.unshift File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")) #
lib in mixlib-authentication
-
-require "rubygems"