Commit Graph

264 Commits

Author SHA1 Message Date
Netscape Navigator 3b2f4ea5d0 Minor cleanup of ::KeyPair 2020-03-12 07:47:42 -05:00
Netscape Navigator f6032dac18 Add tests to verify accuracy of hash chain. NEXT: Tests to verify accuracy of signatures 2020-03-11 08:44:52 -05:00
Netscape Navigator 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
Netscape Navigator 6a345bbb90 Remove superfluous whitespace. Add scratchpad* to ignore. 2020-03-09 08:07:55 -05:00
Netscape Navigator 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
Netscape Navigator c621e5c070 DRY up storage initialization / reset code 2020-03-08 11:18:05 -05:00
Netscape Navigator 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
Netscape Navigator 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
Netscape Navigator 7568d0412e FIx tests, remove unused methods. 2020-03-06 07:47:13 -06:00
Netscape Navigator 17bd8e7927 Factor Pigeon::Message into two smaller classes: Pigeon::Message and Pigeon::Draft 2020-03-05 08:32:22 -06:00
Netscape Navigator aaea1d3f6d Minor cleanup 2020-02-25 18:18:47 -06:00
Netscape Navigator f68e004e53 TODO: Create message index 2019-12-29 20:16:42 -06:00
Netscape Navigator 61460a4ae5 Clear old instances out via `#reset` 2019-12-27 22:44:10 -06:00
Netscape Navigator 52b902b935 Fix one test, add another 2019-12-10 22:05:54 -06:00
Netscape Navigator dab113961a TODO: Make these tests pass 2019-12-10 21:52:43 -06:00
Netscape Navigator 6d244d331b .gitignore updates 2019-12-08 21:58:49 -06:00
Netscape Navigator 0ca6ea0fb8 Fix tests for Message#redner 2019-12-08 21:57:29 -06:00
Netscape Navigator 1b6abf6927 Add more tests 2019-12-05 21:28:21 -06:00
Netscape Navigator 77a5ba27de TODO: Tests for Message#sign 2019-12-04 22:11:04 -06:00
Netscape Navigator 7d8051b7b5 Finish tests for Message#append 2019-12-04 21:56:47 -06:00
Netscape Navigator 7223906613 Constantize sigils 2019-12-04 18:17:36 -06:00
Netscape Navigator e260fc7bb0 Remove irrelevant tests (predates pstore usage) 2019-12-04 18:10:35 -06:00
Netscape Navigator e3529796d5 Fix tests. 2019-12-04 18:01:52 -06:00
Netscape Navigator 90ec73c5e1 Fix tests. 2019-12-04 18:01:23 -06:00
Netscape Navigator d8225bf96d Cleanup 2019-12-02 21:18:44 -06:00
Netscape Navigator f76ee47b7a Comment out old code, add tests 2019-12-02 21:01:24 -06:00
Netscape Navigator caf580951e STABLE-ish: Use PStore instead of filesystem. 2019-12-02 20:31:17 -06:00
Netscape Navigator 0f615f92d7 Dead code removal. 2019-12-01 20:48:42 -06:00
Netscape Navigator 55c02e06df Reset file system before each run in storage_spec.rb 2019-12-01 20:45:28 -06:00
Netscape Navigator 7096099b8a Use PStore instead of filesystem (that was a bad idea, sorry) 2019-11-26 19:58:31 -06:00
Netscape Navigator 4b33674771 Ability to block and list blocks 2019-11-26 19:55:52 -06:00
Netscape Navigator 0c160251ef Squash this 2019-11-26 19:53:54 -06:00
Netscape Navigator 99ed146ee3 === BEGIN FILESYSTEM REMOVAL === 2019-11-26 19:46:50 -06:00
Netscape Navigator ed0ee3520f Tests for KeyPair#sign 2019-10-26 18:15:28 -05:00
Netscape Navigator b083b7f855 Tests for `delete_config` 2019-10-26 18:13:06 -05:00
Netscape Navigator d71f1d1498 Test for render_without_signature 2019-10-21 20:35:48 -05:00
Netscape Navigator cb13fbe57a Add second message to scratchpad.sh 2019-10-21 20:04:35 -05:00
Netscape Navigator 1ef6d4e6ce WIP 2019-10-20 21:11:16 -05:00
Netscape Navigator a2db4e3cdd [UNSTABLE] Fix test, begin `message sign` 2019-10-19 22:43:21 -05:00
Netscape Navigator 1232151df9 `message show` CLI command 2019-10-19 15:48:17 -05:00
Netscape Navigator 6c04082b85 Ability to append to messages 2019-10-19 15:29:29 -05:00
Netscape Navigator 3f1f2d6223 Tests for templates. 2019-10-19 13:26:44 -05:00
Netscape Navigator 729ca8145f Template renderer 2019-10-19 13:14:09 -05:00
Netscape Navigator b439746cf5 Rename *_conf to *_config, add `timestamp` to ::Message initializer. 2019-10-12 15:40:16 -05:00
Netscape Navigator 999af42410 Derive pub/priv key from stored seed.
Co-authored-by: Michael Christenson II <m3talsmith@gmail.com>
2019-10-12 15:25:17 -05:00
Netscape Navigator 9953bcee2c Update spec, begin message implementation 2019-10-12 14:43:27 -05:00
Netscape Navigator fd517e6117 Done with tests. TODO: Message management, bundler, codecov badge (v. important) 2019-10-09 20:27:48 -05:00
Netscape Navigator 40a8a46aa4 Add FakeFS gem to test suite 2019-10-09 19:43:23 -05:00
Netscape Navigator 63b2ac99ed Add logo 2019-10-09 19:32:54 -05:00
Netscape Navigator e3ac894ac2 Tests for Pigeon::KeyPair 2019-10-06 12:57:55 -05:00