History

Merge pull request #3598 from birarda/domain-tunnel

initial pass at using keypairs for username verification for basic domain-server ACL

AndrewMeadows committed 12 years ago

Commit 4fbc5892 parents ec647ca e4b195435 files · +537 −667Browse files

Showing the changes to interface/src/Application.cpp (1 of 35 files). Show all

Unified · Split

interface/src/Application.cpp+7−20
@@ -72,7 +72,6 @@ · 71 unmodified lines
7272 #include "InterfaceVersion.h"
7373 #include "Menu.h"
7474 #include "ModelUploader.h"
75−#include "PaymentManager.h"
7675 #include "Util.h"
7776 #include "devices/MIDIManager.h"
7877 #include "devices/OculusManager.h"
@@ -90,7 +89,6 @@ · 11 unmodified lines
9089 #include "scripting/WindowScriptingInterface.h"
9190
9291 #include "ui/InfoView.h"
93−#include "ui/OAuthWebViewHandler.h"
9492 #include "ui/Snapshot.h"
9593 #include "ui/Stats.h"
9694 #include "ui/TextRenderer.h"
@@ -220,10 +218,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 123 unmodified lines
220218 listenPort = atoi(portStr);
221219 }
222220
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−
227221 // start the nodeThread so its event loop is running
228222 _nodeThread->start();
229223
@@ -256,11 +250,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 26 unmodified lines
256250 connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived);
257251 connect(&domainHandler, &DomainHandler::hostnameChanged, Menu::getInstance(), &Menu::clearLoginDialogDisplayedFlag);
258252
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−
264253 // update our location every 5 seconds in the data-server, assuming that we are authenticated with one
265254 const qint64 DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS = 5 * 1000;
266255
@@ -3483,7 +3472,7 @@ void Application::updateLocationInServer() { · 3216 unmodified lines
34833472
34843473 rootObject.insert(LOCATION_KEY_IN_ROOT, locationObject);
34853474
3486− accountManager.authenticatedRequest("/api/v1/users/location", QNetworkAccessManager::PutOperation,
3475+ accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation,
34873476 JSONCallbackParameters(), QJsonDocument(rootObject).toJson());
34883477 }
34893478 }
@@ -3526,20 +3515,18 @@ void Application::domainChanged(const QString& domainHostname) { · 36 unmodified lines
35263515
35273516 // reset the voxels renderer
35283517 _voxels.killLocalVoxels();
3529−
3530− // reset the auth URL for OAuth web view handler
3531− OAuthWebViewHandler::getInstance().clearLastAuthorizationURL();
35323518 }
35333519
35343520 void Application::connectedToDomain(const QString& hostname) {
35353521 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
35363526
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) + "\"}}";
35413528
3542− accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation,
3529+ accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation,
35433530 JSONCallbackParameters(), domainPutJsonString.toUtf8());
35443531 }
35453532 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t