uclibs / ucrate

Scholar@UC: University of Cincinnati's self-submission institutional repository
https://scholar.uc.edu
Other
5 stars 3 forks source link

Replace ClamAV with Clamby #1076

Closed scherztc closed 8 months ago

scherztc commented 9 months ago

Descriptive summary

DEPRECATION WARNING: The ClamAV has been replaced by Clamby as the supported virus scanner for hydra-works. ClamAV support will be removed in hydra-works 2.0 . (called from infected? at /Users/scherztc/Workspaces/ucrate/app/models/hyrax/virus_scanner.rb:38)

Expected behavior

We should be using Clamby instead of ClamAV. Remove all references to ClamAV in code.

Actual behavior

We are using ClamAV

Steps to reproduce the behavior

  1. bundle exec rake spec
crowesn commented 9 months ago
app/models/hyrax/virus_scanner.rb
4:# If ClamAV is present, it will be used to check for the presence of a virus. If ClamAV is not
8:# To use a virus checker other than ClamAV:
37:      elsif defined?(ClamAV)
45:      Deprecation.warn(self, "The ClamAV has been replaced by Clamby " \
47:        "ClamAV support will be removed in hydra-works 2.0 ")
48:      scan_result = ClamAV.instance.method(:scanfile).call(file)

CHANGELOG.md
205:* Enable support for virus scanning with ClamAV

config/initializers/clamav.rb
13:elsif defined?(ClamAV)
14:  ClamAV.instance.loaddb if defined? ClamAV

spec/models/hyrax/virus_scanner_spec.rb
13:  context 'when ClamAV is defined' do
17:      class ClamAV
19:          @instance ||= ClamAV.new
29:      Object.send(:remove_const, :ClamAV)
33:      before { allow(ClamAV.instance).to receive(:scanfile).with('/tmp/path').and_return(0) }
41:      before { allow(ClamAV.instance).to receive(:scanfile).with('/tmp/path').and_return(1) }
49:  context 'when ClamAV is not defined' do