Skip to content

Commit 449be1b

Browse files
committed
fix(gemspec): ship only runtime files in packaged gem
The gemspec used `git ls-files` to populate `s.files`, which pulled every tracked file — Gemfile, Gemfile.lock, examples/, spec/, .github/, .devcontainer/, etc. — into the published gem. Downstream vulnerability scanners (AWS ECR, Snyk, Trivy, Grype) parse those bundled Gemfile.lock and example-app Gemfiles and report findings against dependencies that are never loaded at runtime, producing large volumes of false positives for gem consumers. Switch to an explicit allow-list covering only the files needed to load and run the gem: lib/**/*.rb, LICENSE, README.md, CHANGELOG.md, auth0.gemspec, and .version. Drop s.test_files (deprecated by RubyGems) and s.executables (no tracked bin/ entries exist). Package contents drop from ~385 files to 51. Refs #720
1 parent 771e5b4 commit 449be1b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

auth0.gemspec

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ Gem::Specification.new do |s|
1111
s.summary = 'Auth0 API Client'
1212
s.description = 'Ruby toolkit for Auth0 API https://auth0.com.'
1313

14-
s.files = `git ls-files`.split("\n")
15-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16-
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
14+
s.files = Dir['lib/**/*.rb'] + %w[LICENSE README.md CHANGELOG.md auth0.gemspec .version]
1715
s.require_paths = ['lib']
1816

1917
s.add_runtime_dependency 'rest-client', '~> 2.1'

0 commit comments

Comments
 (0)