Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/sequin/transforms/transforms.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions test/sequin/yaml_loader_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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!("""
Expand Down
Loading