Commit aede9a2b authored by Aard's avatar Aard

[ssu] Allow resolving store repos on unregistered devices

parent 509179b7
......@@ -128,28 +128,27 @@ void SsuUrlResolver::run(){
// resolve base url
resolvedUrl = ssu.repoUrl(repo, isRnd, repoParameters);
QString credentialsScope = ssu.credentialsScope(repo, isRnd);
// only do credentials magic on secure connections
if (resolvedUrl.startsWith("https://") && ssu.isRegistered()){
if (resolvedUrl.startsWith("https://") && !credentialsScope.isEmpty() &&
(ssu.isRegistered() || credentialsScope == "store")){
// TODO: check for credentials scope required for repository; check if the file exists;
// compare with configuration, and dump credentials to file if necessary
ssuLog->print(LOG_DEBUG, QString("Requesting credentials for '%1' with RND status %2...").arg(repo).arg(isRnd));
QString credentialsScope = ssu.credentialsScope(repo, isRnd);
if (!credentialsScope.isEmpty()){
// personal store repositories as well as the ones listed in the
// store-auth-repos domain setting use store credentials. Refresh
// here, as we only know after checking scope if we need to have
// store credentials at all
if (credentialsScope == "store"){
ssu.updateStoreCredentials();
if (ssu.error())
error (ssu.lastError());
}
headerList.append(QString("credentials=%1").arg(credentialsScope));
writeZyppCredentialsIfNeeded(credentialsScope);
} else
ssuLog->print(LOG_DEBUG, "Skipping credential update due to missing credentials scope");
}
// personal store repositories as well as the ones listed in the
// store-auth-repos domain setting use store credentials. Refresh
// here, as we only know after checking scope if we need to have
// store credentials at all
if (credentialsScope == "store"){
ssu.updateStoreCredentials();
if (ssu.error())
error (ssu.lastError());
}
headerList.append(QString("credentials=%1").arg(credentialsScope));
writeZyppCredentialsIfNeeded(credentialsScope);
} else
ssuLog->print(LOG_DEBUG, QString("Skipping credential for %1 with scope %2").arg(repo).arg(credentialsScope));
if (!headerList.isEmpty() && !resolvedUrl.isEmpty()){
resolvedUrl = QString("%1?%2")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment