Skip to content

Commit

Permalink
fix: add send sms hook as test
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed May 8, 2024
1 parent 2795fcf commit 76698f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/utils/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestConfigParsing(t *testing.T) {
t.Setenv("TWILIO_AUTH_TOKEN", "token")
t.Setenv("AZURE_CLIENT_ID", "hello")
t.Setenv("AZURE_SECRET", "this is cool")
t.Setenv("AUTH_SEND_SMS_SECRETS", "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==")
assert.NoError(t, LoadConfigFS(fsys))
// Check error
assert.Equal(t, "hello", Config.Auth.External["azure"].ClientId)
Expand Down
5 changes: 5 additions & 0 deletions internal/utils/templates/init_config.test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ max_frequency = "5s"
enabled = true
uri = "pg-functions://postgres/auth/custom-access-token-hook"

[auth.hook.send_sms]
enabled = true
uri = "http://host.docker.internal/functions/v1/send_sms"
secrets = "env(AUTH_SEND_SMS_SECRETS)"


# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`.
[auth.sms.twilio]
Expand Down

0 comments on commit 76698f6

Please sign in to comment.