diff options
Diffstat (limited to 'include/odhtdb/Database.hpp')
-rw-r--r-- | include/odhtdb/Database.hpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp index 1e4d470..332a784 100644 --- a/include/odhtdb/Database.hpp +++ b/include/odhtdb/Database.hpp @@ -20,11 +20,7 @@ #include <functional> namespace odhtdb -{ - class User; - class LocalUser; - class Group; - +{ class CommitCreateException : public std::runtime_error { public: @@ -115,14 +111,15 @@ namespace odhtdb class DatabaseCreateResponse { public: - DatabaseCreateResponse(LocalUser *nodeAdminUser, std::shared_ptr<OwnedMemory> key, std::shared_ptr<Hash> hash); + DatabaseCreateResponse(std::shared_ptr<Signature::KeyPair> nodeAdminKeyPair, std::shared_ptr<OwnedMemory> nodeAdminGroupId, std::shared_ptr<OwnedMemory> key, std::shared_ptr<Hash> hash); - const LocalUser* getNodeAdminUser() const; - // Size of encryption key is odhtdb::KEY_BYTE_SIZE (found in Encryption.hpp) + const std::shared_ptr<Signature::KeyPair> getNodeAdminKeyPair() const; + const std::shared_ptr<OwnedMemory> getNodeAdminGroupId() const; const std::shared_ptr<OwnedMemory> getNodeEncryptionKey() const; const std::shared_ptr<Hash> getRequestHash() const; private: - LocalUser *nodeAdminUser; + std::shared_ptr<Signature::KeyPair> nodeAdminKeyPair; + std::shared_ptr<OwnedMemory> nodeAdminGroupId; std::shared_ptr<OwnedMemory> key; std::shared_ptr<Hash> hash; }; @@ -171,12 +168,10 @@ namespace odhtdb // Throws DatabaseCreateException on failure. std::unique_ptr<DatabaseCreateResponse> create(); - // Throws DatabaseCreateException on failure. - std::unique_ptr<DatabaseCreateResponse> create(const Signature::KeyPair &creatorKeyPair); // Throws PermissionDeniedException if user @userToPerformActionWith is not allowed to add data to node - void addData(const DatabaseNode &nodeInfo, const LocalUser *userToPerformActionWith, DataView dataToAdd); + void addData(const DatabaseNode &nodeInfo, const Signature::KeyPair &userToPerformActionWith, DataView dataToAdd); // Throws PermissionDeniedException if user @userToPerformActionWith is not allowed to add user @userToAdd to group @groupToAddUserTo - void addUser(const DatabaseNode &nodeInfo, const LocalUser *userToPerformActionWith, const Signature::PublicKey &userToAddPublicKey, Group *groupToAddUserTo); + void addUser(const DatabaseNode &nodeInfo, const Signature::KeyPair &userToPerformActionWith, const Signature::PublicKey &userToAddPublicKey, const DataView &groupToAddUserTo); ntp::NtpTimestamp getSyncedTimestampUtc() const; private: |