metasploit_data_models 2.0.13 → 2.0.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcb3d56fd1e8230b31894cc9c3b6120010fedc18
4
- data.tar.gz: 8ec3774f4060da78915cfabdf38e9ff6c5a5c9ab
3
+ metadata.gz: 5e9e82390876e9b9ae870c927f96a7602c26fbfa
4
+ data.tar.gz: d6d4b533e723dc98cb52623c8036cdd5ac57d49a
5
5
  SHA512:
6
- metadata.gz: 0bd19418e217972a0b7623e87a9481236baf1d7a032e47a8ef2c3e5125b0f88ef7aca0c41109331021a3c484a36b2e102c8d6155eed4d1b9f12426545c160446
7
- data.tar.gz: 03ce79b0969449d62adfa0d7c009f0296c474ac3eab55fafecb4f7008b54c56594a16c7b2295a6d6be68eeef984827f62228009f0abf208fca1f54d191e5c245
6
+ metadata.gz: 551d6d7340d8c66dddeb5f8e530ea5e21f408da8945b8d25fed323c006f52a0df9f7e36399f87340bfbd281ff2ba288b42973dd97ba895d034c2d99a18c2c882
7
+ data.tar.gz: c77c464e15d3d4d41c336244842ddd2ba5c7cf6b41934114230a551ed3ddee1e9ca8caabe136f0bc032a1a9428d96d8dbffa5eeacd0ab9cff2afa0ad48ad28ad
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -218,6 +218,9 @@ class Mdm::Service < ActiveRecord::Base
218
218
  validates :port,
219
219
  numericality: {
220
220
  only_integer: true
221
+ },
222
+ inclusion: {
223
+ in: 1..65535
221
224
  }
222
225
  validates :port,
223
226
  uniqueness: {
@@ -1,6 +1,6 @@
1
1
  module MetasploitDataModels
2
2
  # VERSION is managed by GemRelease
3
- VERSION = '2.0.13'
3
+ VERSION = '2.0.14'
4
4
 
5
5
  # @return [String]
6
6
  #
@@ -176,6 +176,39 @@ RSpec.describe Mdm::Service, type: :model do
176
176
  end
177
177
 
178
178
  context "validations" do
179
+
180
+ context 'port' do
181
+ it 'should require a port' do
182
+ portless_service= FactoryGirl.build(:mdm_service, :port => nil)
183
+ expect(portless_service).not_to be_valid
184
+ expect(portless_service.errors[:port]).to include("is not a number")
185
+ end
186
+
187
+ it 'should not be valid for out-of-range numbers' do
188
+ out_of_range = FactoryGirl.build(:mdm_service, :port => 70000)
189
+ expect(out_of_range).not_to be_valid
190
+ expect(out_of_range.errors[:port]).to include("is not included in the list")
191
+ end
192
+
193
+ it 'should not be valid for port 0' do
194
+ out_of_range = FactoryGirl.build(:mdm_service, :port => 0)
195
+ expect(out_of_range).not_to be_valid
196
+ expect(out_of_range.errors[:port]).to include("is not included in the list")
197
+ end
198
+
199
+ it 'should not be valid for decimal numbers' do
200
+ out_of_range = FactoryGirl.build(:mdm_service, :port => 5.67)
201
+ expect(out_of_range).not_to be_valid
202
+ expect(out_of_range.errors[:port]).to include("must be an integer")
203
+ end
204
+
205
+ it 'should not be valid for a negative number' do
206
+ out_of_range = FactoryGirl.build(:mdm_service, :port => -8)
207
+ expect(out_of_range).not_to be_valid
208
+ expect(out_of_range.errors[:port]).to include("is not included in the list")
209
+ end
210
+ end
211
+
179
212
  subject(:mdm_service) {
180
213
  FactoryGirl.build(:mdm_service)
181
214
  }
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: 2.0.13
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Huckins
@@ -91,7 +91,7 @@ cert_chain:
91
91
  G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
92
92
  8mVuTXnyJOKRJA==
93
93
  -----END CERTIFICATE-----
94
- date: 2016-12-29 00:00:00.000000000 Z
94
+ date: 2017-01-23 00:00:00.000000000 Z
95
95
  dependencies:
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: metasploit-yard
metadata.gz.sig CHANGED
Binary file