cloudfoundry / cloudfoundry/uaa-cli
politely suggest re-login if ~/.uaa/config.json is v0.0.1 format - upgrading from v0.0.1 to master/HEAD panics
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 22
- Forks
- 14
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
If I've already logged in with uaa v0.0.1, and then try to upgrade to master branch I am rewarded with an ugly panic. Perhaps instead, politely suggest to the user to re-authenticate/re-login if ~/.uaa/config.json exists, but the token is invalid, etc.
$ uaa version
0.0.1
$ VERSION=0.0.1 make build
$ build/uaa version
0.0.1 aa21f51
$ build/uaa clients
panic: must supply a valid token
goroutine 1 [running]:
code.cloudfoundry.org/uaa-cli/cmd.GetAPIFromSavedTokenInContext(0x1d)
/Users/drnic/Projects/gopath/src/code.cloudfoundry.org/uaa-cli/cmd/api_client.go:20 +0x9fd
...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read cmd/api_client.go at GetAPIFromSavedTokenInContext, then reproduce the failure with an existing ~/.uaa/config.json from uaa v0.0.1 and the clients command. Replace the panic for an invalid saved token with a polite re-authentication prompt, and verify that the command no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- authentication, cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100