* Use the host name from the logged in server for codespace commands
* Fix existing tests
* Add tests for server url configuration
* Rename defaultApiUrl to defaultAPIURL and comment cleanup
* Switch to t.Setenv in codespaces api tests
* Switch to t.Setenv in other tests
* Support custom server in web flows for list and create
* Rename GetServerURL() to ServerURL()
When a username option is not provided for the `gh codespace delete`
command, we will use the authenticated user's login as the default to
avoid deleting anyone else's codespace by mistake.
Prior to this change, running `gh codespace delete --org MYORG --all`
would fetch all of the codespacese associated with the org regardless of
user and then only delete the ones associated with the authenticated
user, which would lead to 404 errors when MYORG had codespaces owned by
members other than the authenticated member.
Co-authored-by: Victoria Dye <vdye@github.com>
Co-authored-by: Lessley Dennington <ldennington@github.com>
- Drop GetCodespaceToken as it is no longer necessary
- Introduces new behavior with the API to optionally include connection
details in the GET request. Ommitting to do so results in a faster
response
- Switch to using name instead of GUID
- Remove GUID from the code since it is not used anywhere else
- Add docs to the api client methods
- Re-gen mocked client
- Drop the need for the user argument
- Update mocks
- Remove no longer applicable TODO comment
- Show message for successful deletion (this regressed)