forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request duckdb#10612 from samansmink/delay-secret-storage-…
…directory-initialization delay secret storage initialization
- Loading branch information
Showing
4 changed files
with
78 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
test/sql/secrets/create_secret_non_writable_persistent_dir.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# name: test/sql/secrets/create_secret_non_writable_persistent_dir.test | ||
# description: Test persistent secrets when the secret dir is non-writable | ||
# group: [secrets] | ||
|
||
statement ok | ||
PRAGMA enable_verification; | ||
|
||
load __TEST_DIR__/create_secret_non_writable_persistent_dir.db | ||
|
||
require httpfs | ||
|
||
# First we create any file | ||
statement ok | ||
COPY (SELECT 1 as a) to '__TEST_DIR__/file_to_prevent_the_secret_dir_from_being_created.csv' | ||
|
||
# Then we set the secret dir to this. | ||
statement ok | ||
set secret_directory='__TEST_DIR__/file_to_prevent_the_secret_dir_from_being_created.csv' | ||
|
||
# Now on creation of a tmp secret, the secret manager is initialized, but the persistent secret directory creation is impossible | ||
statement ok | ||
CREATE SECRET my_tmp_secret ( | ||
TYPE S3, | ||
SCOPE 's3://bucket1' | ||
) | ||
|
||
# This now fails with the message that we could not create the persistent secret directory | ||
statement error | ||
CREATE PERSISTENT SECRET my_tmp_secret ( | ||
TYPE S3, | ||
SCOPE 's3://bucket2' | ||
) | ||
---- | ||
|
||
restart | ||
|
||
# Try with a correct, deeply nested path: AOK? | ||
statement ok | ||
set secret_directory='__TEST_DIR__/create_secret_non_writable_persistent_dir/a/deeply/nested/folder/will/be/created' | ||
|
||
statement maybe | ||
CREATE PERSISTENT SECRET my_tmp_secret ( | ||
TYPE S3, | ||
SCOPE 's3://bucket2' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters