From 9e79d8a6b3b0e2e3f7315dd2ac95017d8e8b11dc Mon Sep 17 00:00:00 2001 From: Avril Date: Thu, 8 Oct 2020 01:33:23 +0100 Subject: [PATCH] prepare config --- Cargo.toml | 2 +- config/password.toml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 config/password.toml diff --git a/Cargo.toml b/Cargo.toml index c7cab52..8be0009 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ async-trait = "0.1.40" hex-literal = "0.3.1" once_cell = "1.4.1" getrandom = "0.2.0" -#serde_json = "1.0.57" # serde not suitable for our text formatting :/ maybe just use `cbor` -> base64 with text header? would be a PEM-like format. sounds good imo [build-dependencies] rustc_version = "0.2" +config_struct = "0.5.0" \ No newline at end of file diff --git a/config/password.toml b/config/password.toml new file mode 100644 index 0000000..02c3fb1 --- /dev/null +++ b/config/password.toml @@ -0,0 +1,15 @@ +[password] +length = 3 +message = "Not a safe password" + +[[password.deny]] +message = "Password too alphanumeric" +value = ["^[A-z]+$"] +type = "regex" +case-sensitive = false + +[[password.allow]] +warn = true +message = "Empty string password" +value = [""] +type = "exact" \ No newline at end of file