Skip to content

Commit

Permalink
Merge pull request #89 from nyaruka/ivr_redaction_fix
Browse files Browse the repository at this point in the history
Fix redaction of twiml IVR channel logs
  • Loading branch information
rowanseymour authored Jun 20, 2023
2 parents 237b665 + 45a1f4a commit 7f9c61d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion services/ivr/twiml/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,5 +530,8 @@ func ResponseForSprint(cfg *runtime.Config, urn urns.URN, resumeURL string, es [
}

func (s *service) RedactValues(ch *models.Channel) []string {
return []string{ch.ConfigValue(authTokenConfig, "")}
return []string{
httpx.BasicAuth(ch.ConfigValue(accountSIDConfig, ""), ch.ConfigValue(authTokenConfig, "")),
ch.ConfigValue(authTokenConfig, ""),
}
}
2 changes: 1 addition & 1 deletion services/ivr/twiml/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,5 @@ func TestRedactValues(t *testing.T) {
ch := oa.ChannelByUUID(testdata.TwilioChannel.UUID)
svc, _ := ivr.GetService(ch)

assert.Equal(t, []string{"sesame"}, svc.RedactValues(ch))
assert.Equal(t, []string{"U0lEMTIzNDU2Nzg5OnNlc2FtZQ==", "sesame"}, svc.RedactValues(ch))
}

0 comments on commit 7f9c61d

Please sign in to comment.