29 explicit Sensitive(T value) : value_(std::move(value)) {}
37 std::
string to_string()
const {
return "[SENSITIVE]"; }
40 bool empty()
const {
return is_empty(value_); }
43 static bool is_empty(
const std::string& v) {
return v.empty(); }
45 static bool is_empty(
const U&) {
return false; }
Wraps secret material (access tokens, mTLS private keys).
Definition sensitive.hpp:26
std::string to_string() const
Redacted textual form. Never emits the wrapped value.
Definition sensitive.hpp:37
Sensitive(const Sensitive &)=default
bool empty() const
True when no secret is held (default-constructed / empty string).
Definition sensitive.hpp:40
Sensitive(T value)
Definition sensitive.hpp:29
Sensitive(Sensitive &&) noexcept=default
friend const T & detail::reveal(const Sensitive< T > &s) noexcept
const T & reveal(const Sensitive< T > &s) noexcept
Definition sensitive.hpp:59
Definition authenticator.hpp:40
std::ostream & operator<<(std::ostream &os, const Sensitive< T > &s)
Definition sensitive.hpp:53