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.
Loading...
Searching...
No Matches
duckdb::SecretStorage Class Referenceabstract

Base class for SecretStorage API. More...

Inheritance diagram for duckdb::SecretStorage:

Public Member Functions

 SecretStorage (const string &name, const int64_t tie_break_offset)
virtual string & GetName ()
 SecretStorage API.
virtual unique_ptr< SecretEntry > StoreSecret (unique_ptr< const BaseSecret > secret, OnCreateConflict on_conflict, optional_ptr< CatalogTransaction > transaction=nullptr)=0
 Store a secret.
virtual vector< SecretEntry > AllSecrets (optional_ptr< CatalogTransaction > transaction=nullptr)=0
 Get all secrets.
virtual void DropSecretByName (const string &name, OnEntryNotFound on_entry_not_found, optional_ptr< CatalogTransaction > transaction=nullptr)=0
 Drop secret by name.
virtual SecretMatch LookupSecret (const string &path, const string &type, optional_ptr< CatalogTransaction > transaction=nullptr)=0
 Get best match.
virtual unique_ptr< SecretEntry > GetSecretByName (const string &name, optional_ptr< CatalogTransaction > transaction=nullptr)=0
 Get a secret by name.
virtual bool IncludeInLookups ()
 Returns include_in_lookups, used to create secret storage.
virtual bool Persistent () const

Static Public Attributes

static const int64_t TEMPORARY_STORAGE_OFFSET = 10
 Default storage backend offsets.
static const int64_t LOCAL_FILE_STORAGE_OFFSET = 20

Static Protected Member Functions

static SecretMatch SelectBestMatch (SecretEntry &secret_entry, const string &path, int64_t offset, SecretMatch &current_best)

Protected Attributes

string storage_name
 Name of the storage backend (e.g. temporary, file, etc).
const int64_t tie_break_offset
 Offset associated to this storage for tie-breaking secrets between storages.
bool persistent
 Whether entries in this storage will survive duckdb reboots.

Friends

class SecretManager

Detailed Description

Base class for SecretStorage API.

Constructor & Destructor Documentation

◆ SecretStorage()

duckdb::SecretStorage::SecretStorage ( const string & name,
const int64_t tie_break_offset )
inlineexplicit
const int64_t tie_break_offset
Offset associated to this storage for tie-breaking secrets between storages.
Definition duckdb.cpp:177710
string storage_name
Name of the storage backend (e.g. temporary, file, etc).
Definition duckdb.cpp:177708
bool persistent
Whether entries in this storage will survive duckdb reboots.
Definition duckdb.cpp:177712

Member Function Documentation

◆ GetName()

virtual string & duckdb::SecretStorage::GetName ( )
inlinevirtual

SecretStorage API.

Get the storage name (e.g. local_file, :memory:)

Reimplemented in duckdb::CatalogSetSecretStorage.

177673 {
177674 return storage_name;
177675 };

◆ StoreSecret()

virtual unique_ptr< SecretEntry > duckdb::SecretStorage::StoreSecret ( unique_ptr< const BaseSecret > secret,
OnCreateConflict on_conflict,
optional_ptr< CatalogTransaction > transaction = nullptr )
pure virtual

Store a secret.

Implemented in duckdb::CatalogSetSecretStorage.

◆ AllSecrets()

virtual vector< SecretEntry > duckdb::SecretStorage::AllSecrets ( optional_ptr< CatalogTransaction > transaction = nullptr)
pure virtual

Get all secrets.

Implemented in duckdb::CatalogSetSecretStorage.

◆ DropSecretByName()

virtual void duckdb::SecretStorage::DropSecretByName ( const string & name,
OnEntryNotFound on_entry_not_found,
optional_ptr< CatalogTransaction > transaction = nullptr )
pure virtual

Drop secret by name.

Implemented in duckdb::CatalogSetSecretStorage.

◆ LookupSecret()

virtual SecretMatch duckdb::SecretStorage::LookupSecret ( const string & path,
const string & type,
optional_ptr< CatalogTransaction > transaction = nullptr )
pure virtual

Get best match.

Implemented in duckdb::CatalogSetSecretStorage.

◆ GetSecretByName()

virtual unique_ptr< SecretEntry > duckdb::SecretStorage::GetSecretByName ( const string & name,
optional_ptr< CatalogTransaction > transaction = nullptr )
pure virtual

Get a secret by name.

Implemented in duckdb::CatalogSetSecretStorage.

◆ IncludeInLookups()

virtual bool duckdb::SecretStorage::IncludeInLookups ( )
inlinevirtual

Returns include_in_lookups, used to create secret storage.

177693 {
177694 return true;
177695 }

◆ Persistent()

virtual bool duckdb::SecretStorage::Persistent ( ) const
inlinevirtual
177697 {
177698 return persistent;
177699 }

◆ SelectBestMatch()

SecretMatch duckdb::SecretStorage::SelectBestMatch ( SecretEntry & secret_entry,
const string & path,
int64_t offset,
SecretMatch & current_best )
staticprotected

Helper function to select the best matching secret within a storage. Tie-breaks within a storage are broken by secret name by default.

300903 {
300904 // Get secret match score
300905 auto match_score = secret_entry.secret->MatchScore(path);
300906
300907 // On no match
300908 if (match_score == NumericLimits<int64_t>::Minimum()) {
300909 return current_best;
300910 }
300911
300912 // The number of characters that match, where 0 means matching the catchall of "*"
300913 D_ASSERT(match_score >= 0);
300914
300915 // Apply storage tie-break offset
300916 match_score = 100 * match_score - offset;
300917
300918 // Choose the best matching score, tie-breaking on secret name when necessary
300919 if (match_score > current_best.score) {
300920 return SecretMatch(secret_entry, match_score);
300921 } else if (match_score == current_best.score &&
300922 secret_entry.secret->GetName() < current_best.GetSecret().GetName()) {
300923 return SecretMatch(secret_entry, match_score);
300924 } else {
300925 return current_best;
300926 }
300927}
Here is the call graph for this function:
Here is the caller graph for this function:

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