Optum / dce-cli

Disposable Cloud Environment CLI
Apache License 2.0
37 stars 19 forks source link

ID-less login doesn't work and doesn't seem to exist in DCE project? #92

Open nelsonjchen opened 3 years ago

nelsonjchen commented 3 years ago

Version information

DCE-cli: master at 2021/2/1 DCE: master at 2021/2/1

Describe the bug

dce leases login doesn't work without an explicit ID.

To Reproduce

  1. Run dce leases login. Make sure there's no ID/argument!
time="2021-02-01T00:50:00-07:00" level=debug msg="Requesting leased account credentials"
time="2021-02-01T00:50:31-07:00" level=debug msg="V4 Signing Request:\n POST /api/leases/auth HTTP/1.1\r\nHost: xxxxxxxx.execute-api.us-east-1.amazonaws.com\r\nAccept: application/json\r\nContent-Type: application/json\r\n\r\n"
time="2021-02-01T00:50:31-07:00" level=debug msg="Response:  &{404 Not Found 404 HTTP/2.0 2 0 map[Content-Length:[79] Content-Type:[application/json] Date:[Mon, 01 Feb 2021 07:51:12 GMT] Via:[1.1 36fc63dc4f635a9ea30a821a42657dd4.cloudfront.net (CloudFront)] X-Amz-Apigw-Id:[aDjlmEWNoAMFkpw=] X-Amz-Cf-Id:[RlIsi-QIMevLu6ksu5_tJB0W7r3-UZwfbMP2wpIKHUgcMvAectMzkg==] X-Amz-Cf-Pop:[LAX3-C2] X-Amzn-Errortype:[NotFoundException] X-Amzn-Requestid:[ac3ee942-1fed-4ce4-b1d6-3866d33e17e5] X-Cache:[Error from cloudfront]] {0xc00076fce0} 79 [] false false map[] 0xc000585700 0xc0007998c0}"
time="2021-02-01T00:50:31-07:00" level=fatal msg="[POST /leases/auth][404] postLeasesAuthNotFound "

Expected behavior

dce leases login logs into the lease without an ID present.

Additional context

The change by @eschwartz here seems to indicate that it should be possible to login without the ID. https://github.com/Optum/dce-cli/blame/3aa9d1b4db7284abb3d37d429a6ed6f64d9218cb/CHANGELOG.md#L11

The swagger generated code also imply that a /leases/auth endpoint existed in the swagger documents it was generated from: https://github.com/Optum/dce-cli/blob/3aa9d1b4db7284abb3d37d429a6ed6f64d9218cb/client/operations/operations_client.go#L482

But it doesn't seem that the current master of the swagger API has this defined: https://github.com/Optum/dce/blob/f4a1c1cee56cd7daa01ecca7f35aaec7fe4199b1/modules/swagger.yaml