witness 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +37 -0
- data/Rakefile +49 -0
- data/TODO +11 -0
- data/VERSION +1 -0
- data/lib/witness/base.rb +89 -0
- data/lib/witness/error.rb +6 -0
- data/lib/witness.rb +23 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/support/sample_base.rb +15 -0
- data/spec/support/sample_verification_request.rb +29 -0
- data/spec/support/sample_verification_response.rb +62 -0
- data/spec/witness/base_spec.rb +94 -0
- data/spec/witness/sample_verification_request_spec.rb +130 -0
- data/spec/witness/sample_verification_response_spec.rb +168 -0
- data/spec/witness_spec.rb +51 -0
- data/witness.gemspec +88 -0
- metadata +204 -0
data/.document
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (3.0.3)
|
5
|
+
diff-lcs (1.1.2)
|
6
|
+
git (1.2.5)
|
7
|
+
i18n (0.5.0)
|
8
|
+
jeweler (1.5.1)
|
9
|
+
bundler (~> 1.0.0)
|
10
|
+
git (>= 1.2.5)
|
11
|
+
rake
|
12
|
+
rack (1.2.1)
|
13
|
+
rake (0.8.7)
|
14
|
+
rcov (0.9.9)
|
15
|
+
rspec (2.1.0)
|
16
|
+
rspec-core (~> 2.1.0)
|
17
|
+
rspec-expectations (~> 2.1.0)
|
18
|
+
rspec-mocks (~> 2.1.0)
|
19
|
+
rspec-core (2.1.0)
|
20
|
+
rspec-expectations (2.1.0)
|
21
|
+
diff-lcs (~> 1.1.2)
|
22
|
+
rspec-mocks (2.1.0)
|
23
|
+
sigil (1.0.0)
|
24
|
+
activesupport (>= 3.0.0)
|
25
|
+
i18n
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
activesupport (>= 3.0.0)
|
32
|
+
bundler (~> 1.0.0)
|
33
|
+
jeweler (~> 1.5.1)
|
34
|
+
rack
|
35
|
+
rcov
|
36
|
+
rspec (~> 2.1.0)
|
37
|
+
sigil (>= 1.0.0)
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "witness"
|
16
|
+
gem.homepage = "http://github.com/steveh/witness"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = "Witness"
|
19
|
+
gem.description = "Witness"
|
20
|
+
gem.email = "steve@seven.net.nz"
|
21
|
+
gem.authors = ["Steve Hoeksema"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
gem.add_development_dependency 'rspec', '>= 2.1.0'
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rake/rdoctask'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "witness #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/TODO
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# def self.request(params)
|
2
|
+
# raise Error, "Provided params must be a Hash" unless params.kind_of?(Hash)
|
3
|
+
# raise Error, "Provided params not set" if params.empty?
|
4
|
+
# end
|
5
|
+
#
|
6
|
+
# def self.witness(params, key, slice_slug)
|
7
|
+
# raise Error, "Provided params must be a Hash" unless params.kind_of?(Hash)
|
8
|
+
# raise Error, "Provided params not set" if params.empty?
|
9
|
+
# raise Error, "Key not set" if key.blank?
|
10
|
+
# raise Error, "Expected slice slug not set" if slice_slug.blank?
|
11
|
+
# end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0
|
data/lib/witness/base.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
module Witness
|
2
|
+
class Base
|
3
|
+
VALID_TYPES = [:string, :integer, :symbol]
|
4
|
+
|
5
|
+
class_inheritable_accessor :actions, :presence, :columns
|
6
|
+
|
7
|
+
self.actions ||= []
|
8
|
+
self.columns ||= {}
|
9
|
+
self.presence ||= {}
|
10
|
+
|
11
|
+
def self.action(*action_names)
|
12
|
+
[*action_names].each do |action_name|
|
13
|
+
self.actions << action_name.to_sym
|
14
|
+
|
15
|
+
class_eval <<-end_eval
|
16
|
+
def self.#{action_name.to_sym}(provided_params)
|
17
|
+
command = "#{action_name}".to_sym
|
18
|
+
construct(provided_params.update(:command => command))
|
19
|
+
end
|
20
|
+
end_eval
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.column(column, *attr_names)
|
25
|
+
configuration = { :type => :string, :name => column.to_s.humanize }
|
26
|
+
configuration.update(attr_names.extract_options!)
|
27
|
+
|
28
|
+
self.columns[column] = configuration
|
29
|
+
|
30
|
+
attr_accessor column
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.validates_presence_of(*attr_names)
|
34
|
+
configuration = { :on => self.actions }
|
35
|
+
configuration.update(attr_names.extract_options!)
|
36
|
+
|
37
|
+
[*configuration[:on]].each do |on|
|
38
|
+
self.presence[on] ||= []
|
39
|
+
|
40
|
+
[*attr_names].each do |attr_name|
|
41
|
+
self.presence[on] << attr_name
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
protected :initialize
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def self.construct(provided_params)
|
51
|
+
command = provided_params[:command]
|
52
|
+
|
53
|
+
result = new
|
54
|
+
|
55
|
+
self.columns.each do |column, configuration|
|
56
|
+
if provided_params[column] == nil || provided_params[column] == ""
|
57
|
+
if self.presence[command] && self.presence[command].include?(column)
|
58
|
+
raise Witness::Error, "#{configuration[:name]} not set"
|
59
|
+
end
|
60
|
+
else
|
61
|
+
value = case configuration[:type]
|
62
|
+
when :string
|
63
|
+
provided_params[column].to_s
|
64
|
+
when :integer
|
65
|
+
provided_params[column].to_i
|
66
|
+
when :symbol
|
67
|
+
provided_params[column].to_sym
|
68
|
+
when :boolean
|
69
|
+
case provided_params[column]
|
70
|
+
when true, "true", 1, "1"
|
71
|
+
true
|
72
|
+
when false, "false", 0, "0"
|
73
|
+
false
|
74
|
+
else
|
75
|
+
raise Witness::Error, "#{configuration[:name]} not valid: #{provided_params[column].inspect}"
|
76
|
+
end
|
77
|
+
else
|
78
|
+
provided_params[column]
|
79
|
+
end
|
80
|
+
|
81
|
+
result.send("#{column.to_s}=", value)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
result
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
data/lib/witness.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "active_support/core_ext/class/inheritable_attributes"
|
2
|
+
require "uri"
|
3
|
+
require "rack/utils"
|
4
|
+
require "sigil"
|
5
|
+
|
6
|
+
require "witness/base"
|
7
|
+
require "witness/error"
|
8
|
+
|
9
|
+
module Witness
|
10
|
+
|
11
|
+
def self.update_url(url, new_params)
|
12
|
+
uri = URI.parse(url)
|
13
|
+
query = uri.query
|
14
|
+
params = Rack::Utils.parse_nested_query(query).symbolize_keys
|
15
|
+
uri.path = "/" if uri.path == ""
|
16
|
+
uri.scheme = "http" if uri.scheme.nil?
|
17
|
+
uri.query = params.update(new_params).to_query
|
18
|
+
uri.to_s
|
19
|
+
rescue
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'witness'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class SampleBase < Witness::Base
|
2
|
+
|
3
|
+
action :generate, :receive
|
4
|
+
|
5
|
+
column :first_name
|
6
|
+
column :last_name, :type => :string, :name => "Person last name"
|
7
|
+
column :age, :type => :integer
|
8
|
+
column :base_type, :type => :symbol
|
9
|
+
column :data, :type => nil
|
10
|
+
|
11
|
+
validates_presence_of :first_name, :age
|
12
|
+
validates_presence_of :last_name, :on => :generate
|
13
|
+
validates_presence_of :base_type, :on => :receive
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class SampleVerificationRequest < Witness::Base
|
2
|
+
|
3
|
+
action :generate, :receive
|
4
|
+
|
5
|
+
column :cas_host, :name => "CAS host"
|
6
|
+
column :slice_slug, :name => "Slice"
|
7
|
+
column :secure_area_id, :type => :integer, :name => "Secure Area ID"
|
8
|
+
column :request_url, :name => "Request URL"
|
9
|
+
column :receive_contact_url, :name => "Receive Contact URL"
|
10
|
+
column :receive_login_url, :name => "Receive Login URL"
|
11
|
+
|
12
|
+
validates_presence_of :slice_slug, :secure_area_id, :request_url, :receive_contact_url, :receive_login_url
|
13
|
+
validates_presence_of :cas_host, :on => :generate
|
14
|
+
|
15
|
+
def url
|
16
|
+
Witness.update_url("http://#{cas_host}/cas/contact/witness", params)
|
17
|
+
end
|
18
|
+
|
19
|
+
def params
|
20
|
+
{
|
21
|
+
:slice_slug => slice_slug,
|
22
|
+
:secure_area_id => secure_area_id,
|
23
|
+
:request_url => request_url,
|
24
|
+
:receive_contact_url => receive_contact_url,
|
25
|
+
:receive_login_url => receive_login_url,
|
26
|
+
}.reject { |k, v| v.nil? }
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
class SampleVerificationResponse < Witness::Base
|
2
|
+
|
3
|
+
action :generate, :receive
|
4
|
+
|
5
|
+
column :slice_slug, :name => "Slice"
|
6
|
+
column :secure_area_id, :type => :integer, :name => "Secure Area ID"
|
7
|
+
column :request_url, :name => "Request URL"
|
8
|
+
column :receive_contact_url, :name => "Receive Contact URL"
|
9
|
+
column :contact_id, :type => :integer, :name => "Contact ID"
|
10
|
+
column :authorized, :type => :boolean, :name => "Authorization"
|
11
|
+
column :key
|
12
|
+
|
13
|
+
validates_presence_of :slice_slug, :request_url, :contact_id, :key
|
14
|
+
validates_presence_of :receive_contact_url, :on => :generate
|
15
|
+
|
16
|
+
attr_accessor :signature
|
17
|
+
|
18
|
+
def url
|
19
|
+
Witness.update_url(receive_contact_url, params)
|
20
|
+
end
|
21
|
+
|
22
|
+
def secure_params
|
23
|
+
{
|
24
|
+
:slice_slug => slice_slug,
|
25
|
+
:contact_id => contact_id,
|
26
|
+
:secure_area_id => secure_area_id,
|
27
|
+
:authorized => authorized,
|
28
|
+
:request_url => request_url,
|
29
|
+
:signature => signature,
|
30
|
+
}.reject { |k, v| v.nil? }
|
31
|
+
end
|
32
|
+
|
33
|
+
def params
|
34
|
+
_params = secure_params
|
35
|
+
sigil = Sigil::Base.new(_params, key)
|
36
|
+
_params.update(:signature => sigil.signature).reject { |k, v| v.nil? }
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.construct(provided_params)
|
40
|
+
response = super(provided_params)
|
41
|
+
|
42
|
+
command = provided_params[:command]
|
43
|
+
|
44
|
+
if command == :receive
|
45
|
+
if provided_params[:signature].blank?
|
46
|
+
raise Witness::Error, "Signature not set"
|
47
|
+
end
|
48
|
+
|
49
|
+
sigil = Sigil::Base.new(response.secure_params, response.key)
|
50
|
+
|
51
|
+
verified = sigil.verify(provided_params[:signature])
|
52
|
+
|
53
|
+
if !verified
|
54
|
+
raise Witness::Error, "Signature does not match"
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
response
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Witness::Base do
|
4
|
+
|
5
|
+
it "should not allow initialization" do
|
6
|
+
SampleBase.new.should raise_error
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "action definition" do
|
10
|
+
|
11
|
+
it "should respond to a defined call" do
|
12
|
+
SampleBase.generate({ :first_name => "First", :last_name => "Last", :age => "42" })
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should not respond to an undefined defined call" do
|
16
|
+
lambda { SampleBase.banana({}) }.should raise_error(NoMethodError)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "column definition" do
|
22
|
+
|
23
|
+
it "should define a default name" do
|
24
|
+
SampleBase.columns[:first_name][:name].should == "First name"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should allow override names" do
|
28
|
+
SampleBase.columns[:last_name][:name].should == "Person last name"
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should define a default type" do
|
32
|
+
SampleBase.columns[:first_name][:type].should == :string
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should allow string types" do
|
36
|
+
SampleBase.columns[:last_name][:type].should == :string
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should allow integer types" do
|
40
|
+
SampleBase.columns[:age][:type].should == :integer
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should allow symbol types" do
|
44
|
+
SampleBase.columns[:base_type][:type].should == :symbol
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
describe "validates presence of" do
|
50
|
+
|
51
|
+
it "should raise an error for a nil param" do
|
52
|
+
lambda { SampleBase.generate({ :first_name => nil }) }.should raise_error(Witness::Error, /name not set/)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should raise an error for an empty param" do
|
56
|
+
lambda { SampleBase.generate({ :first_name => "" }) }.should raise_error(Witness::Error, /name not set/)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should not raise an error for a set param" do
|
60
|
+
lambda { SampleBase.generate({ :first_name => "First", :last_name => "Last", :age => "42" }) }.should_not raise_error
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should not raise an error for a zero param" do
|
64
|
+
lambda { SampleBase.generate({ :first_name => "First", :last_name => "Last", :age => "0" }) }.should_not raise_error
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should respect :on setting" do
|
68
|
+
lambda { SampleBase.receive({ :first_name => "First", :base_type => "contact", :age => "42" }) }.should_not raise_error
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
describe "type casting" do
|
74
|
+
|
75
|
+
before do
|
76
|
+
@data = "flibby"
|
77
|
+
@result = SampleBase.receive({ :first_name => "First", :last_name => "Last", :age => "42", :base_type => "contact", :data => @data })
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should cast integers" do
|
81
|
+
@result.age.should == 42
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should cast symbols" do
|
85
|
+
@result.base_type.should == :contact
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should leave alone" do
|
89
|
+
@result.data.should == @data
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe SampleVerificationRequest do
|
4
|
+
|
5
|
+
it "should not allow initialization" do
|
6
|
+
SampleVerificationRequest.new.should raise_error
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "generate" do
|
10
|
+
|
11
|
+
before do
|
12
|
+
@valid_generate_params = {
|
13
|
+
:cas_host => "cas.local",
|
14
|
+
:slice_slug => "banana",
|
15
|
+
:secure_area_id => 42,
|
16
|
+
:request_url => "http://www.example.com/secure",
|
17
|
+
:receive_contact_url => "http://www.example.com/receive?cat=meow",
|
18
|
+
:receive_login_url => "http://www.example.com/login?cat=meow",
|
19
|
+
}
|
20
|
+
|
21
|
+
@valid_params = @valid_generate_params.dup
|
22
|
+
@valid_params.delete(:cas_host)
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "initialization" do
|
26
|
+
|
27
|
+
it "should generate" do
|
28
|
+
SampleVerificationRequest.generate(@valid_generate_params)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should raise an error if cas host is not set" do
|
32
|
+
@valid_generate_params.delete(:cas_host)
|
33
|
+
lambda { SampleVerificationRequest.generate(@valid_generate_params) }.should raise_error(Witness::Error, /CAS host not set/)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should raise an error if Slice slug is not set" do
|
37
|
+
@valid_generate_params.delete(:slice_slug)
|
38
|
+
lambda { SampleVerificationRequest.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Slice not set/)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should raise an error if Secure Area ID is not set" do
|
42
|
+
@valid_generate_params.delete(:secure_area_id)
|
43
|
+
lambda { SampleVerificationRequest.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Secure Area ID not set/)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should raise an error if Request URL is not set" do
|
47
|
+
@valid_generate_params.delete(:request_url)
|
48
|
+
lambda { SampleVerificationRequest.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Request URL not set/)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should raise an error if Receive Contact URL is not set" do
|
52
|
+
@valid_generate_params.delete(:receive_contact_url)
|
53
|
+
lambda { SampleVerificationRequest.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Receive Contact URL not set/)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should raise an error if Receive Login URL is not set" do
|
57
|
+
@valid_generate_params.delete(:receive_login_url)
|
58
|
+
lambda { SampleVerificationRequest.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Receive Login URL not set/)
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "parameters" do
|
64
|
+
|
65
|
+
it "should generate parameters" do
|
66
|
+
request = SampleVerificationRequest.generate(@valid_generate_params)
|
67
|
+
request.params.should == @valid_params
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "url" do
|
73
|
+
|
74
|
+
it "should generate a url" do
|
75
|
+
request = SampleVerificationRequest.generate(@valid_generate_params)
|
76
|
+
request.url.should == "http://cas.local/cas/contact/witness?receive_contact_url=http%3A%2F%2Fwww.example.com%2Freceive%3Fcat%3Dmeow&receive_login_url=http%3A%2F%2Fwww.example.com%2Flogin%3Fcat%3Dmeow&request_url=http%3A%2F%2Fwww.example.com%2Fsecure&secure_area_id=42&slice_slug=banana"
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "receive" do
|
84
|
+
|
85
|
+
before do
|
86
|
+
@valid_generate_params = {
|
87
|
+
:slice_slug => "banana",
|
88
|
+
:secure_area_id => 42,
|
89
|
+
:request_url => "http://www.example.com/secure",
|
90
|
+
:receive_contact_url => "http://www.example.com/receive?cat=meow",
|
91
|
+
:receive_login_url => "http://www.example.com/login?cat=meow",
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
describe "initialization" do
|
96
|
+
|
97
|
+
it "should generate" do
|
98
|
+
SampleVerificationRequest.receive(@valid_generate_params)
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should raise an error if Slice slug is not set" do
|
102
|
+
@valid_generate_params.delete(:slice_slug)
|
103
|
+
lambda { SampleVerificationRequest.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Slice not set/)
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should raise an error if Secure Area ID is not set" do
|
107
|
+
@valid_generate_params.delete(:secure_area_id)
|
108
|
+
lambda { SampleVerificationRequest.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Secure Area ID not set/)
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should raise an error if Request URL is not set" do
|
112
|
+
@valid_generate_params.delete(:request_url)
|
113
|
+
lambda { SampleVerificationRequest.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Request URL not set/)
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should raise an error if Receive Contact URL is not set" do
|
117
|
+
@valid_generate_params.delete(:receive_contact_url)
|
118
|
+
lambda { SampleVerificationRequest.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Receive Contact URL not set/)
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should raise an error if Receive Login URL is not set" do
|
122
|
+
@valid_generate_params.delete(:receive_login_url)
|
123
|
+
lambda { SampleVerificationRequest.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Receive Login URL not set/)
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe SampleVerificationResponse do
|
4
|
+
|
5
|
+
it "should not allow initialization" do
|
6
|
+
SampleVerificationResponse.new.should raise_error
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "generate" do
|
10
|
+
|
11
|
+
before do
|
12
|
+
@valid_generate_params = {
|
13
|
+
:slice_slug => "banana",
|
14
|
+
:secure_area_id => 42,
|
15
|
+
:request_url => "http://www.example.com/secure",
|
16
|
+
:receive_contact_url => "http://www.example.com/receive?cat=meow",
|
17
|
+
:receive_login_url => "http://www.example.com/login?cat=meow",
|
18
|
+
:contact_id => 1234,
|
19
|
+
:authorized => true,
|
20
|
+
:key => "deadbeef",
|
21
|
+
}
|
22
|
+
|
23
|
+
@valid_params = @valid_generate_params.dup
|
24
|
+
@valid_params.delete(:key)
|
25
|
+
@valid_params.delete(:receive_contact_url)
|
26
|
+
@valid_params.delete(:receive_login_url)
|
27
|
+
@valid_params[:signature] = "ffb581dbdf4d72f2c3c4d61af2fbaaa6fbcf66af"
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "initialization" do
|
31
|
+
|
32
|
+
it "should generate" do
|
33
|
+
SampleVerificationResponse.generate(@valid_generate_params)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should raise an error if Slice slug is not set" do
|
37
|
+
@valid_generate_params.delete(:slice_slug)
|
38
|
+
lambda { SampleVerificationResponse.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Slice not set/)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should raise an error if Request URL is not set" do
|
42
|
+
@valid_generate_params.delete(:request_url)
|
43
|
+
lambda { SampleVerificationResponse.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Request URL not set/)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should raise an error if Receive Contact URL is not set" do
|
47
|
+
@valid_generate_params.delete(:receive_contact_url)
|
48
|
+
lambda { SampleVerificationResponse.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Receive Contact URL not set/)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should raise an error if Contact ID is not set" do
|
52
|
+
@valid_generate_params.delete(:contact_id)
|
53
|
+
lambda { SampleVerificationResponse.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Contact ID not set/)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should raise an error if Key is not set" do
|
57
|
+
@valid_generate_params.delete(:key)
|
58
|
+
lambda { SampleVerificationResponse.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Key not set/)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should recognise true authorizations" do
|
62
|
+
@valid_generate_params[:authorized] = true
|
63
|
+
response = SampleVerificationResponse.generate(@valid_generate_params)
|
64
|
+
response.authorized.should == true
|
65
|
+
|
66
|
+
@valid_generate_params[:authorized] = "true"
|
67
|
+
response = SampleVerificationResponse.generate(@valid_generate_params)
|
68
|
+
response.authorized.should == true
|
69
|
+
|
70
|
+
@valid_generate_params[:authorized] = 1
|
71
|
+
response = SampleVerificationResponse.generate(@valid_generate_params)
|
72
|
+
response.authorized.should == true
|
73
|
+
|
74
|
+
@valid_generate_params[:authorized] = "1"
|
75
|
+
response = SampleVerificationResponse.generate(@valid_generate_params)
|
76
|
+
response.authorized.should == true
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should recognise false authorizations" do
|
80
|
+
@valid_generate_params[:authorized] = false
|
81
|
+
response = SampleVerificationResponse.generate(@valid_generate_params)
|
82
|
+
response.authorized.should == false
|
83
|
+
|
84
|
+
@valid_generate_params[:authorized] = "false"
|
85
|
+
response = SampleVerificationResponse.generate(@valid_generate_params)
|
86
|
+
response.authorized.should == false
|
87
|
+
|
88
|
+
@valid_generate_params[:authorized] = 0
|
89
|
+
response = SampleVerificationResponse.generate(@valid_generate_params)
|
90
|
+
response.authorized.should == false
|
91
|
+
|
92
|
+
@valid_generate_params[:authorized] = "0"
|
93
|
+
response = SampleVerificationResponse.generate(@valid_generate_params)
|
94
|
+
response.authorized.should == false
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should deny invalid authorizations" do
|
98
|
+
@valid_generate_params[:authorized] = "meow"
|
99
|
+
lambda { SampleVerificationResponse.generate(@valid_generate_params) }.should raise_error(Witness::Error, /Authorization not valid/)
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
|
104
|
+
describe "parameters" do
|
105
|
+
|
106
|
+
it "should generate parameters" do
|
107
|
+
request = SampleVerificationResponse.generate(@valid_generate_params)
|
108
|
+
request.params.should == @valid_params
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
describe "url" do
|
114
|
+
|
115
|
+
it "should generate a url" do
|
116
|
+
request = SampleVerificationResponse.generate(@valid_generate_params)
|
117
|
+
request.url.should == "http://www.example.com/receive?authorized=true&cat=meow&contact_id=1234&request_url=http%3A%2F%2Fwww.example.com%2Fsecure&secure_area_id=42&signature=ffb581dbdf4d72f2c3c4d61af2fbaaa6fbcf66af&slice_slug=banana"
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
describe "receive" do
|
125
|
+
|
126
|
+
before do
|
127
|
+
@valid_generate_params = {
|
128
|
+
:slice_slug => "banana",
|
129
|
+
:secure_area_id => 42,
|
130
|
+
:request_url => "http://www.example.com/secure",
|
131
|
+
:contact_id => 1234,
|
132
|
+
:authorized => true,
|
133
|
+
:key => "deadbeef",
|
134
|
+
:signature => "ffb581dbdf4d72f2c3c4d61af2fbaaa6fbcf66af",
|
135
|
+
}
|
136
|
+
end
|
137
|
+
|
138
|
+
describe "initialization" do
|
139
|
+
|
140
|
+
it "should generate" do
|
141
|
+
SampleVerificationResponse.receive(@valid_generate_params)
|
142
|
+
end
|
143
|
+
|
144
|
+
it "should raise an error if Slice slug is not set" do
|
145
|
+
@valid_generate_params.delete(:slice_slug)
|
146
|
+
lambda { SampleVerificationResponse.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Slice not set/)
|
147
|
+
end
|
148
|
+
|
149
|
+
it "should raise an error if Request URL is not set" do
|
150
|
+
@valid_generate_params.delete(:request_url)
|
151
|
+
lambda { SampleVerificationResponse.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Request URL not set/)
|
152
|
+
end
|
153
|
+
|
154
|
+
it "should raise an error if Signature is not set" do
|
155
|
+
@valid_generate_params.delete(:signature)
|
156
|
+
lambda { SampleVerificationResponse.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Signature not set/)
|
157
|
+
end
|
158
|
+
|
159
|
+
it "should raise an error if Signature does not match" do
|
160
|
+
@valid_generate_params[:signature] = "incorrect"
|
161
|
+
lambda { SampleVerificationResponse.receive(@valid_generate_params) }.should raise_error(Witness::Error, /Signature does not match/)
|
162
|
+
end
|
163
|
+
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
|
168
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Witness do
|
4
|
+
|
5
|
+
describe "update url" do
|
6
|
+
|
7
|
+
it "should update a basic url" do
|
8
|
+
url = "http://www.example.com/index?colour=black"
|
9
|
+
params = { :noise => "meow", "animal" => :cat }
|
10
|
+
|
11
|
+
Witness.update_url(url, params).should == "http://www.example.com/index?animal=cat&colour=black&noise=meow"
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should update a url with arrays" do
|
15
|
+
url = "http://www.example.com/index?colour[]=black&colour[]=white&cutlery[knife]=1&cutlery[fork]=1"
|
16
|
+
params = { :noise => "meow", "animal" => :cat, :cutlery => { :spoon => 1 } }
|
17
|
+
|
18
|
+
Witness.update_url(url, params).should == "http://www.example.com/index?animal=cat&colour[]=black&colour[]=white&cutlery[spoon]=1&noise=meow"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should update a url wihout a trailing slash" do
|
22
|
+
url = "http://www.example.com"
|
23
|
+
params = { :noise => "meow" }
|
24
|
+
|
25
|
+
Witness.update_url(url, params).should == "http://www.example.com/?noise=meow"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should update a url with a trailing ?" do
|
29
|
+
url = "http://www.example.com/?"
|
30
|
+
params = { :noise => "meow" }
|
31
|
+
|
32
|
+
Witness.update_url(url, params).should == "http://www.example.com/?noise=meow"
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should update a url without http" do
|
36
|
+
url = "www.example.com/?"
|
37
|
+
params = { :noise => "meow" }
|
38
|
+
|
39
|
+
Witness.update_url(url, params).should == "http:www.example.com/?noise=meow"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should rescue with nil given invalid parameters" do
|
43
|
+
url = "www.example.com/?"
|
44
|
+
params = ["cat"]
|
45
|
+
|
46
|
+
Witness.update_url(url, params).should == nil
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
data/witness.gemspec
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{witness}
|
8
|
+
s.version = "2.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Steve Hoeksema"]
|
12
|
+
s.date = %q{2010-12-08}
|
13
|
+
s.description = %q{Witness}
|
14
|
+
s.email = %q{steve@seven.net.nz}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"TODO"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".document",
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
22
|
+
"Rakefile",
|
23
|
+
"TODO",
|
24
|
+
"VERSION",
|
25
|
+
"lib/witness.rb",
|
26
|
+
"lib/witness/base.rb",
|
27
|
+
"lib/witness/error.rb",
|
28
|
+
"spec/spec_helper.rb",
|
29
|
+
"spec/support/sample_base.rb",
|
30
|
+
"spec/support/sample_verification_request.rb",
|
31
|
+
"spec/support/sample_verification_response.rb",
|
32
|
+
"spec/witness/base_spec.rb",
|
33
|
+
"spec/witness/sample_verification_request_spec.rb",
|
34
|
+
"spec/witness/sample_verification_response_spec.rb",
|
35
|
+
"spec/witness_spec.rb",
|
36
|
+
"witness.gemspec"
|
37
|
+
]
|
38
|
+
s.homepage = %q{http://github.com/steveh/witness}
|
39
|
+
s.licenses = ["MIT"]
|
40
|
+
s.require_paths = ["lib"]
|
41
|
+
s.rubygems_version = %q{1.3.7}
|
42
|
+
s.summary = %q{Witness}
|
43
|
+
s.test_files = [
|
44
|
+
"spec/spec_helper.rb",
|
45
|
+
"spec/support/sample_base.rb",
|
46
|
+
"spec/support/sample_verification_request.rb",
|
47
|
+
"spec/support/sample_verification_response.rb",
|
48
|
+
"spec/witness/base_spec.rb",
|
49
|
+
"spec/witness/sample_verification_request_spec.rb",
|
50
|
+
"spec/witness/sample_verification_response_spec.rb",
|
51
|
+
"spec/witness_spec.rb"
|
52
|
+
]
|
53
|
+
|
54
|
+
if s.respond_to? :specification_version then
|
55
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
56
|
+
s.specification_version = 3
|
57
|
+
|
58
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
59
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
|
60
|
+
s.add_runtime_dependency(%q<sigil>, [">= 1.0.0"])
|
61
|
+
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
62
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.1.0"])
|
63
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
64
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
65
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
66
|
+
s.add_development_dependency(%q<rspec>, [">= 2.1.0"])
|
67
|
+
else
|
68
|
+
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
69
|
+
s.add_dependency(%q<sigil>, [">= 1.0.0"])
|
70
|
+
s.add_dependency(%q<rack>, [">= 0"])
|
71
|
+
s.add_dependency(%q<rspec>, ["~> 2.1.0"])
|
72
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
73
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
74
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
75
|
+
s.add_dependency(%q<rspec>, [">= 2.1.0"])
|
76
|
+
end
|
77
|
+
else
|
78
|
+
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
79
|
+
s.add_dependency(%q<sigil>, [">= 1.0.0"])
|
80
|
+
s.add_dependency(%q<rack>, [">= 0"])
|
81
|
+
s.add_dependency(%q<rspec>, ["~> 2.1.0"])
|
82
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
83
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
84
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
85
|
+
s.add_dependency(%q<rspec>, [">= 2.1.0"])
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
metadata
ADDED
@@ -0,0 +1,204 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: witness
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 2
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 2.0.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Steve Hoeksema
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-12-08 00:00:00 +13:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: activesupport
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 3
|
29
|
+
- 0
|
30
|
+
- 0
|
31
|
+
version: 3.0.0
|
32
|
+
type: :runtime
|
33
|
+
prerelease: false
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: sigil
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 1
|
44
|
+
- 0
|
45
|
+
- 0
|
46
|
+
version: 1.0.0
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rack
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
type: :runtime
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rspec
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 2
|
72
|
+
- 1
|
73
|
+
- 0
|
74
|
+
version: 2.1.0
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: *id004
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: bundler
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
segments:
|
86
|
+
- 1
|
87
|
+
- 0
|
88
|
+
- 0
|
89
|
+
version: 1.0.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: *id005
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: jeweler
|
95
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ~>
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
segments:
|
101
|
+
- 1
|
102
|
+
- 5
|
103
|
+
- 1
|
104
|
+
version: 1.5.1
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: *id006
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
name: rcov
|
110
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: *id007
|
121
|
+
- !ruby/object:Gem::Dependency
|
122
|
+
name: rspec
|
123
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
segments:
|
129
|
+
- 2
|
130
|
+
- 1
|
131
|
+
- 0
|
132
|
+
version: 2.1.0
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: *id008
|
136
|
+
description: Witness
|
137
|
+
email: steve@seven.net.nz
|
138
|
+
executables: []
|
139
|
+
|
140
|
+
extensions: []
|
141
|
+
|
142
|
+
extra_rdoc_files:
|
143
|
+
- TODO
|
144
|
+
files:
|
145
|
+
- .document
|
146
|
+
- Gemfile
|
147
|
+
- Gemfile.lock
|
148
|
+
- Rakefile
|
149
|
+
- TODO
|
150
|
+
- VERSION
|
151
|
+
- lib/witness.rb
|
152
|
+
- lib/witness/base.rb
|
153
|
+
- lib/witness/error.rb
|
154
|
+
- spec/spec_helper.rb
|
155
|
+
- spec/support/sample_base.rb
|
156
|
+
- spec/support/sample_verification_request.rb
|
157
|
+
- spec/support/sample_verification_response.rb
|
158
|
+
- spec/witness/base_spec.rb
|
159
|
+
- spec/witness/sample_verification_request_spec.rb
|
160
|
+
- spec/witness/sample_verification_response_spec.rb
|
161
|
+
- spec/witness_spec.rb
|
162
|
+
- witness.gemspec
|
163
|
+
has_rdoc: true
|
164
|
+
homepage: http://github.com/steveh/witness
|
165
|
+
licenses:
|
166
|
+
- MIT
|
167
|
+
post_install_message:
|
168
|
+
rdoc_options: []
|
169
|
+
|
170
|
+
require_paths:
|
171
|
+
- lib
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
none: false
|
174
|
+
requirements:
|
175
|
+
- - ">="
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
hash: 447726333830718148
|
178
|
+
segments:
|
179
|
+
- 0
|
180
|
+
version: "0"
|
181
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
|
+
none: false
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
segments:
|
187
|
+
- 0
|
188
|
+
version: "0"
|
189
|
+
requirements: []
|
190
|
+
|
191
|
+
rubyforge_project:
|
192
|
+
rubygems_version: 1.3.7
|
193
|
+
signing_key:
|
194
|
+
specification_version: 3
|
195
|
+
summary: Witness
|
196
|
+
test_files:
|
197
|
+
- spec/spec_helper.rb
|
198
|
+
- spec/support/sample_base.rb
|
199
|
+
- spec/support/sample_verification_request.rb
|
200
|
+
- spec/support/sample_verification_response.rb
|
201
|
+
- spec/witness/base_spec.rb
|
202
|
+
- spec/witness/sample_verification_request_spec.rb
|
203
|
+
- spec/witness/sample_verification_response_spec.rb
|
204
|
+
- spec/witness_spec.rb
|