1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef SECURITY_GUARD_STORE_DEFINE_H 17 #define SECURITY_GUARD_STORE_DEFINE_H 18 19 #include <string> 20 #include <vector> 21 22 namespace OHOS::Security::SecurityGuard { 23 constexpr int INVALID_INDEX = -1; 24 constexpr int DB_VERSION = 1; 25 constexpr const char *ID = "id"; 26 constexpr const char *USER_ID = "user_id"; 27 constexpr const char *DEVICE_ID = "device_id"; 28 constexpr const char *EVENT_ID = "event_id"; 29 constexpr const char *VERSION = "version"; 30 constexpr const char *DATE = "date"; 31 constexpr const char *CONTENT = "content"; 32 constexpr const char *EVENT_TYPE = "event_type"; 33 constexpr const char *DATA_SENSITIVITY_LEVEL = "data_sensitivity_level"; 34 constexpr const char *OWNER = "owner"; 35 constexpr const char *AUDIT_TABLE = "audit_event"; 36 constexpr const char *RISK_TABLE = "risk_event"; 37 38 const std::string FOLDER_PATH = "/data/service/el1/public/database/security_guard_service/"; 39 40 using SecEventTableInfo = struct { 41 int32_t rowCount; 42 int32_t columnCount; 43 int32_t primaryKeyIndex; 44 int32_t eventIdIndex; 45 int32_t versionIndex; 46 int32_t dateIndex; 47 int32_t contentIndex; 48 int32_t eventTypeIndex; 49 int32_t dataSensitivityLevelIndex; 50 int32_t ownerIndex; 51 int32_t userIdIndex; 52 int32_t deviceIdIndex; 53 }; 54 } // namespace OHOS::Security::SecurityGuard 55 56 #endif // SECURITY_GUARD_STORE_DEFINE_H 57