mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
remove preloading of allowed user keys since it happens on connect
This commit is contained in:
parent
2446fcde8e
commit
2d0c5ff37a
4 changed files with 4 additions and 19 deletions
|
@ -604,19 +604,6 @@ bool DomainGatekeeper::isWithinMaxCapacity() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DomainGatekeeper::preloadAllowedUserPublicKeys() {
|
|
||||||
QStringList allowedUsers = _server->_settingsManager.getAllNames();
|
|
||||||
|
|
||||||
if (allowedUsers.size() > 0) {
|
|
||||||
// in the future we may need to limit how many requests here - for now assume that lists of allowed users are not
|
|
||||||
// going to create > 100 requests
|
|
||||||
foreach(const QString& username, allowedUsers) {
|
|
||||||
requestUserPublicKey(username);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DomainGatekeeper::requestUserPublicKey(const QString& username) {
|
void DomainGatekeeper::requestUserPublicKey(const QString& username) {
|
||||||
// don't request public keys for the standard psuedo-account-names
|
// don't request public keys for the standard psuedo-account-names
|
||||||
if (NodePermissions::standardNames.contains(username, Qt::CaseInsensitive)) {
|
if (NodePermissions::standardNames.contains(username, Qt::CaseInsensitive)) {
|
||||||
|
@ -667,6 +654,8 @@ void DomainGatekeeper::publicKeyJSONCallback(QNetworkReply& requestReply) {
|
||||||
const QString JSON_DATA_KEY = "data";
|
const QString JSON_DATA_KEY = "data";
|
||||||
const QString JSON_PUBLIC_KEY_KEY = "public_key";
|
const QString JSON_PUBLIC_KEY_KEY = "public_key";
|
||||||
|
|
||||||
|
qDebug() << "Extracted public key for" << username.toLower();
|
||||||
|
|
||||||
_userPublicKeys[username.toLower()] =
|
_userPublicKeys[username.toLower()] =
|
||||||
QByteArray::fromBase64(jsonObject[JSON_DATA_KEY].toObject()[JSON_PUBLIC_KEY_KEY].toString().toUtf8());
|
QByteArray::fromBase64(jsonObject[JSON_DATA_KEY].toObject()[JSON_PUBLIC_KEY_KEY].toString().toUtf8());
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,6 @@ public:
|
||||||
const QUuid& walletUUID, const QString& nodeVersion);
|
const QUuid& walletUUID, const QString& nodeVersion);
|
||||||
QUuid assignmentUUIDForPendingAssignment(const QUuid& tempUUID);
|
QUuid assignmentUUIDForPendingAssignment(const QUuid& tempUUID);
|
||||||
|
|
||||||
void preloadAllowedUserPublicKeys();
|
|
||||||
|
|
||||||
void removeICEPeer(const QUuid& peerUUID) { _icePeers.remove(peerUUID); }
|
void removeICEPeer(const QUuid& peerUUID) { _icePeers.remove(peerUUID); }
|
||||||
|
|
||||||
static void sendProtocolMismatchConnectionDenial(const HifiSockAddr& senderSockAddr);
|
static void sendProtocolMismatchConnectionDenial(const HifiSockAddr& senderSockAddr);
|
||||||
|
|
|
@ -160,8 +160,6 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
||||||
getTemporaryName();
|
getTemporaryName();
|
||||||
}
|
}
|
||||||
|
|
||||||
_gatekeeper.preloadAllowedUserPublicKeys(); // so they can connect on first request
|
|
||||||
|
|
||||||
// send signal to DomainMetadata when descriptors changed
|
// send signal to DomainMetadata when descriptors changed
|
||||||
_metadata = new DomainMetadata(this);
|
_metadata = new DomainMetadata(this);
|
||||||
connect(&_settingsManager, &DomainServerSettingsManager::settingsUpdated,
|
connect(&_settingsManager, &DomainServerSettingsManager::settingsUpdated,
|
||||||
|
|
|
@ -327,7 +327,7 @@ void NodeList::sendDomainServerCheckIn() {
|
||||||
<< "but no keypair is present. Waiting for keypair generation to complete.";
|
<< "but no keypair is present. Waiting for keypair generation to complete.";
|
||||||
accountManager->generateNewUserKeypair();
|
accountManager->generateNewUserKeypair();
|
||||||
|
|
||||||
// don't send the check in packet - wait for the keypair first
|
// don't send the check in packet - wait for the new public key to be available to the domain-server first
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue