Vagrant Cloud provides support for uploading directly to the backend
storage instead of streaming through Vagrant Cloud. This adds support
for direct to storage uploads and sets it as the default upload method.
A new option has been added to disable this behavior and revert back
to streaming upload via Vagrant Cloud (`no_direct_upload`).
This default for uploading directly to the backend storage also matches
up with changes being added to Vagrant proper for box upload behavior:
hashicorp/vagrant#11916
This change updates the underlying type of VagrantCloudErrors.Errors to match the expected errors response type and adds a simple test to verify the parsing of various error responses.
Tests before change
```
--- FAIL: TestVagranCloudErrors (0.00s)
client_test.go:23: failed to decode error response: json: cannot unmarshal array into Go struct field VagrantCloudErrors.errors of type map[string][]string
client_test.go:23: failed to decode error response: json: cannot unmarshal array into Go struct field VagrantCloudErrors.errors of type map[string][]string
client_test.go:26: failed to get expected response; expected "", got "error1. error2"
client_test.go:23: failed to decode error response: json: cannot unmarshal array into Go struct field VagrantCloudErrors.errors of type map[string][]string
client_test.go:26: failed to get expected response; expected "", got "message Bad credentials"
```
Test after change
```
--- PASS: TestVagranCloudErrors (0.00s)
```
* stoped using url to pass the auth token and put it in the headers
* added newRequest method to VagrantCloudClient that sets json and auth headesr
* made VagrantCloudClient method pointers to avoid copies
Fixes the following vet reports:
post-processor/vagrant-cloud/client.go:81: arg resp for printf verb %s of wrong type: *net/http.Response
post-processor/vagrant-cloud/client.go:99: arg resp for printf verb %s of wrong type: *net/http.Response
post-processor/vagrant-cloud/client.go:131: arg resp for printf verb %s of wrong type: *net/http.Response
post-processor/vagrant-cloud/client.go:156: arg resp for printf verb %s of wrong type: *net/http.Response
post-processor/vagrant-cloud/client.go:175: arg resp for printf verb %s of wrong type: *net/http.Response