proxygen
TokenBindingContext.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
12 
13 namespace fizz {
14 namespace extensions {
15 
17  public:
18  ~TokenBindingContext() = default;
19 
24  void setSupportedVersions(std::vector<TokenBindingProtocolVersion> versions) {
25  if (!std::is_sorted(
26  versions.begin(),
27  versions.end(),
28  std::greater_equal<TokenBindingProtocolVersion>())) {
29  throw std::runtime_error("Protocol Versions are not in descending order");
30  }
31  supportedVersions_ = std::move(versions);
32  }
33  const auto& getSupportedVersions() const {
34  return supportedVersions_;
35  }
36 
41  std::vector<TokenBindingKeyParameters> keyParams) {
42  supportedKeyParams_ = std::move(keyParams);
43  }
44  const auto& getKeyParams() const {
45  return supportedKeyParams_;
46  }
47 
48  private:
49  std::vector<TokenBindingProtocolVersion> supportedVersions_ = {
51 
52  std::vector<TokenBindingKeyParameters> supportedKeyParams_ = {
54 };
55 } // namespace extensions
56 } // namespace fizz
void setSupportedKeyParameters(std::vector< TokenBindingKeyParameters > keyParams)
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void setSupportedVersions(std::vector< TokenBindingProtocolVersion > versions)
Definition: Actions.h:16
std::vector< TokenBindingProtocolVersion > supportedVersions_
std::vector< TokenBindingKeyParameters > supportedKeyParams_