CMS 3D CMS Logo

Auth.h
Go to the documentation of this file.
1 #ifndef CondCore_CondDB_Auth_h
2 #define CondCore_CondDB_Auth_h
3 
4 #include <string>
5 #include <set>
6 
7 namespace cond {
8 
9  namespace auth {
10 
11  static constexpr const char* const COND_AUTH_PATH = "COND_AUTH_PATH";
12  static constexpr const char* const COND_AUTH_SYS = "COND_AUTH_SYS";
13 
14  static constexpr const char* const COND_ADMIN_GROUP = "COND_ADMIN_GROUP";
15 
16  static constexpr const char* const COND_DEFAULT_ROLE = "COND_DEFAULT_ROLE";
17  static constexpr const char* const COND_WRITER_ROLE = "COND_WRITER_ROLE";
18  static constexpr const char* const COND_READER_ROLE = "COND_READER_ROLE";
19  static constexpr const char* const COND_ADMIN_ROLE = "COND_ADMIN_ROLE";
20 
21  static const std::set<std::string> ROLES = {std::string(COND_DEFAULT_ROLE),
25 
26  typedef enum { DEFAULT_ROLE = 0, READER_ROLE = 1, WRITER_ROLE = 2, ADMIN_ROLE = 3 } RoleCode;
27 
28  static const std::pair<const char*, RoleCode> s_roleCodeArray[] = {std::make_pair(COND_DEFAULT_ROLE, DEFAULT_ROLE),
29  std::make_pair(COND_READER_ROLE, READER_ROLE),
30  std::make_pair(COND_WRITER_ROLE, WRITER_ROLE),
31  std::make_pair(COND_ADMIN_ROLE, ADMIN_ROLE)};
32 
33  static constexpr const char* const COND_DEFAULT_PRINCIPAL = "COND_DEFAULT_PRINCIPAL";
34 
35  static constexpr const char* const COND_KEY = "Memento";
36 
37  static constexpr unsigned int COND_AUTHENTICATION_KEY_SIZE = 30;
38  static constexpr unsigned int COND_DB_KEY_SIZE = 30;
39 
40  static constexpr size_t COND_SESSION_HASH_SIZE = 16;
41 
44 
49 
50  static constexpr const char* const COND_AUTH_PATH_PROPERTY = "AuthenticationFile";
51  } // namespace auth
52 
53 } // namespace cond
54 #endif
static constexpr int COND_DBTAG_WRITE_ACCESS_CODE
Definition: Auth.h:46
static constexpr const char *const COND_AUTH_PATH
Definition: Auth.h:11
static constexpr const char *const COND_AUTH_PATH_PROPERTY
Definition: Auth.h:50
static constexpr size_t COND_SESSION_HASH_SIZE
Definition: Auth.h:40
static constexpr int COND_DBTAG_READ_ACCESS_CODE
Definition: Auth.h:47
static constexpr const char *const COND_READER_ROLE
Definition: Auth.h:18
static const std::set< std::string > ROLES
Definition: Auth.h:21
static constexpr const char *const COND_ADMIN_ROLE
Definition: Auth.h:19
static constexpr unsigned int COND_DB_KEY_SIZE
Definition: Auth.h:38
static constexpr unsigned int COND_AUTHENTICATION_KEY_SIZE
Definition: Auth.h:37
static constexpr int COND_DBTAG_NO_PROTECTION_CODE
Definition: Auth.h:48
static constexpr int COND_DBTAG_LOCK_ACCESS_CODE
Definition: Auth.h:45
static constexpr int COND_DBKEY_CREDENTIAL_CODE
Definition: Auth.h:43
static constexpr const char *const COND_ADMIN_GROUP
Definition: Auth.h:14
static constexpr const char *const COND_AUTH_SYS
Definition: Auth.h:12
RoleCode
Definition: Auth.h:26
static const std::pair< const char *, RoleCode > s_roleCodeArray[]
Definition: Auth.h:28
static constexpr const char *const COND_DEFAULT_PRINCIPAL
Definition: Auth.h:33
static constexpr const char *const COND_WRITER_ROLE
Definition: Auth.h:17
static constexpr int COND_SESSION_HASH_CODE
Definition: Auth.h:42
static constexpr const char *const COND_KEY
Definition: Auth.h:35
static constexpr const char *const COND_DEFAULT_ROLE
Definition: Auth.h:16