wechat-validation 0.2.1 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +10 -3
- data/Gemfile.lock +36 -21
- data/ROADMAP.md +9 -1
- data/lib/wechat/validation/signature.rb +14 -0
- data/lib/wechat/validation/version.rb +1 -1
- data/wechat-validation.gemspec +3 -3
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2bb424f703d5c856c6d2cbdf5aa99c89236ce1761800cff951cefe8a0636f6ce
|
4
|
+
data.tar.gz: e05df5f32d84d978acfe8ff6e7c77a4cfd6870939235e0b9322ec9a8cfcc672a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1167bbf8c9d2ebd77670e671452570dcbb864cd32b8efe867e185aa4f336bd38268bbc247304a34992d2356a8fe979b02eafec801ffd44b77d7405a9af6d137
|
7
|
+
data.tar.gz: e50d37e1b4cdef3f475eaa703aa97a39fb7db718499d91dfaee212536c0f79b1c49c947d4147321c29849ff5f34f4d89a68d6a329289289ac7fd33fbb6256722
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
# Wechat Validation Change Log 微信验证库变更日志
|
2
2
|
|
3
3
|
## v0.1
|
4
|
+
|
4
5
|
1. Wechat::Validation.sign method
|
5
6
|
|
6
7
|
## v0.2
|
7
|
-
|
8
|
+
|
9
|
+
1. Improve the Wechat Validation to deprecate the .``sign`` method, use Wechat Validation Signature .``create`` instead
|
8
10
|
|
9
11
|
## v0.2.1
|
10
|
-
|
11
|
-
|
12
|
+
|
13
|
+
1. Improved the Ruby Gem Specification to depend on [wechat-core](https://github.com/topbitdu/wechat-core) v0.4
|
14
|
+
2. Improved the Signature class for the argument validation
|
15
|
+
|
16
|
+
## v1.0
|
17
|
+
|
18
|
+
1. Improved the Ruby Gem Specification to depend on [wechat-core](https://github.com/topbitdu/wechat-core) v1.0, rake v11.0 & bundler v2.0
|
data/Gemfile.lock
CHANGED
@@ -1,39 +1,54 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
wechat-validation (0
|
5
|
-
wechat-core (
|
4
|
+
wechat-validation (1.0)
|
5
|
+
wechat-core (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
activesupport (6.0.2.2)
|
11
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
+
i18n (>= 0.7, < 2)
|
13
|
+
minitest (~> 5.1)
|
14
|
+
tzinfo (~> 1.1)
|
15
|
+
zeitwerk (~> 2.2)
|
16
|
+
concurrent-ruby (1.1.6)
|
17
|
+
diff-lcs (1.3)
|
18
|
+
httpclient (2.8.3)
|
19
|
+
i18n (1.8.2)
|
20
|
+
concurrent-ruby (~> 1.0)
|
21
|
+
minitest (5.14.0)
|
22
|
+
rake (11.3.0)
|
23
|
+
rspec (3.6.0)
|
24
|
+
rspec-core (~> 3.6.0)
|
25
|
+
rspec-expectations (~> 3.6.0)
|
26
|
+
rspec-mocks (~> 3.6.0)
|
27
|
+
rspec-core (3.6.0)
|
28
|
+
rspec-support (~> 3.6.0)
|
29
|
+
rspec-expectations (3.6.0)
|
20
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
-
rspec-support (~> 3.
|
22
|
-
rspec-mocks (3.
|
31
|
+
rspec-support (~> 3.6.0)
|
32
|
+
rspec-mocks (3.6.0)
|
23
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
-
rspec-support (~> 3.
|
25
|
-
rspec-support (3.
|
26
|
-
|
27
|
-
|
34
|
+
rspec-support (~> 3.6.0)
|
35
|
+
rspec-support (3.6.0)
|
36
|
+
thread_safe (0.3.6)
|
37
|
+
tzinfo (1.2.7)
|
38
|
+
thread_safe (~> 0.1)
|
39
|
+
wechat-core (1.0)
|
40
|
+
activesupport (~> 6.0)
|
41
|
+
httpclient (~> 2.8)
|
42
|
+
zeitwerk (2.3.0)
|
28
43
|
|
29
44
|
PLATFORMS
|
30
45
|
ruby
|
31
46
|
|
32
47
|
DEPENDENCIES
|
33
|
-
bundler (~>
|
34
|
-
rake (~>
|
48
|
+
bundler (~> 2.0)
|
49
|
+
rake (~> 11.0)
|
35
50
|
rspec (~> 3.0)
|
36
51
|
wechat-validation!
|
37
52
|
|
38
53
|
BUNDLED WITH
|
39
|
-
1.
|
54
|
+
2.1.4
|
data/ROADMAP.md
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
# Wechat Validation Road Map 微信验证库路线图
|
2
2
|
|
3
3
|
## v0.1
|
4
|
+
|
4
5
|
1. Wechat::Validation.sign method
|
5
6
|
|
6
7
|
## v0.2
|
7
|
-
|
8
|
+
|
9
|
+
1. Improve the Wechat Validation to deprecate the .``sign`` method, use Wechat Validation Signature .``create`` instead
|
8
10
|
|
9
11
|
## v0.2.1
|
12
|
+
|
10
13
|
1. Improve the Ruby Gem Specification to depend on [wechat-core](https://github.com/topbitdu/wechat-core) v0.4
|
11
14
|
2. Improve the Signature class for the argument validation
|
12
15
|
|
13
16
|
## v1.0
|
17
|
+
|
18
|
+
1. Improve the Ruby Gem Specification to depend on [wechat-core](https://github.com/topbitdu/wechat-core) v1.0, rake v11.0 & bundler v2.0
|
19
|
+
|
20
|
+
## v1.1
|
21
|
+
|
14
22
|
1. Remove the deprecated classes & methods
|
15
23
|
2. Improve the Signature class for argument validation
|
@@ -1,7 +1,21 @@
|
|
1
|
+
##
|
2
|
+
# Signature 是参数签名类,用于生成参数签名。如:
|
3
|
+
# nonce = # Get the nonce from the request parameters.
|
4
|
+
# timestamp = # Get the timestamp from the request parameters.
|
5
|
+
# token = # Load the token from the configuration file.
|
6
|
+
# actual_signature = # Get the actual signature from the request parameters.
|
7
|
+
# expected_signature = Wechat::Validation::Signature.create nonce, timestamp, token
|
8
|
+
# if expected_signature==actual_signature
|
9
|
+
# # The signature is matched.
|
10
|
+
# else
|
11
|
+
# # The signature is not matched.
|
12
|
+
# end
|
13
|
+
|
1
14
|
class Wechat::Validation::Signature
|
2
15
|
|
3
16
|
extend Wechat::Core::Common
|
4
17
|
|
18
|
+
##
|
5
19
|
# 验证服务器地址的有效性
|
6
20
|
# http://mp.weixin.qq.com/wiki/8/f9a0b8382e0b77d87b3bcc1ce6fbc104.html#.E7.AC.AC.E4.BA.8C.E6.AD.A5.EF.BC.9A.E9.AA.8C.E8.AF.81.E6.9C.8D.E5.8A.A1.E5.99.A8.E5.9C.B0.E5.9D.80.E7.9A.84.E6.9C.89.E6.95.88.E6.80.A7
|
7
21
|
#
|
data/wechat-validation.gemspec
CHANGED
@@ -26,10 +26,10 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = [ 'lib' ]
|
28
28
|
|
29
|
-
spec.add_dependency 'wechat-core', '~> 0
|
29
|
+
spec.add_dependency 'wechat-core', '~> 1.0'
|
30
30
|
|
31
|
-
spec.add_development_dependency 'bundler', '~>
|
32
|
-
spec.add_development_dependency 'rake', '~>
|
31
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
32
|
+
spec.add_development_dependency 'rake', '~> 11.0'
|
33
33
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
34
|
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wechat-validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0
|
4
|
+
version: '1.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wechat-core
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '11.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '11.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,8 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
|
115
|
-
rubygems_version: 2.6.4
|
114
|
+
rubygems_version: 3.1.2
|
116
115
|
signing_key:
|
117
116
|
specification_version: 4
|
118
117
|
summary: Wechat Server Validation Library 微信服务器验证库
|