terracognita icon indicating copy to clipboard operation
terracognita copied to clipboard

cmd/aws: Added support for 'ssocreds'

Open xescugc opened this issue 2 years ago • 6 comments

By adding the provider to the list of Providers to check for credentials

Closes #282

xescugc avatar May 23 '22 13:05 xescugc

When can this be merged? Is there anything that needs to be done?

joh-klein avatar Jun 27 '22 11:06 joh-klein

@joh-klein could you test the PR and confirm this works for you?

xlr-8 avatar Jun 28 '22 07:06 xlr-8

I tried it – it does not work for me at all. It just says the flag "access-key" is required. When I removed the "access-key is required" check, it failed with Error: could not initialize 'reader' because: EmptyStaticCreds: static credentials are empty.

joh-klein avatar Jun 28 '22 07:06 joh-klein

Alright so we'll need to update it to avoid having several credential required between SSO/access/secret key, etc

xlr-8 avatar Jun 29 '22 08:06 xlr-8

any updates?

Hokwang avatar Jul 25 '22 06:07 Hokwang

I'm asking the OPS to enable SSO so I can test it.

Though I see what I did wrong. AWS expects the SSO provider initialization to have the values you have on the file so they can request the AccessKey/SecretKey, so I do not have to remove the requirement of those as internally I set them from the fetcher.

But the implementation is not correct as I'm not reading the file, I was expecting the lib to do it as we have for shared credentials, so what should be done is to fetch the file first, read the values, initialize the sso provider and then call the .Retrieve() which returns the Value which has the Access/Secret.

For this I have to find a public method on the AWS lib (fond a private one for now) that reads the config raw and then I can read the values from it so i can initialize the the sso Provider correctly.

That's where I'm now, If I find the method then It should be farely easy to implement I think. I'm looking into it but it's not my main priority tbh, but I'm looking into it :).

xescugc avatar Jul 25 '22 09:07 xescugc