![]() |
Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
|
The Secret Manager for DuckDB. Can handle both temporary and persistent secrets. More...

Public Member Functions | |
| DUCKDB_API void | Initialize (DatabaseInstance &db) |
| DUCKDB_API void | LoadSecretStorage (unique_ptr< SecretStorage > storage) |
| Load a secret storage. | |
| DUCKDB_API unique_ptr< BaseSecret > | DeserializeSecret (Deserializer &deserializer, const string &secret_path="") |
| DUCKDB_API void | RegisterSecretType (SecretType &type) |
| Register a new SecretType. | |
| DUCKDB_API SecretType | LookupType (const string &type) |
| Lookup a SecretType. | |
| DUCKDB_API void | RegisterSecretFunction (CreateSecretFunction function, OnCreateConflict on_conflict) |
| Register a Secret Function i.e. a secret provider for a secret type. | |
| DUCKDB_API unique_ptr< SecretEntry > | RegisterSecret (CatalogTransaction transaction, unique_ptr< const BaseSecret > secret, OnCreateConflict on_conflict, SecretPersistType persist_type, const string &storage="") |
| Register a secret by providing a secret manually. | |
| DUCKDB_API unique_ptr< SecretEntry > | CreateSecret (ClientContext &context, const CreateSecretInput &info) |
| Create a secret from a CreateSecretInfo. | |
| DUCKDB_API BoundStatement | BindCreateSecret (CatalogTransaction transaction, CreateSecretInput &info) |
| The Bind for create secret is done by the secret manager. | |
| DUCKDB_API SecretMatch | LookupSecret (CatalogTransaction transaction, const string &path, const string &type) |
| Lookup the best matching secret by matching the secret scopes to the path. | |
| DUCKDB_API unique_ptr< SecretEntry > | GetSecretByName (CatalogTransaction transaction, const string &name, const string &storage="") |
| Get a secret by name, optionally from a specific storage. | |
| DUCKDB_API void | DropSecretByName (CatalogTransaction transaction, const string &name, OnEntryNotFound on_entry_not_found, SecretPersistType persist_type=SecretPersistType::DEFAULT, const string &storage="") |
| Delete a secret by name, optionally by providing the storage to drop from. | |
| DUCKDB_API vector< SecretEntry > | AllSecrets (CatalogTransaction transaction) |
| List all secrets from all secret storages. | |
| DUCKDB_API vector< SecretType > | AllSecretTypes () |
| List all secret types. | |
| virtual DUCKDB_API void | SetEnablePersistentSecrets (bool enabled) |
| Secret Manager settings. | |
| virtual DUCKDB_API void | ResetEnablePersistentSecrets () |
| virtual DUCKDB_API bool | PersistentSecretsEnabled () |
| virtual DUCKDB_API void | SetDefaultStorage (const string &storage) |
| virtual DUCKDB_API void | ResetDefaultStorage () |
| virtual DUCKDB_API string | DefaultStorage () |
| virtual DUCKDB_API void | SetPersistentSecretPath (const string &path) |
| virtual DUCKDB_API void | ResetPersistentSecretPath () |
| virtual DUCKDB_API string | PersistentSecretPath () |
| DUCKDB_API void | DropSecretByName (ClientContext &context, const string &name, OnEntryNotFound on_entry_not_found, SecretPersistType persist_type=SecretPersistType::DEFAULT, const string &storage="") |
| Utility functions. | |
Static Public Member Functions | |
| static DUCKDB_API SecretManager & | Get (ClientContext &context) |
| Static Helper Functions. | |
| static DUCKDB_API SecretManager & | Get (DatabaseInstance &db) |
Static Public Attributes | |
| static constexpr const char * | TEMPORARY_STORAGE_NAME = "memory" |
| The default storage backends. | |
| static constexpr const char * | LOCAL_FILE_STORAGE_NAME = "local_file" |
Private Member Functions | |
| void | RegisterSecretTypeInternal (SecretType &type) |
| Register a secret type. | |
| SecretType | LookupTypeInternal (const string &type) |
| Lookup a SecretType, throws if not found. | |
| bool | TryLookupTypeInternal (const string &type, SecretType &type_out) |
| Try to lookup a SecretType. | |
| void | RegisterSecretFunctionInternal (CreateSecretFunction function, OnCreateConflict on_conflict) |
| Register a secret provider. | |
| optional_ptr< CreateSecretFunction > | LookupFunctionInternal (const string &type, const string &provider) |
| Lookup a CreateSecretFunction. | |
| unique_ptr< SecretEntry > | RegisterSecretInternal (CatalogTransaction transaction, unique_ptr< const BaseSecret > secret, OnCreateConflict on_conflict, SecretPersistType persist_type, const string &storage="") |
| Register a new Secret. | |
| void | InitializeSecrets (CatalogTransaction transaction) |
| Initialize the secret catalog_set and persistent secrets (lazily). | |
| void | LoadSecretStorageInternal (unique_ptr< SecretStorage > storage) |
| Load a secret storage. | |
| void | AutoloadExtensionForType (const string &type) |
| Autoload extension for specific secret type. | |
| void | AutoloadExtensionForFunction (const string &type, const string &provider) |
| Autoload extension for specific secret function. | |
| void | ThrowTypeNotFoundError (const string &type, const string &secret_path="") |
| Will throw appropriate error message when type not found. | |
| void | ThrowProviderNotFoundError (const string &type, const string &provider, bool was_default=false) |
| vector< reference< SecretStorage > > | GetSecretStorages () |
| Thread-safe accessors for secret_storages. | |
| optional_ptr< SecretStorage > | GetSecretStorage (const string &name) |
| void | ThrowOnSettingChangeIfInitialized () |
| Throw an exception if the secret manager is initialized. | |
Private Attributes | |
| mutex | manager_lock |
| Lock for types, functions, settings and storages. | |
| case_insensitive_map_t< CreateSecretFunctionSet > | secret_functions |
| Secret functions;. | |
| case_insensitive_map_t< SecretType > | secret_types |
| Secret types;. | |
| case_insensitive_map_t< unique_ptr< SecretStorage > > | secret_storages |
| Map of all registered SecretStorages. | |
| atomic< bool > | initialized {false} |
| While false, secret manager settings can still be changed. | |
| SecretManagerConfig | config |
| Configuration for secret manager. | |
| optional_ptr< DatabaseInstance > | db |
| Pointer to current db instance. | |
Friends | |
| struct | SecretEntry |
The Secret Manager for DuckDB. Can handle both temporary and persistent secrets.
|
static |
Static Helper Functions.
|
static |
| void duckdb::SecretManager::Initialize | ( | DatabaseInstance & | db | ) |
| void duckdb::SecretManager::LoadSecretStorage | ( | unique_ptr< SecretStorage > | storage | ) |
Load a secret storage.

| unique_ptr< BaseSecret > duckdb::SecretManager::DeserializeSecret | ( | Deserializer & | deserializer, |
| const string & | secret_path = "" ) |
Deserialize a secret by automatically selecting the correct deserializer, secret_path can be set to improve error hints

| void duckdb::SecretManager::RegisterSecretType | ( | SecretType & | type | ) |
Register a new SecretType.

| SecretType duckdb::SecretManager::LookupType | ( | const string & | type | ) |
Lookup a SecretType.

| void duckdb::SecretManager::RegisterSecretFunction | ( | CreateSecretFunction | function, |
| OnCreateConflict | on_conflict ) |
Register a Secret Function i.e. a secret provider for a secret type.

| unique_ptr< SecretEntry > duckdb::SecretManager::RegisterSecret | ( | CatalogTransaction | transaction, |
| unique_ptr< const BaseSecret > | secret, | ||
| OnCreateConflict | on_conflict, | ||
| SecretPersistType | persist_type, | ||
| const string & | storage = "" ) |
Register a secret by providing a secret manually.

| unique_ptr< SecretEntry > duckdb::SecretManager::CreateSecret | ( | ClientContext & | context, |
| const CreateSecretInput & | info ) |
Create a secret from a CreateSecretInfo.

| BoundStatement duckdb::SecretManager::BindCreateSecret | ( | CatalogTransaction | transaction, |
| CreateSecretInput & | info ) |
The Bind for create secret is done by the secret manager.

| SecretMatch duckdb::SecretManager::LookupSecret | ( | CatalogTransaction | transaction, |
| const string & | path, | ||
| const string & | type ) |
Lookup the best matching secret by matching the secret scopes to the path.

| unique_ptr< SecretEntry > duckdb::SecretManager::GetSecretByName | ( | CatalogTransaction | transaction, |
| const string & | name, | ||
| const string & | storage = "" ) |
Get a secret by name, optionally from a specific storage.

| void duckdb::SecretManager::DropSecretByName | ( | CatalogTransaction | transaction, |
| const string & | name, | ||
| OnEntryNotFound | on_entry_not_found, | ||
| SecretPersistType | persist_type = SecretPersistType::DEFAULT, | ||
| const string & | storage = "" ) |
Delete a secret by name, optionally by providing the storage to drop from.


| vector< SecretEntry > duckdb::SecretManager::AllSecrets | ( | CatalogTransaction | transaction | ) |
List all secrets from all secret storages.

| vector< SecretType > duckdb::SecretManager::AllSecretTypes | ( | ) |
List all secret types.
|
virtual |
Secret Manager settings.

|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| void duckdb::SecretManager::DropSecretByName | ( | ClientContext & | context, |
| const string & | name, | ||
| OnEntryNotFound | on_entry_not_found, | ||
| SecretPersistType | persist_type = SecretPersistType::DEFAULT, | ||
| const string & | storage = "" ) |
Utility functions.

|
private |
Register a secret type.

|
private |
Lookup a SecretType, throws if not found.


|
private |
Try to lookup a SecretType.


|
private |
Register a secret provider.

|
private |
Lookup a CreateSecretFunction.


|
private |
Register a new Secret.
Ensure we only create secrets for known types;
Handle default for persist type
Resolve storage
Lookup which backend to store the secret in


|
private |
Initialize the secret catalog_set and persistent secrets (lazily).


|
private |
Load a secret storage.

|
private |
Autoload extension for specific secret type.


|
private |
Autoload extension for specific secret function.


|
private |
Will throw appropriate error message when type not found.


|
private |
|
private |
Thread-safe accessors for secret_storages.

|
private |
|
private |
Throw an exception if the secret manager is initialized.

|
private |
While false, secret manager settings can still be changed.