OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UserMapping.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 OmniSci, Inc.
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  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <map>
20 #include <string>
21 
22 class ForeignServer;
23 
24 namespace foreign_storage {
26  static constexpr char const* USER = "USER";
27  static constexpr char const* PUBLIC = "PUBLIC";
28 };
29 
30 struct UserMapping {
31  int32_t id;
32  int32_t user_id;
34  std::string type;
35  std::string options;
36 
38 
39  UserMapping(const int32_t id,
40  const int32_t user_id,
41  const int32_t foreign_server_id,
42  const std::string type,
43  const std::string options)
44  : id(id)
45  , user_id(user_id)
46  , foreign_server_id(foreign_server_id)
47  , type(type)
48  , options(options) {}
49 
50  std::map<std::string, std::string, std::less<>> getUnencryptedOptions() const {
51  return {};
52  }
53 
54  void validate(const ForeignServer* foreign_server) {}
55 };
56 } // namespace foreign_storage
static constexpr char const * PUBLIC
Definition: UserMapping.h:27
void validate(const ForeignServer *foreign_server)
Definition: UserMapping.h:54
UserMapping(const int32_t id, const int32_t user_id, const int32_t foreign_server_id, const std::string type, const std::string options)
Definition: UserMapping.h:39
std::map< std::string, std::string, std::less<> > getUnencryptedOptions() const
Definition: UserMapping.h:50
static constexpr char const * USER
Definition: UserMapping.h:26