Skip to content

Commit

Permalink
Merge pull request #83 from HynekBlaha/workload-identity
Browse files Browse the repository at this point in the history
Add Workload Identity Credentials
  • Loading branch information
samansmink authored Oct 1, 2024
2 parents b0ffe7a + f08f876 commit 68b9232
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/azure_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void LoadInternal(DatabaseInstance &instance) {
LogicalType::VARCHAR);
config.AddExtensionOption("azure_credential_chain",
"Ordered list of Azure credential providers, in string format separated by ';'. E.g. "
"'cli;managed_identity;env'",
"'cli;workload_identity;managed_identity;env'",
LogicalType::VARCHAR, nullptr);
config.AddExtensionOption("azure_endpoint",
"Override the azure endpoint for when the Azure credential providers are used.",
Expand Down
3 changes: 3 additions & 0 deletions src/azure_storage_account_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <azure/identity/default_azure_credential.hpp>
#include <azure/identity/environment_credential.hpp>
#include <azure/identity/managed_identity_credential.hpp>
#include <azure/identity/workload_identity_credential.hpp>
#include <azure/storage/blobs/blob_options.hpp>
#include <azure/storage/blobs/blob_service_client.hpp>

Expand Down Expand Up @@ -138,6 +139,8 @@ CreateChainedTokenCredential(const std::string &chain,
for (const auto &item : chain_list) {
if (item == "cli") {
sources.push_back(std::make_shared<Azure::Identity::AzureCliCredential>(credential_options));
} else if (item == "workload_identity") {
sources.push_back(std::make_shared<Azure::Identity::WorkloadIdentityCredential>(credential_options));
} else if (item == "managed_identity") {
sources.push_back(std::make_shared<Azure::Identity::ManagedIdentityCredential>(credential_options));
} else if (item == "env") {
Expand Down

0 comments on commit 68b9232

Please sign in to comment.