Class: Dependabot::NpmAndYarn::UpdateChecker::VulnerabilityAuditor

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/npm_and_yarn/update_checker/vulnerability_auditor.rb

Instance Method Summary collapse

Constructor Details

#initialize(dependency_files:, credentials:) ⇒ VulnerabilityAuditor

Returns a new instance of VulnerabilityAuditor.



30
31
32
33
# File 'lib/dependabot/npm_and_yarn/update_checker/vulnerability_auditor.rb', line 30

def initialize(dependency_files:, credentials:)
  @dependency_files = dependency_files
  @credentials = credentials
end

Instance Method Details

#audit(dependency:, security_advisories:) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/dependabot/npm_and_yarn/update_checker/vulnerability_auditor.rb', line 63

def audit(dependency:, security_advisories:)
  Dependabot.logger.info("VulnerabilityAuditor: starting audit")
  fix_unavailable = fix_unavailable_response(dependency)

  run_audit(
    dependency: dependency,
    security_advisories: security_advisories,
    fix_unavailable: fix_unavailable
  )
rescue SharedHelpers::HelperSubprocessFailed => e
  log_helper_subprocess_failure(dependency, e)
  T.must(fix_unavailable)
end