metasploit_data_models 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/mdm/tag.rb +2 -2
- data/config/locales/en.yml +6 -0
- data/lib/metasploit_data_models/version.rb +2 -1
- data/spec/app/models/mdm/tag_spec.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d60b2cfe141cf2b3ad7f5c68c4d2a6c1691efcf7
|
4
|
+
data.tar.gz: 1003666ecbc6ad0995736cbcd760bf9148f9bc28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c9e27ed550c0ce6379b2e1a19ce0ada035fcb5d40526cb5b7617e6c59b27338b619071d87cedab183d20e9b7addecd77339664e9e9dd86eb1dbd92c54961af0
|
7
|
+
data.tar.gz: ef87d2788f0424aa1152f02f6c44947c92fd0a13603a316a99e8456cf90d3df42b46354ff8ac1236787b6b047f4bd9e56afdc14423c90fe2a611cca623239b29
|
data/app/models/mdm/tag.rb
CHANGED
@@ -82,11 +82,11 @@ class Mdm::Tag < ActiveRecord::Base
|
|
82
82
|
validates :desc,
|
83
83
|
:length => {
|
84
84
|
:maximum => ((8 * (2 ** 10)) - 1),
|
85
|
-
:message =>
|
85
|
+
:message => I18n.t('activerecord.ancestors.mdm/tag.model.errors.messages.length')
|
86
86
|
}
|
87
87
|
validates :name,
|
88
88
|
:format => {
|
89
|
-
:with => /\A[A-Za-z0-9\x2e\x2d_]+\z/, :message =>
|
89
|
+
:with => /\A[A-Za-z0-9\x2e\x2d_]+\z/, :message => I18n.t('activerecord.ancestors.mdm/tag.model.errors.messages.character')
|
90
90
|
},
|
91
91
|
:presence => true
|
92
92
|
|
data/config/locales/en.yml
CHANGED
@@ -26,6 +26,12 @@ en:
|
|
26
26
|
os_name:
|
27
27
|
help: "Filters the results by operating system."
|
28
28
|
mdm/tag:
|
29
|
+
model:
|
30
|
+
errors:
|
31
|
+
messages:
|
32
|
+
character: "Tag names can only contain alphanumeric characters, dots, dashes, and underscores."
|
33
|
+
length: "desc must be less than 8k."
|
34
|
+
|
29
35
|
search:
|
30
36
|
operator:
|
31
37
|
names:
|
@@ -37,6 +37,7 @@ RSpec.describe Mdm::Tag, type: :model do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
context 'name' do
|
40
|
+
let(:error_msg) {I18n.t('activerecord.ancestors.mdm/tag.model.errors.messages.character')}
|
40
41
|
it 'must be present' do
|
41
42
|
nameless_tag = FactoryGirl.build(:mdm_tag, :name => nil)
|
42
43
|
expect(nameless_tag).not_to be_valid
|
@@ -49,19 +50,19 @@ RSpec.describe Mdm::Tag, type: :model do
|
|
49
50
|
#Test for various bad inputs we should never allow
|
50
51
|
mytag = FactoryGirl.build(:mdm_tag, :name => "A'1")
|
51
52
|
expect(mytag).not_to be_valid
|
52
|
-
expect(mytag.errors[:name]).to include(
|
53
|
+
expect(mytag.errors[:name]).to include(error_msg)
|
53
54
|
mytag = FactoryGirl.build(:mdm_tag, :name => "A;1")
|
54
55
|
expect(mytag).not_to be_valid
|
55
|
-
expect(mytag.errors[:name]).to include(
|
56
|
+
expect(mytag.errors[:name]).to include(error_msg)
|
56
57
|
mytag = FactoryGirl.build(:mdm_tag, :name => "A%1")
|
57
58
|
expect(mytag).not_to be_valid
|
58
|
-
expect(mytag.errors[:name]).to include(
|
59
|
+
expect(mytag.errors[:name]).to include(error_msg)
|
59
60
|
mytag = FactoryGirl.build(:mdm_tag, :name => "A=1")
|
60
61
|
expect(mytag).not_to be_valid
|
61
|
-
expect(mytag.errors[:name]).to include(
|
62
|
+
expect(mytag.errors[:name]).to include(error_msg)
|
62
63
|
mytag = FactoryGirl.build(:mdm_tag, :name => "#A1")
|
63
64
|
expect(mytag).not_to be_valid
|
64
|
-
expect(mytag.errors[:name]).to include(
|
65
|
+
expect(mytag.errors[:name]).to include(error_msg)
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metasploit_data_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Huckins
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-06-
|
14
|
+
date: 2015-06-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: metasploit-version
|