Sha256: 1b374f49885625ec8f7ecf6b9853077dbec38df3f22c1ec6d48d02b94d4234d3

Contents?: true

Size: 442 Bytes

Versions: 24

Compression:

Stored size: 442 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Endpoints
    class Sources < Grape::API
      namespace :sources do
        desc "Get sources", {
          is_array: true,
          success: Entities::Sources,
          summary: "Get sources"
        }
        get "/" do
          sources = Mihari::Alert.distinct.pluck(:source)
          present({ sources: sources }, with: Entities::Sources)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
mihari-4.12.0 lib/mihari/web/endpoints/sources.rb
mihari-4.11.0 lib/mihari/web/endpoints/sources.rb
mihari-4.10.0 lib/mihari/web/endpoints/sources.rb
mihari-4.9.0 lib/mihari/web/endpoints/sources.rb
mihari-4.8.0 lib/mihari/web/endpoints/sources.rb
mihari-4.7.4 lib/mihari/web/endpoints/sources.rb
mihari-4.7.3 lib/mihari/web/endpoints/sources.rb
mihari-4.7.2 lib/mihari/web/endpoints/sources.rb
mihari-4.7.1 lib/mihari/web/endpoints/sources.rb
mihari-4.7.0 lib/mihari/web/endpoints/sources.rb
mihari-4.6.1 lib/mihari/web/endpoints/sources.rb
mihari-4.6.0 lib/mihari/web/endpoints/sources.rb
mihari-4.5.3 lib/mihari/web/endpoints/sources.rb
mihari-4.5.2 lib/mihari/web/endpoints/sources.rb
mihari-4.5.1 lib/mihari/web/endpoints/sources.rb
mihari-4.5.0 lib/mihari/web/endpoints/sources.rb
mihari-4.4.1 lib/mihari/web/endpoints/sources.rb
mihari-4.4.0 lib/mihari/web/endpoints/sources.rb
mihari-4.3.0 lib/mihari/web/endpoints/sources.rb
mihari-4.2.0 lib/mihari/web/endpoints/sources.rb