aboutsummaryrefslogtreecommitdiff
path: root/include/StagedObject.hpp
diff options
context:
space:
mode:
authorAleksi Lindeman <0xdec05eba@gmail.com>2018-03-05 22:45:56 +0100
committerAleksi Lindeman <0xdec05eba@gmail.com>2018-03-05 22:48:26 +0100
commit2ffb47d0043e57707474e5ae811f97c2e5e93f25 (patch)
treefd60b300cdf736de5adc68b395105dcfc6a43f09 /include/StagedObject.hpp
parent66661e47dc826f50b690e080057f47a0ea27016c (diff)
Implement 'create' operation, add seeding
Seeding is currently only done on the key you specify, in the future the user should request data that it can seed.
Diffstat (limited to 'include/StagedObject.hpp')
-rw-r--r--include/StagedObject.hpp38
1 files changed, 10 insertions, 28 deletions
diff --git a/include/StagedObject.hpp b/include/StagedObject.hpp
index fccf4f6..a75664e 100644
--- a/include/StagedObject.hpp
+++ b/include/StagedObject.hpp
@@ -1,40 +1,22 @@
#pragma once
-#include "Key.hpp"
-#include "types.hpp"
+#include "utils.hpp"
+#include "Hash.hpp"
#include "DataView.hpp"
-#include "Signature.hpp"
namespace odhtdb
{
- class Group;
-
struct StagedCreateObject
{
- Key key;
- Group *primaryAdminGroup;
- u64 timestamp; // In microseconds
-
- StagedCreateObject() : key(), primaryAdminGroup(nullptr), timestamp(0) {}
- StagedCreateObject(const Key &_key, Group *_primaryAdminGroup, u64 _timestamp) :
- key(_key), primaryAdminGroup(_primaryAdminGroup), timestamp(_timestamp)
- {
-
- }
- };
-
- struct StagedAddObject
- {
- Key key;
- std::unique_ptr<std::string> data;
- u64 timestamp; // In microseconds
- Signature::PublicKey creatorPublicKey;
-
- StagedAddObject() : key(), data(), timestamp(0), creatorPublicKey(Signature::PublicKey::ZERO) {}
- StagedAddObject(const Key &_key, std::unique_ptr<std::string> &&_data, u64 _timestamp, const Signature::PublicKey &_creatorPublicKey) :
- key(_key), data(std::move(_data)), timestamp(_timestamp), creatorPublicKey(_creatorPublicKey)
+ DISABLE_COPY(StagedCreateObject)
+ DataView encryptedBody;
+ std::shared_ptr<Hash> requestKey;
+
+ StagedCreateObject(DataView &_encryptedBody, const std::shared_ptr<Hash> &_requestKey) :
+ encryptedBody(_encryptedBody),
+ requestKey(_requestKey)
{
-
+
}
};
}