Commit Graph

233 Commits

Author SHA1 Message Date
0a907cb086 Move Pigeon::Lexer into its own module 2020-03-18 07:32:40 -05:00
decc2f83a0 (FAILING) Finish all the regexes required for a bundle lexer 2020-03-17 08:40:09 -05:00
f94200750b Add example bundle 2020-03-16 08:07:03 -05:00
4b87a58b0e Add message find and message find-all (local user only - find-all for peers 🔜) 2020-03-15 13:51:20 -05:00
f296a71890 Formatting updates 2020-03-15 13:12:26 -05:00
46e1a659f6 Constantize literals for portability and DRYness 2020-03-15 12:50:57 -05:00
589e3d9d6a Fix CLI. Add trailing CR to bundles 2020-03-15 12:32:41 -05:00
19a9b5b627 JSON-ify key / value pairs if they arent strings 2020-03-15 12:12:48 -05:00
31daf90cdc We have BUNDLE CREATION 🎉 🎉 🎉 2020-03-15 11:51:13 -05:00
34e81f859a TODO: pigeon bundle create 2020-03-13 22:41:31 -05:00
a6b46699e4 Update Storage.reset logic 2020-03-13 22:40:15 -05:00
3da232ba79 Bug fix: Dont destroy entire DB when loading app 2020-03-13 22:34:29 -05:00
05480b03e5 Convert "message..." commands to "draft..." commands 2020-03-13 22:17:56 -05:00
afa160c2d2 Convert ".sig.ed25519" literals to constants. Update README. 2020-03-13 22:09:31 -05:00
ef569d3fb4 Use multihash (instead of hex) for blob notation 2020-03-13 21:59:13 -05:00
56518e55c8 Stability issues WIP.
What's Next?

 * Update the protocol spec and push to Tildegit
 * Cleanup fix scratchpad.sh (currently crashes because ::Draft.current is unexpectedlyy nil)
 * Fix failing test (going to make ::Draft.current crash maybe)
 * Make blobs URLSafe b64??
2020-03-13 08:08:46 -05:00
3c9b653f7c Change Message.from_draft to Message.publish
This mmakes it more obvious that the method can only be
used on *your* messages rather than the messages of peers.
2020-03-13 07:42:44 -05:00
ff1c7cee00 test to verify message signatures 2020-03-13 07:39:44 -05:00
18d82f30f7 TODO: Fix scratchpad.sh, write test to verify message signatures 2020-03-12 08:07:13 -05:00
3b2f4ea5d0 Minor cleanup of ::KeyPair 2020-03-12 07:47:42 -05:00
f6032dac18 Add tests to verify accuracy of hash chain. NEXT: Tests to verify accuracy of signatures 2020-03-11 08:44:52 -05:00
c27db9ae71 TODO: Verify accuracy of signature chain.
Also todo:
 * Use URL safe base64 for blob multihash?
 * Replicate/verify signatures of SSB messages for backwards compat.
2020-03-09 08:56:45 -05:00
6a345bbb90 Remove superfluous whitespace. Add scratchpad* to ignore. 2020-03-09 08:07:55 -05:00
a14089143a [INCOMPLETE] Wrote tests for message linkage, but there is a problem
Observe the messages below:

=== BEGIN SAMPLE
	author @sqTnBVTpnkzptZ2Ek7U7IfBKbQdWfe4HfsBd-9fcyDg=.ed25519
	kind unit_test
	prev NONE
	depth 0

	description:"Message number 1"

	signature oBZcedW6JFqWVVqVHSjKeJWzd2uQtkBi2ATtF9meLzwrgf59DcjFQ5n0W6ZcCQkCSCpXECoBwF8BdnPej9XCBw==.sig.ed25519
	author @sqTnBVTpnkzptZ2Ek7U7IfBKbQdWfe4HfsBd-9fcyDg=.ed25519
	kind unit_test
	prev oBZcedW6JFqWVVqVHSjKeJWzd2uQtkBi2ATtF9meLzwrgf59DcjFQ5n0W6ZcCQkCSCpXECoBwF8BdnPej9XCBw==.sig.ed25519
	depth 1

	description:"Message number 2"

	signature MB52WQfouTRP_cKHnaMR8iL0EEXFDWrKghBbC8DQ_QxKzS8PFDSXCxbZFr2bfEbCzBrd_bCxP1q9uK4ndQwkCQ==.sig.ed25519
	author @sqTnBVTpnkzptZ2Ek7U7IfBKbQdWfe4HfsBd-9fcyDg=.ed25519
	kind unit_test
	prev MB52WQfouTRP_cKHnaMR8iL0EEXFDWrKghBbC8DQ_QxKzS8PFDSXCxbZFr2bfEbCzBrd_bCxP1q9uK4ndQwkCQ==.sig.ed25519
	depth 2

	description:"Message number 3"

	signature jEIN2yYSWmg-fnontgoZQS3Cw7KJIzhxuH6Gz-bE5pRat9zjP6vFJOlbNjADif_sPTxdye-kZdy52gTspDmdBw==.sig.ed25519
=== END EXAMPLE

Notice that the `signature` is identical to the `prev` value.
This is wrong.
The signature value is fine as it is, but the `prev` value needs to be a traditional message.
That is to say it should be a URL safe base64 string that starts with a "%" character.
You can't just copy/paste the signature like that.

For more info visit:
  https://spec.scuttlebutt.nz/feed/datatypes.html#multihash-encoding
  https://spec.scuttlebutt.nz/print.html#json-encoding
2020-03-08 11:39:49 -05:00
c621e5c070 DRY up storage initialization / reset code 2020-03-08 11:18:05 -05:00
be5dfc982a 🎉 100% coverage. NEXT: Verify message chain creation via tests.
Currently, it is not working correctly.
Take a look at scratchpad.sh. The `prev:` values are wrong.

It is probably as simple as updating local indexes when
Pigeon::Storage#save_message is called. Re run the indexes
at that time. Or heck, add a map/reduce ability?
2020-03-07 09:56:03 -06:00
f4b6ddbf51 (99.44% coverage) TODO: Need to reset current draft when a draft is signed/committed to the log 2020-03-06 08:42:19 -06:00
7568d0412e FIx tests, remove unused methods. 2020-03-06 07:47:13 -06:00
17bd8e7927 Factor Pigeon::Message into two smaller classes: Pigeon::Message and Pigeon::Draft 2020-03-05 08:32:22 -06:00
aaea1d3f6d Minor cleanup 2020-02-25 18:18:47 -06:00
f68e004e53 TODO: Create message index 2019-12-29 20:16:42 -06:00
61460a4ae5 Clear old instances out via #reset 2019-12-27 22:44:10 -06:00
52b902b935 Fix one test, add another 2019-12-10 22:05:54 -06:00
dab113961a TODO: Make these tests pass 2019-12-10 21:52:43 -06:00
6d244d331b .gitignore updates 2019-12-08 21:58:49 -06:00
0ca6ea0fb8 Fix tests for Message#redner 2019-12-08 21:57:29 -06:00
1b6abf6927 Add more tests 2019-12-05 21:28:21 -06:00
77a5ba27de TODO: Tests for Message#sign 2019-12-04 22:11:04 -06:00
7d8051b7b5 Finish tests for Message#append 2019-12-04 21:56:47 -06:00
7223906613 Constantize sigils 2019-12-04 18:17:36 -06:00
e260fc7bb0 Remove irrelevant tests (predates pstore usage) 2019-12-04 18:10:35 -06:00
e3529796d5 Fix tests. 2019-12-04 18:01:52 -06:00
90ec73c5e1 Fix tests. 2019-12-04 18:01:23 -06:00
d8225bf96d Cleanup 2019-12-02 21:18:44 -06:00
f76ee47b7a Comment out old code, add tests 2019-12-02 21:01:24 -06:00
caf580951e STABLE-ish: Use PStore instead of filesystem. 2019-12-02 20:31:17 -06:00
0f615f92d7 Dead code removal. 2019-12-01 20:48:42 -06:00
55c02e06df Reset file system before each run in storage_spec.rb 2019-12-01 20:45:28 -06:00
7096099b8a Use PStore instead of filesystem (that was a bad idea, sorry) 2019-11-26 19:58:31 -06:00
4b33674771 Ability to block and list blocks 2019-11-26 19:55:52 -06:00