signauth 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +15 -0
- data/README.md +4 -0
- data/Rakefile +12 -1
- data/lib/signauth/signer.rb +1 -1
- data/lib/signauth/version.rb +1 -1
- data/signauth.gemspec +1 -0
- data/spec/signauth/signer_spec.rb +11 -0
- data/spec/spec_helper.rb +2 -1
- metadata +10 -6
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Signature authentication.
|
4
4
|
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/signauth.svg)](http://badge.fury.io/rb/signauth)
|
6
|
+
[![Build Status](https://travis-ci.org/arukoh/signauth.svg?branch=master)](https://travis-ci.org/arukoh/signauth)
|
7
|
+
[![Dependency Status](https://gemnasium.com/arukoh/signauth.svg)](https://gemnasium.com/arukoh/signauth)
|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
Add this line to your application's Gemfile:
|
data/Rakefile
CHANGED
@@ -1,9 +1,20 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
-
|
2
|
+
require 'rubygems'
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'bundler'
|
10
|
+
Bundler::GemHelper.install_tasks
|
3
11
|
|
12
|
+
require 'rake'
|
4
13
|
require "bundler/gem_tasks"
|
5
14
|
require 'rspec/core/rake_task'
|
6
15
|
|
16
|
+
$:.push File.expand_path("../lib", __FILE__)
|
17
|
+
|
7
18
|
task :default => :spec
|
8
19
|
|
9
20
|
RSpec::Core::RakeTask.new(:spec)
|
data/lib/signauth/signer.rb
CHANGED
@@ -11,7 +11,7 @@ module Signauth
|
|
11
11
|
|
12
12
|
def hmac(key, value, algorithm = 'HMAC-SHA-256')
|
13
13
|
digest = digest_name(algorithm)
|
14
|
-
OpenSSL::HMAC.digest(OpenSSL::Digest
|
14
|
+
OpenSSL::HMAC.digest(OpenSSL::Digest.new(digest), key, value)
|
15
15
|
end
|
16
16
|
|
17
17
|
def slow_string_comparison(given, computed)
|
data/lib/signauth/version.rb
CHANGED
data/signauth.gemspec
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Signauth::Signer do
|
4
|
+
describe "#sign" do
|
5
|
+
let(:secret) { "secret" }
|
6
|
+
let(:string_to_sign) { "string to sign" }
|
7
|
+
subject { Signauth::Signer.sign(secret, string_to_sign) }
|
8
|
+
|
9
|
+
it { should eq "fis5QmLSbj+hOfuCgndTJdCdp81sZh0GwayU7Y+5Cnw=" }
|
10
|
+
end
|
11
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-08-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -52,6 +52,7 @@ extra_rdoc_files: []
|
|
52
52
|
files:
|
53
53
|
- .gitignore
|
54
54
|
- .rspec
|
55
|
+
- .travis.yml
|
55
56
|
- Gemfile
|
56
57
|
- LICENSE
|
57
58
|
- README.md
|
@@ -68,10 +69,12 @@ files:
|
|
68
69
|
- lib/signauth/signer.rb
|
69
70
|
- lib/signauth/version.rb
|
70
71
|
- signauth.gemspec
|
72
|
+
- spec/signauth/signer_spec.rb
|
71
73
|
- spec/signauth_spec.rb
|
72
74
|
- spec/spec_helper.rb
|
73
75
|
homepage: https://github.com/arukoh/signauth
|
74
|
-
licenses:
|
76
|
+
licenses:
|
77
|
+
- MIT
|
75
78
|
post_install_message:
|
76
79
|
rdoc_options: []
|
77
80
|
require_paths:
|
@@ -84,7 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
87
|
version: '0'
|
85
88
|
segments:
|
86
89
|
- 0
|
87
|
-
hash: -
|
90
|
+
hash: -784316223
|
88
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
92
|
none: false
|
90
93
|
requirements:
|
@@ -93,13 +96,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
96
|
version: '0'
|
94
97
|
segments:
|
95
98
|
- 0
|
96
|
-
hash: -
|
99
|
+
hash: -784316223
|
97
100
|
requirements: []
|
98
101
|
rubyforge_project:
|
99
|
-
rubygems_version: 1.8.
|
102
|
+
rubygems_version: 1.8.25
|
100
103
|
signing_key:
|
101
104
|
specification_version: 3
|
102
105
|
summary: Signature authentication
|
103
106
|
test_files:
|
107
|
+
- spec/signauth/signer_spec.rb
|
104
108
|
- spec/signauth_spec.rb
|
105
109
|
- spec/spec_helper.rb
|