Sha256: 7f393c6a0337e271d8bfe314aa777e11e9c34275dfeadfd208da8b90c151ecff
Contents?: true
Size: 903 Bytes
Versions: 2
Compression:
Stored size: 903 Bytes
Contents
# frozen_string_literal: true module Mihari module Clients # # TheHive API client # class TheHive < Base # # @param [String] base_url # @param [String, nil] api_key # @param [String, nil] api_version # @param [Hash] headers # @param [Integer, nil] timeout # def initialize(base_url, api_key:, api_version:, headers: {}, timeout: nil) raise(ArgumentError, "api_key is required") unless api_key base_url += "/#{api_version}" unless api_version.nil? headers["authorization"] = "Bearer #{api_key}" super(base_url, headers: headers, timeout: timeout) end # # @param [Hash] json # # @return [Hash] # def alert(json) json = json.to_camelback_keys.compact res = post("/alert", json: json) JSON.parse(res.body.to_s) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mihari-5.7.1 | lib/mihari/clients/the_hive.rb |
mihari-5.7.0 | lib/mihari/clients/the_hive.rb |