1
#pragma once
2

            
3
#include "envoy/extensions/formatter/generic_secret/v3/generic_secret.pb.h"
4
#include "envoy/formatter/substitution_formatter_base.h"
5
#include "envoy/secret/secret_manager.h"
6
#include "envoy/server/factory_context.h"
7

            
8
#include "source/common/common/logger.h"
9

            
10
namespace Envoy {
11
namespace Extensions {
12
namespace Formatter {
13

            
14
/**
15
 * CommandParserFactory for the %SECRET% formatter.
16
 *
17
 * This formatter resolves the value of a generic secret (from SDS or static bootstrap config)
18
 * and makes it available as a substitution format command.
19
 */
20
class GenericSecretFormatterFactory : public Envoy::Formatter::CommandParserFactory {
21
public:
22
  Envoy::Formatter::CommandParserPtr
23
  createCommandParserFromProto(const Protobuf::Message& config,
24
                               Server::Configuration::GenericFactoryContext& context) override;
25
  ProtobufTypes::MessagePtr createEmptyConfigProto() override;
26
  std::string name() const override;
27
};
28

            
29
} // namespace Formatter
30
} // namespace Extensions
31
} // namespace Envoy