Efim Poberezkin
08171e987d
agent sqlite: initialize database in home directory by default ( #74 )
2021-03-29 19:18:54 +04:00
Efim Poberezkin
b9943c359d
chat: subscribe to all connections on startup ( #70 )
2021-03-06 15:39:00 +04:00
Efim Poberezkin
11c8bee836
agent store: make newtypes for msg internal Ids ( #68 )
2021-03-04 23:19:12 +04:00
Efim Poberezkin
93e782b874
agent store: organize sender and broker fields into tuples ( #67 )
2021-03-04 23:00:00 +04:00
Efim Poberezkin
660e35d1d1
check that sqlite library is compiled with threadsafe code ( #63 )
2021-03-02 22:30:59 +04:00
Evgeny Poberezkin
927ff230da
Separate db connection for each TCP client connection ( #60 )
...
* use separate db connections for each TCP client connection
* refactor atomically, increast delay in tests
* increase test delay for SMP server to start
* increase SMP ping frequency
* remove comment
* separate SQLite connection per thread, to support multi-threaded mode
* remove redundant import
2021-02-28 14:59:29 +00:00
Efim Poberezkin
3af34dea8b
agent store: accept internal ts and return internal id ( #58 )
2021-02-27 15:06:51 +04:00
Efim Poberezkin
8134bb0eb9
agent store: settle naming of Rcv and Snd entities ( #55 )
2021-02-26 18:17:56 +04:00
Efim Poberezkin
0f60c53a66
agent: save messages ( #45 )
2021-02-25 19:02:27 +04:00
Efim Poberezkin
469f84bb74
use cryptographic key pairs for encryption keys ( #39 )
...
* use cryptographic key pairs for encryption keys
* use speaking key types
* fix key types
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2021-02-26 18:14:22 +04:00
Evgeny Poberezkin
0fe41dbf16
Sign / verify SMP commands ( #37 )
...
* generate key pair
* crypto: sign/verify functions
* remove extension
* parse/serialize keys
* use RSA recipient/sender keys (TODO sign/verify)
* make PublicKey newtype, assign 0s to private_p & private_q
* replace SMP command parsing with Attoparsec
* rename types: Signed->Transmission, Transmission->SignedTransmission
* sign and verify commands (server tests skipped, agent tests pass)
* SMP client: avoid seralizing transmission twice when sending commands
* update SMP server tests to use command signatures
* remove support for "SEND :msg" syntax from SMP server protocol
* rename RSA module name to R to avoid confusion with C used for S.M.Crypto
* update key sizes to use bits `div` 8
* tidy up
2021-02-26 18:14:22 +04:00
Efim Poberezkin
7e9cfcce8c
agent sqlite: rework schema, make methods transactional, enable foreign keys ( #34 )
...
* agent sqlite: rework schema
* agent sqlite: explicitly mark primary keys as NOT NULL
* agent sqlite: adjust connections and queues fkeys
* agent sqlite: remove ack_mode from queues tables
* [WIP] agent sqlite: refactor methods
* agent sqlite: implement transactional createRcvConn
* add comment
* agent sqlite: remove ConnAlias from createRcvConn signature
* agent sqlite: implement transactional createSndConn
* agent sqlite: remove monadic stack from store util methods
* agent sqlite: refactor getConn
* agent sqlite: rename conn -> dbConn
* agent sqlite: move transactional logic to utils
* agent sqlite: remove addServer from store interface
* fix comment
* agent sqlite: refactor getRcvQueue
* agent sqlite: refactor deleteConn
* agent sqlite: remove old deleteConn
* agent sqlite: enable FKs
* agent sqlite: refactor methods upgrading connection to duplex
* agent sqlite: uncomment not implemented methods
* agent sqlite: rename methods upgrading connection to duplex
* use liftEither
* agent sqlite: refactor update queue status methods
* agent sqlite: refactor createMsg
* clean up
* fix compilation errors in src
* fix existing tests
* clean up tests
* agent sqlite: test that foreign keys are enabled
* change private members naming
* tests: expect specific error code
* clean up
* agent sqlite: consistently separate lifts from logic to their own lines
2021-02-04 19:23:43 +04:00
Efim Poberezkin
e09d3bae99
agent store: move SQLite Types -> Util ( #30 )
2021-01-25 20:14:33 +04:00
Efim Poberezkin
f50da16d0a
reorganize Protocol and Agent Store ( #25 )
...
* chore: move members from Server/Transmission.hs to Protocol.hs
* chore: revert qualified SMP import for server and client
* chore: fix corrId call
* chore: move common types to Common.hs
* chore: decompose SQLite.hs
* chore: rename Agent/Transmission.hs ErrorType -> AgentErrorType
* chore: move Protocol ErrorType -> Common SMPErrorType
* chore: rename Common -> Types
* chore: revert SMPErrorType -> ErrorType
2021-02-26 18:11:22 +04:00
Efim Poberezkin
c14b0251d5
agent store: add getReceiveQueue
2021-02-26 18:11:22 +04:00
Efim Poberezkin
8ab79b066d
agent store: add update queue methods ( #19 )
2021-02-26 18:11:22 +04:00
Efim Poberezkin
c1f15c9d93
tests: randomize db file name to fix io errors ( #16 )
...
* tests: check file doesn't exist in store tests after
* Revert "tests: check file doesn't exist in store tests after"
This reverts commit de624433a9 .
* [WIP] tests: randomize db file
* [WIP] tests: try runIO to get filename into after
* random db file name for agent tests
* tests: randomize DB file name
* tests: increase SMP agent start delay
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2021-02-26 18:11:22 +04:00
Efim Poberezkin
5f59fcc969
agent store: add createMsg ( #14 )
2021-01-15 19:30:11 +04:00
Efim Poberezkin
1c5325babf
agent store: add positive updateQueueStatus tests for snd and rcv conns ( #10 )
2021-01-12 19:01:53 +04:00
Efim Poberezkin
123fe0e3e2
agent store: adjust tests hierarchy
2021-01-11 20:28:20 +04:00
Efim Poberezkin
7f22dcd496
agent store: add updateQueueStatus tests
2021-01-11 19:34:30 +04:00
Evgeny Poberezkin
ea6496ca24
better MonadUnliftIO instance for ExceptT; fix tests
2021-01-09 20:35:19 +00:00
Evgeny Poberezkin
0d0a12f778
refactor store: m (Either e a) => ExceptT e m a
2021-01-09 11:18:52 +00:00
Efim Poberezkin
af5bd101cb
agent store: make create connection methods return ()
2021-01-08 15:51:33 +04:00
Efim Poberezkin
19238c6cc4
agent store: add deleteConn and tests
2021-01-07 17:58:46 +04:00
Efim Poberezkin
6dff023965
test: set up and tear down db per test
2021-01-07 14:51:49 +04:00
Efim Poberezkin
e692cb0119
add addRcvQueue and tests
2021-01-07 14:00:53 +04:00
Evgeny Poberezkin
51cc602bdb
agent store: refactor addSndQueue
2021-01-06 20:22:00 +00:00
Efim Poberezkin
5a6b1c67a9
add test testAddSndQueue
2021-01-06 23:01:53 +04:00
Efim Poberezkin
94d0be5d27
add test for addSndQueue
2021-01-06 22:35:04 +04:00
Evgeny Poberezkin
6e6ad0fb9b
agent store: getConn with tests
2021-01-05 20:31:01 +00:00
Efim Poberezkin
799d179f6f
add createSndConn test
2021-01-05 18:03:57 +04:00
Evgeny Poberezkin
5d2e77f41d
test: agent SQLite createRcvConnection
2021-01-04 20:25:02 +00:00