-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relays and mailboxes #3
Merged
Merged
Changes from 83 commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
6745b72
initial Relay implementation
pavlo-liapin c2ef4eb
fix some linter errors
pavlo-liapin 709655c
stub for Mailbox
pavlo-liapin 24f1e8f
move some more code from CoffeeScript
pavlo-liapin 5857792
encode/decode UTF8 strings in mailboxes
pavlo-liapin 98de3c1
add more options to create a mailbox
pavlo-liapin cde5a2c
add initial relay operations
pavlo-liapin 2f80539
add message status test
pavlo-liapin 08ac31a
fix the count test
pavlo-liapin b8b10dd
add mailbox download test
pavlo-liapin 58ecec8
add delete tests
pavlo-liapin fae838e
add message status test
pavlo-liapin 54e5555
add first file commands and tests
pavlo-liapin f1dd9f1
add file status and metadata test
pavlo-liapin beeb6ff
add download file logic
pavlo-liapin 9a82e36
add delete file command
pavlo-liapin 9501b5e
refactor Relay code
pavlo-liapin 9968b08
more Relay refactorings
pavlo-liapin 37b04db
further Relay optimizations
pavlo-liapin 5e2c7c5
remove unneeded private method
pavlo-liapin 20701aa
optimize _makeNonce method
pavlo-liapin d2fb5a2
better itoa method
pavlo-liapin 987f8bb
move test.zip out of src
pavlo-liapin f98f780
move file commands from Relay to Mailbox API
pavlo-liapin 9032e83
move message Zax commands to Mailbox
pavlo-liapin bf74890
optimize some constructors
pavlo-liapin e30403b
further constructor optimizations
pavlo-liapin d0fe25c
optimize optional properties
pavlo-liapin 0616af3
move mailbox tests to appropriate directory
pavlo-liapin 5db0c0d
incremental improvents
pavlo-liapin 4309d67
decrypt messages after download
pavlo-liapin 32b6fcb
optimize h2() input
pavlo-liapin 3e36536
optimize base64 conversions
pavlo-liapin ff212f5
optimize symmetric encryption
pavlo-liapin 7960f9e
optmize Zax command response parsing
pavlo-liapin 05dbfbf
fix some linter warnings
pavlo-liapin 9bbb6dd
move runCommand encryption logic to Mailbox
pavlo-liapin 4b001e9
refactor Relay
pavlo-liapin dbfd697
optimize Relay code
pavlo-liapin 883b8e1
move connectMailbox logic to Mailbox
pavlo-liapin 36205df
add some comments
pavlo-liapin 7553575
add more comments and typings to Mailbox
pavlo-liapin 9a34563
more comments for Mailbox
pavlo-liapin cf61133
add more comments to Mailbox
pavlo-liapin f1dbdcd
move Zax interfaces to a separate file
pavlo-liapin 5290d41
improvements to Relay class per CR
pavlo-liapin e9ca70c
extend some Mailbox tests
pavlo-liapin 118429c
make Mailbox.download method more readable
pavlo-liapin 2aea172
optimize Mailbox file test
pavlo-liapin 42a5d8f
generate a file for Mailbox file test in the test itself
pavlo-liapin 6ceb987
move test relay URL to config and add README section about tests
pavlo-liapin 48d6896
refactor Mailbox static intializers
pavlo-liapin 807d20a
add some eslint exceptions
pavlo-liapin 1c889db
some minor refactoring
pavlo-liapin 27bfe8c
add an ability to upload encrypted plaintext messages
pavlo-liapin b003ca3
remove RELAY_SESSION_TIMEOUT usage from KeyRing
pavlo-liapin 72c42ae
don't store relayPublicKey in Relay
pavlo-liapin bdfbed5
add RelaysService
pavlo-liapin cc314fb
remove useless verification
pavlo-liapin b9e7a4b
make Relay constuctor private and add a static `new` method
pavlo-liapin 47e8460
move nonce helper to NaCl driver
pavlo-liapin 3980443
move raw encode/decode methods to NaCl driver
pavlo-liapin 742622b
refactor Relay/Mailbox
pavlo-liapin d26f8b5
fix lint errors
pavlo-liapin ae06043
further optimizations to Mailbox/Relay
pavlo-liapin 98c0b05
more refactoring
pavlo-liapin 6cceaca
fixes per CR
pavlo-liapin 475b73e
update dependencies
pavlo-liapin acb252c
turn off some ESLint rules
pavlo-liapin 93f1d66
fixes per CR
pavlo-liapin 94ef178
tag all comments with the class name
pavlo-liapin cae01ea
fixes per CR
pavlo-liapin 542d43e
fixes per CR
pavlo-liapin 1858e28
remove temporary keys
pavlo-liapin a5e9608
log network errors
pavlo-liapin 4029aa2
add mutex
pavlo-liapin cba87a8
move relay factory to Relay class as a static method
pavlo-liapin 0a19d2d
consider session timeouts
pavlo-liapin 5099039
fixes per CR
pavlo-liapin 1b290da
update NaclDriver interface to be more consistent
pavlo-liapin 7b0aee2
move RelayCommand to zax.interface.ts
pavlo-liapin 60f12c1
move some method wrappers from NaCl Driver to NaCl singleton
pavlo-liapin 3318841
optimize httpCall error message
pavlo-liapin 777f17b
remove try-catch for HTTP calls
pavlo-liapin 15c1d31
minor refactorings per CR
pavlo-liapin 05046a8
make NaCl constructor private to prevent unintended usage
pavlo-liapin 5c10662
remove unnecessary methods
pavlo-liapin 9da743c
Move static encryption methods to a separate helper
pavlo-liapin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
# glow.ts | ||
Client library for interacting with Zax Cryptographic Relay | ||
|
||
## Running tests | ||
|
||
Unit tests are powered by [Jest](https://jestjs.io). The engine runs all the tests in each `describe` section serially in the order they are described in the `.spec.ts` file. | ||
By default, unit tests connect to a remote [Zax](https://github.com/vault12/zax) Cryptographic Relay Server on `https://z.vault12.com`. | ||
You may also run tests on a local or any other test server by modifying the code in [src/tests.helper.ts#L1](src/tests.helper.ts#L1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
export const config = { | ||
|
||
COMM_KEY_TAG: '__::commKey::__', | ||
NONCE_TAG: '__nc', | ||
STORAGE_ROOT: '.v2.stor.vlt12', | ||
// Relay tokens, keys and hashes are 32 bytes | ||
RELAY_TOKEN_LEN: 32, | ||
|
||
RELAY_TOKEN_B64: 44, | ||
|
||
// 5 min - Matched with config.x.relay.token_timeout | ||
// 5 min - Token expiration on the server side, matched with config.x.relay.token_timeout on Zax server | ||
RELAY_TOKEN_TIMEOUT: 5 * 60 * 1000, | ||
|
||
// 15 min - Matched with config.x.relay.session_timeout | ||
RELAY_SESSION_TIMEOUT: 15 * 60 * 1000 | ||
// 5 sec - Ajax request timeout | ||
RELAY_AJAX_TIMEOUT: 5 * 1000 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used now,
Mailbox
reconnects whenRelay
's token expires