Lines Matching defs:json

71     const std::string APP_JSON_CONFIG("/appdata-sandbox.json");
72 const std::string APP_ISOLATED_JSON_CONFIG("/appdata-sandbox-isolated.json");
159 bool JsonUtils::GetJsonObjFromJson(nlohmann::json &jsonObj, const std::string &jsonPath)
171 jsonObj = nlohmann::json::parse(buf.str(), nullptr, false);
172 APPSPAWN_CHECK(!jsonObj.is_discarded() && jsonObj.is_structured(), return false, "Parse json file failed");
176 bool JsonUtils::GetStringFromJson(const nlohmann::json &json, const std::string &key, std::string &value)
178 APPSPAWN_CHECK(json != nullptr && json.is_object(), return false, "json is not object.");
179 bool isRet = json.find(key) != json.end() && json.at(key).is_string();
181 value = json.at(key).get<std::string>();
187 std::map<SandboxConfigType, std::vector<nlohmann::json>> SandboxUtils::appSandboxConfig_ = {};
190 void SandboxUtils::StoreJsonConfig(nlohmann::json &appSandboxConfig, SandboxConfigType type)
195 std::vector<nlohmann::json> &SandboxUtils::GetJsonConfig(SandboxConfigType type)
327 void SandboxUtils::DoSandboxChmod(nlohmann::json jsonConfig, std::string &sandboxRoot)
548 bool SandboxUtils::GetSandboxDacOverrideEnable(nlohmann::json &config)
561 std::string SandboxUtils::GetSbxPathByConfig(const AppSpawningCtx *appProperty, nlohmann::json &config)
589 bool SandboxUtils::GetSbxSwitchStatusByConfig(nlohmann::json &config)
604 static bool CheckMountConfig(nlohmann::json &mntPoint, const AppSpawningCtx *appProperty,
714 unsigned long SandboxUtils::GetSandboxMountFlags(nlohmann::json &config)
725 std::string SandboxUtils::GetSandboxFsType(nlohmann::json &config)
734 std::string SandboxUtils::GetSandboxOptions(const AppSpawningCtx *appProperty, nlohmann::json &config)
751 nlohmann::json &mntPoint, SandboxMountConfig &mountConfig)
763 std::string SandboxUtils::GetSandboxPath(const AppSpawningCtx *appProperty, nlohmann::json &mntPoint,
776 static bool CheckMountFlag(const AppSpawningCtx *appProperty, const std::string bundleName, nlohmann::json &appConfig)
788 nlohmann::json &appConfig, const char *typeName, const std::string &section)
800 nlohmann::json& mountPoints = appConfig[g_mountPrefix];
803 nlohmann::json& mntPoint = mountPoints[i];
837 int32_t SandboxUtils::DoAddGid(AppSpawningCtx *appProperty, nlohmann::json &appConfig,
849 nlohmann::json& gids = appConfig[g_gidPrefix];
861 int SandboxUtils::DoAllSymlinkPointslink(const AppSpawningCtx *appProperty, nlohmann::json &appConfig)
866 nlohmann::json& symlinkPoints = appConfig[g_symlinkPrefix];
871 nlohmann::json& symPoint = symlinkPoints[i];
902 nlohmann::json &wholeConfig)
905 nlohmann::json& privateAppConfig = wholeConfig[g_privatePrefix][0];
916 nlohmann::json &wholeConfig)
922 nlohmann::json& permissionAppConfig = wholeConfig[g_permissionPrefix][0];
923 for (nlohmann::json::iterator it = permissionAppConfig.begin(); it != permissionAppConfig.end(); ++it) {
946 nlohmann::json& permissionAppConfig = config[g_permissionPrefix][0];
956 nlohmann::json &wholeConfig)
959 nlohmann::json& privateAppConfig = wholeConfig[g_privatePrefix][0];
968 nlohmann::json &appConfig)
974 nlohmann::json& flagsPoints = appConfig[g_flagePoint];
978 nlohmann::json& flagPoint = flagsPoints[i];
995 nlohmann::json &wholeConfig)
998 nlohmann::json& privateAppConfig = wholeConfig[g_privatePrefix][0];
1007 nlohmann::json &wholeConfig)
1009 nlohmann::json& commonConfig = wholeConfig[g_commonPrefix][0];
1017 int32_t SandboxUtils::DoSandboxFileCommonBind(const AppSpawningCtx *appProperty, nlohmann::json &wholeConfig)
1019 nlohmann::json& commonConfig = wholeConfig[g_commonPrefix][0];
1037 nlohmann::json &wholeConfig)
1039 nlohmann::json& commonConfig = wholeConfig[g_commonPrefix][0];
1057 nlohmann::json &config)
1072 nlohmann::json &config)
1093 nlohmann::json& privateAppConfig = config[g_privatePrefix][0];
1129 nlohmann::json& privateAppConfig = config[g_privatePrefix][0];
1158 nlohmann::json &config)
1234 nlohmann::json hsps = nlohmann::json::parse(hspListInfo.c_str(), nullptr, false);
1236 && hsps.contains(g_hspList_key_versions), return -1, "MountAllHsp: json parse failed");
1238 nlohmann::json& bundles = hsps[g_hspList_key_bundles];
1239 nlohmann::json& modules = hsps[g_hspList_key_modules];
1240 nlohmann::json& versions = hsps[g_hspList_key_versions];
1247 // elements in json arrary can be different type
1290 nlohmann::json groups = nlohmann::json::parse(dataGroupInfo.c_str(), nullptr, false);
1293 "MountAllGroup: json parse failed");
1295 nlohmann::json& dataGroupIds = groups[g_groupList_key_dataGroupId];
1296 nlohmann::json& gids = groups[g_groupList_key_gid];
1297 nlohmann::json& dirs = groups[g_groupList_key_dir];
1303 // elements in json arrary can be different type
1345 nlohmann::json appConfig;
1355 nlohmann::json& privateAppConfig = config[g_privatePrefix][0];
1361 nlohmann::json& baseConfig = config[g_commonPrefix][0];
1401 nlohmann::json& commonAppConfig = wholeConfig[g_commonPrefix][0];
1421 nlohmann::json& privateAppConfig = wholeConfig[g_privatePrefix][0];
1423 nlohmann::json& appConfig = privateAppConfig[GetBundleName(appProperty)][0];
1744 nlohmann::json appSandboxConfig;