Sha256: de399f4eab42fabff22509f1b1deb6263e1323259b35173f4e2cc1f3e621b955

Contents?: true

Size: 632 Bytes

Versions: 4

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Web
    module Endpoints
      #
      # Config API endpoint
      #
      class Configs < Grape::API
        namespace :configs do
          desc "Get configs", {
            is_array: true,
            success: Entities::Config,
            summary: "Get configs"
          }
          get "/" do
            configs = (Mihari.analyzers + Mihari.emitters + Mihari.enrichers).filter_map do |klass|
              Mihari::Structs::Config.from_class(klass)
            end
            present(configs, with: Entities::Config)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mihari-6.3.0 lib/mihari/web/endpoints/configs.rb
mihari-6.2.0 lib/mihari/web/endpoints/configs.rb
mihari-6.1.0 lib/mihari/web/endpoints/configs.rb
mihari-6.0.0 lib/mihari/web/endpoints/configs.rb