slanger 0.4.2 → 0.4.3
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.
Potentially problematic release.
This version of slanger might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/slanger/api/request_validation.rb +1 -1
- data/lib/slanger/version.rb +1 -1
- data/spec/unit/request_validation_spec.rb +11 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa3af74396ad01a665097cd94f9520c3f9e93e35
|
4
|
+
data.tar.gz: beac501fa1ec42ba40096fe2854654200c7436ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcf153eb18832d068ada988ca15d9c11cd21c06d712c0a38b1cdef1502becc64a19d106f6834819582b82b083e7e872578d6b8bd7290314c4827da17995036f8
|
7
|
+
data.tar.gz: 9c72e7738e139b245d474d4d007ca1897f9bfa585c642d369274cc6d877b2f74f75190a6cbaadba3ede607c0d1b708a7281f1e2bdf953c4e6d82337616f0ade7
|
@@ -53,7 +53,7 @@ module Slanger
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def validate_channel_id!(channel_id)
|
56
|
-
validate_with_regex!(/\A[\w@\-;]
|
56
|
+
validate_with_regex!(/\A[\w@\-;_.=,]{1,164}\z/, channel_id, "channel_id")
|
57
57
|
end
|
58
58
|
|
59
59
|
def validate_with_regex!(regex, value, name)
|
data/lib/slanger/version.rb
CHANGED
@@ -28,22 +28,30 @@ describe Slanger::Api::RequestValidation do
|
|
28
28
|
let(:body) { {socket_id: "1234.5678", channels: channels}.to_json }
|
29
29
|
|
30
30
|
context "with valid channels" do
|
31
|
-
let(:channels) { ["MY_CHANNEL", "presence-abcd"] }
|
31
|
+
let(:channels) { ["MY_CHANNEL", "presence-abcd", "foo-bar_1234@=,.;", "a"*164] }
|
32
32
|
|
33
33
|
it "returns an array of valid channel_id values" do
|
34
34
|
rv = Slanger::Api::RequestValidation.new(body, {}, "")
|
35
35
|
|
36
|
-
expect(rv.channels).to eq ["MY_CHANNEL", "presence-abcd"]
|
36
|
+
expect(rv.channels).to eq ["MY_CHANNEL", "presence-abcd", "foo-bar_1234@=,.;", "a"*164]
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
context "with invalid
|
40
|
+
context "with invalid characters" do
|
41
41
|
let(:channels) { ["MY_CHANNEL:presence-abcd", "presence-abcd"] }
|
42
42
|
|
43
43
|
it "rejects invalid channels" do
|
44
44
|
expect{ Slanger::Api::RequestValidation.new(body, {}, "")}.to raise_error Slanger::Api::InvalidRequest
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
context "with invalid channel length" do
|
49
|
+
let(:channels) { ["a"*165] }
|
50
|
+
|
51
|
+
it "rejects names longer than 164 characters" do
|
52
|
+
expect{ Slanger::Api::RequestValidation.new(body, {}, "")}.to raise_error Slanger::Api::InvalidRequest
|
53
|
+
end
|
54
|
+
end
|
47
55
|
end
|
48
56
|
|
49
57
|
describe "#socket_id" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slanger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stevie Graham
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
@@ -356,7 +356,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
356
356
|
version: '0'
|
357
357
|
requirements: []
|
358
358
|
rubyforge_project:
|
359
|
-
rubygems_version: 2.
|
359
|
+
rubygems_version: 2.2.0
|
360
360
|
signing_key:
|
361
361
|
specification_version: 4
|
362
362
|
summary: A websocket service compatible with Pusher libraries
|
@@ -375,3 +375,4 @@ test_files:
|
|
375
375
|
- spec/unit/channel_spec.rb
|
376
376
|
- spec/unit/request_validation_spec.rb
|
377
377
|
- spec/unit/webhook_spec.rb
|
378
|
+
has_rdoc:
|