27 Commits

Author SHA1 Message Date
Chris Roberts
97f5822dee Ignore URLs which cannot be parsed in the authentication middleware
Fixes #9725
2018-04-26 15:08:06 -07:00
Chris Roberts
5feb234665 Return original URL value when unmodified
Due to the behavior of URI.parse on Ruby < 2.5 returning the string
value of the parsed URI object may modify the original URL. Specifically
it will remove the `//` prefix characters from SMB paths. When no
host modifications are being made, always return the original value.

Fixes #9636
2018-04-25 16:21:21 -07:00
Chris Roberts
fc5ceafbcf Only generate notice once 2018-02-22 14:49:44 -08:00
Chris Roberts
f2bf18e56b Update behavior of the authentication middleware
Always remap old hosts to target host when encountered. When custom
vagrant server is defined, warn when tokens may be attached and allow
time for user to cancel.

Fixes #9442
2018-02-21 17:03:38 -08:00
Justin Campbell
40d8dc4582 Add app.vagrantup.com to allowed auth hosts
This should allow users setting VAGRANT_SERVER_URL to app.vagrantup.com to authenticate to private boxes.
2017-11-07 10:35:16 -05:00
Justin Campbell
c5266e98b8 Change allowed auth hosts to list 2017-11-07 10:32:33 -05:00
Justin Campbell
f8fa7e3b29 command/login: Fix typo in server_error 2017-08-30 10:39:58 -04:00
Justin Campbell
3ddc98c2e4 command/login: Support 2FA login on Vagrant Cloud 2017-08-30 10:39:58 -04:00
Justin Campbell
0e091fee16 command/login: Store user/pass on client
Will allow us to prompt for other info without forgetting this data.
2017-08-30 10:39:58 -04:00
Justin Campbell
03ebd8b714 command/login: Add hostname to default token desc
Uses `Socket.gethostname` to add the current hostname to the default
description.
2017-08-10 17:21:20 -04:00
Justin Campbell
92578aed4b command/login: Add description to created token
This adds a prompt for a token description, which is now supported in
Vagrant Cloud. Pressing enter on the prompt uses the default description
of `"Vagrant login"`.

    $ vagrant login
    In a moment we will ask for your username and password to HashiCorp's
    Vagrant Cloud. After authenticating, we will store an access token locally on
    disk. Your login details will be transmitted over a secure connection, and
    are never stored on disk locally.

    If you do not have an Vagrant Cloud account, sign up at
    https://www.vagrantcloud.com

    Vagrant Cloud Username: justincampbell
    Password (will be hidden):
    Token description (Defaults to "Vagrant login"):
    You are now logged in.
    $

Which created a token with the default description of "Vagrant login":

![](http://c.justincampbell.me/2V0p0T0U0d0O/Screen%20Shot%202017-08-10%20at%205.08.21%20PM.png)

Entering a description:

    Token description (Defaults to "Vagrant login"): Justin's MacBook Pro

![](http://c.justincampbell.me/2m1N0d1M3k3P/Screen%20Shot%202017-08-10%20at%205.09.39%20PM.png)
2017-08-10 17:12:38 -04:00
Chris Roberts
5f955c3d38 Convert atlas references to vagrant cloud 2017-06-23 10:01:51 -07:00
Seth Vargo
2d0943b0ad Print a warning when token and envvar are set
Fixes GH-7206
2016-04-08 10:16:10 -04:00
Seth Vargo
b5a6c6e6ab Fix whitespace 2016-02-03 09:55:10 -05:00
Tom Scanlan
661b6a4813 fix login behind proxy (#6898)
we're using rest_client 1.6.9, which doesn't use proxy passed in
to the RestClient::Request.execute.  Must set RestClient.proxy
instead
2016-01-20 16:15:50 -05:00
Seth Vargo
bd48d24825 Respect proxy envvars for login command 2015-11-23 20:19:45 -05:00
Seth Vargo
ff95fc5c1e Only append access_token the first time
This fixes GH-6395 by only appending the access_token once. It also fixes a
bug that was never reported. If a user supplied an access_token for a box URL,
Vagrant would silently overwrite it.

After this commit, Vagrant only appends an access_token to the URL if no
value exists at the key.
2015-11-18 10:44:35 -08:00
Seth Vargo
114858c7d2 Verify the token is valid when saving 2015-01-09 13:24:53 -05:00
Seth Vargo
253f0637e5 Add a -t command for setting the login token 2015-01-08 17:16:21 -05:00
Seth Vargo
e828719c2f Add logging to vagrant-login 2015-01-07 11:43:14 -05:00
Mitchell Hashimoto
fdd7bc3ffd commands/login: append access token to vagrantcloud => atlas URLs 2014-12-12 14:53:05 -08:00
Seth Vargo
6596f7f29d Merge pull request #4937 from mitchellh/sethvargo/error_format
Use the new Rails error format
2014-12-11 16:54:45 -08:00
Seth Vargo
9a575a79ec Use the new Rails error format 2014-12-11 01:21:46 -08:00
Seth Vargo
7d6a6cd263 Read the ATLAS_TOKEN in vagrant-login 2014-12-10 15:08:43 -08:00
Seth Vargo
62065e013a Read and return login errors from Atlas 2014-12-08 18:26:36 -08:00
Seth Vargo
3d8a1ec3fc Fix some rename shit 2014-12-08 18:26:36 -08:00
Seth Vargo
b973186cb5 Add vagrant-login to core ;) 2014-12-08 18:26:36 -08:00