(arg string)
| 146 | } |
| 147 | |
| 148 | func newBasicAuth(arg string) (AuthMode, error) { |
| 149 | pieces := strings.Split(arg, ":") |
| 150 | if len(pieces) != 2 { |
| 151 | return nil, fmt.Errorf("invalid basic auth syntax. got %q, want \"username:password\"", arg) |
| 152 | } |
| 153 | return NewBasicAuth(pieces[0], pieces[1]), nil |
| 154 | } |
| 155 | |
| 156 | // NewBasicAuth returns a UserPass Authmode, adequate to support HTTP |
| 157 | // basic authentication. |
nothing calls this directly
no test coverage detected