Example #1
0
File: ssu.cpp Project: jvihrial/ssu
QString Ssu::credentialsScope(QString repoName, bool rndRepo){
  SsuCoreConfig *settings = SsuCoreConfig::instance();
  SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat);

  // hardcoded magic for doing special privileges store repositories
  if (repoName == "store" || repoName.startsWith("store-c-"))
    return "store";

  // check if some repos are marked for using store-credentials
  // in current domain, checking first for rnd/release specific
  // settings, and if not found in generic settings
  QString storeAuthReposKey = QString("store-auth-repos-%1")
    .arg(rndRepo ? "rnd" : "release");
  QStringList storeAuthRepos =
    SsuVariables::variable(&repoSettings,
                           domain() + "-domain",
                           storeAuthReposKey).toStringList();
  if (storeAuthRepos.empty())
    storeAuthRepos =
      SsuVariables::variable(&repoSettings,
                             domain() + "-domain",
                             "store-auth-repos").toStringList();

  if (storeAuthRepos.contains(repoName))
    return "store";

  return settings->credentialsScope(repoName, rndRepo);
}
Example #2
0
QString SsuRepoManager::caCertificatePath(QString domain){
  SsuCoreConfig *settings = SsuCoreConfig::instance();
  SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat);

  if (domain.isEmpty())
    domain = settings->domain();

  QString ca = SsuVariables::variable(&repoSettings, domain + "-domain",
                                      "_ca-certificate").toString();
  if (!ca.isEmpty())
    return ca;

  // compat setting, can go away after some time
  if (settings->contains("ca-certificate"))
    return settings->value("ca-certificate").toString();

  return "";
}