iceberg-cpp
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
iceberg::KmsRegistry Class Reference

Creates KMS clients by name. More...

#include <key_management_client.h>

Public Types

using Properties = std::unordered_map< std::string, std::string >
 
using Factory = std::function< Result< std::unique_ptr< KeyManagementClient > >()>
 

Static Public Member Functions

static void Register (std::string name, Factory factory)
 Register a client factory under name, replacing any previous one.
 
static Result< std::shared_ptr< KeyManagementClient > > Load (std::string_view name, const Properties &properties)
 Create and initialize the client registered under name.
 
static Result< std::shared_ptr< KeyManagementClient > > FromCatalogProperties (const Properties &properties)
 Create the KMS client configured by catalog properties.
 

Static Public Attributes

static constexpr std::string_view kKmsType = "encryption.kms-type"
 
static constexpr std::string_view kKmsImpl = "encryption.kms-impl"
 
static constexpr std::string_view kKmsTypeAws = "aws"
 
static constexpr std::string_view kKmsTypeGcp = "gcp"
 
static constexpr std::string_view kKmsTypeAzure = "azure"
 

Detailed Description

Creates KMS clients by name.

Catalogs create their KMS client from the catalog properties, with the same property names as Java:

Java has no built-in clients yet and rejects every encryption.kms-type (EncryptionUtil.createKmsClient); here the type names resolve through the same registry, so a client registered under one of them is used.

Built-in clients register themselves when their library is linked and initialized; applications register custom clients before creating catalogs.

Member Function Documentation

◆ FromCatalogProperties()

static Result< std::shared_ptr< KeyManagementClient > > iceberg::KmsRegistry::FromCatalogProperties ( const Properties &  properties)
static

Create the KMS client configured by catalog properties.

Returns
the initialized client, or nullptr if neither encryption.kms-type nor encryption.kms-impl is set.

◆ Register()

static void iceberg::KmsRegistry::Register ( std::string  name,
Factory  factory 
)
static

Register a client factory under name, replacing any previous one.

An empty factory is accepted here but makes the corresponding Load fail with an invalid-argument error rather than being invoked.


The documentation for this class was generated from the following file: