lib/mihari/schemas/emitter.rb in mihari-4.12.0 vs lib/mihari/schemas/emitter.rb in mihari-5.0.0

- old
+ new

@@ -1,23 +1,21 @@ # frozen_string_literal: true module Mihari module Schemas - Emitter = Dry::Schema.Params do - required(:emitter).value(Types::EmitterTypes) + Database = Dry::Schema.Params do + required(:emitter).value(Types::String.enum("database")) end MISP = Dry::Schema.Params do required(:emitter).value(Types::String.enum("misp")) - optional(:api_endpoint).value(:string) optional(:url).value(:string) optional(:api_key).value(:string) end TheHive = Dry::Schema.Params do required(:emitter).value(Types::String.enum("the_hive")) - optional(:api_endpoint).value(:string) optional(:url).value(:string) optional(:api_key).value(:string) optional(:api_version).value(Types::String.enum("v4", "v5")).default("v4") end @@ -25,14 +23,14 @@ required(:emitter).value(Types::String.enum("slack")) optional(:webhook_url).value(:string) optional(:channel).value(:string) end - HTTP = Dry::Schema.Params do - required(:emitter).value(Types::String.enum("http")) + Webhook = Dry::Schema.Params do + required(:emitter).value(Types::String.enum("webhook")) required(:url).value(:string) - optional(:http_request_method).value(Types::HTTPRequestMethods).default("POST") - optional(:http_request_headers).value(:hash).default({}) + optional(:method).value(Types::HTTPRequestMethods).default("POST") + optional(:headers).value(:hash).default({}) optional(:template).value(:string) end end end