-
Notifications
You must be signed in to change notification settings - Fork 4
Testing Milestone 3
First, run Fennel Protocol as a dev node:
$ ./scripts/setup.sh
$ ./scripts/build-run.shThen, within the fennel-server repo, run:
$ cargo runIn the fennel-cli repo, run
$ cargo runto produce a readout of available commands.
The CLI supports account creation. When executing the create-identity command, a Fennel Server Packet is generated and passed to the Fennel Protocol API, and creates a new identity. Upon return of the event, the CLI then inserts the returned index into the Fennel Server database, and associates the index with the account which created the identity.
The specification document for the Whiteflag Protocol V1 is outlined here and a full implementation of version 1 exists in java here. For milestone 3, the goal was to deliver the minimum implementation of the Whiteflag Protocol V1 in rust. According to section 2.5 in the specification document, there are two components necessary for a minimum implementation:
- the A message with at least one authentication option;
- the possibility to Recall, Update and Discontinue (Reference Codes 1, 2 and 4) any implemented sign or signal, if such Reference Type is valid i.a.w. Reference options.
The java codebase implementation was used as a reference point for implementing the Whiteflag Protocol V1 into the fennel-lib repository. The units tests were also ported over and used to verify that the protocol was implemented properly in the rust codebase.
Whiteflag is a message based system with different kinds of messages and each kind of message has its own fields. The authentication message is a kind of message and its fields are outlined in section 4.3.4.1 of the specification document.
Authentication messages are used in whiteflag to establish a reference to the identity of the user. For every session, the creation of an authentication message is the first message a user must send in order to interact with whiteflag. The discontinue authentication message is the last message a user sends to signal the end of that interaction.
The "reference code" is the Reference Indicator field, which is a field contained in the header of every whiteflag message. Every kind of message has a header portion and its fields are outlined in section 4.2.1 of the specification document.
- 1: Recall
- 2: Update
- 4: Discontinue
There are some important files to highlight in the fennel-lib repository:
- field definitions:
src/whiteflag/wf_core/definitions.rs - field tests:
src/whiteflag/wf_core/field_tests.rs - message tests:
src/whiteflag/wf_core/message_tests.rs
A whiteflag message is composed of a header and a body. Both the header and body are arrays of fields. Every message shares the same base fields as their header, but unique body fields. In wf_core/definitions.rs, generic_header_fields() returns the array of fields needed for the header of any message and authentication_body_fields() returns the array of fields needed for an authentication message body. The ReferenceIndicator field is defined within the array of generic header fields.
The encoding used is specified at the field level. That is, each field has a specific encoding it uses. Every kind of encoding is validated in the wf_core/field_tests.rs at the field level.
The encoding and decoding processes are validated at the message level in wf_core/message_tests.rs. There are two authentication message tests: encode_auth_message() and decode_auth_message(). These tests demonstrate a successful implementation of a whiteflag authentication message that uses the authentication option, which is the VerificationMethod field, of code 1 (section 4.3.4.2 of specification document).