Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-format
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ token.txt
_site/
credentials.json
compile_commands.json
compile_flags.txt
.cache/clangd/
.helix/
2 changes: 1 addition & 1 deletion docs/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ INSTALL gsheets FROM community;
LOAD gsheets;
```

The latest version of [DuckDB](https://duckdb.org/docs/installation) (currently 1.2.0) is supported.
The latest version of [DuckDB](https://duckdb.org/docs/installation) (currently 1.3.1) is supported.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 4984 files
2 changes: 1 addition & 1 deletion src/gsheets_get_token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@
base64encode(claim_set_64, jwt_claim_set.dump().c_str(), strlen(jwt_claim_set.dump().c_str()));

char input[1024];
int input_length = sprintf(input, "%s.%s", header_64, claim_set_64);

Check warning on line 108 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Check warning on line 108 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Check warning on line 108 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Check warning on line 108 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

unsigned char *digest = SHA256((const unsigned char *)input, input_length, NULL);
char digest_str[1024];
for (int i = 0; i < SHA256_DIGEST_LENGTH; ++i) {
sprintf(digest_str + i * 2, "%02x", digest[i]);

Check warning on line 113 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Check warning on line 113 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Check warning on line 113 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Check warning on line 113 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
}

digest_str[SHA256_DIGEST_LENGTH * 2] = '\0';
Expand All @@ -120,18 +120,18 @@
int private_key_length = std::strlen(secret_string.c_str());
BIO_write(bio, private_key_pointer, private_key_length);
EVP_PKEY* evp_key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
RSA* rsa = EVP_PKEY_get1_RSA(evp_key);

Check warning on line 123 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_eh, wasm32-emscripten)

'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]

Check warning on line 123 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_eh, wasm32-emscripten)

'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]

Check warning on line 123 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_mvp, wasm32-emscripten)

'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]

Check warning on line 123 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_mvp, wasm32-emscripten)

'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]

Check warning on line 123 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_threads, wasm32-emscripten)

'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]

Check warning on line 123 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_threads, wasm32-emscripten)

'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]

Check warning on line 123 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]

Check warning on line 123 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]

if (rsa != NULL) {
unsigned char sigret[4096] = {};
unsigned int siglen;
if (RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, sigret, &siglen, rsa)) {

Check warning on line 128 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_eh, wasm32-emscripten)

'RSA_sign' is deprecated [-Wdeprecated-declarations]

Check warning on line 128 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_eh, wasm32-emscripten)

'RSA_sign' is deprecated [-Wdeprecated-declarations]

Check warning on line 128 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_mvp, wasm32-emscripten)

'RSA_sign' is deprecated [-Wdeprecated-declarations]

Check warning on line 128 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_mvp, wasm32-emscripten)

'RSA_sign' is deprecated [-Wdeprecated-declarations]

Check warning on line 128 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_threads, wasm32-emscripten)

'RSA_sign' is deprecated [-Wdeprecated-declarations]

Check warning on line 128 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_threads, wasm32-emscripten)

'RSA_sign' is deprecated [-Wdeprecated-declarations]

Check warning on line 128 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'RSA_sign' is deprecated [-Wdeprecated-declarations]

Check warning on line 128 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'RSA_sign' is deprecated [-Wdeprecated-declarations]
if (RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, sigret, siglen, rsa)) {

Check warning on line 129 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_eh, wasm32-emscripten)

'RSA_verify' is deprecated [-Wdeprecated-declarations]

Check warning on line 129 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_eh, wasm32-emscripten)

'RSA_verify' is deprecated [-Wdeprecated-declarations]

Check warning on line 129 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_mvp, wasm32-emscripten)

'RSA_verify' is deprecated [-Wdeprecated-declarations]

Check warning on line 129 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_mvp, wasm32-emscripten)

'RSA_verify' is deprecated [-Wdeprecated-declarations]

Check warning on line 129 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_threads, wasm32-emscripten)

'RSA_verify' is deprecated [-Wdeprecated-declarations]

Check warning on line 129 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_threads, wasm32-emscripten)

'RSA_verify' is deprecated [-Wdeprecated-declarations]

Check warning on line 129 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'RSA_verify' is deprecated [-Wdeprecated-declarations]

Check warning on line 129 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'RSA_verify' is deprecated [-Wdeprecated-declarations]
char signature_64[1024];
base64encode(signature_64, (const char *)sigret, siglen);

char jwt[1024];
sprintf(jwt, "%s.%s", input, signature_64);

Check warning on line 134 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Check warning on line 134 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

std::string body = "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=" + std::string(jwt);
std::string response = perform_https_request("oauth2.googleapis.com", "/token", "",
Expand All @@ -150,7 +150,7 @@
printf("RSA_sign failed: %lu, %s\n", err, ERR_error_string(err, NULL));
}

RSA_free(rsa);

Check warning on line 153 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_eh, wasm32-emscripten)

'RSA_free' is deprecated [-Wdeprecated-declarations]

Check warning on line 153 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_eh, wasm32-emscripten)

'RSA_free' is deprecated [-Wdeprecated-declarations]

Check warning on line 153 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_mvp, wasm32-emscripten)

'RSA_free' is deprecated [-Wdeprecated-declarations]

Check warning on line 153 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_mvp, wasm32-emscripten)

'RSA_free' is deprecated [-Wdeprecated-declarations]

Check warning on line 153 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_threads, wasm32-emscripten)

'RSA_free' is deprecated [-Wdeprecated-declarations]

Check warning on line 153 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / DuckDB-Wasm (wasm_threads, wasm32-emscripten)

'RSA_free' is deprecated [-Wdeprecated-declarations]

Check warning on line 153 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'RSA_free' is deprecated [-Wdeprecated-declarations]

Check warning on line 153 in src/gsheets_get_token.cpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'RSA_free' is deprecated [-Wdeprecated-declarations]
}

throw InvalidInputException("Conversion from private key to token failed. Check email, key format in JSON file (-----BEGIN PRIVATE KEY-----\\n ... -----END PRIVATE KEY-----\\n), and expiration date.");
Expand Down Expand Up @@ -188,7 +188,7 @@
auto old_secret = secret_manager.GetSecretByName(transaction, secret_name);
auto persist_type = old_secret->persist_type;
auto storage_mode = old_secret->storage_mode;
CreateSecretInfo create_secret_info = CreateSecretInfo(OnCreateConflict::REPLACE_ON_CONFLICT, persist_type);
auto create_secret_info = make_uniq<CreateSecretInfo>(OnCreateConflict::REPLACE_ON_CONFLICT, persist_type);

// Copy the old secret (to get metadata about the secret we want to maintain)
auto new_secret = old_secret->secret->Clone().get();
Expand Down
Loading