generated from duckdb/extension-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #11 from ccfelius/secrets
made secrets work
- Loading branch information
Showing
3 changed files
with
107 additions
and
26 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
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,35 @@ | ||
# name: test/sql/secrets/secrets_encryption.test | ||
# description: Test secret creation for internal encryption | ||
# group: [simple-encryption/secrets] | ||
|
||
statement ok | ||
PRAGMA enable_verification; | ||
|
||
require simple_encryption | ||
|
||
# Ensure any currently stored secrets don't interfere with the test | ||
statement ok | ||
set allow_persistent_secrets=false; | ||
|
||
# Create an internal secret (for internal encryption of columns) | ||
statement ok | ||
CREATE SECRET test_key ( | ||
TYPE ENCRYPTION, | ||
KEY_NAME 'key_1', | ||
KEY_VALUE '0123456789112345', | ||
LENGTH 16 | ||
); | ||
|
||
# Create an internal secret (for internal encryption of columns) | ||
statement error | ||
CREATE SECRET test_wrong_length ( | ||
TYPE ENCRYPTION, | ||
KEY_NAME 'key_1', | ||
KEY_VALUE '0123456789112345', | ||
LENGTH 99 | ||
); | ||
---- | ||
Invalid Input Error: Invalid size for encryption key: '99', expected: 16, 24, or 32 | ||
|
||
statement ok | ||
SELECT encrypt(11, '0123456789112345'); |