initial pass at using keypairs for username verification for basic domain-server ACL
Showing the changes to interface/src/Application.cpp (1 of 35 files). Show all
Unified · Split
| @@ -72,7 +72,6 @@ · 71 unmodified lines | ||
| 72 | 72 | #include "InterfaceVersion.h" |
| 73 | 73 | #include "Menu.h" |
| 74 | 74 | #include "ModelUploader.h" |
| 75 | −#include "PaymentManager.h" | |
| 76 | 75 | #include "Util.h" |
| 77 | 76 | #include "devices/MIDIManager.h" |
| 78 | 77 | #include "devices/OculusManager.h" |
| @@ -90,7 +89,6 @@ · 11 unmodified lines | ||
| 90 | 89 | #include "scripting/WindowScriptingInterface.h" |
| 91 | 90 | |
| 92 | 91 | #include "ui/InfoView.h" |
| 93 | −#include "ui/OAuthWebViewHandler.h" | |
| 94 | 92 | #include "ui/Snapshot.h" |
| 95 | 93 | #include "ui/Stats.h" |
| 96 | 94 | #include "ui/TextRenderer.h" |
| @@ -220,10 +218,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 123 unmodified lines | ||
| 220 | 218 | listenPort = atoi(portStr); |
| 221 | 219 | } |
| 222 | 220 | |
| 223 | − // call the OAuthWebviewHandler static getter so that its instance lives in our thread | |
| 224 | − // make sure it is ready before the NodeList might need it | |
| 225 | − OAuthWebViewHandler::getInstance(); | |
| 226 | − | |
| 227 | 221 | // start the nodeThread so its event loop is running |
| 228 | 222 | _nodeThread->start(); |
| 229 | 223 | |
| @@ -256,11 +250,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 26 unmodified lines | ||
| 256 | 250 | connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived); |
| 257 | 251 | connect(&domainHandler, &DomainHandler::hostnameChanged, Menu::getInstance(), &Menu::clearLoginDialogDisplayedFlag); |
| 258 | 252 | |
| 259 | − // hookup VoxelEditSender to PaymentManager so we can pay for octree edits | |
| 260 | − const PaymentManager& paymentManager = PaymentManager::getInstance(); | |
| 261 | − connect(&_voxelEditSender, &VoxelEditPacketSender::octreePaymentRequired, | |
| 262 | − &paymentManager, &PaymentManager::sendSignedPayment); | |
| 263 | − | |
| 264 | 253 | // update our location every 5 seconds in the data-server, assuming that we are authenticated with one |
| 265 | 254 | const qint64 DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS = 5 * 1000; |
| 266 | 255 | |
| @@ -3483,7 +3472,7 @@ void Application::updateLocationInServer() { · 3216 unmodified lines | ||
| 3483 | 3472 | |
| 3484 | 3473 | rootObject.insert(LOCATION_KEY_IN_ROOT, locationObject); |
| 3485 | 3474 | |
| 3486 | − accountManager.authenticatedRequest("/api/v1/users/location", QNetworkAccessManager::PutOperation, | |
| 3475 | + accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation, | |
| 3487 | 3476 | JSONCallbackParameters(), QJsonDocument(rootObject).toJson()); |
| 3488 | 3477 | } |
| 3489 | 3478 | } |
| @@ -3526,20 +3515,18 @@ void Application::domainChanged(const QString& domainHostname) { · 36 unmodified lines | ||
| 3526 | 3515 | |
| 3527 | 3516 | // reset the voxels renderer |
| 3528 | 3517 | _voxels.killLocalVoxels(); |
| 3529 | − | |
| 3530 | − // reset the auth URL for OAuth web view handler | |
| 3531 | − OAuthWebViewHandler::getInstance().clearLastAuthorizationURL(); | |
| 3532 | 3518 | } |
| 3533 | 3519 | |
| 3534 | 3520 | void Application::connectedToDomain(const QString& hostname) { |
| 3535 | 3521 | AccountManager& accountManager = AccountManager::getInstance(); |
| 3522 | + const QUuid& domainID = NodeList::getInstance()->getDomainHandler().getUUID(); | |
| 3523 | + | |
| 3524 | + if (accountManager.isLoggedIn() && !domainID.isNull()) { | |
| 3525 | + // update our data-server with the domain-server we're logged in with | |
| 3536 | 3526 | |
| 3537 | − if (accountManager.isLoggedIn()) { | |
| 3538 | − // update our domain-server with the data-server we're logged in with | |
| 3539 | − | |
| 3540 | − QString domainPutJsonString = "{\"address\":{\"domain\":\"" + hostname + "\"}}"; | |
| 3527 | + QString domainPutJsonString = "{\"location\":{\"domain_id\":\"" + uuidStringWithoutCurlyBraces(domainID) + "\"}}"; | |
| 3541 | 3528 | |
| 3542 | − accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation, | |
| 3529 | + accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation, | |
| 3543 | 3530 | JSONCallbackParameters(), domainPutJsonString.toUtf8()); |
| 3544 | 3531 | } |
| 3545 | 3532 | } |