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::KeyValueSecret Class Reference

#include <duckdb.hpp>

Inheritance diagram for duckdb::KeyValueSecret:
Collaboration diagram for duckdb::KeyValueSecret:

Public Member Functions

 KeyValueSecret (const vector< string > &prefix_paths, const string &type, const string &provider, const string &name)
 
 KeyValueSecret (const BaseSecret &secret)
 
 KeyValueSecret (const KeyValueSecret &secret)
 
 KeyValueSecret (KeyValueSecret &&secret) noexcept
 
string ToString (SecretDisplayType mode=SecretDisplayType::REDACTED) const override
 Print the secret as a key value map in the format 'key1=value;key2=value2'.
 
void Serialize (Serializer &serializer) const override
 Serialize this secret.
 
Value TryGetValue (const string &key, bool error_on_missing=false) const
 Tries to get the value at key <key>, depending on error_on_missing will throw or return Value()
 
unique_ptr< const BaseSecretClone () const override
 
bool TryGetValue (const string &key, Value &result) const
 
bool TrySetValue (const string &key, const CreateSecretInput &input)
 
- Public Member Functions inherited from duckdb::BaseSecret
 BaseSecret (vector< string > prefix_paths_p, string type_p, string provider_p, string name_p)
 
 BaseSecret (const BaseSecret &other)
 
virtual int64_t MatchScore (const string &path) const
 
const vector< string > & GetScope () const
 Getters.
 
const string & GetType () const
 
const string & GetProvider () const
 
const string & GetName () const
 
bool IsSerializable () const
 

Static Public Member Functions

template<class TYPE >
static unique_ptr< BaseSecretDeserialize (Deserializer &deserializer, BaseSecret base_secret)
 

Public Attributes

case_insensitive_tree_t< Valuesecret_map
 the map of key -> values that make up the secret
 
case_insensitive_set_t redact_keys
 keys that are sensitive and should be redacted
 

Additional Inherited Members

- Protected Member Functions inherited from duckdb::BaseSecret
virtual void SerializeBaseSecret (Serializer &serializer) const final
 Helper function to serialize the base BaseSecret class variables.
 
- Protected Attributes inherited from duckdb::BaseSecret
vector< string > prefix_paths
 prefixes to which the secret applies
 
string type
 Type of secret.
 
string provider
 Provider of the secret.
 
string name
 Name of the secret.
 
bool serializable
 Whether the secret can be serialized/deserialized.
 

Detailed Description

The KeyValueSecret is a class that implements a Secret as a set of key -> values. This class can be used for most use-cases of secrets as secrets generally tend to fit in a key value map.

Constructor & Destructor Documentation

◆ KeyValueSecret() [1/4]

duckdb::KeyValueSecret::KeyValueSecret ( const vector< string > &  prefix_paths,
const string &  type,
const string &  provider,
const string &  name 
)
inline
53277 : BaseSecret(prefix_paths, type, provider, name) {
53278 D_ASSERT(!type.empty());
53279 serializable = true;
53280 }
string type
Type of secret.
Definition duckdb.hpp:53263
string provider
Provider of the secret.
Definition duckdb.hpp:53265
vector< string > prefix_paths
prefixes to which the secret applies
Definition duckdb.hpp:53260
string name
Name of the secret.
Definition duckdb.hpp:53267
bool serializable
Whether the secret can be serialized/deserialized.
Definition duckdb.hpp:53269

◆ KeyValueSecret() [2/4]

duckdb::KeyValueSecret::KeyValueSecret ( const BaseSecret secret)
inlineexplicit
53282 : BaseSecret(secret.GetScope(), secret.GetType(), secret.GetProvider(), secret.GetName()) {
53283 serializable = true;
53284 };

◆ KeyValueSecret() [3/4]

duckdb::KeyValueSecret::KeyValueSecret ( const KeyValueSecret secret)
inline
53286 : BaseSecret(secret.GetScope(), secret.GetType(), secret.GetProvider(), secret.GetName()) {
53287 secret_map = secret.secret_map;
53288 redact_keys = secret.redact_keys;
53289 serializable = true;
53290 };
case_insensitive_tree_t< Value > secret_map
the map of key -> values that make up the secret
Definition duckdb.hpp:53351
case_insensitive_set_t redact_keys
keys that are sensitive and should be redacted
Definition duckdb.hpp:53353

◆ KeyValueSecret() [4/4]

duckdb::KeyValueSecret::KeyValueSecret ( KeyValueSecret &&  secret)
inlinenoexcept
53292 : BaseSecret(std::move(secret.prefix_paths), std::move(secret.type), std::move(secret.provider),
53293 std::move(secret.name)) {
53294 secret_map = std::move(secret.secret_map);
53295 redact_keys = std::move(secret.redact_keys);
53296 serializable = true;
53297 };

Member Function Documentation

◆ ToString()

string duckdb::KeyValueSecret::ToString ( SecretDisplayType  mode = SecretDisplayType::REDACTED) const
overridevirtual

Print the secret as a key value map in the format 'key1=value;key2=value2'.

Reimplemented from duckdb::BaseSecret.

◆ Serialize()

void duckdb::KeyValueSecret::Serialize ( Serializer serializer) const
overridevirtual

Serialize this secret.

Reimplemented from duckdb::BaseSecret.

◆ Deserialize()

template<class TYPE >
static unique_ptr< BaseSecret > duckdb::KeyValueSecret::Deserialize ( Deserializer deserializer,
BaseSecret  base_secret 
)
inlinestatic
53308 {
53309 auto result = make_uniq<TYPE>(base_secret);
53310 Value secret_map_value;
53311 deserializer.ReadProperty(201, "secret_map", secret_map_value);
53312
53313 for (const auto &entry : ListValue::GetChildren(secret_map_value)) {
53314 auto kv_struct = StructValue::GetChildren(entry);
53315 result->secret_map[kv_struct[0].ToString()] = kv_struct[1];
53316 }
53317
53318 Value redact_set_value;
53319 deserializer.ReadProperty(202, "redact_keys", redact_set_value);
53320 for (const auto &entry : ListValue::GetChildren(redact_set_value)) {
53321 result->redact_keys.insert(entry.ToString());
53322 }
53323
53324 return duckdb::unique_ptr_cast<TYPE, BaseSecret>(std::move(result));
53325 }
Definition duckdb.hpp:960

◆ Clone()

unique_ptr< const BaseSecret > duckdb::KeyValueSecret::Clone ( ) const
inlineoverridevirtual

Reimplemented from duckdb::BaseSecret.

53327 {
53328 return make_uniq<KeyValueSecret>(*this);
53329 }

◆ TryGetValue()

bool duckdb::KeyValueSecret::TryGetValue ( const string &  key,
Value result 
) const
inline
53332 {
53333 auto lookup = secret_map.find(key);
53334 if (lookup == secret_map.end()) {
53335 return false;
53336 }
53337 result = lookup->second;
53338 return true;
53339 }

◆ TrySetValue()

bool duckdb::KeyValueSecret::TrySetValue ( const string &  key,
const CreateSecretInput input 
)
inline
53341 {
53342 auto lookup = input.options.find(key);
53343 if (lookup != input.options.end()) {
53344 secret_map[key] = lookup->second;
53345 return true;
53346 }
53347 return false;
53348 }

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