ronin-db-activerecord 0.1.5 → 0.1.6

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: 35997b96261ef5eff4b50913690276c01e5c252984575aaed1cb2043c54e420f
4
- data.tar.gz: 97fb7f0f80518d129b4919e12787fb837a2a1090a67fa3d443f8f46f067a26aa
3
+ metadata.gz: 641f203f12ca2e88ac5de9f8a8c5fe6fbf5da527b7108102d55f0e65934ea641
4
+ data.tar.gz: a55081d93e685f8232ae74e54bd99a5f242b40834d5ea55792ec08f3dc184782
5
5
  SHA512:
6
- metadata.gz: f21ffa2cc2243a506e1338bf64f14dbcf6dd99605a25ac49b0a05f5e5298dfa43e2dbbedb50c74df9cb06ea74e35f33d6ce2bee1cc0ffa018c40aa194d9108a4
7
- data.tar.gz: 6f04a43848ab8faccb4e779d8f999de7cc51a669a935dddf0ec1e7a7d3f314a202355cbe114d29bfe70c49e55ec92a7cd4e9f2dcf7fba535013587f6d248bdc7
6
+ metadata.gz: f090ebd86546fed4ba74bada319aaaf6c524360b4f48745042aa8d5b5118c50c3e5d3224143c6fa3901546b456dd853dd1fe97853e9c259b76f8ad284e8fec0b
7
+ data.tar.gz: 833ab9ec1142ba4363a42453c874bde62c2b049fb3662dfe3870c9d4eeed38948d0faff22dcdc85b9db71c8610dde8d0393e2ef51779f3df76ee4102c1957f39
@@ -12,6 +12,7 @@ jobs:
12
12
  - '3.0'
13
13
  - '3.1'
14
14
  - '3.2'
15
+ - '3.3'
15
16
  - jruby
16
17
  - truffleruby
17
18
  name: Ruby ${{ matrix.ruby }}
data/ChangeLog.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### 0.1.6 / 2024-06-19
2
+
3
+ * Improve the validation of email addresses passed to
4
+ {Ronin::DB::EmailAddress.import}.
5
+ * Add missing `software_id` column to the `ronin_open_ports` table.
6
+ * Add missing `foreign_key` to {Ronin::DB::SoftwareVendor#software}.
7
+ * Add missing `class_name` to {Ronin::DB::Vulnerability#url}.
8
+ * Add missing `dependent: :destroy` to {Ronin::DB::HostName#urls}.
9
+ * Add missing `dependent: :destroy` to {Ronin::DB::HostName#email_addresses}.
10
+
1
11
  ### 0.1.5 / 2023-12-13
2
12
 
3
13
  * Corrected {Ronin::DB::HTTPRequest#request_method} to accept and store
data/Gemfile CHANGED
@@ -9,6 +9,7 @@ gem 'sqlite3', '~> 1.0', platforms: [:mri, :truffleruby]
9
9
  platform :jruby do
10
10
  gem 'jruby-openssl', '~> 0.7'
11
11
  gem 'activerecord-jdbcsqlite3-adapter', '~> 70.0'
12
+ gem 'activerecord', '< 7.1.0'
12
13
  end
13
14
 
14
15
  group :development do
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Adds the `software_id` column to the `ronin_open_ports` table.
25
+ #
26
+ class AddSoftwareIdColumnToOpenPortsTable < ActiveRecord::Migration[7.0]
27
+ def change
28
+ add_reference :ronin_open_ports, :software, null: true,
29
+ foreign_key: {
30
+ to_table: :ronin_softwares
31
+ }
32
+ end
33
+ end
data/gemspec.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: ronin-db-activerecord
2
- version: 0.1.5
2
+ version: 0.1.6
3
3
  summary: ActiveRecord backend for the Ronin Database
4
4
  description:
5
5
  ronin-db-activerecord contains ActiveRecord models and migrations for the
@@ -159,8 +159,8 @@ module Ronin
159
159
  # @api public
160
160
  #
161
161
  def self.import(email)
162
- if email =~ /\s/
163
- raise(ArgumentError,"email address #{email.inspect} must not contain spaces")
162
+ unless email =~ URI::MailTo::EMAIL_REGEXP
163
+ raise(ArgumentError,"invalid email address: #{email.inspect}")
164
164
  end
165
165
 
166
166
  normalized_email = email.downcase
@@ -92,13 +92,14 @@ module Ronin
92
92
  # The email addresses that are associated with the host-name.
93
93
  #
94
94
  # @return [Array<EmailAddress>]
95
- has_many :email_addresses
95
+ has_many :email_addresses, dependent: :destroy
96
96
 
97
97
  # @!attribute [rw] urls
98
98
  # The URLs that point to this host name.
99
99
  #
100
100
  # @return [Array<URL>]
101
- has_many :urls, class_name: 'URL'
101
+ has_many :urls, dependent: :destroy,
102
+ class_name: 'URL'
102
103
 
103
104
  #
104
105
  # Looks up the host name.
@@ -31,11 +31,18 @@ module Ronin
31
31
  include Model
32
32
  include Model::HasUniqueName
33
33
 
34
- # The primary-key of the vendor
34
+ # @!attribute [rw] id
35
+ # The primary-key of the vendor
36
+ #
37
+ # @return [Integer]
35
38
  attribute :id, :integer
36
39
 
37
- # Products published by the vendor
38
- has_many :software, class_name: 'Software'
40
+ # @!attribute [rw] software
41
+ # Products published by the vendor
42
+ #
43
+ # @return [Array<Software>]
44
+ has_many :software, class_name: 'Software',
45
+ foreign_key: :vendor_id
39
46
 
40
47
  end
41
48
  end
@@ -72,7 +72,8 @@ module Ronin
72
72
  # The URL that is vulnerable.
73
73
  #
74
74
  # @return [URL, nil]
75
- belongs_to :url, optional: true
75
+ belongs_to :url, optional: true,
76
+ class_name: 'URL'
76
77
 
77
78
  # @!attribute [rw] advisory
78
79
  # The vulnerability advisory.
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.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uri-query_params
@@ -109,6 +109,7 @@ files:
109
109
  - db/migrate/0033_create_ronin_http_response_headers_table.rb
110
110
  - db/migrate/0034_create_ronin_service_credentials_table.rb
111
111
  - db/migrate/0035_create_ronin_web_credentials_table.rb
112
+ - db/migrate/0036_add_software_id_column_to_open_ports_table.rb
112
113
  - gemspec.yml
113
114
  - lib/ronin/db/address.rb
114
115
  - lib/ronin/db/advisory.rb
@@ -177,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
178
  - !ruby/object:Gem::Version
178
179
  version: '0'
179
180
  requirements: []
180
- rubygems_version: 3.3.26
181
+ rubygems_version: 3.3.27
181
182
  signing_key:
182
183
  specification_version: 4
183
184
  summary: ActiveRecord backend for the Ronin Database