ronin-db-activerecord 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 7721bd84ea50f21af938f496faf1699c3107782131ca9db874eb101b19abf759
4
- data.tar.gz: f4394aed731c6f2d83124d870ba29da9258c034828bc4ca96643f5a9b9267d46
3
+ metadata.gz: 103e3bf44773b89e137e7fbeb233068092132fa2cb84f2853c279656a5840161
4
+ data.tar.gz: 8ccbc6e458538cac41520f2af05bb3c5ce84d99c1052c7a47febb1138293cbc4
5
5
  SHA512:
6
- metadata.gz: 2e4d44293f4877cfa1e2aa1c806b6f1b3ada40c58fe0b1d38702bc41dce1c898c7d89f6684bf24bf28888db87f7560c141fda2ea504c3ac5134c8603f0ce8e63
7
- data.tar.gz: 2f003abce7ad7327b7c843ccb12d272af041f2b2f058afb3e2e7bb573e2ef9986aa8dd9c2fa35179837e21e3aef929524b389459de3ee12e06bce1c05ed77b50
6
+ metadata.gz: 4dc6c76ee2a87f82d3f184c42c5236e821f626c33563d88c22bab7d5482c0493a8fbfc88568757c3c7791868cf2476398103d6e0687c2acf164efede7c3d73cd
7
+ data.tar.gz: 33e06032f67edc6022bb39f33ab70ede1ca2fcf49f11677b926e7c41ee55a8e292c94f052065f9ea6ac8caefc49550691e56db86ffa5ea481111c0edad3c130a
data/.document CHANGED
@@ -2,4 +2,3 @@ lib/**/*.rb
2
2
  -
3
3
  ChangeLog.md
4
4
  COPYING.txt
5
- man/*.md
data/ChangeLog.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### 0.1.2 / 2023-09-19
2
+
3
+ * Fix {Ronin::DB::MACAddress#address} validation regex to match the whole
4
+ string.
5
+ * Use `:datetime` instead of `:time` for `created_at` attributes.
6
+ * Documentation improvements.
7
+
1
8
  ### 0.1.1 / 2023-04-04
2
9
 
3
10
  * Reordered database migrations so they can be ran in correct order on
data/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
  * [Issues](https://github.com/ronin-rb/ronin-db-activerecord/issues)
10
10
  * [Documentation](https://ronin-rb.dev/docs/ronin-db-activerecord/frames)
11
11
  * [Discord](https://discord.gg/6WAb3PsVX9) |
12
- [Twitter](https://twitter.com/ronin_rb) |
13
12
  [Mastodon](https://infosec.exchange/@ronin_rb)
14
13
 
15
14
  ## Description
data/gemspec.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: ronin-db-activerecord
2
- version: 0.1.1
2
+ version: 0.1.2
3
3
  summary: ActiveRecord backend for the Ronin Database
4
4
  description:
5
5
  ronin-db-activerecord contains ActiveRecord models and migrations for the
@@ -58,7 +58,7 @@ module Ronin
58
58
  # Tracks when the IP Address was first created
59
59
  #
60
60
  # @return [Time]
61
- attribute :created_at, :time
61
+ attribute :created_at, :datetime
62
62
 
63
63
  #
64
64
  # Looks up the address.
@@ -69,6 +69,8 @@ module Ronin
69
69
  # @return [Address, nil]
70
70
  # The found address.
71
71
  #
72
+ # @api public
73
+ #
72
74
  def self.lookup(address)
73
75
  find_by(address: address)
74
76
  end
@@ -80,7 +82,7 @@ module Ronin
80
82
  # The address to parse.
81
83
  #
82
84
  # @return [Address]
83
- # The parsed address.
85
+ # The imported address.
84
86
  #
85
87
  # @api public
86
88
  #
data/lib/ronin/db/asn.rb CHANGED
@@ -82,13 +82,13 @@ module Ronin
82
82
  # @!attribute [rw] country_code
83
83
  # The country code of the ASN.
84
84
  #
85
- # @return [String]
85
+ # @return [String, nil]
86
86
  attribute :country_code, :string
87
87
 
88
88
  # @!attribute [rw] name
89
89
  # The organization the ASN is currently assigned to.
90
90
  #
91
- # @return [String]
91
+ # @return [String, nil]
92
92
  attribute :name, :string
93
93
 
94
94
  #
@@ -84,7 +84,7 @@ module Ronin
84
84
  # Tracks when the email address was created at.
85
85
  #
86
86
  # @return [Time]
87
- attribute :created_at, :time
87
+ attribute :created_at, :datetime
88
88
 
89
89
  #
90
90
  # Searches for email addresses associated with the given host name(s).
@@ -60,7 +60,7 @@ module Ronin
60
60
  # When the host name was first created.
61
61
  #
62
62
  # @return [Time]
63
- attribute :created_at, :time
63
+ attribute :created_at, :datetime
64
64
 
65
65
  # @!attribute [rw] host_name_ip_addresses
66
66
  # The IP Address associations.
@@ -58,7 +58,7 @@ module Ronin
58
58
  # Tracks when a IP Address is associated with a host name
59
59
  #
60
60
  # @return [Time]
61
- attribute :created_at, :time
61
+ attribute :created_at, :datetime
62
62
 
63
63
  end
64
64
  end
@@ -57,7 +57,7 @@ module Ronin
57
57
  # When the HTTP query param name was first created.
58
58
  #
59
59
  # @return [Time]
60
- attribute :created_at, :time
60
+ attribute :created_at, :datetime
61
61
 
62
62
  #
63
63
  # Converts the HTTP query param name to a String.
@@ -113,7 +113,7 @@ module Ronin
113
113
  # When the HTTP request was created.
114
114
  #
115
115
  # @return [Time]
116
- attribute :created_at, :time
116
+ attribute :created_at, :datetime
117
117
 
118
118
  end
119
119
  end
@@ -74,7 +74,7 @@ module Ronin
74
74
  # When the HTTP response was created.
75
75
  #
76
76
  # @return [Time]
77
- attribute :created_at, :time
77
+ attribute :created_at, :datetime
78
78
 
79
79
  # @!attribute [rw] request
80
80
  # The associated HTTP request that the response was returned for.
@@ -55,7 +55,7 @@ module Ronin
55
55
  # Tracks when an IP Address becomes associated with a MAC Address.
56
56
  #
57
57
  # @return [Time]
58
- attribute :created_at, :time
58
+ attribute :created_at, :datetime
59
59
 
60
60
  end
61
61
  end
@@ -34,12 +34,12 @@ module Ronin
34
34
  # The MAC address.
35
35
  #
36
36
  # @return [String]
37
- attribute :address, :string # length: 17..17,
37
+ attribute :address, :string
38
38
  validates :address, presence: true,
39
39
  uniqueness: true,
40
40
  length: {maximum: 17},
41
41
  format: {
42
- with: /[0-9a-fA-F]{2}(?::[0-9a-fA-F]{2}){5}/,
42
+ with: /\A[0-9a-fA-F]{2}(?::[0-9a-fA-F]{2}){5}\z/,
43
43
  message: 'Must be a valid MAC address'
44
44
  }
45
45
 
@@ -42,7 +42,7 @@ module Ronin
42
42
  #
43
43
  def self.included(model)
44
44
  model.class_eval do
45
- attribute :last_scanned_at, :time
45
+ attribute :last_scanned_at, :datetime
46
46
  end
47
47
  end
48
48
  end
@@ -74,7 +74,7 @@ module Ronin
74
74
  # Define the created_at timestamp
75
75
  #
76
76
  # @return [Time]
77
- attribute :created_at, :time
77
+ attribute :created_at, :datetime
78
78
 
79
79
  # @!attribute [rw] service_credentials
80
80
  # Credentials used by the service running on the port
@@ -43,7 +43,7 @@ module Ronin
43
43
  # Tracks when the organization was first created
44
44
  #
45
45
  # @return [Time]
46
- attribute :created_at, :time
46
+ attribute :created_at, :datetime
47
47
 
48
48
  end
49
49
  end
data/lib/ronin/db/os.rb CHANGED
@@ -51,14 +51,14 @@ module Ronin
51
51
  #
52
52
  # @return [String]
53
53
  attribute :version, :string
54
- validates :version, presence: true,
54
+ validates :version, presence: true,
55
55
  uniqueness: {scope: :name}
56
56
 
57
57
  # @!attribute [rw] os_guesses
58
58
  # Any OS guesses for the Operating System.
59
59
  #
60
60
  # @return [Array<OSGuess>]
61
- has_many :os_guesses, dependent: :destroy,
61
+ has_many :os_guesses, dependent: :destroy,
62
62
  class_name: 'OSGuess'
63
63
 
64
64
  # @!attribute [rw] ip_addresses
@@ -57,7 +57,7 @@ module Ronin
57
57
  # Tracks when an OS guess is made against an IP Address.
58
58
  #
59
59
  # @return [Time]
60
- attribute :created_at, :time
60
+ attribute :created_at, :datetime
61
61
 
62
62
  end
63
63
  end
@@ -49,14 +49,14 @@ module Ronin
49
49
  #
50
50
  # @return [String]
51
51
  attribute :version, :string
52
- validates :version, presence: true,
52
+ validates :version, presence: true,
53
53
  uniqueness: {scope: :name}
54
54
 
55
55
  # @!attribute [rw] vendor
56
56
  # The vendor of the software
57
57
  #
58
58
  # @return [SoftwareVendor, nil]
59
- belongs_to :vendor, optional: true,
59
+ belongs_to :vendor, optional: true,
60
60
  class_name: 'SoftwareVendor'
61
61
 
62
62
  # @!attribute [rw] open_ports
data/lib/ronin/db/url.rb CHANGED
@@ -95,7 +95,7 @@ module Ronin
95
95
  # Defines the created_at timestamp
96
96
  #
97
97
  # @return [Time]
98
- attribute :created_at, :time
98
+ attribute :created_at, :datetime
99
99
 
100
100
  # @!attribute [rw] query_params
101
101
  # The query params of the URL.
@@ -57,7 +57,7 @@ module Ronin
57
57
  # When the URL query param name was first created.
58
58
  #
59
59
  # @return [Time]
60
- attribute :created_at, :time
60
+ attribute :created_at, :datetime
61
61
 
62
62
  #
63
63
  # Converts the URL query param name to a String.
@@ -48,7 +48,7 @@ module Ronin
48
48
  # Tracks when the user-name was created.
49
49
  #
50
50
  # @return [Time]
51
- attribute :created_at, :time
51
+ attribute :created_at, :datetime
52
52
 
53
53
  # @!attribute [rw] credentials
54
54
  # Any credentials belonging to the user.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-db-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-04 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uri-query_params