Add basic JWT authentication for app API
This commit is contained in:
parent
7ad2ed8ff1
commit
3825263fa3
14 changed files with 289 additions and 40 deletions
|
@ -8,7 +8,7 @@ use i2p::net::I2pSocketAddr;
|
|||
use serde::{Serialize, Deserialize};
|
||||
use state::{State, types::{MessageId, PeerId}, CommState, ApiState};
|
||||
|
||||
mod api;
|
||||
pub mod api;
|
||||
pub mod comm;
|
||||
pub mod config;
|
||||
pub mod state;
|
||||
|
@ -31,7 +31,7 @@ impl Ubisync {
|
|||
let comm_handle = Arc::new(CommHandle::new(CommState::new(state.clone()), config)?);
|
||||
state.set_comm_handle(comm_handle.clone());
|
||||
|
||||
let api = Arc::new(ApiBuilder::from(config.api_config.clone()).build(ApiState::new(state.clone())).await);
|
||||
let api = Arc::new(ApiBuilder::from(config.api_config.clone()).build(ApiState::new(state.clone(), &config.jwt_secret)).await);
|
||||
|
||||
comm_handle.run().await;
|
||||
Ok(Ubisync {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue