mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2025-03-12 08:01:42 +01:00
More fragmentation
This commit is contained in:
parent
4e60b5d767
commit
150b2e68d9
13
Cargo.lock
generated
13
Cargo.lock
generated
@ -70,6 +70,15 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "api"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"capnp",
|
||||||
|
"capnpc",
|
||||||
|
"walkdir",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayref"
|
name = "arrayref"
|
||||||
version = "0.3.6"
|
version = "0.3.6"
|
||||||
@ -602,15 +611,14 @@ dependencies = [
|
|||||||
name = "diflouroborane"
|
name = "diflouroborane"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"api",
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"async-native-tls",
|
"async-native-tls",
|
||||||
"async-oneshot",
|
"async-oneshot",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bincode",
|
"bincode",
|
||||||
"capnp",
|
"capnp",
|
||||||
"capnp-futures",
|
|
||||||
"capnp-rpc",
|
"capnp-rpc",
|
||||||
"capnpc",
|
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
"erased-serde",
|
"erased-serde",
|
||||||
@ -637,7 +645,6 @@ dependencies = [
|
|||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"uuid",
|
"uuid",
|
||||||
"walkdir",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
10
Cargo.toml
10
Cargo.toml
@ -57,10 +57,9 @@ tracing = "0.1.28"
|
|||||||
tracing-subscriber = "0.2.25"
|
tracing-subscriber = "0.2.25"
|
||||||
|
|
||||||
# API
|
# API
|
||||||
capnp = "0.14.3"
|
api = { path = "api" }
|
||||||
capnpc = "0.14.4"
|
capnp = "0.14"
|
||||||
capnp-rpc = "0.14.1"
|
capnp-rpc = "0.14.1"
|
||||||
capnp-futures = "0.14.1"
|
|
||||||
|
|
||||||
# API Authentication
|
# API Authentication
|
||||||
rsasl = "1.4.0" # TODO update this if bindgen breaks (again)
|
rsasl = "1.4.0" # TODO update this if bindgen breaks (again)
|
||||||
@ -76,11 +75,6 @@ erased-serde = "0.3"
|
|||||||
serde_dhall = { version = "0.10.1", default-features = false }
|
serde_dhall = { version = "0.10.1", default-features = false }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
capnpc = "0.14.4"
|
|
||||||
# Used in build.rs to iterate over all files in schema/
|
|
||||||
walkdir = "2.3.2"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
futures-test = "0.3.16"
|
futures-test = "0.3.16"
|
||||||
tempfile = "3.2"
|
tempfile = "3.2"
|
||||||
|
@ -2,7 +2,15 @@
|
|||||||
name = "api"
|
name = "api"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
build = "build.rs"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
capnp = "0.14.3"
|
||||||
|
capnpc = "0.14.4"
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
capnpc = "0.14.4"
|
||||||
|
# Used in build.rs to iterate over all files in schema/
|
||||||
|
walkdir = "2.3.2"
|
||||||
|
@ -8,14 +8,8 @@ fn is_hidden(entry: &DirEntry) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Tell cargo to only run this script if the schema files or this script have changed
|
|
||||||
println!("cargo:rerun-if-changed=schema");
|
|
||||||
|
|
||||||
let mut compile_command = ::capnpc::CompilerCommand::new();
|
let mut compile_command = ::capnpc::CompilerCommand::new();
|
||||||
|
compile_command.src_prefix("schema");
|
||||||
// Set parent module of all generated schema files.
|
|
||||||
// i.e. a file "user.capnp" will result in module "schema::user"
|
|
||||||
compile_command.default_parent_module(vec!["schema".into()]);
|
|
||||||
|
|
||||||
for entry in WalkDir::new("schema")
|
for entry in WalkDir::new("schema")
|
||||||
.max_depth(2)
|
.max_depth(2)
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 3023fb22598980352f0865825f6d91ce5f20754e
|
Subproject commit f713df2221727f2f9535be4c4c9ae36de77c1a63
|
@ -1,8 +1,41 @@
|
|||||||
#[cfg(test)]
|
pub use capnpc::schema_capnp;
|
||||||
mod tests {
|
|
||||||
#[test]
|
#[allow(dead_code)]
|
||||||
fn it_works() {
|
pub mod auth_capnp {
|
||||||
let result = 2 + 2;
|
include!(concat!(env!("OUT_DIR"), "/auth_capnp.rs"));
|
||||||
assert_eq!(result, 4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub mod main_capnp {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/main_capnp.rs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub mod utils_capnp {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/utils_capnp.rs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub mod resource_capnp {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/resource_capnp.rs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub mod resources_capnp {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/resources_capnp.rs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub mod role_capnp {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/role_capnp.rs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub mod user_capnp {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/user_capnp.rs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub mod users_capnp {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/users_capnp.rs"));
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#![forbid(unused_imports)]
|
#![forbid(unused_imports)]
|
||||||
|
#![warn(missing_docs, missing_debug_implementations)]
|
||||||
|
|
||||||
|
|
||||||
pub mod config;
|
|
||||||
pub mod db;
|
pub mod db;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
pub mod network;
|
pub mod network;
|
||||||
pub mod oid;
|
pub mod oid;
|
||||||
pub mod permissions;
|
pub mod permissions;
|
||||||
pub mod resource;
|
pub mod resource;
|
||||||
pub mod schema;
|
|
||||||
pub mod state;
|
pub mod state;
|
||||||
pub mod varint;
|
pub mod varint;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//! oid crate by https://github.com/UnnecessaryEngineering/oid turned into vendore'd module
|
//! oid crate by <https://github.com/UnnecessaryEngineering/oid> turned into vendore'd module
|
||||||
//!
|
//!
|
||||||
//! [Object Identifiers] are a standard of the [ITU] used to reference objects, things, and
|
//! [Object Identifiers] are a standard of the [ITU] used to reference objects, things, and
|
||||||
//! concepts in a globally unique way. This crate provides for data structures and methods
|
//! concepts in a globally unique way. This crate provides for data structures and methods
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
pub use capnpc::schema_capnp;
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod auth_capnp {
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/schema/auth_capnp.rs"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod main_capnp {
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/schema/main_capnp.rs"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod utils_capnp {
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/schema/utils_capnp.rs"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod resource_capnp {
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/schema/resource_capnp.rs"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod resources_capnp {
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/schema/resources_capnp.rs"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod role_capnp {
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/schema/role_capnp.rs"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod user_capnp {
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/schema/user_capnp.rs"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod users_capnp {
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/schema/users_capnp.rs"));
|
|
||||||
}
|
|
@ -113,6 +113,7 @@ impl_convert_from_to!(u32, 5, VarU32);
|
|||||||
impl_convert_from_to!(u64, 10, VarU64);
|
impl_convert_from_to!(u64, 10, VarU64);
|
||||||
impl_convert_from_to!(u128, 19, VarU128);
|
impl_convert_from_to!(u128, 19, VarU128);
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[cfg(target_pointer_width = "64")]
|
#[cfg(target_pointer_width = "64")]
|
||||||
type VarUsize = VarU64;
|
type VarUsize = VarU64;
|
||||||
#[cfg(target_pointer_width = "32")]
|
#[cfg(target_pointer_width = "32")]
|
||||||
|
@ -7,7 +7,7 @@ use serde::{Serialize, Deserialize, Deserializer, Serializer};
|
|||||||
use std::fmt::Formatter;
|
use std::fmt::Formatter;
|
||||||
use std::net::{SocketAddr, IpAddr, ToSocketAddrs};
|
use std::net::{SocketAddr, IpAddr, ToSocketAddrs};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use crate::permissions::{PermRule, RoleIdentifier};
|
use diflouroborane::permissions::{PermRule, RoleIdentifier};
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
|
|
||||||
type Result<T> = std::result::Result<T, serde_dhall::Error>;
|
type Result<T> = std::result::Result<T, serde_dhall::Error>;
|
@ -5,10 +5,12 @@ use std::{
|
|||||||
};
|
};
|
||||||
use clap::{App, Arg, crate_version, crate_description, crate_name};
|
use clap::{App, Arg, crate_version, crate_description, crate_name};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use diflouroborane::{config, error::Error};
|
use diflouroborane::{error::Error};
|
||||||
use diflouroborane::db::{Databases, Dump};
|
use diflouroborane::db::{Databases, Dump};
|
||||||
use std::net::ToSocketAddrs;
|
use std::net::ToSocketAddrs;
|
||||||
|
|
||||||
|
mod config;
|
||||||
|
|
||||||
fn main() -> Result<(), Error> {
|
fn main() -> Result<(), Error> {
|
||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
// Argument parsing
|
// Argument parsing
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
strict digraph connection {
|
strict digraph connection {
|
||||||
Establish [label="TCP/SCTP connection established"];
|
Establish [label="TCP/SCTP connection established"];
|
||||||
Closed [label="TCP/SCTP connection closed"];
|
Closed [label="TCP/SCTP connection closed"];
|
||||||
|
Open;
|
||||||
|
SASL;
|
||||||
|
Authenticated;
|
||||||
|
STARTTLS;
|
||||||
|
Encrypted;
|
||||||
|
|
||||||
Establish -> Open [label=open];
|
Establish -> Open [label=open];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user