bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
NgapApi.h
1// -*- mode: c++; c-basic-offset:4 -*-
2
3// This file is part of ngap_module, A C++ module that can be loaded in to
4// the OPeNDAP Back-End Server (BES) and is able to handle remote requests.
5
6// Copyright (c) 2020 OPeNDAP, Inc.
7// Author: Nathan Potter <ndp@opendap.org>
8//
9// This library is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Lesser General Public
11// License as published by the Free Software Foundation; either
12// version 2.1 of the License, or (at your option) any later version.
13//
14// This library is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// Lesser General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22//
23// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24
25/*
26 * NgapApi.h
27 *
28 * Created on: July, 13 2018
29 * Author: ndp
30 */
31
32#ifndef MODULES_NGAP_MODULE_NGAPAPI_H_
33#define MODULES_NGAP_MODULE_NGAPAPI_H_
34
35#include <string>
36#include <vector>
37#include <map>
38
39#include "rapidjson/document.h"
40
41namespace http {
42class url;
43}
44
45namespace ngap {
46
47class NgapApi {
48private:
49 static std::string get_cmr_search_endpoint_url();
50 static std::string find_get_data_url_in_granules_umm_json_v1_4(const std::string &rest_path,
51 rapidjson::Document &cmr_granule_response);
52 static std::string build_cmr_query_url(const std::string &restified_path);
53 static std::string build_cmr_query_url_old_rpath_format(const std::string &restified_path);
54
55 friend class NgapApiTest;
56
57public:
58 NgapApi() = default;
59 ~NgapApi() = default;
60 NgapApi(const NgapApi &other) = delete;
61 NgapApi &operator=(const NgapApi &other) = delete;
62
63 static std::string convert_ngap_resty_path_to_data_access_url(const std::string &restified_path);
64
65 static bool signed_url_is_expired(const http::url &signed_url) ;
66};
67
68} // namespace ngap
69
70#endif /* MODULES_NGAP_MODULE_NGAPAPI_H_ */
Parse a URL into the protocol, host, path and query parts.
Definition url_impl.h:44
static bool signed_url_is_expired(const http::url &signed_url)
Has the signed S3 URL expired? If neither the CloudFront Expires header nor the AWS Expires header ar...
Definition NgapApi.cc:452
static std::string convert_ngap_resty_path_to_data_access_url(const std::string &restified_path)
Converts an NGAP restified granule path into a CMR metadata query for the granule.
Definition NgapApi.cc:414
utility class for the HTTP catalog module
Definition TheBESKeys.h:51