mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
[CI] Update QEMU to v5.1.0-2 (#1321)
* [CI] Update QEMU to v5.1.0-2 * Fix linter errors from golangci-lint update
This commit is contained in:
parent
ed5e72508d
commit
b1a01b1727
|
@ -46,7 +46,7 @@ func dockerBuildOfficialImage(arch string) error {
|
||||||
// Set default Architecture Dockerfile to amd64.
|
// Set default Architecture Dockerfile to amd64.
|
||||||
dockerfile := "Dockerfile"
|
dockerfile := "Dockerfile"
|
||||||
// Set version of QEMU.
|
// Set version of QEMU.
|
||||||
qemuversion := "v5.0.0-2"
|
qemuversion := "v5.1.0-2"
|
||||||
|
|
||||||
// If not the default value.
|
// If not the default value.
|
||||||
if arch != defaultArch {
|
if arch != defaultArch {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//usr/bin/env go run "$0" "$@"; exit
|
//usr/bin/env go run "$0" "$@"; exit
|
||||||
//nolint:godot
|
//nolint:gocritic,godot
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,17 @@ func WithDatabase(content []byte, f func(path string)) {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer os.Remove(tmpfile.Name()) // clean up
|
defer os.Remove(tmpfile.Name()) // Clean up
|
||||||
|
|
||||||
if _, err := tmpfile.Write(content); err != nil {
|
if _, err := tmpfile.Write(content); err != nil {
|
||||||
tmpfile.Close()
|
tmpfile.Close()
|
||||||
log.Fatal(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
f(tmpfile.Name())
|
f(tmpfile.Name())
|
||||||
|
|
||||||
if err := tmpfile.Close(); err != nil {
|
if err := tmpfile.Close(); err != nil {
|
||||||
log.Fatal(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ func validateFileAuthenticationBackend(configuration *schema.FileAuthenticationB
|
||||||
validator.Push(fmt.Errorf("The number of iterations specified is invalid, must be 1 or more, you configured %d", configuration.Password.Iterations))
|
validator.Push(fmt.Errorf("The number of iterations specified is invalid, must be 1 or more, you configured %d", configuration.Password.Iterations))
|
||||||
}
|
}
|
||||||
|
|
||||||
//Salt Length
|
// Salt Length
|
||||||
switch {
|
switch {
|
||||||
case configuration.Password.SaltLength == 0:
|
case configuration.Password.SaltLength == 0:
|
||||||
configuration.Password.SaltLength = schema.DefaultPasswordConfiguration.SaltLength
|
configuration.Password.SaltLength = schema.DefaultPasswordConfiguration.SaltLength
|
||||||
|
|
|
@ -55,7 +55,7 @@ func getSecretValue(name string, validator *schema.StructValidator, viper *viper
|
||||||
if err != nil {
|
if err != nil {
|
||||||
validator.Push(fmt.Errorf("error loading secret file (%s): %s", name, err))
|
validator.Push(fmt.Errorf("error loading secret file (%s): %s", name, err))
|
||||||
} else {
|
} else {
|
||||||
return strings.Replace(string(content), "\n", "", -1)
|
return strings.ReplaceAll(string(content), "\n", "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -913,7 +913,6 @@ func TestShouldGetRemovedUserGroupsFromBackend(t *testing.T) {
|
||||||
|
|
||||||
func TestShouldGetAddedUserGroupsFromBackend(t *testing.T) {
|
func TestShouldGetAddedUserGroupsFromBackend(t *testing.T) {
|
||||||
mock := mocks.NewMockAutheliaCtx(t)
|
mock := mocks.NewMockAutheliaCtx(t)
|
||||||
//defer mock.Close()
|
|
||||||
|
|
||||||
// Setup pointer to john so we can adjust it during the test.
|
// Setup pointer to john so we can adjust it during the test.
|
||||||
user := &authentication.UserDetails{
|
user := &authentication.UserDetails{
|
||||||
|
|
|
@ -58,7 +58,7 @@ func (n *SMTPNotifier) initializeTLSConfig() {
|
||||||
// The second part of this check happens in the Configure Cert Pool code block
|
// The second part of this check happens in the Configure Cert Pool code block
|
||||||
log.Debug("Notifier SMTP client initializing TLS configuration")
|
log.Debug("Notifier SMTP client initializing TLS configuration")
|
||||||
|
|
||||||
//Configure Cert Pool
|
// Configure Cert Pool
|
||||||
certPool, err := x509.SystemCertPool()
|
certPool, err := x509.SystemCertPool()
|
||||||
if err != nil || certPool == nil {
|
if err != nil || certPool == nil {
|
||||||
certPool = x509.NewCertPool()
|
certPool = x509.NewCertPool()
|
||||||
|
|
|
@ -270,7 +270,7 @@ func TestSQLProviderMethodsTOTP(t *testing.T) {
|
||||||
WithArgs(args...).
|
WithArgs(args...).
|
||||||
WillReturnRows(sqlmock.NewRows([]string{"secret"}))
|
WillReturnRows(sqlmock.NewRows([]string{"secret"}))
|
||||||
|
|
||||||
//Test Blank Rows
|
// Test Blank Rows
|
||||||
secret, err = provider.LoadTOTPSecret(unitTestUser)
|
secret, err = provider.LoadTOTPSecret(unitTestUser)
|
||||||
assert.EqualError(t, err, "No TOTP secret registered")
|
assert.EqualError(t, err, "No TOTP secret registered")
|
||||||
assert.Equal(t, "", secret)
|
assert.Equal(t, "", secret)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user