-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for secrets #23
Conversation
Idea: would it make sense have So the idea would be that users that want default behaviours can keep using And users that will want more control can move to use explicit Obv, this can also added later after landing this PR. |
Yea good point, I've considered this, but i think there's not really a point. If we're already deprecating the |
Thanks! LGTM. A related question - previously this extension would be auto-loaded when |
@Mytherin Yea it is! We can autoload on secret load and creation https://github.com/duckdb/duckdb/blob/1e216074028c0aaef838ae2075e2e30705aa48e7/src/main/secret/secret_manager.cpp#L196 |
Cool, very nice! |
This PR adds support for a new concept in duckdb: secrets (duckdb/duckdb#10042)
To summarize, secrets are, in the most generic sense, scoped sets of configuration that provide the necessary information to do something. In most cases this "something" will be an authorized request to some API.
For the AWS extension this means the what was previously configured through duckdb settings, will now be done through secrets. Check out the aforementioned PR in duckdb on what benefits this brings. This means that the
load_aws_credentials()
function call is now implemented as a Secret Provider calledcredential_chain
.credential_chain secret provider overview
The
credential_chain
provider uses the AWS SDK to create an S3 secret. This is done in exactly the same way as theload_aws_credentials
function now does, except instead of setting the duckdb_settings, it creates a secret.The easiest way to use it is:
This will create an S3 secret that basically does everything automatically, just like
load_aws_credentials
.Note that all of the fields that you can normally set for s3 secrets are also implemented, including the ones set automatically. For example to automatically load the config, override the loaded region, and disable ssl:
Small feature addition
While implementing, I added a small feature similar to what already existed in the azure extension: the ability to specify the credential chain used. This means that you can change (the order in) which different places are searched for credentials by the aws sdk. For example, to search for credentials firstly in the config, and then the env:
This feature fixes #16
Also this should fix issue #14 and #10 by providing a way to pass the profile to the
sso
chain:Finally, the credential chain provider can take various arguments to configure the several other aws sdk providers, however, these are currently not yet tested properly. (see test/sql/aws_secret_chains.test for more info)