3 files changed
+35
-4
Cargo.lock
+26
@@ -814,6 +814,16 @@ version = "0.3.26"
814
source = "registry+https://github.com/rust-lang/crates.io-index"
815
checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
816
817
+[[package]]
818
+name = "pre-commit"
819
+version = "0.5.2"
820
+source = "registry+https://github.com/rust-lang/crates.io-index"
821
+checksum = "d0f2b9887f84ec91cd86f71c193b883209d744bc8c2a3363c6b1df88efa5af8f"
822
+dependencies = [
823
+ "rustc-serialize",
824
+ "toml",
825
+]
826
+
827
[[package]]
828
name = "proc-macro-error"
829
version = "1.0.4"
@@ -954,6 +964,12 @@ version = "0.2.1"
964
source = "registry+https://github.com/rust-lang/crates.io-index"
965
checksum = "b833d8d034ea094b1ea68aa6d5c740e0d04bad9d16568d08ba6f76823a114316"
966
967
+[[package]]
968
+name = "rustc-serialize"
969
+version = "0.3.24"
970
+source = "registry+https://github.com/rust-lang/crates.io-index"
971
+checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
972
+
973
[[package]]
974
name = "rustix"
975
version = "0.36.8"
@@ -1115,6 +1131,7 @@ dependencies = [
1131
"home",
1132
"log",
1133
"open",
1134
+ "pre-commit",
1135
"regex",
1136
"reqwest",
1137
"serde",
@@ -1399,6 +1416,15 @@ dependencies = [
1416
"tracing",
1417
]
1418
1419
+[[package]]
1420
+name = "toml"
1421
+version = "0.2.1"
1422
+source = "registry+https://github.com/rust-lang/crates.io-index"
1423
+checksum = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4"
1424
+dependencies = [
1425
+ "rustc-serialize",
1426
+]
1427
+
1428
[[package]]
1429
name = "tower-service"
1430
version = "0.3.2"
app-oten/src/lib.rs
+4
-4
@@ -7,7 +7,7 @@ use reqwest::Client;
7
use smbpndk_model::{AuthApp, AuthAppCreate};
8
use smbpndk_networking::{constants::BASE_URL, get_token};
9
10
-pub async fn get_auth_apps() -> Result<Vec<AuthApp>> {
10
+async fn get_auth_apps() -> Result<Vec<AuthApp>> {
11
// Get current token
12
let token = get_token().await?;
13
@@ -26,7 +26,7 @@ pub async fn get_auth_apps() -> Result<Vec<AuthApp>> {
26
}
27
}
28
29
-pub async fn get_auth_app(id: &str) -> Result<AuthApp> {
29
+async fn get_auth_app(id: &str) -> Result<AuthApp> {
30
// Get current token
31
let token = get_token().await?;
32
@@ -48,7 +48,7 @@ pub async fn get_auth_app(id: &str) -> Result<AuthApp> {
48
}
49
}
50
51
-pub async fn delete_auth_app(id: String) -> Result<()> {
51
+async fn delete_auth_app(id: String) -> Result<()> {
52
// Get current token
53
let token = get_token().await?;
54
@@ -67,7 +67,7 @@ pub async fn delete_auth_app(id: String) -> Result<()> {
67
}
68
}
69
70
-pub async fn create_auth_app(auth_app: AuthAppCreate) -> Result<AuthApp> {
70
+async fn create_auth_app(auth_app: AuthAppCreate) -> Result<AuthApp> {
71
// Get current token
72
let token = get_token().await?;
73
smbpndk-cli/Cargo.toml
+5
@@ -27,6 +27,7 @@ dotenv = "0.15.0"
27
home = "0.5.4"
28
log = "0.4.14"
29
open = "4.0.1"
30
+pre-commit = "0.5.2"
31
regex = "1.3.1"
32
reqwest = { version = "0.11", features = ["json"] }
33
serde = { version = "1", features = ["derive"] }
@@ -41,3 +42,7 @@ tracing = { version = "0.1.35", features = ["log"] }
42
tracing-bunyan-formatter = "0.3.3"
43
tracing-subscriber = { version = "0.3.14", features = ["registry", "env-filter"] }
44
url-builder = "0.1.1"
45
+
46
+[package.metadata.precommit]
47
+fmt = "cargo fmt"
48
+sort = "cargo sort -w"
\ No newline at end of file