AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
UrlAllowListWrapper.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDKASSETMANAGER_URLALLOWLISTWRAPPER_H_
17 #define ACSDKASSETMANAGER_URLALLOWLISTWRAPPER_H_
18 #include <memory>
19 #include <mutex>
20 #include <vector>
21 
22 namespace alexaClientSDK {
23 namespace acsdkAssets {
24 namespace manager {
25 
27 public:
34  static std::shared_ptr<UrlAllowListWrapper> create(
35  std::vector<std::string> newAllowList,
36  bool allowAllUrls = false);
37 
43  bool isUrlAllowed(const std::string& url);
44 
49  void setUrlAllowList(std::vector<std::string> newAllowList);
50 
56 
62  bool allowAllUrls(bool allow);
63 
64  ~UrlAllowListWrapper() = default;
65 
66 private:
67  UrlAllowListWrapper(std::vector<std::string> newAllowList, bool allowAllUrls) :
68  m_allowList(std::move(newAllowList)),
69  m_allowAllUrls(allowAllUrls) {
70  }
71 
73  std::vector<std::string> m_allowList;
75  std::mutex m_allowListMutex;
77  bool m_allowAllUrls;
78 };
79 
80 } // namespace manager
81 } // namespace acsdkAssets
82 } // namespace alexaClientSDK
83 
84 #endif // ACSDKASSETMANAGER_URLALLOWLISTWRAPPER_H_
::std::string string
Definition: gtest-port.h:1097
void setUrlAllowList(std::vector< std::string > newAllowList)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
const T & move(const T &t)
Definition: gtest-port.h:1317
static std::shared_ptr< UrlAllowListWrapper > create(std::vector< std::string > newAllowList, bool allowAllUrls=false)

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0