65 Commits

Author SHA1 Message Date
Joonas Koivunen
cb664e11f8 fix: go back to using futures channels
we cannot simply replace async aware channels with crossbeam channels,
which cannot wake us up. keeping the channel buffer size at 1 to catch
any errors.
2020-03-17 10:34:43 +02:00
David Craven
d755576a17 Add boilerplate. 2020-03-13 13:53:55 +01:00
Joonas Koivunen
e0179d5ef4 add: test for loading go-ipfs 0.4.23 rsa key 2020-03-12 16:30:36 +02:00
Joonas Koivunen
6b780a767d add: tests for pem_to_der 2020-03-12 16:30:36 +02:00
Joonas Koivunen
53236d6665 fix: deny init with <= 2048 bit keys
this might need to be changed silently to 2048 if the tests use 1024 bit
keys.
2020-03-12 16:30:36 +02:00
Joonas Koivunen
5fb9add3c3 doc: add doc comments for config 2020-03-12 16:30:36 +02:00
Joonas Koivunen
abb6ef1e0a fix: warning on unused variable 2020-03-12 16:30:36 +02:00
Joonas Koivunen
f3e0b8a890 chore: cargo fmt 2020-03-12 16:30:36 +02:00
Joonas Koivunen
f690d51b8e fix: output the generated peerid in main 2020-03-12 16:30:36 +02:00
Joonas Koivunen
9b76a35275 fix: use base64pad instead of base64, field names 2020-03-12 16:30:36 +02:00
Joonas Koivunen
47b9d02a2a feat: rsa keygen using openssl with compat storage
taking on the openssl dependency is used for:

 - rsa key generation
 - from/to `pkcs#1` and `pkcs#8` transformations

Crate `rsa` was also considered but it does not support exporting keys
in any format at the moment and it's import code looks different from
`ring`s (this could be the case of not importing the "precomputed"
values in `rsa`).

The `pkcs#1` is (hopefully) used with go-ipfs-config/go-libp2p
compatible key storage but rust-libp2p/ring need the key in `pkcs#8` der
format. PEM parsing and PEM to DER was implemented by hand as it looked
like the existingly depended on crates are not compatible as much as
possible.
2020-03-12 16:30:36 +02:00
Joonas Koivunen
826755500a refactor: move v0::version in own module 2020-03-12 16:30:36 +02:00
Joonas Koivunen
992838f9a2 add: /api/v0/version with query args 2020-03-11 14:02:29 -04:00
Joonas Koivunen
c316a1c824 add: build metadata with vergen
this could be moved over to rust-ipfs but I think that people will
prefer to track their own binarys version (which is tracked hopefully in
a vcs) instead of their `rust-ipfs` deps version, which will be in their
`Cargo.lock` file.
2020-03-11 14:02:29 -04:00
Joonas Koivunen
e032d3d4aa
Http v0 for testing (#71)
* add first draft of the http api

* chore note on the difficulties with with_graceful_shutdown

* add the second required output line by js-ipfsd-ctl

* run cargo fmt for different formatting from rls?

* chore note on (stalled) progress

* add remaining cli args boilerplate

what is missing now is using ephemeral addresses with the warp, as
js-ipfsd-ctl doesn't always to shutdown the older one, or then it just
doesn't shut down correctly.

* fix bind to ephemeral localhost port

* add env_logger initialization

* fix faked multiaddr typo

never remember its "ip4" instead of "ipv4"

* fix do GET on every method in /id

for some reason js-ipfsd-ctl will do a POST against /api/v0/id.

* chore run cargo fmt

* Adding placeholder NOT_IMPLEMENTED endpiints

* rustfmt

* Feedback from PR

* Update http/Cargo.toml

Co-Authored-By: Joonas Koivunen <joonas@equilibrium.co>

Co-authored-by: Mark Robert Henderson <henderson.mark@gmail.com>
2020-03-05 21:38:44 +02:00