(wd string)
| 135 | } |
| 136 | |
| 137 | func makeBasicAuthFiles(wd string) error { |
| 138 | |
| 139 | pwdFile := path.Join(wd, "basic-auth-password") |
| 140 | authPassword, err := password.Generate(63, 10, 0, false, true) |
| 141 | |
| 142 | if err != nil { |
| 143 | return err |
| 144 | } |
| 145 | |
| 146 | err = makeFile(pwdFile, authPassword) |
| 147 | if err != nil { |
| 148 | return err |
| 149 | } |
| 150 | |
| 151 | userFile := path.Join(wd, "basic-auth-user") |
| 152 | err = makeFile(userFile, "admin") |
| 153 | if err != nil { |
| 154 | return err |
| 155 | } |
| 156 | |
| 157 | return nil |
| 158 | } |
| 159 | |
| 160 | // makeFile will create a file with the specified content if it does not exist yet. |
| 161 | // if the file already exists, the method is a noop. |
no test coverage detected