Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-15 02:44:50

0001 #ifndef CondCore_CondDB_Auth_h
0002 #define CondCore_CondDB_Auth_h
0003 
0004 #include <string>
0005 #include <set>
0006 
0007 namespace cond {
0008 
0009   namespace auth {
0010 
0011     static constexpr const char* const COND_AUTH_PATH = "COND_AUTH_PATH";
0012     static constexpr const char* const COND_AUTH_SYS = "COND_AUTH_SYS";
0013 
0014     static constexpr const char* const COND_ADMIN_GROUP = "COND_ADMIN_GROUP";
0015 
0016     static constexpr const char* const COND_DEFAULT_ROLE = "COND_DEFAULT_ROLE";
0017     static constexpr const char* const COND_WRITER_ROLE = "COND_WRITER_ROLE";
0018     static constexpr const char* const COND_READER_ROLE = "COND_READER_ROLE";
0019     static constexpr const char* const COND_ADMIN_ROLE = "COND_ADMIN_ROLE";
0020 
0021     static const std::set<std::string> ROLES = {std::string(COND_DEFAULT_ROLE),
0022                                                 std::string(COND_READER_ROLE),
0023                                                 std::string(COND_WRITER_ROLE),
0024                                                 std::string(COND_ADMIN_ROLE)};
0025 
0026     typedef enum { DEFAULT_ROLE = 0, READER_ROLE = 1, WRITER_ROLE = 2, ADMIN_ROLE = 3 } RoleCode;
0027 
0028     static const std::pair<const char*, RoleCode> s_roleCodeArray[] = {std::make_pair(COND_DEFAULT_ROLE, DEFAULT_ROLE),
0029                                                                        std::make_pair(COND_READER_ROLE, READER_ROLE),
0030                                                                        std::make_pair(COND_WRITER_ROLE, WRITER_ROLE),
0031                                                                        std::make_pair(COND_ADMIN_ROLE, ADMIN_ROLE)};
0032 
0033     static constexpr const char* const COND_DEFAULT_PRINCIPAL = "COND_DEFAULT_PRINCIPAL";
0034 
0035     static constexpr const char* const COND_KEY = "Memento";
0036 
0037     static constexpr unsigned int COND_AUTHENTICATION_KEY_SIZE = 30;
0038     static constexpr unsigned int COND_DB_KEY_SIZE = 30;
0039 
0040     static constexpr size_t COND_SESSION_HASH_SIZE = 16;
0041 
0042     static constexpr int COND_SESSION_HASH_CODE = 4;
0043     static constexpr int COND_DBKEY_CREDENTIAL_CODE = 1;
0044 
0045     static constexpr int COND_DBTAG_LOCK_ACCESS_CODE = 8;
0046     static constexpr int COND_DBTAG_WRITE_ACCESS_CODE = 2;
0047     static constexpr int COND_DBTAG_READ_ACCESS_CODE = 1;
0048     static constexpr int COND_DBTAG_NO_PROTECTION_CODE = 0;
0049 
0050     static constexpr const char* const COND_AUTH_PATH_PROPERTY = "AuthenticationFile";
0051   }  // namespace auth
0052 
0053 }  // namespace cond
0054 #endif