dradis-html_export 5.2.0 → 5.4.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: da3de9ef6789e2ba0c0f4dbfd052d638c0f1cbc55d302b943eaa475b200cc3f7
4
- data.tar.gz: 953e29ffaf6423c8078e24d788d074a0d5c1d879b69d38b6fbf563a67074f5e3
3
+ metadata.gz: f45358ed8df2359d53e55838b812d4d5e2b01266d4bac0ae6980c29f838d74d1
4
+ data.tar.gz: e93833b125fb875df49501a251ec47756b9578700bb3f449674acdc3a521e311
5
5
  SHA512:
6
- metadata.gz: f23f91e59ebe0492a25ec1d47370cfb948dad44a8a795b03b1bcfce7739bbbd215a80483636628158f5498639448213588038946ff2f03ea25760d9a1bf08345
7
- data.tar.gz: 0d9d87c2fca2b4d28614a8208f3e1c78f2fcc29f89c2c8de6b548e6e483a7bc879fb8a28c53d60a5ac709baa8ff174b56885b675994b9d6349a1caea1889bf4a
6
+ metadata.gz: 2a87500d8072415c08196b61b9cd1bd32ea947c10f8b3769d81ebd1d1e9cdc52b736e985b1f4869b413c51c4c677fda47c92d610ec461d650c466fb72a7333a2
7
+ data.tar.gz: ffe9102e55b1a8e4e9f42bc9318b0ba4d9b1c172ea7354ac790033e686f164f6dd4d1dab7c370de12e8410b6b35a2c5929a39047889b92b00a968a10355075a4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ v5.4.0 (September 2026)
2
+ - Only include Published Evidence in exports when the export scope is set to Published
3
+
4
+ v5.3.0 (August 2026)
5
+ - No changes
6
+
1
7
  v5.2.0 (June 2026)
2
8
  - No changes
3
9
 
@@ -14,6 +14,7 @@ module Dradis
14
14
  end
15
15
 
16
16
  private
17
+
17
18
  def log_report
18
19
  logger.debug { "Report title: #{title}" }
19
20
  logger.debug { "Template properties define sort fields: #{template_properties&.sort_fields}" }
@@ -28,9 +29,7 @@ module Dradis
28
29
  end
29
30
 
30
31
  def nodes
31
- # FIXME: This is an ugly piece of code and the list of nodes should
32
- # come from the ContentService.
33
- @nodes ||= issues.map(&:evidence).flatten.map(&:node).uniq
32
+ @nodes ||= content_service.all_evidence.map(&:node).uniq
34
33
  end
35
34
 
36
35
  def notes
@@ -8,7 +8,7 @@ module Dradis
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 5
11
- MINOR = 2
11
+ MINOR = 4
12
12
  TINY = 0
13
13
  PRE = nil
14
14
 
@@ -90,14 +90,14 @@
90
90
  <div class="row">
91
91
  <div class="col-md-3 evidence-sidebar">
92
92
  <ul class="nav nav-list evidence-sidenav">
93
- <% issue.evidence_by_node.each do |node, instances| %>
93
+ <% issue.evidence_by_node(scope).each do |node, instances| %>
94
94
  <li><a href="#evidence_for_<%= node.id %>"><i class="glyphicon glyphicon-<%= ['folder-close','hdd'][node.type_id] %>"></i> <%= node.label %> (<%= pluralize instances.count, 'instance' %>)</a></li>
95
95
  <% end %>
96
96
  </ul>
97
97
  </div>
98
98
 
99
99
  <div class="col-md-9">
100
- <% issue.evidence_by_node.each do |node, instances| %>
100
+ <% issue.evidence_by_node(scope).each do |node, instances| %>
101
101
  <section id="evidence_for_#{node.id}">
102
102
  <% if instances.count == 1 %>
103
103
  <div class="content-textile" id="node_<%= node.id %>_instance_0">
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dradis-html_export
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martin
@@ -56,14 +56,7 @@ executables: []
56
56
  extensions: []
57
57
  extra_rdoc_files: []
58
58
  files:
59
- - ".github/issue_template.md"
60
- - ".github/pull_request_template.md"
61
- - ".gitignore"
62
- - ".rspec"
63
59
  - CHANGELOG.md
64
- - CHANGELOG.template
65
- - CONTRIBUTING.md
66
- - Gemfile
67
60
  - README.md
68
61
  - Rakefile
69
62
  - app/controllers/dradis/plugins/html_export/reports_controller.rb
@@ -71,7 +64,6 @@ files:
71
64
  - app/views/dradis/plugins/html_export/export/_index-content.html.erb
72
65
  - app/views/dradis/plugins/html_export/export/_index-tabs.html.erb
73
66
  - config/routes.rb
74
- - dradis-html_export.gemspec
75
67
  - lib/dradis-html_export.rb
76
68
  - lib/dradis/plugins/html_export.rb
77
69
  - lib/dradis/plugins/html_export/engine.rb
@@ -79,12 +71,6 @@ files:
79
71
  - lib/dradis/plugins/html_export/gem_version.rb
80
72
  - lib/dradis/plugins/html_export/version.rb
81
73
  - lib/tasks/thorfile.rb
82
- - spec/fixtures/files/liquid.html.erb
83
- - spec/fixtures/files/template.html.erb
84
- - spec/lib/dradis/plugins/html_export/exporter_spec.rb
85
- - spec/presenters/dradis/plugins/html_export/template_presenter_spec.rb
86
- - spec/requests/html_export_spec.rb
87
- - spec/spec_helper.rb
88
74
  - templates/basic.html.erb
89
75
  - templates/default_dradis_template_v3.0.html.erb
90
76
  homepage: https://dradis.com/support/guides/reporting/html_reports.html
@@ -108,10 +94,4 @@ requirements: []
108
94
  rubygems_version: 3.6.9
109
95
  specification_version: 4
110
96
  summary: Dradis HTML export plugin
111
- test_files:
112
- - spec/fixtures/files/liquid.html.erb
113
- - spec/fixtures/files/template.html.erb
114
- - spec/lib/dradis/plugins/html_export/exporter_spec.rb
115
- - spec/presenters/dradis/plugins/html_export/template_presenter_spec.rb
116
- - spec/requests/html_export_spec.rb
117
- - spec/spec_helper.rb
97
+ test_files: []
@@ -1,16 +0,0 @@
1
- ### Steps to reproduce
2
-
3
- Help us help you, how can we reproduce the problem?
4
-
5
- ### Expected behavior
6
- Tell us what should happen
7
-
8
- ### Actual behavior
9
- Tell us what happens instead
10
-
11
- ### System configuration
12
- **Dradis version**:
13
-
14
- **Ruby version**:
15
-
16
- **OS version**:
@@ -1,45 +0,0 @@
1
- Please review [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/develop/CONTRIBUTING.md) and remove this line.
2
-
3
- ### Summary
4
-
5
- Provide a general description of the code changes in your pull
6
- request... were there any bugs you had fixed? If so, mention them. If
7
- these bugs have open GitHub issues, be sure to tag them here as well,
8
- to keep the conversation linked together.
9
-
10
-
11
- ### Testing Steps
12
-
13
- Provide steps to test functionality, described in detail for someone not familiar with this part of the application / code base
14
-
15
-
16
- ### Other Information
17
-
18
- If there's anything else that's important and relevant to your pull
19
- request, mention that information here. This could include
20
- benchmarks, or other information.
21
-
22
- Thanks for contributing to Dradis!
23
-
24
-
25
- ### Copyright assignment
26
-
27
- Collaboration is difficult with commercial closed source but we want
28
- to keep as much of the OSS ethos as possible available to users
29
- who want to fix it themselves.
30
-
31
- In order to unambiguously own and sell Dradis Framework commercial
32
- products, we must have the copyright associated with the entire
33
- codebase. Any code you create which is merged must be owned by us.
34
- That's not us trying to be a jerks, that's just the way it works.
35
-
36
- You can delete this section, but the following sentence needs to
37
- remain in the PR's description:
38
-
39
- > I assign all rights, including copyright, to any future Dradis
40
- > work by myself to Security Roots.
41
-
42
- ### Check List
43
-
44
- - [ ] Added a CHANGELOG entry
45
- - [ ] Added specs
data/.gitignore DELETED
@@ -1,20 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- spec/dummy
16
- test/tmp
17
- test/version_tmp
18
- tmp
19
- /vendor/
20
- .DS_Store
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
data/CHANGELOG.template DELETED
@@ -1,12 +0,0 @@
1
- [v#.#.#] ([month] [YYYY])
2
- - [future tense verb] [feature]
3
- - Upgraded gems:
4
- - [gem]
5
- - Bugs fixes:
6
- - [future tense verb] [bug fix]
7
- - Bug tracker items:
8
- - [item]
9
- - Security Fixes:
10
- - High: (Authenticated|Unauthenticated) (admin|author|contributor) [vulnerability description]
11
- - Medium: (Authenticated|Unauthenticated) (admin|author|contributor) [vulnerability description]
12
- - Low: (Authenticated|Unauthenticated) (admin|author|contributor) [vulnerability description]
data/CONTRIBUTING.md DELETED
@@ -1,3 +0,0 @@
1
- # Plugin contribution guidelines
2
-
3
- See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradisframework/blob/master/CONTRIBUTING.md)
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in dradis-html_export.gemspec
4
- gemspec
@@ -1,35 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- require File.expand_path('../lib/dradis/plugins/html_export/version', __FILE__)
4
- version = Dradis::Plugins::HtmlExport::version
5
-
6
- Gem::Specification.new do |spec|
7
- spec.platform = Gem::Platform::RUBY
8
- spec.name = 'dradis-html_export'
9
- spec.version = version
10
- spec.required_ruby_version = '>= 1.9.3'
11
- spec.license = 'GPL-2'
12
-
13
- spec.authors = ['Daniel Martin']
14
- spec.description = 'Export to HTML plugin for the Dradis Framework'
15
- spec.summary = 'Dradis HTML export plugin'
16
- spec.homepage = 'https://dradis.com/support/guides/reporting/html_reports.html'
17
-
18
- spec.files = `git ls-files`.split($\)
19
- spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
20
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
- spec.require_paths = ['lib']
22
-
23
- # gem.add_dependency 'dradis_core', version
24
- spec.add_dependency 'dradis-plugins', '>= 4.8.0'
25
-
26
- # Note markup
27
- spec.add_dependency 'rails_autolink', '~> 1.1'
28
- spec.add_dependency 'RedCloth', '~> 4.3.2'
29
-
30
- # gem.add_development_dependency 'capybara', '~> 1.1.3'
31
- # gem.add_development_dependency 'database_cleaner'
32
- # gem.add_development_dependency 'factory_girl_rails'
33
- # gem.add_development_dependency 'rspec-rails', '~> 2.11.0'
34
- # gem.add_development_dependency 'sqlite3'
35
- end
@@ -1,12 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>My Title</title>
5
- </head>
6
- <body>
7
- <h2>Issues</h2>
8
- <% issues.each do |issue| %>
9
- <p><%= markup(issue.text, liquid: true) %></p>
10
- <% end %>
11
- </body>
12
- </html>
@@ -1,12 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>My Title</title>
5
- </head>
6
- <body>
7
- <h2>Issues</h2>
8
- <% issues.each do |issue| %>
9
- <p><%= markup(issue.text) %></p>
10
- <% end %>
11
- </body>
12
- </html>
@@ -1,150 +0,0 @@
1
- require 'rails_helper'
2
-
3
- describe Dradis::Plugins::HtmlExport::Exporter do
4
- before { Dradis::Plugins::HtmlExport::Exporter.include(ApplicationHelper) }
5
-
6
- let!(:project) { create(:project, :with_team) }
7
-
8
- let!(:content_blocks) { create_list(:content_block, 5, project: project) }
9
- let!(:issues) { create_list(:issue, 5, node: project.issue_library) }
10
- let!(:nodes) { create_list(:node, 5, project: project) }
11
- let!(:tags) { create_list(:tag, 5, project: project) }
12
-
13
- let(:controller) { Dradis::Plugins::HtmlExport::ExportController.new }
14
-
15
- let(:exporter) { described_class.new(export_options) }
16
-
17
- context 'html' do
18
- let(:export_options) do
19
- {
20
- project_id: project.id,
21
- template: Dradis::Plugins::HtmlExport::Engine.root.join(
22
- 'spec/fixtures/files/template.html.erb'
23
- )
24
- }
25
- end
26
-
27
- it 'exports html' do
28
- html = exporter.export
29
-
30
- issues.each do |issue|
31
- expect(html.include?(issue.title))
32
- end
33
- end
34
- end
35
-
36
- context 'templates' do
37
- describe 'basic template' do
38
- let(:export_options) do
39
- {
40
- project_id: project.id,
41
- template: Dradis::Plugins::HtmlExport::Engine.root.join(
42
- 'templates/basic.html.erb'
43
- )
44
- }
45
- end
46
-
47
- it 'exports html' do
48
- html = exporter.export
49
-
50
- issues.each do |issue|
51
- expect(html.include?(issue.title))
52
- end
53
- end
54
- end
55
-
56
- describe 'default template' do
57
- let(:export_options) do
58
- {
59
- project_id: project.id,
60
- template: Dradis::Plugins::HtmlExport::Engine.root.join(
61
- 'templates/default_dradis_template_v3.0.html.erb'
62
- )
63
- }
64
- end
65
-
66
- it 'exports html' do
67
- html = exporter.export
68
-
69
- issues.each do |issue|
70
- expect(html.include?(issue.title))
71
- end
72
- end
73
- end
74
- end
75
-
76
- context 'liquid' do
77
- let(:export_options) do
78
- {
79
- project_id: project.id,
80
- template: Dradis::Plugins::HtmlExport::Engine.root.join(
81
- 'spec/fixtures/files/liquid.html.erb'
82
- )
83
- }
84
- end
85
-
86
- before do
87
- report_content = project.content_library
88
- report_content.properties = {
89
- 'dradis.project' => project.name,
90
- 'dradis.version' => 'v1.0'
91
- }
92
- report_content.save
93
-
94
- nodes.each do |node|
95
- create(:evidence, node: node, issue: issues.first)
96
- end
97
-
98
- create(:issue,
99
- node: project.issue_library,
100
- text: <<-TEXT
101
- #[Title]#
102
- Test Issue
103
-
104
- #[Description]#
105
- *Project:* {{ project.name }}
106
- *Document Properties:*
107
- * {{ document_properties.dradis.project }}
108
- * {{ document_properties.dradis.version }}
109
-
110
- *Nodes:*
111
- {% for node in nodes %}
112
- * {{ node.label }}
113
- {% endfor %}
114
-
115
- *Content blocks:*
116
- {% for content_block in content_blocks %}
117
- * {{ content_block.fields['Title'] }}
118
- {% endfor %}
119
-
120
- *Tags:*
121
- {% for tag in tags %}
122
- * {{ tag.name }}
123
- {% endfor %}
124
- TEXT
125
- )
126
- end
127
-
128
- it 'parses liquid syntax' do
129
- html = exporter.export
130
-
131
- expect(html).to include project.name
132
-
133
- project.content_library.properties.each do |_, value|
134
- expect(html).to include value
135
- end
136
-
137
- nodes.each do |node|
138
- expect(html).to include node.label
139
- end
140
-
141
- content_blocks.each do |content_block|
142
- expect(html).to include content_block.title
143
- end
144
-
145
- tags.each do |tag|
146
- expect(html).to include tag.name
147
- end
148
- end
149
- end
150
- end
@@ -1,47 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe Dradis::Plugins::HtmlExport::TemplatePresenter do
4
- class FakeView
5
- include ActionView::Helpers::TextHelper
6
- end
7
-
8
- let(:template_presenter) { described_class.new(template, FakeView.new) }
9
-
10
- describe '#title' do
11
- context 'when template is a string' do
12
- let(:template) { 'basic.html.erb' }
13
-
14
- it 'returns the string' do
15
- expect(template_presenter.title).to eq template
16
- end
17
- end
18
-
19
- context 'when template is a RTP' do
20
- let(:template) do
21
- double(
22
- 'ReportTemplateProperties',
23
- title: 'Basic',
24
- template_file: 'basic.html.erb'
25
- )
26
- end
27
-
28
- it 'returns a formatted title' do
29
- expect(template_presenter.title).to eq "<span>#{template.title} - </span><small>#{template.template_file}</small>"
30
- end
31
-
32
- context 'when title contains javascript' do
33
- let(:template) do
34
- double(
35
- 'ReportTemplateProperties',
36
- title: '<script>alert("hello world")</script>',
37
- template_file: 'basic.html.erb'
38
- )
39
- end
40
-
41
- it 'prevents cross site scriptiing' do
42
- expect(template_presenter.title).to eq "<span>&lt;script&gt;alert(&quot;hello world&quot;)&lt;/script&gt; - </span><small>#{template.template_file}</small>"
43
- end
44
- end
45
- end
46
- end
47
- end
@@ -1,7 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "HTML Export" do
4
- it "presents the note text in the report layout" do
5
- Dradis::Core::VERSION::STRING.should eq('3.0.0.beta')
6
- end
7
- end
data/spec/spec_helper.rb DELETED
@@ -1,39 +0,0 @@
1
- # Configure Rails Envinronment
2
- ENV["RAILS_ENV"] ||= 'test'
3
- require File.expand_path("../dummy/config/environment", __FILE__)
4
-
5
- require 'rspec/rails'
6
-
7
- # Requires supporting ruby files with custom matchers and macros, etc,
8
- # in spec/support/ and its subdirectories.
9
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
-
11
- require 'database_cleaner'
12
- require 'factory_girl_rails'
13
-
14
-
15
- RSpec.configure do |config|
16
-
17
- # Capybara javascript drivers require transactional fixtures set to false,
18
- # and we just use DatabaseCleaner to cleanup after each test instead.
19
- # Without transactional fixtures set to false none of the records created to
20
- # setup a test will be available to the browser, which runs under a seperate
21
- # server instance.
22
- config.use_transactional_fixtures = false
23
-
24
- config.before(:each) do
25
- if example.metadata[:js]
26
- DatabaseCleaner.strategy = :truncation
27
- else
28
- DatabaseCleaner.strategy = :transaction
29
- end
30
- end
31
-
32
- config.before(:each) do
33
- DatabaseCleaner.start
34
- end
35
-
36
- config.after(:each) do
37
- DatabaseCleaner.clean
38
- end
39
- end