(contents string, t *testing.T)
| 37 | } |
| 38 | |
| 39 | func createBasicAuthFile(contents string, t *testing.T) (string, error) { |
| 40 | dir := t.TempDir() |
| 41 | |
| 42 | filename := fmt.Sprintf("%s/%s", dir, uuid.NewUUID()) |
| 43 | |
| 44 | err := os.WriteFile(filename, []byte(contents), 0666) |
| 45 | |
| 46 | if err != nil { |
| 47 | return "", fmt.Errorf("could not write password file: %s", err) |
| 48 | } |
| 49 | |
| 50 | return filename, nil |
| 51 | } |
| 52 | |
| 53 | func createBasicAuth(user string, password string, t *testing.T) (AuthScheme, error) { |
| 54 | contents := fmt.Sprintf("%s:%s", user, password) |
no test coverage detected