ace-support-core 0.31.0 → 0.32.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: 24d4b0dce143ebd6e3a05238ffa19ba782ccebf08c7a9027db568d641f1a07e3
4
- data.tar.gz: 2ea4aa3a99418d953d05a4622760d3142fcf2593fce656f9c95da5dc0c3d3227
3
+ metadata.gz: bbf3729aa95960c4ae5dff473126e61e991c0b036817165602753b6b39e9a67d
4
+ data.tar.gz: a5152044d579586750e8623a378b01dd1a53d8032be9621eea26343fc9a15b5d
5
5
  SHA512:
6
- metadata.gz: 16fb57a03877b9e0602606aa6869613a823d09553fd477921d4827ab2d485c1cdb2620a6ce133d55c9aa00fe2931772aa8ded2354ed12b02d2016cc5c8d0e1a9
7
- data.tar.gz: c5dc7f819ca8bd17eac6b24b1c802befbcda08b320a317c2f3b7ad1527b8f2cb08f64866964aadda87f5036908bd2dc6d2502c43e0f77b3ce26de29d9b6c4405
6
+ metadata.gz: 204925a3ee7699019defcf6c038f34ed4d81f056b9ae2ec08acd90788de2d61bcc20d2f833f81db4f9d81ca20afefdce7dca13ed34e477de4ffa2df92eeb24ce
7
+ data.tar.gz: 6cdf410a04b8078f4b915d789adbb71eb8038b0968351aae7bc9127bd7ed2bcd9aabc9cab5677a4eb4426378e4cfb9d514c9bf861573cca3849a64d2fe0b244c
data/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.32.0] - 2026-09-24
11
+
12
+ ### Added
13
+
14
+ - Restrict file aggregation to an allowed root and explicit trusted paths for review context.
15
+
16
+ ## [0.31.1] - 2026-09-02
17
+
18
+ ### Technical
19
+ - Included in the coordinated all-package patch release preparation for ACE monorepo review.
10
20
  ## [0.31.0] - 2026-08-12
11
21
 
12
22
  ### Changed
@@ -13,6 +13,8 @@ module Ace
13
13
  @max_size = options[:max_size] || Atoms::FileReader::MAX_FILE_SIZE
14
14
  @base_dir = options[:base_dir] || Ace::Support::Fs::Molecules::ProjectRootFinder.find_or_current
15
15
  @exclude_patterns = options[:exclude] || []
16
+ @allowed_root = File.realpath(options[:allowed_root]) if options[:allowed_root]
17
+ @allowed_paths = Array(options[:allowed_paths])
16
18
  end
17
19
 
18
20
  # Aggregate files from patterns
@@ -142,6 +144,10 @@ module Ace
142
144
  # Make path relative to base directory for display
143
145
  display_path = make_relative_path(resolved_path)
144
146
 
147
+ if @allowed_root && !inside_allowed_root?(resolved_path)
148
+ raise ArgumentError, "File outside allowed root: #{display_path}"
149
+ end
150
+
145
151
  # Check if file is readable
146
152
  unless Atoms::FileReader.readable?(resolved_path)
147
153
  result[:errors] << "File not readable: #{display_path}"
@@ -175,6 +181,14 @@ module Ace
175
181
  end
176
182
  end
177
183
 
184
+ def inside_allowed_root?(path)
185
+ real_path = File.realpath(path)
186
+ real_path == @allowed_root || real_path.start_with?("#{@allowed_root}#{File::SEPARATOR}") ||
187
+ @allowed_paths.include?(real_path)
188
+ rescue Errno::ENOENT, Errno::EACCES
189
+ false
190
+ end
191
+
178
192
  # Make path relative to base directory
179
193
  # @param path [String] Path to make relative
180
194
  # @return [String] Relative path if possible
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ace
4
4
  module Core
5
- VERSION = "0.31.0"
5
+ VERSION = "0.32.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-support-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-08-12 00:00:00.000000000 Z
10
+ date: 2026-09-24 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ace-support-config
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '0.17'
18
+ version: '0.18'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '0.17'
25
+ version: '0.18'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: ace-support-fs
28
28
  requirement: !ruby/object:Gem::Requirement