1
#pragma once
2

            
3
#include "source/common/singleton/const_singleton.h"
4
#include "source/extensions/common/aws/signer_base_impl.h"
5

            
6
using AwsSigningHeaderMatcherVector = std::vector<envoy::type::matcher::v3::StringMatcher>;
7

            
8
namespace Envoy {
9
namespace Extensions {
10
namespace Common {
11
namespace Aws {
12

            
13
class SigV4ASignatureHeaderValues : public SignatureHeaderValues {
14
public:
15
  const Http::LowerCaseString RegionSet{"x-amz-region-set"};
16
};
17

            
18
using SigV4ASignatureHeaders = ConstSingleton<SigV4ASignatureHeaderValues>;
19

            
20
class SigV4ASignatureConstants : public SignatureConstants {
21
public:
22
  static constexpr absl::string_view SigV4AAuthorizationHeaderFormat =
23
      "AWS4-ECDSA-P256-SHA256 Credential={}, SignedHeaders={}, Signature={}";
24
  static constexpr absl::string_view SigV4ACredentialScopeFormat = "{}/{}/aws4_request";
25
  static constexpr absl::string_view SigV4ASignatureVersion = "AWS4A";
26
  static constexpr absl::string_view SigV4AStringToSignFormat = "{}\n{}\n{}\n{}";
27
  static constexpr absl::string_view SigV4AAlgorithm = "AWS4-ECDSA-P256-SHA256";
28
};
29

            
30
enum SigV4AKeyDerivationResult {
31
  AkdrSuccess,
32
  AkdrNextCounter,
33
  AkdrFailure,
34
};
35

            
36
} // namespace Aws
37
} // namespace Common
38
} // namespace Extensions
39
} // namespace Envoy