Skip to content

Commit 73b16b6

Browse files
committed
Allow encrypted_headers to be sent in via sequin config import
1 parent 6f6cc76 commit 73b16b6

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

lib/sequin/transforms/transforms.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,11 @@ defmodule Sequin.Transforms do
435435
{:error, error} -> {:halt, {:error, error}}
436436
end
437437

438-
# Ignore encrypted_headers until encryption/decryption works
439438
"encrypted_headers" ->
440-
{:cont, {:ok, acc}}
439+
case parse_headers(value) do
440+
{:ok, headers} -> {:cont, {:ok, Map.put(acc, :encrypted_headers, headers)}}
441+
{:error, error} -> {:halt, {:error, error}}
442+
end
441443

442444
"webhook.site" ->
443445
if value in [true, "true"] do

test/sequin_web/controllers/yaml_controller_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ defmodule SequinWeb.YamlControllerTest do
44
alias Sequin.Databases.PostgresDatabase
55
alias Sequin.Databases.Sequence
66
alias Sequin.Test.UnboxedRepo
7+
alias Sequin.TestSupport.Models.Character
78
alias Sequin.TestSupport.ReplicationSlots
89

910
@moduletag :unboxed
@@ -120,7 +121,7 @@ defmodule SequinWeb.YamlControllerTest do
120121
- insert
121122
- update
122123
- delete
123-
source_table_name: accounts
124+
source_table_name: #{Character.table_name()}
124125
source_table_schema: public
125126
destination_table_name: sequin_events
126127
destination_table_schema: public
@@ -133,15 +134,14 @@ defmodule SequinWeb.YamlControllerTest do
133134
pool_size: 10
134135
username: postgres
135136
password: '********'
136-
database: sequin_example
137+
database: sequin_test
137138
slot_name: sequin_slot
138139
use_local_tunnel: false
139-
publication_name: sequin_pub
140+
publication_name: characters_publication
140141
http_endpoints:
141142
- name: test_http_endpoint
142143
url: http://localhost:4000/something
143144
headers: {}
144-
encrypted_headers: '(0 encrypted header(s)) - sha256sum: b4a8f200'
145145
sinks:
146146
- name: accounts_sink
147147
status: active

test/support/models/character.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ defmodule Sequin.TestSupport.Models.Character do
1717
timestamps(type: :naive_datetime_usec)
1818
end
1919

20+
def table_name do
21+
"Characters"
22+
end
23+
2024
def quoted_table_name do
2125
~s{"Characters"}
2226
end

0 commit comments

Comments
 (0)