diff --git a/lib/sequin/transforms/transforms.ex b/lib/sequin/transforms/transforms.ex index ebd12dffc..88e6e83fa 100644 --- a/lib/sequin/transforms/transforms.ex +++ b/lib/sequin/transforms/transforms.ex @@ -1619,6 +1619,7 @@ defmodule Sequin.Transforms do end # Helper to parse auth_type + defp parse_auth_type("none"), do: :none defp parse_auth_type("api_key"), do: :api_key defp parse_auth_type("basic"), do: :basic defp parse_auth_type("bearer"), do: :bearer diff --git a/test/sequin/yaml_loader_test.exs b/test/sequin/yaml_loader_test.exs index a00fa908b..1ac0af370 100644 --- a/test/sequin/yaml_loader_test.exs +++ b/test/sequin/yaml_loader_test.exs @@ -1493,6 +1493,36 @@ defmodule Sequin.YamlLoaderTest do } = consumer.sink end + test "creates elasticsearch sink consumer with auth_type none" do + assert :ok = + YamlLoader.apply_from_yml!(""" + #{account_and_db_yml()} + + sinks: + - name: "elasticsearch-no-auth" + database: "test-db" + destination: + type: "elasticsearch" + endpoint_url: "https://elasticsearch.example.com" + index_name: "test-index" + auth_type: "none" + batch_size: 100 + """) + + assert [consumer] = Repo.all(SinkConsumer) + + assert consumer.name == "elasticsearch-no-auth" + + assert %ElasticsearchSink{ + type: :elasticsearch, + endpoint_url: "https://elasticsearch.example.com", + index_name: "test-index", + auth_type: :none, + auth_value: nil, + batch_size: 100 + } = consumer.sink + end + test "creates redis string sink consumer" do assert :ok = YamlLoader.apply_from_yml!("""