mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
upload the generated public key to data-web, add getter for private key
This commit is contained in:
parent
7ce806b746
commit
f8c89d0790
3 changed files with 19 additions and 1 deletions
|
@ -509,6 +509,23 @@ void AccountManager::processGeneratedKeypair(const QByteArray& publicKey, const
|
|||
// set the private key on our data-server account info
|
||||
_accountInfo.setPrivateKey(privateKey);
|
||||
|
||||
// upload the public key so data-web has an up-to-date key
|
||||
const QString PUBLIC_KEY_UPDATE_PATH = "api/v1/user/public_key";
|
||||
|
||||
// setup a multipart upload to send up the public key
|
||||
QHttpMultiPart* requestMultiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
|
||||
|
||||
QHttpPart keyPart;
|
||||
keyPart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/octet-stream"));
|
||||
keyPart.setHeader(QNetworkRequest::ContentDispositionHeader,
|
||||
QVariant("form-data; name=\"public_key\"; filename=\"public_key\""));
|
||||
keyPart.setBody(publicKey);
|
||||
|
||||
requestMultiPart->append(keyPart);
|
||||
|
||||
authenticatedRequest(PUBLIC_KEY_UPDATE_PATH, QNetworkAccessManager::PutOperation,
|
||||
JSONCallbackParameters(), QByteArray(), requestMultiPart);
|
||||
|
||||
// get rid of the keypair generator now that we don't need it anymore
|
||||
sender()->deleteLater();
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
const QUuid& getWalletID() const { return _walletID; }
|
||||
void setWalletID(const QUuid& walletID);
|
||||
|
||||
const QByteArray& getPrivateKey() const { return _privateKey; }
|
||||
void setPrivateKey(const QByteArray& privateKey) { _privateKey = privateKey; }
|
||||
|
||||
qint64 getBalance() const { return _balance; }
|
||||
|
|
|
@ -33,7 +33,7 @@ const char SOLO_NODE_TYPES[2] = {
|
|||
NodeType::AudioMixer
|
||||
};
|
||||
|
||||
const QUrl DEFAULT_NODE_AUTH_URL = QUrl("https://data.highfidelity.io");
|
||||
const QUrl DEFAULT_NODE_AUTH_URL = QUrl("http://data.highfidelity.io");
|
||||
|
||||
std::auto_ptr<LimitedNodeList> LimitedNodeList::_sharedInstance;
|
||||
|
||||
|
|
Loading…
Reference in a new issue