Update outdated libraries and add helper make argument.

This commit is contained in:
William Brown 2020-04-11 10:32:56 +10:00
parent 29d99654c3
commit b8f906ed36
12 changed files with 376 additions and 405 deletions

713
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -14,3 +14,7 @@ doc-local:
install-tools-local: install-tools-local:
cd kanidm_tools && cargo install --path . --force cd kanidm_tools && cargo install --path . --force
prep:
cargo outdated -R
cargo audit

View file

@ -11,14 +11,14 @@ repository = "https://github.com/kanidm/kanidm/"
[dependencies] [dependencies]
log = "0.4" log = "0.4"
env_logger = "0.6" env_logger = "0.7"
reqwest = { version = "0.10", features=["blocking", "cookies", "json", "native-tls"] } reqwest = { version = "0.10", features=["blocking", "cookies", "json", "native-tls"] }
kanidm_proto = { path = "../kanidm_proto", version = "0.1" } kanidm_proto = { path = "../kanidm_proto", version = "0.1" }
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
toml = "0.5" toml = "0.5"
uuid = { version = "0.7", features = ["serde", "v4"] } uuid = { version = "0.8", features = ["serde", "v4"] }
[dev-dependencies] [dev-dependencies]
tokio = "0.2" tokio = "0.2"

View file

@ -12,7 +12,7 @@ repository = "https://github.com/kanidm/kanidm/"
[dependencies] [dependencies]
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
uuid = { version = "0.7", features = ["serde", "v4"] } uuid = { version = "0.8", features = ["serde", "v4"] }
# actix = { version = "0.9", optional = true } # actix = { version = "0.9", optional = true }
zxcvbn = { version = "2.0", features = ["ser"] } zxcvbn = { version = "2.0", features = ["ser"] }
base32 = "0.4" base32 = "0.4"

View file

@ -29,13 +29,13 @@ path = "src/badlist_preprocess.rs"
[dependencies] [dependencies]
kanidm_client = { path = "../kanidm_client", version = "0.1" } kanidm_client = { path = "../kanidm_client", version = "0.1" }
kanidm_proto = { path = "../kanidm_proto", version = "0.1" } kanidm_proto = { path = "../kanidm_proto", version = "0.1" }
rpassword = "0.4" rpassword = "4.0"
structopt = { version = "0.2", default-features = false } structopt = { version = "0.3", default-features = false }
log = "0.4" log = "0.4"
env_logger = "0.6" env_logger = "0.7"
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
shellexpand = "1.0" shellexpand = "2.0"
rayon = "1.2" rayon = "1.2"
zxcvbn = "2.0" zxcvbn = "2.0"

View file

@ -44,23 +44,23 @@ kanidm_client = { path = "../kanidm_client", version = "0.1" }
kanidm_proto = { path = "../kanidm_proto", version = "0.1" } kanidm_proto = { path = "../kanidm_proto", version = "0.1" }
kanidm = { path = "../kanidmd" } kanidm = { path = "../kanidmd" }
toml = "0.5" toml = "0.5"
rpassword = "0.4" rpassword = "4.0"
tokio = { version = "0.2", features=["full"] } tokio = { version = "0.2", features=["full"] }
tokio-util = { version = "0.2", features = ["codec"] } tokio-util = { version = "0.3", features = ["codec"] }
futures = "0.3" futures = "0.3"
bytes = "0.5" bytes = "0.5"
libc = "0.2" libc = "0.2"
log = "0.4" log = "0.4"
env_logger = "0.6" env_logger = "0.7"
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
serde_cbor = "0.10" serde_cbor = "0.11"
structopt = { version = "0.2", default-features = false } structopt = { version = "0.3", default-features = false }
rusqlite = { version = "0.20", features = ["backup"] } rusqlite = { version = "0.21" }
r2d2 = "0.8" r2d2 = "0.8"
r2d2_sqlite = "0.12" r2d2_sqlite = "0.14"
reqwest = { version = "0.10" } reqwest = { version = "0.10" }

View file

@ -29,8 +29,7 @@ impl Decoder for ClientCodec {
} }
} }
impl Encoder for ClientCodec { impl Encoder<ClientRequest> for ClientCodec {
type Item = ClientRequest;
type Error = IoError; type Error = IoError;
fn encode(&mut self, msg: ClientRequest, dst: &mut BytesMut) -> Result<(), Self::Error> { fn encode(&mut self, msg: ClientRequest, dst: &mut BytesMut) -> Result<(), Self::Error> {

View file

@ -38,8 +38,7 @@ impl Decoder for ClientCodec {
} }
} }
impl Encoder for ClientCodec { impl Encoder<ClientResponse> for ClientCodec {
type Item = ClientResponse;
type Error = io::Error; type Error = io::Error;
fn encode(&mut self, msg: ClientResponse, dst: &mut BytesMut) -> Result<(), Self::Error> { fn encode(&mut self, msg: ClientResponse, dst: &mut BytesMut) -> Result<(), Self::Error> {

View file

@ -34,28 +34,28 @@ actix-session = "0.3"
actix-files = "0.2" actix-files = "0.2"
log = "0.4" log = "0.4"
env_logger = "0.6" env_logger = "0.7"
rand = "0.6" rand = "0.7"
chrono = "0.4" chrono = "0.4"
cookie = "0.11" cookie = "0.13"
regex = "1" regex = "1"
lazy_static = "1.2.0" lazy_static = "1.2.0"
lru = "0.1" # lru = "0.1"
tokio = "0.2" tokio = "0.2"
futures = "0.3" futures = "0.3"
uuid = { version = "0.7", features = ["serde", "v4" ] } uuid = { version = "0.8", features = ["serde", "v4" ] }
serde = "1.0" serde = "1.0"
serde_cbor = "0.10" serde_cbor = "0.11"
serde_json = "1.0" serde_json = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
rusqlite = { version = "0.20", features = ["backup"] } rusqlite = { version = "0.21", features = ["backup"] }
r2d2 = "0.8" r2d2 = "0.8"
r2d2_sqlite = "0.12" r2d2_sqlite = "0.14"
structopt = { version = "0.2", default-features = false } structopt = { version = "0.3", default-features = false }
time = "0.1" time = "0.1"
concread = "0.1" concread = "0.1"
@ -63,7 +63,7 @@ concread = "0.1"
openssl = "0.10" openssl = "0.10"
sshkeys = "0.1" sshkeys = "0.1"
rpassword = "0.4" rpassword = "4.0"
num_cpus = "1.10" num_cpus = "1.10"
idlset = { version = "0.1" , features = ["use_smallvec"] } idlset = { version = "0.1" , features = ["use_smallvec"] }

View file

@ -27,6 +27,11 @@ FROM run_base
MAINTAINER william@blackhats.net.au MAINTAINER william@blackhats.net.au
EXPOSE 8443 EXPOSE 8443
WORKDIR /
COPY --from=builder /home/kanidm/target/release/kanidmd /sbin/
VOLUME /data
ENV RUST_BACKTRACE 1 ENV RUST_BACKTRACE 1
CMD ["/sbin/kanidmd", "server", "-D", "/data/kanidm.db", "-C", "/data/ca.pem", "-c", "/data/cert.pem", "-k", "/data/key.pem", "--bindaddr", "0.0.0.0:8443"] CMD ["/sbin/kanidmd", "server", "-D", "/data/kanidm.db", "-C", "/data/ca.pem", "-c", "/data/cert.pem", "-k", "/data/key.pem", "--bindaddr", "0.0.0.0:8443"]

View file

@ -5,7 +5,6 @@ use idlset::IDLBitRange;
use kanidm_proto::v1::{ConsistencyError, OperationError}; use kanidm_proto::v1::{ConsistencyError, OperationError};
use r2d2::Pool; use r2d2::Pool;
use r2d2_sqlite::SqliteConnectionManager; use r2d2_sqlite::SqliteConnectionManager;
use rusqlite::types::ToSql;
use rusqlite::OptionalExtension; use rusqlite::OptionalExtension;
use rusqlite::NO_PARAMS; use rusqlite::NO_PARAMS;
use std::convert::TryFrom; use std::convert::TryFrom;
@ -121,7 +120,7 @@ pub trait IdlSqliteTransaction {
); );
let i: Option<i64> = try_audit!( let i: Option<i64> = try_audit!(
audit, audit,
stmt.query_row_named(&[(":tname", &tname as &dyn ToSql)], |row| row.get(0)), stmt.query_row_named(&[(":tname", &tname)], |row| row.get(0)),
"SQLite Error {:?}", "SQLite Error {:?}",
OperationError::SQLiteError OperationError::SQLiteError
); );

View file

@ -35,7 +35,7 @@ pub fn password_from_random() -> String {
} }
pub fn readable_password_from_random() -> String { pub fn readable_password_from_random() -> String {
let mut trng = thread_rng(); let trng = thread_rng();
format!( format!(
"{}-{}-{}-{}", "{}-{}-{}-{}",
trng.sample_iter(&DistinctAlpha).take(4).collect::<String>(), trng.sample_iter(&DistinctAlpha).take(4).collect::<String>(),