Commit graph

33 commits

Author SHA1 Message Date
Chris Roberts
6e13612111 Add test coverage for architecture support 2023-09-14 16:15:03 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
3d0d0148e9 Update tests to use real UI instance
Replaces use of UI doubles within tests to use actual UI instance
    to ensure calls are passing parameters correctly.
2021-06-23 14:04:48 -07:00
Chris Roberts
eae6c1d022
Merge pull request #12419 from chrisroberts/fix-local-box-add
Fix local box add with relative path on Windows
2021-06-22 15:45:49 -07:00
Chris Roberts
e7a6f397da Updates for Ruby 3.0 2021-06-21 15:57:46 -07:00
Chris Roberts
218f8323fb Return original when access token is not removed
When scrubbing box urls of access token parameters, only return
    the processed URL if the access token was removed. If it was not
    removed, return the original URL string. This prevents issues with
    local file URLs being parsed and replaced with invalid paths.

    Fixes: #12340 #12350 #12320
2021-06-11 16:59:35 -07:00
Ikko Ashimine
ddb3994c25
Fix typo in publish_test.rb
vesion -> version
2021-03-27 11:34:15 +09:00
Chris Roberts
cf51c18ad8 Update authentication middleware access token handling
Replace the `VAGRANT_ALLOW_PARAM_AUTH_TOKEN` environment variable
    with `VAGRANT_SERVER_ACCESS_TOKEN_BY_URL` and update the behavior
    when the environment variable is set to add the access token as
    a query parameter and disable the addition of the authentication
    header.

    Fixes #12080
2021-03-24 17:24:47 -07:00
Chris Roberts
fd4da92245 Check file size prior to upload and automatically adjust options
When uploading box file, check if the size is greater than
    5GB. If the size is larger and the direct to storage option
    is enabled, disable the option due to current 5GB restriction
    on direct uploads.
2021-03-23 15:11:32 -07:00
Chris Roberts
60323fdd6c
Merge pull request #12235 from chrisroberts/api-notify-ups
Prevent notification on default store, fix client end point
2021-03-17 13:57:47 -07:00
Chris Roberts
3316098bb6 White space trim 2021-03-17 13:08:30 -07:00
Chris Roberts
d580fbbee2 Use the server url helper method within the client
Some client setup locations where not using the custom helper
    method for the vagrant server URL value so they have been
    updated. The api path is also appended if it is not set for
    custom server URLs
2021-03-15 17:17:10 -07:00
Chris Roberts
867d65b079 Remove access token parameter if found on URL 2021-03-15 15:17:48 -07:00
Chris Roberts
51382a0d0a Deprecate hook and disable access token parameter by default
This sets the `authenticate_box_url` hook as deprecated and also
    disables the cloud auth middleware from adding an access token
    as a URL parameter by default. An environment variable has been
    added which can be used for re-enabling the access token URL
    parameter behavior if required for some legacy system which does
    not support the authorization header.
2021-03-15 14:46:46 -07:00
Chris Roberts
4253f27901 Prevent printing token warning more than once
Mark warning of double tokens set when initially print to prevent
the warning from being shown multiple times during a single run.
2020-11-03 13:47:53 -08:00
Chris Roberts
8b0790168b Check for filter versions and break up box output 2020-10-30 09:26:07 -07:00
Chris Roberts
78d309a09b Update cloud command to use refactored library implementation
This PR is dependent on the 2.1.0 release of the vagrant_cloud
library. It updates the `cloud` command to use the new interface
for interacting with the Vagrant Cloud API. It also adds support
for direct to backend storage uploads, and defaults to this
method.

Also included is a bit of cleanup refactoring, addition of method
documentation, and fixing up some small issues around custom username
usage within the internal client for authentication.
2020-10-30 09:26:07 -07:00
Sophia Castellarin
70d37e8a9c
Merge pull request #11835 from soapy1/remove-url-token
Download a box by setting auth headers
2020-09-22 15:35:30 -05:00
Nandor Kiss
cc3cdfe452 --force instead of --yes. 2020-09-22 20:13:30 +02:00
Nandor Kiss
59d398c405 --yes at vagrant cloud version release command. 2020-09-16 22:25:41 +02:00
sophia
d6a88f666f Add some docstrings and logging 2020-09-15 15:01:01 -05:00
sophia
fffc555faf Add tests for new hook 2020-08-21 10:54:43 -05:00
Brian Cain
cff0ef9830
Update to use example domain
This commit updates the example output to use example.com, rather than a
potnetially real domain.
2020-05-20 14:56:02 -07:00
Brian Cain
145f04893c
Fixes #11137: Fixup how cloud publish handles its arguments
Prior to this commit, if a user didn't supply a box file on disk or a
box url, Vagrant would crash and display a stacktrace with an invalid
file. This commit fixes that by adding some extra handling around the
arguments supplied to the publish command.
2019-11-07 10:19:52 -08:00
Chris Roberts
0bce1e6307 Update tests for checksum and filechecksum 2019-10-08 11:23:48 -07:00
Brian Cain
cdcedb0a9e
Fixes #10682: Move over AddAuthentication middleware and hooks
Prior to this commit, the AddAuthentication hooks still existed in a
deprecated class LoginCommand. This commit fixes that by moving it over
to the vagrant cloud cli namespace instead.
2019-02-21 09:42:16 -08:00
Brian Cain
6d4d9b9304
Fixes #10432: Validate that provider file exists prior to upload
Prior to this commit, Vagrant would attempt to path expand a file that
didn't exist if it was left out of the passed in arguments and no
`--url` was used for external box uploading. This commit fixes that by
adding some additional validation for the passed in box file.
2018-11-30 14:13:45 -08:00
Brian Cain
42c01f241c
Mark password as sensitive in logs 2018-10-12 09:07:12 -07:00
Brian Cain
e8115a4389
Update based on second round of feedback 2018-10-12 09:07:12 -07:00
Brian Cain
d8ec19faa8
Fixup: Update vagrant cloud command PR with feedback 2018-10-12 09:07:12 -07:00
Brian Cain
3c45acc35f
Continue if entity already exists with publish command 2018-10-12 09:07:12 -07:00
Brian Cain
83bd592e30
Introduce curl helper and uploader classes
This commit introduces a new uploader class for uploading files and
splits up some commonly used functionality between it and the downloader
class into a curl helper library.
2018-10-12 09:07:10 -07:00
Brian Cain
e70b871660
Introduce cloud command
This commit adds a new command to Vagrant called `cloud`. It handles any
and all interactions with the external service Vagrant Cloud.
2018-10-12 09:06:00 -07:00