diff --git a/libssu/ssu.cpp b/libssu/ssu.cpp index 93c7491..cb1ece5 100644 --- a/libssu/ssu.cpp +++ b/libssu/ssu.cpp @@ -98,6 +98,7 @@ QString Ssu::credentialsScope(QString repoName, bool rndRepo){ SsuVariables::variable(&repoSettings, domain() + "-domain", storeAuthReposKey).toStringList(); + if (storeAuthRepos.empty()) storeAuthRepos = SsuVariables::variable(&repoSettings, @@ -107,6 +108,18 @@ QString Ssu::credentialsScope(QString repoName, bool rndRepo){ if (storeAuthRepos.contains(repoName)) return "store"; + // If we defined explicitly what credentials to use with which secure domain + // use those. + QHash secureDomainAuth; + SsuVariables::variableSection(&repoSettings, "secure-domain-auth", &secureDomainAuth); + QHashIterator i(secureDomainAuth); + while (i.hasNext()) { + i.next(); + if (repoUrl(repoName, rndRepo).contains(i.key()) && !i.value().isEmpty()) { + return i.value(); + } + } + return settings->credentialsScope(repoName, rndRepo); }