30 [[nodiscard]]
static std::optional<Secret>
FromEnv(
const char* name);
39 [[nodiscard]]
const std::string&
reveal()
const {
return value_; }
41 [[nodiscard]]
bool empty()
const {
return value_.empty(); }
42 [[nodiscard]] std::size_t
size()
const {
return value_.size(); }
Holds a credential, such as an LLM provider's API key.
Definition secret.hpp:20
bool empty() const
Definition secret.hpp:41
Secret(const Secret &other)
Secret & operator=(Secret &&other) noexcept
Secret(std::string value)
std::string redacted() const
A description safe to print, for example <secret, 108 characters>.
static std::optional< Secret > FromEnv(const char *name)
Reads the environment variable name.
Secret & operator=(const Secret &other)
const std::string & reveal() const
The value, to put in a request header. Never log it.
Definition secret.hpp:39
Secret()=default
An empty secret.
std::size_t size() const
Definition secret.hpp:42
Secret(Secret &&other) noexcept