40 Commits

Author SHA1 Message Date
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
sophia
3516aa7131
Set defailt Vagrant log level 2022-04-25 12:26:44 -05:00
sophia
434cc89a95
Get rid of extra subcommand help message
The available subcommands are displayed using the option parser
in the vagrant client
2022-04-25 12:24:11 -05:00
sophia
633528318d
Get help from ui output 2022-04-25 12:23:58 -05:00
sophia
0c1e44f553
Get help from commands that have subcommands 2022-04-25 12:23:58 -05: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
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
16e91e4ba2 Do not convert value to allow nil value to pass through 2021-03-17 13:08:43 -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
baa24af179 Remove all unused code related to the deprecated login command 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
sophia
0d1635303f Sperate hook for authenticating url and adding headers for authentication 2020-08-18 17:42:59 -05:00
sophia
f440012b30 Scrub token from logs 2020-08-18 10:51:42 -05:00
sophia
b5f6df9ec0 Download a box by setting auth headers 2020-08-18 10:13:39 -05:00
comet
fa43afb57b
update 2020-01-27 17:04:23 -06: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
cc23905142 Add support for providing box checksums to Vagrant Cloud 2019-10-08 11:23:48 -07:00
Brian Cain
5b3c6b8ad4
Fixes #10723: Fix bug instance var in Vagrant Cloud CLI optparse
This commit uses the correct instance variable for the optparse library
when reading in the command line flags for various Vagrant Cloud CLI
commands.
2019-03-11 14:21:55 -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
ca6cc140ff
Catch InvalidVersion errors from vagrant_cloud client
This commit adds a new rescue to the `publish` command for when the
client detects an invalid version prior to making the API request to
create that version.
2018-12-17 14:41:29 -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
15fb2b729d
Remove #Hash.compact for ruby 2.3 compatibility 2018-10-16 14:41:31 -07:00
Brian Cain
42c01f241c
Mark password as sensitive in logs 2018-10-12 09:07:12 -07:00
Brian Cain
adefbbaf6e
Scrub Vagrant Cloud tokens from RestClient logger 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