23 using namespace folly;
27 constexpr std::chrono::milliseconds kCredentialPollInterval =
28 std::chrono::duration_cast<std::chrono::milliseconds>(
29 std::chrono::seconds(10));
32 std::vector<std::string>& seedList) {
36 for (
const auto&
seed : keyConfig) {
37 seedList.push_back(
seed.asString());
44 TLSCredProcessor::TLSCredProcessor()
58 poller_ = std::make_unique<FilePoller>(pollInterval);
69 std::function<
void()> callback) {
86 poller_->removeFileToTrack(path);
89 if (!certFiles_.empty()) {
91 for (
const auto& path: certFiles_) {
92 poller_->addFileToTrack(path, certChangedCob);
118 LOG(
WARNING) <<
"Failed to read " << fileName
119 <<
"; Ticket seeds are unavailable.";
123 if (conf.
type() != dynamic::Type::OBJECT) {
124 LOG(
WARNING) <<
"Error parsing " << fileName <<
" expected object";
128 if (conf.
count(
"old")) {
129 insertSeeds(conf[
"old"], seedData.
oldSeeds);
131 if (conf.
count(
"current")) {
134 if (conf.
count(
"new")) {
135 insertSeeds(conf[
"new"], seedData.
newSeeds);
138 }
catch (
const std::exception& ex) {
139 LOG(
WARNING) <<
"Parsing " << fileName <<
" failed: " << ex.what();
std::vector< std::string > newSeeds
void setTicketPathToWatch(const std::string &ticketFile)
void certFileUpdated() noexcept
std::vector< std::string > currentSeeds
bool readFile(int fd, Container &out, size_t num_bytes=std::numeric_limits< size_t >::max())
static folly::Optional< wangle::TLSTicketKeySeeds > processTLSTickets(const std::string &fileName)
dynamic parseJson(StringPiece range)
std::set< std::string > certFiles_
constexpr detail::Map< Move > move
IfIsNonStringDynamicConvertible< K, std::size_t > count(K &&) const
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
std::unique_ptr< FilePoller > poller_
void setPollInterval(std::chrono::milliseconds pollInterval)
std::vector< std::function< void()> > certCallbacks_
void addCertCallback(std::function< void()> callback)
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique(Args &&...args)
std::vector< std::function< void(wangle::TLSTicketKeySeeds)> > ticketCallbacks_
void setCertPathsToWatch(std::set< std::string > certFiles)
std::vector< std::string > oldSeeds
void ticketFileUpdated(const std::string &ticketFile) noexcept
void addTicketCallback(std::function< void(wangle::TLSTicketKeySeeds)> callback)