mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
File permissions on config files allow more restrictive setting (#966)
* File permissions on config files allow more restrictive setting * Make the tests a bit more readable * Bring back the tests dude * Update error message * remove else * Add more test cases * Change Lstat to Stat * Add note for umask * Make sure the permissions are 0600 or lower * Update config file * Do not check for windows * Fix CI errors * Fix CI test
This commit is contained in:
@@ -9,9 +9,13 @@ import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
var (
|
||||
func testConfigFile(t *testing.T) (testConfigFile string) {
|
||||
testConfigFile = filepath.Join("..", "..", "config.dev.toml")
|
||||
)
|
||||
if err := os.Chmod(testConfigFile, 0700); err != nil {
|
||||
t.Fatalf("%s\n", err)
|
||||
}
|
||||
return testConfigFile
|
||||
}
|
||||
|
||||
type FilterTests struct {
|
||||
suite.Suite
|
||||
|
||||
Reference in New Issue
Block a user