mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-27 18:42:17 +03:00
Merge branch 'jf/invite' of github.com:uqbar-dao/uqbar into jf/invite
This commit is contained in:
commit
529234f1bd
@ -1,6 +1,6 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use dotenv;
|
use dotenv;
|
||||||
use ethers::prelude::{namehash};
|
use ethers::prelude::namehash;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::{mpsc, oneshot};
|
use tokio::sync::{mpsc, oneshot};
|
||||||
|
@ -140,8 +140,10 @@ async fn handle_keyfile_vet(
|
|||||||
|
|
||||||
let keyfile_vetted = KeyfileVetted {
|
let keyfile_vetted = KeyfileVetted {
|
||||||
username: decoded_keyfile.username,
|
username: decoded_keyfile.username,
|
||||||
networking_key: format!("0x{}", hex::encode
|
networking_key: format!(
|
||||||
(decoded_keyfile.networking_keypair.public_key().as_ref())),
|
"0x{}",
|
||||||
|
hex::encode(decoded_keyfile.networking_keypair.public_key().as_ref())
|
||||||
|
),
|
||||||
routers: decoded_keyfile.routers,
|
routers: decoded_keyfile.routers,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -180,16 +182,18 @@ async fn handle_boot(
|
|||||||
Keyfile {
|
Keyfile {
|
||||||
username: our.name.clone(),
|
username: our.name.clone(),
|
||||||
routers: our.allowed_routers.clone(),
|
routers: our.allowed_routers.clone(),
|
||||||
networking_keypair: signature::Ed25519KeyPair
|
networking_keypair: signature::Ed25519KeyPair::from_pkcs8(networking_keypair.as_ref())
|
||||||
::from_pkcs8(networking_keypair.as_ref()).unwrap(),
|
.unwrap(),
|
||||||
jwt_secret_bytes: jwt_secret.to_vec(),
|
jwt_secret_bytes: jwt_secret.to_vec(),
|
||||||
file_key: keygen::generate_file_key(),
|
file_key: keygen::generate_file_key(),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
match keygen::decode_keyfile(encoded_keyfile.clone(), &info.password) {
|
match keygen::decode_keyfile(encoded_keyfile.clone(), &info.password) {
|
||||||
Ok(k) => {
|
Ok(k) => {
|
||||||
our.networking_key = format!("0x{}", hex::encode
|
our.networking_key = format!(
|
||||||
(k.networking_keypair.public_key().as_ref()));
|
"0x{}",
|
||||||
|
hex::encode(k.networking_keypair.public_key().as_ref())
|
||||||
|
);
|
||||||
k
|
k
|
||||||
}
|
}
|
||||||
Err(_) => return Err(warp::reject()),
|
Err(_) => return Err(warp::reject()),
|
||||||
|
Loading…
Reference in New Issue
Block a user