ronin-db-activerecord 0.1.1 → 0.1.3

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: 1955e0bb44de72a102427476e4a30818b24e9bd752fba63df6f848335886e335
4
+ data.tar.gz: dd85e3447194d1f9f12be6e239867e3ab1cae5823ee8a26d82f084a54ed69ee3
5
5
  SHA512:
6
- metadata.gz: 2e4d44293f4877cfa1e2aa1c806b6f1b3ada40c58fe0b1d38702bc41dce1c898c7d89f6684bf24bf28888db87f7560c141fda2ea504c3ac5134c8603f0ce8e63
7
- data.tar.gz: 2f003abce7ad7327b7c843ccb12d272af041f2b2f058afb3e2e7bb573e2ef9986aa8dd9c2fa35179837e21e3aef929524b389459de3ee12e06bce1c05ed77b50
6
+ metadata.gz: 8d910cee63ce24acfa4856b342627c3c9899dc66da57b477bc1fa7736e79a2dcc9f11d14736c5e2006f80e6ed871e73d9c7af6036db1e6d6e211b7319eb190a9
7
+ data.tar.gz: 01f5b3d036f3757d39778c3a345fc9bea9804d18189a550e13010dcd52ee7fcb7c0873fcf1aaa93e71b3fd1376cfb51653e17bfaa4eb35f17d5a950497522362
data/.document CHANGED
@@ -2,4 +2,3 @@ lib/**/*.rb
2
2
  -
3
3
  ChangeLog.md
4
4
  COPYING.txt
5
- man/*.md
@@ -16,7 +16,7 @@ jobs:
16
16
  - truffleruby
17
17
  name: Ruby ${{ matrix.ruby }}
18
18
  steps:
19
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v4
20
20
  - name: Set up Ruby
21
21
  uses: ruby/setup-ruby@v1
22
22
  with:
@@ -35,7 +35,7 @@ jobs:
35
35
  rubocop:
36
36
  runs-on: ubuntu-latest
37
37
  steps:
38
- - uses: actions/checkout@v2
38
+ - uses: actions/checkout@v4
39
39
  - name: Set up Ruby
40
40
  uses: ruby/setup-ruby@v1
41
41
  with:
data/ChangeLog.md CHANGED
@@ -1,3 +1,16 @@
1
+ ### 0.1.3 / 2023-10-14
2
+
3
+ * Require [activerecord] `~> 7.0, < 7.1.0`.
4
+ * **Note:** [activerecord] 7.1.0 changed it's internal migration APIs which
5
+ `ronin-db-activerecord` was using to run migrations.
6
+
7
+ ### 0.1.2 / 2023-09-19
8
+
9
+ * Fix {Ronin::DB::MACAddress#address} validation regex to match the whole
10
+ string.
11
+ * Use `:datetime` instead of `:time` for `created_at` attributes.
12
+ * Documentation improvements.
13
+
1
14
  ### 0.1.1 / 2023-04-04
2
15
 
3
16
  * Reordered database migrations so they can be ran in correct order on
@@ -47,3 +60,4 @@
47
60
  * {Ronin::DB::Vulnerability}
48
61
  * {Ronin::DB::WebCredential}
49
62
 
63
+ [activerecord]: https://github.com/rails/rails/tree/main/activerecord#readme
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
@@ -121,7 +120,9 @@ Ronin::DB::Models.connect
121
120
  ## Requirements
122
121
 
123
122
  * [Ruby] >= 3.0.0
124
- * [activerecord] ~> 7.0
123
+ * [activerecord] ~> 7.0, < 7.1.0
124
+ * **Note:** [activerecord] 7.1.0 changed it's internal migration APIs which
125
+ `ronin-db-activerecord` was using to run migrations.
125
126
 
126
127
  ## Install
127
128
 
data/gemspec.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: ronin-db-activerecord
2
- version: 0.1.1
2
+ version: 0.1.3
3
3
  summary: ActiveRecord backend for the Ronin Database
4
4
  description:
5
5
  ronin-db-activerecord contains ActiveRecord models and migrations for the
@@ -22,7 +22,7 @@ required_ruby_version: ">= 3.0.0"
22
22
 
23
23
  dependencies:
24
24
  uri-query_params: ~> 0.6
25
- activerecord: ~> 7.0
25
+ activerecord: ~> 7.0, < 7.1.0
26
26
 
27
27
  development_dependencies:
28
28
  bundler: ~> 2.0
@@ -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.3
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-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uri-query_params
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '7.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 7.1.0
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@ dependencies:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '7.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: 7.1.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement