mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
a44f0cf959
* fix: redis sentinel secret missing * refactor: use consts for authentication_backend.file.password errs * fix: unit test for new default port * test: cover additional misses * test: fix windows/linux specific test error * test: more windows specific tests * test: remove superfluous url.IsAbs * test: validator 100% coverage
19 lines
521 B
Go
19 lines
521 B
Go
package validator
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestShouldValidateCorrectSecretKeys(t *testing.T) {
|
|
assert.True(t, isSecretKey("jwt_secret"))
|
|
assert.True(t, isSecretKey("authelia.jwt_secret.file"))
|
|
assert.False(t, isSecretKey("totp.issuer"))
|
|
}
|
|
|
|
func TestShouldCreateCorrectSecretEnvNames(t *testing.T) {
|
|
assert.Equal(t, "authelia.jwt_secret.file", SecretNameToEnvName("jwt_secret"))
|
|
assert.Equal(t, "authelia.not_a_real_secret.file", SecretNameToEnvName("not_a_real_secret"))
|
|
}
|