1
#pragma once
2

            
3
#include "envoy/http/header_map.h"
4

            
5
namespace Envoy {
6
namespace Extensions {
7
namespace Http {
8
namespace InjectedCredentials {
9
namespace Common {
10

            
11
/**
12
 * Credential injector injects credential to HTTP headers.
13
 */
14
class CredentialInjector {
15
public:
16
80
  virtual ~CredentialInjector() = default;
17

            
18
  /**
19
   * Inject credential to HTTP headers.
20
   * @param headers supplies the reference to HTTP headers. The credential will be injected into the
21
   * headers.
22
   * @param overwrite whether to overwrite the existing credential in the headers.
23
   * @return Status whether the injection is successful.
24
   */
25
  virtual absl::Status inject(Envoy::Http::RequestHeaderMap& headers, bool overwrite) PURE;
26
};
27

            
28
using CredentialInjectorSharedPtr = std::shared_ptr<CredentialInjector>;
29

            
30
} // namespace Common
31
} // namespace InjectedCredentials
32
} // namespace Http
33
} // namespace Extensions
34
} // namespace Envoy