mihari 8.0.1 → 8.0.2

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
  SHA256:
3
- metadata.gz: 29091282748973618fb309a3584d0e24ea27f7e18f284feeb57dbb0f10138f33
4
- data.tar.gz: c8079484f9241000479f543785c7d97f892b9a182401047ecf752090fe5bf37b
3
+ metadata.gz: d3d454e8ac560ec2d1b7463dfdc686e69fc033da82e318f9479ba14f72194c49
4
+ data.tar.gz: d2f191e78eb2180a9062d885fd527f5e55c70fa70a5e9f8f910b15a50d57d6a2
5
5
  SHA512:
6
- metadata.gz: 4892f605f6dc1169ca22859eb6ddac36b42828575790c2cd7f6ecdf73a158bbdd80704f3c1a0fcba2fd1af3972270131c7df7e657ee30e9cdc7675bbb0aaca3c
7
- data.tar.gz: 9fdd385288a708f900518c348a8a7ba2b0fd2ac7c0fb81e51c0b71a6e6b313fa8df87e8829539db52ecfc267481229bf2daee21c6bac3ab9ad313a7ee5c2451b
6
+ metadata.gz: 723186046c14e4532c3662280264a51fb7a5966173d7010c50d6537a8b96304b6ff7f7f24d9686d1773fe8f13ceaba09d7d33c0265e286b58c9d18f3849645b8
7
+ data.tar.gz: 8a9f7001f3edb2a4035178c810ff5a12cf2cf913533f853e778c8d15ef4e74edfaef4d1b9061ab406d824406e7abd9eba94adb2e45da6c9b963a5d029123d322
@@ -22,6 +22,8 @@ module Mihari
22
22
  # @param [Hash] d
23
23
  #
24
24
  def from_dynamic!(d)
25
+ return nil if d.nil?
26
+
25
27
  d = Types::Hash[d]
26
28
  new(
27
29
  asn: d.fetch("asn")
@@ -102,8 +104,8 @@ module Mihari
102
104
  attribute :location, Location
103
105
 
104
106
  # @!attribute [r] autonomous_system
105
- # @return [AutonomousSystem]
106
- attribute :autonomous_system, AutonomousSystem
107
+ # @return [AutonomousSystem, nil]
108
+ attribute :autonomous_system, AutonomousSystem.optional
107
109
 
108
110
  # @!attribute [r] metadata
109
111
  # @return [Hash]
@@ -127,7 +129,7 @@ module Mihari
127
129
  Models::Artifact.new(
128
130
  data: ip,
129
131
  metadata:,
130
- autonomous_system: autonomous_system.as,
132
+ autonomous_system: autonomous_system&.as,
131
133
  geolocation: location.geolocation,
132
134
  ports:
133
135
  )
@@ -142,7 +144,7 @@ module Mihari
142
144
  new(
143
145
  ip: d.fetch("ip"),
144
146
  location: Location.from_dynamic!(d.fetch("location")),
145
- autonomous_system: AutonomousSystem.from_dynamic!(d.fetch("autonomous_system")),
147
+ autonomous_system: AutonomousSystem.from_dynamic!(d["autonomous_system"]),
146
148
  metadata: d,
147
149
  services: d.fetch("services", []).map { |x| Service.from_dynamic!(x) }
148
150
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "8.0.1"
4
+ VERSION = "8.0.2"
5
5
  end