Skip to content

Conversation

@benfleis
Copy link
Contributor

@benfleis benfleis commented Sep 29, 2025

support create secret validation via {none, exists} options, to allow absent credentials (and fix #108)

fixes: #108

  • exists setting matches current behavior -- credential must be found/exist for CREATE SECRET to succeed.
  • none matches previous (v1.3.2) behavior, where no credential is required at CREATE SECRET time.

@benfleis benfleis changed the title support validation to none, exists in CREATE SECRET AWS provider support create secret validation via {none, exists} options, to allow absent credentials (and fix #108) Sep 29, 2025
@benfleis benfleis requested a review from samansmink September 29, 2025 20:47
@benfleis benfleis changed the base branch from main to v1.4-andium September 30, 2025 08:57
@benfleis benfleis force-pushed the add-aws-secret-validation branch from 1bb6867 to c92510b Compare September 30, 2025 09:27
Tmonster and others added 4 commits September 30, 2025 13:31
`exists` setting matches current behavior -- actual credential must be
found/exist for `CREATE SECRET` to succeed.

`none` matches previous (v1.3.2) behavior, where no credential is
required at `CREATE SECRET` time.

fixes duckdb#108
also fix/update include httpfs path
@benfleis benfleis force-pushed the add-aws-secret-validation branch from c92510b to 0dcde66 Compare September 30, 2025 11:51
… absent credentials (and fix duckdb#108)

- `exists` setting matches current behavior -- credential must be found/exist for `CREATE SECRET` to succeed.
- `none` matches previous (v1.3.2) behavior, where no credential is required at `CREATE SECRET` time.
Copy link
Collaborator

@Tmonster Tmonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! just one question about what happens in the absence of the validation argument

@benfleis benfleis requested a review from Tmonster October 1, 2025 10:30
Copy link
Collaborator

@Tmonster Tmonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I have a few questions/comments about testing

I don't think the test/sql/aws_secret_validation tests are running in CI right now. MinioTests.yml will only run ./build/release/test/unittest "*/test/sql/env/*", which won't match test/sql/aws_secret_validation.test

Edit: hit enter too soon sorry.

Also, could we get some tests that test Env vars vs. credentials file?

I testing with assume role, and that looks fine.


#### Use non existent profile to force no available credentials

# bad validation param
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also add a validation 'exists' with a profile? Then if we can check the contents of the secret with something like

from duckdb_secrets() select unnest(split(secret_string, ';'));

That would be super cool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 - that the explicit profile exists check be added.

IMHO checking secrets contents seems unnecessarily e2e here, with little payoff. That data is passthrough, relative to this test, and the correctness of secret retention should already be tested elsewhere, right?

@benfleis benfleis requested a review from Tmonster October 1, 2025 13:18
Copy link
Collaborator

@samansmink samansmink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @benfleis! I did another pass which led to some minor nitpicks

VALIDATION 'exists'
);
----
<REGEX>:.*Invalid Input Error: Failed to create secret.*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this throw an InvalidConfigurationException exception too? InvalidInputException suggests that the failure depends on a wrong input whereas this actually depends on the configuration being wrong. I think ideally we'd throw an error that references the fact that it is the VALIDATION option that caused this

VALIDATION 'nonsense'
);
----
<REGEX>:.*Invalid Configuration Error: Unknown AWS VALIDATION option.*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually an InvalidInputException? This is wrong input no matter the configuration?

VALIDATION 'exists'
);
----
<REGEX>:.*Invalid Configuration Error: Failed to load profile.*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again here: I think referencing the relationship to the VALIDATION option here would be nice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the thrown errors to include "Secret Validation Failure", which (correctly) touches some other existing tests/errors as well, and included some extra 'none' validation tests alongside those.

@benfleis benfleis requested a review from samansmink October 1, 2025 21:07
Copy link
Collaborator

@Tmonster Tmonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

Copy link
Collaborator

@samansmink samansmink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @benfleis!

@samansmink samansmink merged commit 18803d5 into duckdb:v1.4-andium Oct 2, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S3 secret with credential_chain provider cannot be configured in 1.4.0

3 participants