emgarten / Sleet

A static nuget feed generator for Azure Storage, AWS S3, and more.
MIT License
362 stars 43 forks source link

Add AWS SSO support #170

Closed emgarten closed 1 year ago

emgarten commented 1 year ago

Add support for AWS profiles with SSO

I based this work on: https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/sso.html

It looks relatively straight forward to add, however it is unclear how this works as a fallback with the existing profile support and unfortunately I don't have an SSO account to test this with.

As a fallback this should be safe since the existing profile load runs first. My concern is when looking at the code for the existing profile load I see internally it runs with isSsoSession: false and doesn't appear to allow setting it to true.

Potentially an SSO profile could get loaded from the existing profile load. The result may or may not work due to that flag. If it gives incomplete credentials it may return true and not fallback to the new SSO code.

I'm going to go ahead with this change because either way including the AWS SSO SDK binaries looks like a step in the right direction based on the fact that currently Sleet will throw an assembly load exception since those binaries aren't there. The AWS SDK clearly knows about them, but the SDK NuGet package doesn't have a dependency on those. It is up to app to bring them in.

Fixes: https://github.com/emgarten/Sleet/issues/168