-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(encryption): Enable encryption in transit (#161)
* feat(tls): Feature for encryption in transit using rediss:// urls * Go formatting * Fixed base url trim * Add test for TLS settings
- Loading branch information
1 parent
2d465e0
commit fbbffa3
Showing
2 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package test | ||
|
||
import ( | ||
"github.com/armory/dinghy/cmd" | ||
"github.com/armory/dinghy/pkg/settings/global" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestThatGetAddressWorks(t *testing.T) { | ||
var options = dinghy.NewRedisOptions(global.Redis{ | ||
BaseURL: "rediss://something", | ||
Password: "bob", | ||
}) | ||
assert.Equal(t, "something", options.Addr) | ||
assert.NotNilf(t, options.TLSConfig, "TLS config should not be nil!") | ||
|
||
options = dinghy.NewRedisOptions(global.Redis{ | ||
BaseURL: "redis://no-ssl-redis", | ||
Password: "bob", | ||
}) | ||
assert.Equal(t, "no-ssl-redis", options.Addr) | ||
assert.Nilf(t, options.TLSConfig, "TLS config should be nil for redis:// requests!") | ||
} |