Sha256: 81b01f7257da9ccfa27e37af0db2abc2d73fa2146e377c6ae4bec549323c3c03
Contents?: true
Size: 1.62 KB
Versions: 7
Compression:
Stored size: 1.62 KB
Contents
# frozen_string_literal: true module Mihari module Schemas # # Emitter schemas # module Emitters extend Schemas::Mixins Database = Dry::Schema.Params do required(:emitter).value(Types::String.enum(*Mihari::Emitters::Database.class_keys)) optional(:options).hash(Options) end MISP = Dry::Schema.Params do required(:emitter).value(Types::String.enum(*Mihari::Emitters::MISP.class_keys)) optional(:url).value(:string) optional(:api_key).value(:string) optional(:options).hash(Options) end TheHive = Dry::Schema.Params do required(:emitter).value(Types::String.enum(*Mihari::Emitters::TheHive.class_keys)) optional(:url).value(:string) optional(:api_key).value(:string) optional(:api_version).value(Types::String.enum("v4", "v5")).default("v4") optional(:options).hash(Options) end Slack = Dry::Schema.Params do required(:emitter).value(Types::String.enum(*Mihari::Emitters::Slack.class_keys)) optional(:webhook_url).value(:string) optional(:channel).value(:string) optional(:options).hash(Options) end Webhook = Dry::Schema.Params do required(:emitter).value(Types::String.enum(*Mihari::Emitters::Webhook.class_keys)) required(:url).value(:string) optional(:method).value(Types::HTTPRequestMethods).default("POST") optional(:headers).value(:hash).default({}) optional(:template).value(:string) optional(:options).hash(Options) end end Emitter = Schemas::Emitters.get_or_composition end end
Version data entries
7 entries across 7 versions & 1 rubygems