bes  Updated for version 3.20.6
WhiteList.h
1 // RemoteAccess.h
2 
3 // -*- mode: c++; c-basic-offset:4 -*-
4 
5 // This file is part of the OPeNDAP Back-End Server (BES)
6 // and embodies a whitelist of remote system that may be
7 // accessed by the server as part of it's routine operation.
8 
9 // Copyright (c) 2018 OPeNDAP, Inc.
10 // Author: Nathan D. Potter <ndp@opendap.org>
11 //
12 // This library is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU Lesser General Public
14 // License as published by the Free Software Foundation; either
15 // version 2.1 of the License, or (at your option) any later version.
16 //
17 // This library is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // Lesser General Public License for more details.
21 //
22 // You should have received a copy of the GNU Lesser General Public
23 // License along with this library; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 //
26 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
27 
28 // Authors:
29 // ndp Nathan D. Potter <ndp@opendap.org>
30 
31 #ifndef I_RemoteAccess_H
32 #define I_RemoteAccess_H 1
33 
34 #include <string>
35 #include <vector>
36 
37 #define REMOTE_ACCESS_WHITELIST "Gateway.Whitelist"
38 
39 namespace bes {
40 
51 class WhiteList {
52 private:
53  static WhiteList *d_instance;
54 
55  std::vector<std::string> d_white_list;
56 
57 protected:
58  WhiteList();
59 
60 public:
61  virtual ~WhiteList() {}
62 
63  static WhiteList *get_white_list();
64 
65  bool is_white_listed(const std::string &url);
66 };
67 
68 } // namespace bes
69 
70 #endif // I_RemoteAccess_H
71 
bes::WhiteList
Can a given URL be dereferenced given the BES's configuration?
Definition: WhiteList.h:51
bes::WhiteList::is_white_listed
bool is_white_listed(const std::string &url)
Definition: WhiteList.cc:87
bes::WhiteList::get_white_list
static WhiteList * get_white_list()
Static accessor for the singleton.
Definition: WhiteList.cc:55