siteguard_lite-custom_signature 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/siteguard_lite/custom_signature/bytesize_validator.rb +1 -1
- data/lib/siteguard_lite/custom_signature/condition.rb +7 -8
- data/lib/siteguard_lite/custom_signature/rule.rb +4 -1
- data/lib/siteguard_lite/custom_signature/version.rb +1 -1
- data/lib/siteguard_lite/custom_signature/yaml_loader.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2afd93f858fa218143f84c0f9f17d1193240151c01143e957eb486441072b415
|
4
|
+
data.tar.gz: 29790f84d51e9781f1d50c1dda38b37475b7a0d568e5690b04ecd73f4b5261cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29d812d5abbc1935b228a3bc1035359302ff1a07314e52d2fc5dd750fac7a6fe6331426b32feccae819eead5383bd146ef803eef0eca8d56d2f107cbf0d8c332
|
7
|
+
data.tar.gz: b9d2fccf098915d39214cbed4293f58503d7b328c58b1a55ec01152cda27f682a1004854bd29214dad911c3f5012485712cf4e31d6bea9a754f1f6d7a0c88bf4
|
@@ -20,7 +20,7 @@ module SiteguardLite
|
|
20
20
|
|
21
21
|
[
|
22
22
|
rule.enable_str,
|
23
|
-
|
23
|
+
rule.action,
|
24
24
|
'',
|
25
25
|
rule.name,
|
26
26
|
@key,
|
@@ -42,14 +42,13 @@ module SiteguardLite
|
|
42
42
|
private
|
43
43
|
|
44
44
|
def comparison_str(rule, last)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
].flatten.join(',')
|
50
|
-
else
|
51
|
-
@comparison_methods.join(',')
|
45
|
+
str = @comparison_methods.join(',')
|
46
|
+
|
47
|
+
if last && rule.exclusion_action && rule.signature
|
48
|
+
str << ",#{rule.exclusion_action}(#{rule.signature})"
|
52
49
|
end
|
50
|
+
|
51
|
+
str
|
53
52
|
end
|
54
53
|
end
|
55
54
|
end
|
@@ -3,17 +3,19 @@ module SiteguardLite
|
|
3
3
|
class Rule
|
4
4
|
include ActiveModel::Validations
|
5
5
|
|
6
|
-
attr_reader :name, :comment, :enable, :conditions
|
6
|
+
attr_reader :name, :action, :comment, :enable, :conditions
|
7
7
|
attr_accessor :exclusion_action, :signature
|
8
8
|
|
9
9
|
validates :name, bytesize: { maximum: 29 }
|
10
10
|
validates :signature, bytesize: { maximum: 999 }
|
11
|
+
validates :action, inclusion: %w(BLOCK NONE WHITE) # TODO support FILTER action
|
11
12
|
|
12
13
|
def initialize(args)
|
13
14
|
@name = args[:name]
|
14
15
|
@comment = args[:comment]
|
15
16
|
@exclusion_action = args[:exclusion_action]
|
16
17
|
@signature = args[:signature]
|
18
|
+
@action = args[:action] || 'NONE'
|
17
19
|
|
18
20
|
@enable = true
|
19
21
|
|
@@ -42,6 +44,7 @@ module SiteguardLite
|
|
42
44
|
def to_hash
|
43
45
|
{
|
44
46
|
name: @name,
|
47
|
+
action: @action,
|
45
48
|
comment: @comment,
|
46
49
|
exclusion_action: @exclusion_action,
|
47
50
|
signature: @signature,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: siteguard_lite-custom_signature
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takatoshi Ono
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|