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

Base class from which BaseSecret classes can be made. More...

#include <duckdb.hpp>

Inheritance diagram for duckdb::BaseSecret:
Collaboration diagram for duckdb::BaseSecret:

Public Member Functions

 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
 The score of how well this secret's scope matches the path (by default: the length of the longest matching prefix).
virtual string ToString (SecretDisplayType mode=SecretDisplayType::REDACTED) const
 Prints the secret as a string.
virtual void Serialize (Serializer &serializer) const
 Serialize this secret.
virtual unique_ptr< const BaseSecret > Clone () const
const vector< string > & GetScope () const
 Getters.
const string & GetType () const
const string & GetProvider () const
const string & GetName () const
bool IsSerializable () const

Protected Member Functions

virtual void SerializeBaseSecret (Serializer &serializer) const final
 Helper function to serialize the base BaseSecret class variables.

Protected Attributes

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.

Friends

class SecretManager

Detailed Description

Base class from which BaseSecret classes can be made.

Constructor & Destructor Documentation

◆ BaseSecret() [1/2]

duckdb::BaseSecret::BaseSecret ( vector< string > prefix_paths_p,
string type_p,
string provider_p,
string name_p )
inline
53214 : prefix_paths(std::move(prefix_paths_p)), type(std::move(type_p)), provider(std::move(provider_p)),
53215 name(std::move(name_p)), serializable(false) {
53216 D_ASSERT(!type.empty());
53217 }
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

◆ BaseSecret() [2/2]

duckdb::BaseSecret::BaseSecret ( const BaseSecret & other)
inline
53219 : prefix_paths(other.prefix_paths), type(other.type), provider(other.provider), name(other.name),
53220 serializable(other.serializable) {
53221 D_ASSERT(!type.empty());
53222 }

Member Function Documentation

◆ MatchScore()

int64_t duckdb::BaseSecret::MatchScore ( const string & path) const
virtual

The score of how well this secret's scope matches the path (by default: the length of the longest matching prefix).

299867 {
299868 int64_t longest_match = NumericLimits<int64_t>::Minimum();
299869
299870 if (prefix_paths.empty()) {
299871 longest_match = 0;
299872 }
299873
299874 for (const auto &prefix : prefix_paths) {
299875 // Handle empty scope which matches all at lowest possible score
299876 if (prefix.empty()) {
299877 longest_match = 0;
299878 continue;
299879 }
299880 if (StringUtil::StartsWith(path, prefix)) {
299881 longest_match = MaxValue<int64_t>(NumericCast<int64_t>(prefix.length()), longest_match);
299882 }
299883 }
299884 return longest_match;
299885}
static DUCKDB_API bool StartsWith(string str, string prefix)
Returns true if the target string starts with the given prefix.
Definition duckdb.cpp:109377
::int64_t int64_t
Here is the call graph for this function:

◆ ToString()

string duckdb::BaseSecret::ToString ( SecretDisplayType mode = SecretDisplayType::REDACTED) const
virtual

Prints the secret as a string.

Reimplemented in duckdb::KeyValueSecret.

299895 {
299896 return "";
299897}

◆ Serialize()

void duckdb::BaseSecret::Serialize ( Serializer & serializer) const
virtual

Serialize this secret.

Reimplemented in duckdb::KeyValueSecret.

299899 {
299900 throw InternalException("Attempted to serialize secret without serialize");
299901}

◆ Clone()

virtual unique_ptr< const BaseSecret > duckdb::BaseSecret::Clone ( ) const
inlinevirtual
53233 {
53234 D_ASSERT(typeid(BaseSecret) == typeid(*this));
53235 return make_uniq<BaseSecret>(*this);
53236 }

◆ GetScope()

const vector< string > & duckdb::BaseSecret::GetScope ( ) const
inline

Getters.

53239 {
53240 return prefix_paths;
53241 }

◆ GetType()

const string & duckdb::BaseSecret::GetType ( ) const
inline
53242 {
53243 return type;
53244 }

◆ GetProvider()

const string & duckdb::BaseSecret::GetProvider ( ) const
inline
53245 {
53246 return provider;
53247 }

◆ GetName()

const string & duckdb::BaseSecret::GetName ( ) const
inline
53248 {
53249 return name;
53250 }

◆ IsSerializable()

bool duckdb::BaseSecret::IsSerializable ( ) const
inline
53251 {
53252 return serializable;
53253 }

◆ SerializeBaseSecret()

void duckdb::BaseSecret::SerializeBaseSecret ( Serializer & serializer) const
finalprotectedvirtual

Helper function to serialize the base BaseSecret class variables.

299887 {
299888 serializer.WriteProperty(100, "type", type);
299889 serializer.WriteProperty(101, "provider", provider);
299890 serializer.WriteProperty(102, "name", name);
299891 serializer.WriteList(103, "scope", prefix_paths.size(),
299892 [&](Serializer::List &list, idx_t i) { list.WriteElement(prefix_paths[i]); });
299893}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
Here is the caller graph for this function:

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