patronus_fati 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f846c13ed96d628de8bb8f4cc5d4db5dba18a18f
4
- data.tar.gz: 213e462efeca90304442a3cdd0567d788e0c5e44
3
+ metadata.gz: 07f850ac1cb0f1dd2f7dfb513bd4ce335fbbf6a4
4
+ data.tar.gz: fb8c5272dca78ebf66d505ccb899fc2de44637dc
5
5
  SHA512:
6
- metadata.gz: c01c8e041b55e645506de4c3d1004afe258d19dd8208cc3b1e1f0e3b5a175fa387491fe8420cbcfdcfacc2a78d9ecc85a9aa2af432893b8fd5f4356b09dae912
7
- data.tar.gz: 65fe59c2a5c91caa39d25c8aa1b8c7e9024a157f4e0af4159765b212ce61054baf0dbb20875db24cdd99732f6cf461649df98510aaf8444d9c810ac42b63f30d
6
+ metadata.gz: 16a3e594dea7679cf076e53fbd762d0387a34f81e9d94e7ced43d79045fae10f1b96a8ed85fb7cb9b5e0440917be279e9c04f9b841c0c868d84cf76bdcce0496
7
+ data.tar.gz: f723d26a1a9e1f143612efc29322a268d67f6a8cc7ba30d38280043b81d03e312052469ac672a4fa571b4f8e2ba3eb593ec8080b5df26e910e137ebde4f35d4f
@@ -15,18 +15,6 @@ module PatronusFati::DataModels
15
15
  property :max_seen_rate, Integer
16
16
  property :type, String, :required => true
17
17
 
18
- property :duplicate_iv_pkts, Integer, :default => 0
19
- property :crypt_packets, Integer, :default => 0
20
- property :data_packets, Integer, :default => 0
21
- property :data_size, Integer, :default => 0
22
-
23
- property :fragments, Integer, :default => 0
24
- property :retries, Integer, :default => 0
25
-
26
- property :range_ip, String
27
- property :netmask, String
28
- property :gateway_ip, String
29
-
30
18
  has n, :clients, :through => :connections
31
19
  has n, :connections, :constraint => :destroy,
32
20
  :child_key => :access_point_id
@@ -8,19 +8,8 @@ module PatronusFati::DataModels
8
8
  property :id, Serial
9
9
  property :bssid, String, :length => 17, :unique_index => true
10
10
  property :channel, Integer
11
-
12
- property :crypt_packets, Integer, :default => 0
13
- property :data_packets, Integer, :default => 0
14
- property :data_size, Integer, :default => 0
15
- property :fragments, Integer, :default => 0
16
- property :retries, Integer, :default => 0
17
-
18
11
  property :max_seen_rate, Integer
19
12
 
20
- property :ip, String
21
- property :gateway_ip, String
22
- property :dhcp_host, String, :length => 64
23
-
24
13
  has n, :connections, :constraint => :destroy
25
14
  has n, :access_points, :through => :connections
26
15
 
@@ -7,7 +7,7 @@ module PatronusFati::DataModels
7
7
  property :id, Serial
8
8
 
9
9
  property :connected_at, Integer, :default => Proc.new { Time.now.to_i }
10
- property :disconnected_at, Integer, :default => Proc.new { Time.now.to_i }
10
+ property :disconnected_at, Integer
11
11
  property :duration, Integer
12
12
 
13
13
  belongs_to :access_point
@@ -23,21 +23,6 @@ module PatronusFati::MessageProcessor::Bssid
23
23
  bssid: attrs[:bssid],
24
24
  type: attrs[:type],
25
25
  channel: attrs[:channel],
26
-
27
- crypt_packets: attrs[:cryptpackets],
28
- data_packets: attrs[:datapackets],
29
- data_size: attrs[:datasize],
30
-
31
- fragments: attrs[:fragments],
32
- retries: attrs[:retries],
33
-
34
- max_seen_rate: attrs[:maxseenrate],
35
- duplicate_iv_pkts: attrs[:dupeivpackets],
36
-
37
- range_ip: attrs[:rangeip],
38
- netmask: attrs[:netmaskip],
39
- gateway_ip: attrs[:gatewayip],
40
-
41
26
  last_seen_at: Time.now.to_i
42
27
  }.reject { |_, v| v.nil? }
43
28
  end
@@ -31,20 +31,7 @@ module PatronusFati::MessageProcessor::Client
31
31
  {
32
32
  bssid: attrs[:mac],
33
33
  channel: attrs[:channel],
34
-
35
- crypt_packets: attrs[:cryptpackets],
36
- data_packets: attrs[:datapackets],
37
- data_size: attrs[:datasize],
38
-
39
- fragments: attrs[:fragments],
40
- retries: attrs[:retries],
41
-
42
34
  max_seen_rate: attrs[:maxseenrate],
43
-
44
- ip: attrs[:ip],
45
- gateway_ip: attrs[:gatewayip],
46
- dhcp_host: attrs[:dhcphost],
47
-
48
35
  last_seen_at: Time.now.to_i
49
36
  }.reject { |_, v| v.nil? }
50
37
  end
@@ -1,3 +1,3 @@
1
1
  module PatronusFati
2
- VERSION = '0.8.8'
2
+ VERSION = '0.8.9'
3
3
  end
@@ -1,86 +1,82 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe 'DataModels::Connection' do
4
- subject { PatronusFati::DataModels::Connection }
5
-
3
+ RSpec.describe PatronusFati::DataModels::Connection do
4
+ let(:ap_model) { PatronusFati::DataModels::AccessPoint }
6
5
  let(:client_model) { PatronusFati::DataModels::Client }
7
- let(:unsaved_client) { client_model.new(bssid: '11:22:33:00:00:00') }
8
6
 
9
- let(:ap_model) { PatronusFati::DataModels::AccessPoint }
10
7
  let(:unsaved_ap) { ap_model.new(bssid: '22:33:44:00:00:01', type: 'adhoc', channel: 6) }
8
+ let(:unsaved_client) { client_model.new(bssid: '11:22:33:00:00:00') }
11
9
 
12
- let(:instance) { subject.new(client: unsaved_client, access_point: unsaved_ap) }
10
+ let(:instance) { described_class.new(client: unsaved_client, access_point: unsaved_ap) }
13
11
 
14
- it { expect(subject).to have_property(:id) }
12
+ it { expect(described_class).to have_property(:id) }
15
13
 
16
- it { expect(subject).to have_property(:connected_at) }
17
- it { expect(subject).to have_property(:disconnected_at) }
14
+ it { expect(described_class).to have_property(:connected_at) }
15
+ it { expect(described_class).to have_property(:disconnected_at) }
18
16
 
19
- it { expect(subject).to belong_to(:access_point) }
20
- it { expect(subject).to belong_to(:client) }
17
+ it { expect(described_class).to belong_to(:access_point) }
18
+ it { expect(described_class).to belong_to(:client) }
21
19
 
22
- context '#active?' do
20
+ context '#connected?' do
23
21
  it 'should be true when a disconnection hasn\'t been registered' do
24
22
  inst = instance
25
23
  inst.disconnected_at = nil
26
24
 
27
- expect(inst).to be_active
25
+ expect(inst).to be_connected
28
26
  end
29
27
 
30
28
  it 'should be false when a disconnection has been registered' do
31
29
  inst = instance
32
30
  inst.disconnected_at = Time.now
33
31
 
34
- expect(inst).to_not be_active
32
+ expect(inst).to_not be_connected
35
33
  end
36
34
  end
37
35
 
38
36
  context '#disconnect!' do
39
- it 'should change an active instance to be inactive' do
37
+ it 'should change a connected instance to be disconnected' do
40
38
  inst = instance
41
39
  inst.save
42
40
 
43
- expect(inst).to be_active
41
+ expect(inst).to be_connected
44
42
  inst.disconnect!
45
- expect(inst).to_not be_active
43
+ expect(inst).to_not be_connected
46
44
  end
47
45
  end
48
46
 
49
- context '#active scope' do
47
+ context '#connected scope' do
50
48
  it 'should include active connections' do
51
49
  inst = instance
52
50
  inst.save
53
51
 
54
- expect(inst).to be_active
55
- expect(subject.active).to include(inst)
52
+ expect(described_class.connected).to include(inst)
56
53
  end
57
54
 
58
- it 'should not include inactive connections' do
55
+ it 'should not include disconnected connections' do
59
56
  inst = instance
60
57
  inst.save
61
58
  inst.disconnect!
62
59
 
63
- expect(inst).to_not be_active
64
- expect(subject.active).to_not include(inst)
60
+ expect(described_class.connected).to_not include(inst)
65
61
  end
66
62
  end
67
63
 
68
- context '#inactive scope' do
69
- it 'should not include active connections' do
64
+ context '#disconnected scope' do
65
+ it 'should not include disconnected connections' do
70
66
  inst = instance
71
67
  inst.save
72
68
 
73
- expect(inst).to be_active
74
- expect(subject.inactive).to_not include(inst)
69
+ expect(inst).to be_connected
70
+ expect(described_class.disconnected).to_not include(inst)
75
71
  end
76
72
 
77
- it 'should include inactive connections' do
73
+ it 'should include disconnected connections' do
78
74
  inst = instance
79
75
  inst.save
80
76
  inst.disconnect!
81
77
 
82
- expect(inst).to_not be_active
83
- expect(subject.inactive).to include(inst)
78
+ expect(inst).to_not be_connected
79
+ expect(described_class.disconnected).to include(inst)
84
80
  end
85
81
  end
86
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patronus_fati
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8
4
+ version: 0.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stelfox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-10 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dm-constraints