Sha256: 8df9a85a7fbd49f477ca24e11a1f289dad3222941cbb16aec74632e766d5d2df
Contents?: true
Size: 925 Bytes
Versions: 13
Compression:
Stored size: 925 Bytes
Contents
# frozen_string_literal: true module Mihari module Controllers class AnalyzersController < BaseController post "/api/analyzer" do contract = Mihari::Schemas::AnalyzerRunContract.new result = contract.call(params) unless result.errors.empty? status 400 return json(result.errors.to_h) end args = result.to_h ignore_old_artifacts = args[:ignoreOldArtifacts] ignore_threshold = args[:ignoreThreshold] analyzer = Mihari::Analyzers::Basic.new( title: args[:title], description: args[:description], source: args[:source], artifacts: args[:artifacts], tags: args[:tags] ) analyzer.ignore_old_artifacts = ignore_old_artifacts analyzer.ignore_threshold = ignore_threshold analyzer.run status 201 body "" end end end end
Version data entries
13 entries across 13 versions & 1 rubygems