iauth 1.0.1 → 1.0.2
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.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/Gemfile.lock +20 -0
- data/iauth.gemspec +1 -1
- data/lib/iauth.rb +5 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85d666d622383c6bdb5173c2a23a591f9e9ea03d
|
4
|
+
data.tar.gz: 8a1520c157a24e991ba1bb46660f123041eedf20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81e27f4970baf4eb61fb5b373d8eca98294dd5b5282353d1da6bf08e008aa89ceb8d13b4fa6c350736034581f5485dddd2e9757c4eddae1e3f82de79f4022246
|
7
|
+
data.tar.gz: 5634f0934ba1b5a237dc986226d50a2e362082eef48b1d53372ba72bd5e239f9323586ff22ad555bcb909fd420daddae43c4e657f0318b74066d4345c70896a4
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
iauth (1.0.0)
|
5
|
+
httparty
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
httparty (0.13.3)
|
11
|
+
json (~> 1.8)
|
12
|
+
multi_xml (>= 0.5.2)
|
13
|
+
json (1.8.1)
|
14
|
+
multi_xml (0.5.5)
|
15
|
+
|
16
|
+
PLATFORMS
|
17
|
+
ruby
|
18
|
+
|
19
|
+
DEPENDENCIES
|
20
|
+
iauth!
|
data/iauth.gemspec
CHANGED
data/lib/iauth.rb
CHANGED
@@ -63,7 +63,7 @@ class IAuth
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def request(method, url, params)
|
66
|
-
nonce = SecureRandom.hex
|
66
|
+
nonce = SecureRandom.hex(8)
|
67
67
|
options = {
|
68
68
|
'nonce' => nonce,
|
69
69
|
'token' => @ACCESS_TOKEN,
|
@@ -103,7 +103,7 @@ private
|
|
103
103
|
header.merge! header_options
|
104
104
|
headerStr = header.sort.map{|p|p.join '='}.join '&'
|
105
105
|
baseStr = "#{method.upcase}&#{url}&#{headerStr}"
|
106
|
-
sig = signature(baseStr
|
106
|
+
sig = signature(baseStr)
|
107
107
|
header['sig'] = sig
|
108
108
|
|
109
109
|
options = {
|
@@ -119,7 +119,9 @@ private
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
def signature(baseStr
|
122
|
+
def signature(baseStr)
|
123
|
+
secret = @APP_SECRET
|
124
|
+
secret += "&#{@ACCESS_SECRET}" if @ACCESS_SECRET != ''
|
123
125
|
Digest::MD5.hexdigest "#{baseStr}&#{secret}"
|
124
126
|
end
|
125
127
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -32,6 +32,8 @@ extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
34
|
- ".gitignore"
|
35
|
+
- Gemfile
|
36
|
+
- Gemfile.lock
|
35
37
|
- README.md
|
36
38
|
- iauth.gemspec
|
37
39
|
- lib/iauth.rb
|