update docs

This commit is contained in:
creating2morrow 2024-04-09 23:58:41 -04:00
parent 3b6e34119d
commit 91d4ce3966
16 changed files with 56 additions and 27 deletions

View file

@ -51,13 +51,13 @@ curl -iv http://localhost:9044/contacts
## send message
```bash
curl -ivk http://localhost:9045/tx -d '{"uid":"123", "mid": "", "body": [1,2,3 <PLAINTEXT_BYTES>], "from": "alice.b32.i2p", "created": 0, "to": "bob.b32.i2p"}' -H 'Content-Type: application/json'
curl -ivk http://localhost:9045/tx -d '{"uid":"123", "mid": "", "body": "string", "from": "alice.b32.i2p", "created": 0, "to": "bob.b32.i2p"}' -H 'Content-Type: application/json'
```
## receive message
```bash
curl -iv http://alice.b32.i2p/message/rx -d '{"uid":"", "mid": "", "body": [1,2,3 <ENCRYPTED_BYTES>], "from": "bob.b32.i2p", "created": 0, "to": "alice.b32.i2p"}' -H 'Content-Type: application/json' -H 'proof: eyJhbGciOiJIUzUxMiJ9...'
curl -iv http://alice.b32.i2p/message/rx -d '{"uid":"", "mid": "", "body": "string", "from": "bob.b32.i2p", "created": 0, "to": "alice.b32.i2p"}' -H 'Content-Type: application/json' -H 'proof: eyJhbGciOiJIUzUxMiJ9...'
```
## view messages

View file

@ -1,3 +1,4 @@
//! core command line arguments
use clap::Parser;
/// cmd line args

View file

@ -1,3 +1,5 @@
//! Internal authorization module that uses JWTs
use crate::{
args,
db,

View file

@ -1,4 +1,5 @@
// db created and exported from here
//! Primary LMDB interface for read, write, delete etc.
extern crate lmdb_rs as lmdb;
use lmdb::{

View file

@ -1,3 +1,5 @@
//! Marketplace disputes operations module
use std::error::Error;
use crate::{

View file

@ -1,3 +1,5 @@
//! TODO: replace i2p-zero with i2pd bindings
use crate::{
args,
utils,

View file

@ -1,23 +1,24 @@
pub mod args; // command line arguments
pub mod auth; // internal auth repo/service layer
pub mod contact; // contact repo/service layer
pub mod neveko25519; // cipher logic
pub mod dispute; // dispute repo/service layer
pub mod db; // lmdb interface
pub mod i2p; // i2p repo/service layer
pub mod message; // message repo/service layer
pub mod models; // db structs
pub mod monero; // monero-wallet-rpc interface
pub mod order; // order repo/service layer
pub mod product; // product repo/service layer
pub mod proof; // external auth/payment proof module
pub mod reqres; // http request/responses
pub mod user; // user repo/service layer
pub mod utils; // misc.
pub mod args;
pub mod auth;
pub mod contact;
pub mod neveko25519;
pub mod dispute;
pub mod db;
pub mod i2p;
pub mod message;
pub mod models;
pub mod monero;
pub mod order;
pub mod product;
pub mod proof;
pub mod reqres;
pub mod user;
pub mod utils;
pub const APP_NAME: &str = "neveko";
pub const NEVEKO_JWP_SECRET_KEY: &str = "NEVEKO_JWP_SECRET_KEY";
pub const NEVEKO_JWT_SECRET_KEY: &str = "NEVEKO_JWT_SECRET_KEY";
pub const NEVEKO_NMPK: &str = "NEVEKO_NMPK";
// LMDB Keys
pub const AUTH_DB_KEY: &str = "a";

View file

@ -1,4 +1,5 @@
// Message repo/service layer
//! Message processing module
use crate::{
contact,
db,

View file

@ -1,3 +1,5 @@
//! Custom object relational mapping (ORM) for structs into LMBD
use crate::utils;
use rocket::serde::{
json::Json,

View file

@ -1,3 +1,5 @@
//! TODO: replace with monero bindings
use crate::{
args,
i2p,

View file

@ -1,3 +1,5 @@
//! Marketplace order logic module
use std::error::Error;
use crate::{

View file

@ -1,4 +1,5 @@
// Product repo/service layer
//! Marketplace products upload, modification, etc module
use crate::{
db,
models::*,

View file

@ -1,3 +1,5 @@
//! External authorization module via JWPs
use crate::{
db,
monero,

View file

@ -1,3 +1,5 @@
//! Structs for all http requests
use crate::utils;
use serde::{
Deserialize,

View file

@ -1,4 +1,6 @@
// User repo/service layer
//! TODO(c2m): remove this module since there is only support for a single
//! authenticated user
use crate::{
db,
models::*,
@ -11,10 +13,6 @@ use log::{
};
use rocket::serde::json::Json;
// This module is only used for remote access
// TODO(c2m): remove this module since there is only support for a single
// authenticated user
/// Create a new user
pub fn create(address: &String) -> User {
let f_uid: String = format!("{}{}", crate::USER_DB_KEY, utils::generate_rnd());

View file

@ -1,7 +1,17 @@
//! Generic functions for startup and convenience
use crate::{
args, contact, db, dispute, i2p, message, models, monero, neveko25519, reqres, utils
args,
contact,
db,
dispute,
i2p,
message,
models,
monero,
neveko25519,
reqres,
utils,
};
use clap::Parser;
use log::{