bp3-activestorage 0.1.4 → 0.2.0

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: 34fbb5b6345aa578e865332d2ee110f53953882ceb091267dc0ec0d2545b995f
4
- data.tar.gz: 85787fa528b3fbfe8ace1442a7c379a86fb2cfbc4cabcae4953d7308e0c7b6a9
3
+ metadata.gz: c92e9ed2f063e2d3d1a777bdd9f3d3ddb23892a9ad70ef54796c4b4abf2e5f43
4
+ data.tar.gz: f6bcf3de5ed1ee85c69dcebab7281bbde03049f927b455e4535928d592d8ec58
5
5
  SHA512:
6
- metadata.gz: 1f29ebafd2d475e469e6cd2239c3385f415891061a8f8121e6f5d1f1ea55a710c92e9c0b4c54abfe09bbc3e633b23b2571b871eaa0701ccf51fe1364f8305ff3
7
- data.tar.gz: c9a9256d5da25941a6d5c2caa5c6675e33db65e1dd9f62ef46d1eddd0810a548d58417c73aca6069c5a68081bd7856c1ccbfe3c38f4da571a0e25ee41e248187
6
+ metadata.gz: a2fb3b472e8299d518b954a56b5a973a91601d23ad8dd7c9555b49b441423f4ddd44e0e6f166b2a33d34b2963c6d85c69b2ba33984dadf4cef2e16c07fabd990
7
+ data.tar.gz: 37c2134952350031e4d4a994468d4e38f8a566a83257e59ffcf0d310a904f639cc660d648818b307f5a2b124f699bc5f119092a40089a81f2caae3f6e217b003
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rake
3
3
  - rubocop-rspec
4
4
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2026-10-30
4
+
5
+ ### Security
6
+
7
+ - Refuse `ActiveStorage::Blob#key` to explore, as it locates the file in storage
8
+ - Require bp3-core 0.4.0, for `unexplorable_columns`
9
+
10
+ ## [0.1.5] - 2026-01-12
11
+
12
+ - Update gems
13
+
3
14
  ## [0.1.4] - 2024-11-18
4
15
 
5
16
  - Use ruby 3.3.5 and relax gem constraints
data/CLAUDE.md ADDED
@@ -0,0 +1,56 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ bp3-activestorage adapts `activestorage` for BP3 (persuavis/black_phoebe_3), a multi-site multi-tenant
8
+ Rails application. It makes ActiveStorage's records and controllers BP3-aware. There is nothing to
9
+ configure: adding the gem is enough.
10
+
11
+ ## Commands
12
+
13
+ The gems run on Ruby 3.4.6 (`.ruby-version`). Prefix commands with `~/.rvm/bin/rvm 3.4.6 do` when the
14
+ shell is not already on it; a missing `rspec` means the wrong Ruby, not a missing bundle.
15
+
16
+ - `bundle exec rake` - specs and RuboCop (the default task)
17
+ - `bundle exec rspec spec/path/to/file_spec.rb[:LINE]` - one file or example
18
+ - `bundle exec rubocop` / `bundle exec rubocop -a`
19
+ - `bin/setup`, `bin/console`, `rake install`
20
+
21
+ ## Architecture
22
+
23
+ `lib/bp3/activestorage/railtie.rb` reopens five classes in an `after_initialize` block. The Railtie is
24
+ only defined when `Rails.env` is.
25
+
26
+ **Models**: `ActiveStorage::Attachment`, `Blob` and `VariantRecord`
27
+ - include `Bp3::Core::Rqid`, `Sqnr` and `Ransackable` (Blob also `Displayable`), call
28
+ `use_sqnr_for_ordering` and `has_paper_trail`
29
+ - declare optional `belongs_to :sites_site` (aliased `site`) and `belongs_to :tenant` by hand
30
+ - define `table_name_basis`, the table name without its `public.` schema prefix
31
+ - **Do not include `Bp3::Core::Tenantable`.** Its callbacks set site and tenant behind the scenes and its
32
+ default scope then hides blobs that a later lookup needs to find
33
+ - Blob's `version_filter_mask` is `'[FILTERED][AB]'`
34
+
35
+ **Controllers**: `ActiveStorage::BaseController` and `ActiveStorage::Representations::ProxyController`
36
+ include `Bp3::Core::Actions`, `Settings`, `FeatureFlags` and `Cookies`, so file requests get the same site,
37
+ tenant and request tracking as the rest of the application. They do not authenticate;
38
+ `authenticate_root!` breaks the proxy controller.
39
+
40
+ ## Testing
41
+
42
+ The spec only checks the version; the Railtie needs a Rails application with a database to exercise. Try a
43
+ change against the application (black_phoebe_3) by putting this repo's `lib` ahead of the bundled gem.
44
+
45
+ ## Code Style
46
+
47
+ - RuboCop (`.rubocop.yml`): target Ruby 3.2.2, NewCops, rubocop-rake and rubocop-rspec; AbcSize 26,
48
+ MethodLength 15, BlockLength 66, ModuleLength 150; `Lint/ConstantDefinitionInBlock` and `Lint/Void`
49
+ are off for `lib/bp3/**/railtie.rb`, where classes are reopened inside a block
50
+ - Every file starts with `# frozen_string_literal: true`
51
+ - American English; no trailing whitespace on any added or modified line
52
+
53
+ ## Release
54
+
55
+ Bump `lib/bp3/activestorage/version.rb` and add a `CHANGELOG.md` entry. `rake release` tags, pushes and
56
+ publishes to rubygems.org; leave releasing and committing to the user.
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bp3-activestorage (0.1.4)
5
- activestorage (>= 7.1.2)
6
- bp3-core (>= 0.1.0)
4
+ bp3-activestorage (0.2.0)
5
+ activestorage (~> 8.1)
6
+ bp3-core (>= 0.4.0)
7
7
  paper_trail (>= 15.1)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (8.0.0)
13
- actionview (= 8.0.0)
14
- activesupport (= 8.0.0)
12
+ actionpack (8.1.4)
13
+ actionview (= 8.1.4)
14
+ activesupport (= 8.1.4)
15
15
  nokogiri (>= 1.8.5)
16
16
  rack (>= 2.2.4)
17
17
  rack-session (>= 1.0.1)
@@ -19,135 +19,156 @@ GEM
19
19
  rails-dom-testing (~> 2.2)
20
20
  rails-html-sanitizer (~> 1.6)
21
21
  useragent (~> 0.16)
22
- actionview (8.0.0)
23
- activesupport (= 8.0.0)
22
+ actionview (8.1.4)
23
+ activesupport (= 8.1.4)
24
24
  builder (~> 3.1)
25
25
  erubi (~> 1.11)
26
26
  rails-dom-testing (~> 2.2)
27
27
  rails-html-sanitizer (~> 1.6)
28
- activejob (8.0.0)
29
- activesupport (= 8.0.0)
28
+ activejob (8.1.4)
29
+ activesupport (= 8.1.4)
30
30
  globalid (>= 0.3.6)
31
- activemodel (8.0.0)
32
- activesupport (= 8.0.0)
33
- activerecord (8.0.0)
34
- activemodel (= 8.0.0)
35
- activesupport (= 8.0.0)
31
+ activemodel (8.1.4)
32
+ activesupport (= 8.1.4)
33
+ activerecord (8.1.4)
34
+ activemodel (= 8.1.4)
35
+ activesupport (= 8.1.4)
36
36
  timeout (>= 0.4.0)
37
- activestorage (8.0.0)
38
- actionpack (= 8.0.0)
39
- activejob (= 8.0.0)
40
- activerecord (= 8.0.0)
41
- activesupport (= 8.0.0)
37
+ activestorage (8.1.4)
38
+ actionpack (= 8.1.4)
39
+ activejob (= 8.1.4)
40
+ activerecord (= 8.1.4)
41
+ activesupport (= 8.1.4)
42
42
  marcel (~> 1.0)
43
- activesupport (8.0.0)
43
+ activesupport (8.1.4)
44
44
  base64
45
- benchmark (>= 0.3)
46
45
  bigdecimal
47
46
  concurrent-ruby (~> 1.0, >= 1.3.1)
48
47
  connection_pool (>= 2.2.5)
49
48
  drb
50
49
  i18n (>= 1.6, < 2)
50
+ json
51
51
  logger (>= 1.4.2)
52
52
  minitest (>= 5.1)
53
53
  securerandom (>= 0.3)
54
54
  tzinfo (~> 2.0, >= 2.0.5)
55
55
  uri (>= 0.13.1)
56
- ast (2.4.2)
57
- base64 (0.2.0)
58
- benchmark (0.4.0)
59
- bigdecimal (3.1.8)
60
- bp3-core (0.1.5)
61
- actionview (>= 7.1.2)
62
- activesupport (>= 7.1.2)
56
+ ast (2.4.3)
57
+ base64 (0.3.0)
58
+ bigdecimal (4.1.3)
59
+ bp3-core (0.4.0)
60
+ actionview (~> 8.1)
61
+ activesupport (~> 8.1)
62
+ bp3-request_state (~> 0.1)
63
+ bp3-request_state (0.1.3)
64
+ actionpack (~> 8.1)
65
+ activesupport (~> 8.1)
66
+ request_store (>= 1.5.1)
63
67
  builder (3.3.0)
64
- byebug (11.1.3)
65
- concurrent-ruby (1.3.4)
66
- connection_pool (2.4.1)
67
- crass (1.0.6)
68
- diff-lcs (1.5.1)
69
- drb (2.2.1)
70
- erubi (1.13.0)
71
- globalid (1.2.1)
68
+ byebug (13.0.0)
69
+ reline (>= 0.6.0)
70
+ concurrent-ruby (1.3.8)
71
+ connection_pool (3.0.2)
72
+ crass (1.0.8)
73
+ diff-lcs (1.6.2)
74
+ drb (2.2.3)
75
+ erubi (1.13.1)
76
+ globalid (1.4.0)
72
77
  activesupport (>= 6.1)
73
- i18n (1.14.6)
78
+ i18n (1.15.2)
74
79
  concurrent-ruby (~> 1.0)
75
- json (2.8.2)
76
- language_server-protocol (3.17.0.3)
77
- logger (1.6.1)
78
- loofah (2.23.1)
80
+ io-console (0.9.5)
81
+ json (3.1.0)
82
+ language_server-protocol (3.17.0.6)
83
+ lint_roller (1.1.0)
84
+ logger (1.7.0)
85
+ loofah (2.25.2)
79
86
  crass (~> 1.0.2)
80
87
  nokogiri (>= 1.12.0)
81
- marcel (1.0.4)
82
- minitest (5.25.1)
83
- nokogiri (1.16.7-x86_64-darwin)
88
+ marcel (1.2.1)
89
+ minitest (6.0.6)
90
+ drb (~> 2.0)
91
+ prism (~> 1.5)
92
+ nokogiri (1.19.4-x86_64-darwin)
84
93
  racc (~> 1.4)
85
- paper_trail (16.0.0)
86
- activerecord (>= 6.1)
94
+ paper_trail (17.0.0)
95
+ activerecord (>= 7.1)
87
96
  request_store (~> 1.4)
88
- parallel (1.26.3)
89
- parser (3.3.6.0)
97
+ parallel (2.3.0)
98
+ parser (3.3.13.0)
90
99
  ast (~> 2.4.1)
91
100
  racc
101
+ prism (1.9.0)
92
102
  racc (1.8.1)
93
- rack (3.1.8)
94
- rack-session (2.0.0)
103
+ rack (3.2.8)
104
+ rack-session (2.1.2)
105
+ base64 (>= 0.1.0)
95
106
  rack (>= 3.0.0)
96
- rack-test (2.1.0)
107
+ rack-test (2.3.0)
97
108
  rack (>= 1.3)
98
- rails-dom-testing (2.2.0)
109
+ rails-dom-testing (2.3.0)
99
110
  activesupport (>= 5.0.0)
100
111
  minitest
101
112
  nokogiri (>= 1.6)
102
- rails-html-sanitizer (1.6.0)
103
- loofah (~> 2.21)
104
- nokogiri (~> 1.14)
113
+ rails-html-sanitizer (1.7.1)
114
+ loofah (~> 2.25, >= 2.25.2)
115
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
105
116
  rainbow (3.1.1)
106
- rake (13.2.1)
107
- regexp_parser (2.9.2)
117
+ rake (13.4.2)
118
+ regexp_parser (2.13.1)
119
+ reline (0.7.0)
120
+ io-console (~> 0.5)
108
121
  request_store (1.7.0)
109
122
  rack (>= 1.4)
110
- rspec (3.13.0)
123
+ rspec (3.13.2)
111
124
  rspec-core (~> 3.13.0)
112
125
  rspec-expectations (~> 3.13.0)
113
126
  rspec-mocks (~> 3.13.0)
114
- rspec-core (3.13.2)
127
+ rspec-core (3.13.6)
115
128
  rspec-support (~> 3.13.0)
116
- rspec-expectations (3.13.3)
129
+ rspec-expectations (3.13.5)
117
130
  diff-lcs (>= 1.2.0, < 2.0)
118
131
  rspec-support (~> 3.13.0)
119
- rspec-mocks (3.13.2)
132
+ rspec-mocks (3.13.8)
120
133
  diff-lcs (>= 1.2.0, < 2.0)
121
134
  rspec-support (~> 3.13.0)
122
- rspec-support (3.13.1)
123
- rubocop (1.68.0)
124
- json (~> 2.3)
125
- language_server-protocol (>= 3.17.0)
126
- parallel (~> 1.10)
135
+ rspec-support (3.13.7)
136
+ rubocop (1.92.2)
137
+ json (>= 2.3)
138
+ language_server-protocol (~> 3.17.0.2)
139
+ lint_roller (~> 1.1.0)
140
+ parallel (>= 1.10)
127
141
  parser (>= 3.3.0.2)
128
142
  rainbow (>= 2.2.2, < 4.0)
129
- regexp_parser (>= 2.4, < 3.0)
130
- rubocop-ast (>= 1.32.2, < 2.0)
143
+ regexp_parser (>= 2.11.3, < 3.0)
144
+ rubocop-ast (>= 1.49.0, < 2.0)
131
145
  ruby-progressbar (~> 1.7)
132
- unicode-display_width (>= 2.4.0, < 3.0)
133
- rubocop-ast (1.36.1)
134
- parser (>= 3.3.1.0)
135
- rubocop-rake (0.6.0)
136
- rubocop (~> 1.0)
137
- rubocop-rspec (3.2.0)
138
- rubocop (~> 1.61)
146
+ unicode-display_width (>= 2.4.0, < 4.0)
147
+ rubocop-ast (1.50.0)
148
+ parser (>= 3.3.7.2)
149
+ prism (~> 1.7)
150
+ rubocop-rake (0.7.1)
151
+ lint_roller (~> 1.1)
152
+ rubocop (>= 1.72.1)
153
+ rubocop-rspec (3.10.2)
154
+ lint_roller (~> 1.1)
155
+ regexp_parser (>= 2.0)
156
+ rubocop (~> 1.86, >= 1.86.2)
139
157
  ruby-progressbar (1.13.0)
140
- securerandom (0.3.2)
141
- timeout (0.4.2)
158
+ securerandom (0.4.1)
159
+ timeout (0.6.1)
142
160
  tzinfo (2.0.6)
143
161
  concurrent-ruby (~> 1.0)
144
- unicode-display_width (2.6.0)
145
- uri (1.0.2)
146
- useragent (0.16.10)
162
+ unicode-display_width (3.3.0)
163
+ unicode-emoji (~> 4.3)
164
+ unicode-emoji (4.3.0)
165
+ uri (1.1.2)
166
+ useragent (0.16.11)
147
167
 
148
168
  PLATFORMS
149
169
  x86_64-darwin-22
150
170
  x86_64-darwin-23
171
+ x86_64-darwin-24
151
172
 
152
173
  DEPENDENCIES
153
174
  bp3-activestorage!
@@ -159,4 +180,4 @@ DEPENDENCIES
159
180
  rubocop-rspec (>= 2.25)
160
181
 
161
182
  BUNDLED WITH
162
- 2.5.23
183
+ 2.7.2
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ['lib']
33
33
 
34
- spec.add_dependency 'activestorage', '>= 7.1.2'
35
- spec.add_dependency 'bp3-core', '>= 0.1.0'
34
+ spec.add_dependency 'activestorage', '~> 8.1'
35
+ spec.add_dependency 'bp3-core', '>= 0.4.0'
36
36
  spec.add_dependency 'paper_trail', '>= 15.1'
37
37
 
38
38
  spec.add_development_dependency 'byebug'
@@ -2,7 +2,7 @@
2
2
 
3
3
  # require 'rails/railtie'
4
4
 
5
- # rubocop:disable Metrics/BlockLength
5
+ # rubocop:disable-next Metrics/BlockLength
6
6
  module Bp3
7
7
  module Activestorage
8
8
  if defined?(Rails.env)
@@ -41,6 +41,9 @@ module Bp3
41
41
  include Bp3::Core::Displayable
42
42
  include Bp3::Core::Ransackable
43
43
 
44
+ # The key locates the file in storage, so it is not to be guessed at one character at a time
45
+ self.unexplorable_columns = %w[key]
46
+
44
47
  use_sqnr_for_ordering
45
48
  has_paper_trail
46
49
 
@@ -107,4 +110,3 @@ module Bp3
107
110
  end
108
111
  end
109
112
  end
110
- # rubocop:enable Metrics/BlockLength
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bp3
4
4
  module Activestorage
5
- VERSION = '0.1.4'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,43 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bp3-activestorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wim den Braven
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-11-18 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activestorage
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 7.1.2
18
+ version: '8.1'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">="
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 7.1.2
25
+ version: '8.1'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: bp3-core
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: 0.1.0
32
+ version: 0.4.0
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: 0.1.0
39
+ version: 0.4.0
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: paper_trail
43
42
  requirement: !ruby/object:Gem::Requirement
@@ -136,7 +135,6 @@ dependencies:
136
135
  - - ">="
137
136
  - !ruby/object:Gem::Version
138
137
  version: '2.25'
139
- description:
140
138
  email:
141
139
  - wimdenbraven@persuavis.com
142
140
  executables: []
@@ -147,6 +145,7 @@ files:
147
145
  - ".rubocop.yml"
148
146
  - ".yardopts"
149
147
  - CHANGELOG.md
148
+ - CLAUDE.md
150
149
  - Gemfile
151
150
  - Gemfile.lock
152
151
  - LICENSE.txt
@@ -167,7 +166,6 @@ metadata:
167
166
  source_code_uri: https://github.com/persuavis/bp3-activestorage
168
167
  changelog_uri: https://github.com/persuavis/bp3-activestorage/blob/main/CHANGELOG.md
169
168
  rubygems_mfa_required: 'true'
170
- post_install_message:
171
169
  rdoc_options: []
172
170
  require_paths:
173
171
  - lib
@@ -182,8 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
180
  - !ruby/object:Gem::Version
183
181
  version: '0'
184
182
  requirements: []
185
- rubygems_version: 3.5.23
186
- signing_key:
183
+ rubygems_version: 4.0.4
187
184
  specification_version: 4
188
185
  summary: bp3-activestorage adapts activestorage for BP3 (persuavis/black_phoebe_3).
189
186
  test_files: []