mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 04:27:02 +01:00
parent
254a5e060c
commit
6bc719cdb2
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,4 +11,5 @@ vendor.tar.gz
|
|||
kanidm_rlm_python/test_data/ca.pem
|
||||
loc.sh
|
||||
todo.sh
|
||||
vendor.tar.*
|
||||
|
||||
|
|
302
Cargo.lock
generated
302
Cargo.lock
generated
|
@ -68,7 +68,7 @@ checksum = "7f200cbb1e856866d9eade941cf3aa0c5d7dd36f74311c4273b494f4ef036957"
|
|||
dependencies = [
|
||||
"getrandom 0.2.2",
|
||||
"once_cell",
|
||||
"version_check 0.9.2",
|
||||
"version_check 0.9.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -82,9 +82,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.38"
|
||||
version = "1.0.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1"
|
||||
checksum = "81cddc5f91628367664cc7c69714ff08deee8a3efc54623011c772544d7b2767"
|
||||
|
||||
[[package]]
|
||||
name = "anymap"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344"
|
||||
|
||||
[[package]]
|
||||
name = "arrayref"
|
||||
|
@ -480,6 +486,12 @@ dependencies = [
|
|||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "boolinator"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9"
|
||||
|
||||
[[package]]
|
||||
name = "bstr"
|
||||
version = "0.2.15"
|
||||
|
@ -565,6 +577,12 @@ version = "1.0.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-match"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8100e46ff92eb85bf6dc2930c73f2a4f7176393c84a9446b3d501e1b354e7b34"
|
||||
|
||||
[[package]]
|
||||
name = "checked_int_cast"
|
||||
version = "1.0.0"
|
||||
|
@ -633,6 +651,16 @@ dependencies = [
|
|||
"cache-padded",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "console_error_panic_hook"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.10",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "const_fn"
|
||||
version = "0.4.5"
|
||||
|
@ -658,8 +686,8 @@ dependencies = [
|
|||
"percent-encoding",
|
||||
"rand 0.8.3",
|
||||
"sha2 0.9.3",
|
||||
"time 0.2.25",
|
||||
"version_check 0.9.2",
|
||||
"time 0.2.26",
|
||||
"version_check 0.9.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -674,7 +702,7 @@ dependencies = [
|
|||
"publicsuffix",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"time 0.2.25",
|
||||
"time 0.2.26",
|
||||
"url",
|
||||
]
|
||||
|
||||
|
@ -877,9 +905,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ctor"
|
||||
version = "0.1.19"
|
||||
version = "0.1.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8f45d9ad417bcef4817d614a501ab55cdd96a6fdb24f49aab89a54acfd66b19"
|
||||
checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn",
|
||||
|
@ -1114,12 +1142,13 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fernet"
|
||||
version = "0.1.3"
|
||||
source = "git+https://github.com/mozilla-services/fernet-rs.git#ee37de7ec699b4add245396a8492ba76d37048a7"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93804560e638370a8be6d59ce71ed803e55e230abdbf42598e666b41adda9b1f"
|
||||
dependencies = [
|
||||
"base64 0.12.3",
|
||||
"base64 0.13.0",
|
||||
"byteorder",
|
||||
"getrandom 0.1.16",
|
||||
"getrandom 0.2.2",
|
||||
"openssl",
|
||||
"zeroize",
|
||||
]
|
||||
|
@ -1290,7 +1319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
|
||||
dependencies = [
|
||||
"typenum",
|
||||
"version_check 0.9.2",
|
||||
"version_check 0.9.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1311,8 +1340,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"wasi 0.10.2+wasi-snapshot-preview1",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1325,6 +1356,49 @@ dependencies = [
|
|||
"polyval",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gloo"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68ce6f2dfa9f57f15b848efa2aade5e1850dc72986b87a2b0752d44ca08f4967"
|
||||
dependencies = [
|
||||
"gloo-console-timer",
|
||||
"gloo-events",
|
||||
"gloo-file",
|
||||
"gloo-timers",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gloo-console-timer"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b48675544b29ac03402c6dffc31a912f716e38d19f7e74b78b7e900ec3c941ea"
|
||||
dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gloo-events"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "088514ec8ef284891c762c88a66b639b3a730134714692ee31829765c5bc814f"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gloo-file"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f9fecfe46b5dc3cc46f58e98ba580cc714f2c93860796d002eb3527a465ef49"
|
||||
dependencies = [
|
||||
"gloo-events",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gloo-timers"
|
||||
version = "0.2.1"
|
||||
|
@ -1433,12 +1507,13 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "http-body"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994"
|
||||
checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http",
|
||||
"pin-project-lite 0.2.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1511,7 +1586,7 @@ dependencies = [
|
|||
"httpdate",
|
||||
"itoa",
|
||||
"pin-project",
|
||||
"socket2",
|
||||
"socket2 0.3.19",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
|
@ -1546,7 +1621,7 @@ dependencies = [
|
|||
"serde",
|
||||
"serde_derive",
|
||||
"smallvec",
|
||||
"time 0.2.25",
|
||||
"time 0.2.26",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1638,9 +1713,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.48"
|
||||
version = "0.3.49"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78"
|
||||
checksum = "dc15e39392125075f60c95ba416f5381ff6c3a948ff02ab12464715adf56c821"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
@ -1687,7 +1762,7 @@ dependencies = [
|
|||
"structopt",
|
||||
"tide",
|
||||
"tide-rustls",
|
||||
"time 0.2.25",
|
||||
"time 0.2.26",
|
||||
"tokio",
|
||||
"tokio-openssl",
|
||||
"tokio-util",
|
||||
|
@ -1730,10 +1805,8 @@ dependencies = [
|
|||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"uuid",
|
||||
"webauthn-rs",
|
||||
"zxcvbn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1752,7 +1825,7 @@ dependencies = [
|
|||
"serde_json",
|
||||
"shellexpand",
|
||||
"structopt",
|
||||
"time 0.2.25",
|
||||
"time 0.2.26",
|
||||
"webauthn-authenticator-rs",
|
||||
"zxcvbn",
|
||||
]
|
||||
|
@ -1787,6 +1860,17 @@ dependencies = [
|
|||
"users",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kanidmd_web_ui"
|
||||
version = "1.1.0-alpha.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"kanidm_proto",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"yew",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kv-log-macro"
|
||||
version = "1.0.7"
|
||||
|
@ -1839,9 +1923,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.88"
|
||||
version = "0.2.91"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a"
|
||||
checksum = "8916b1f6ca17130ec6568feccee27c156ad12037880833a3b842a823236502e7"
|
||||
|
||||
[[package]]
|
||||
name = "libm"
|
||||
|
@ -1851,8 +1935,9 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
|
|||
|
||||
[[package]]
|
||||
name = "libnss"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/csnewman/libnss-rs.git?rev=eab2d93d2438652773699b0807d558ce75b1e748#eab2d93d2438652773699b0807d558ce75b1e748"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48b67ef5ebef2a035ac8106c9b71176b6246be2a580ff4ee94bb80919e55b34c"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"libc",
|
||||
|
@ -1967,9 +2052,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
|
|||
|
||||
[[package]]
|
||||
name = "mio"
|
||||
version = "0.7.9"
|
||||
version = "0.7.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a5dede4e2065b3842b8b0af444119f3aa331cc7cc2dd20388bfb0f5d5a38823a"
|
||||
checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
|
@ -1980,11 +2065,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "miow"
|
||||
version = "0.3.6"
|
||||
version = "0.3.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897"
|
||||
checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
|
||||
dependencies = [
|
||||
"socket2",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
|
@ -2008,12 +2092,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "nb-connect"
|
||||
version = "1.0.3"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "670361df1bc2399ee1ff50406a0d422587dd3bb0da596e1978fe8e05dabddf4f"
|
||||
checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"socket2",
|
||||
"socket2 0.4.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2039,7 +2123,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"version_check 0.9.2",
|
||||
"version_check 0.9.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2052,7 +2136,7 @@ dependencies = [
|
|||
"funty",
|
||||
"lexical-core",
|
||||
"memchr",
|
||||
"version_check 0.9.2",
|
||||
"version_check 0.9.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2372,11 +2456,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "polling"
|
||||
version = "2.0.2"
|
||||
version = "2.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4"
|
||||
checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.10",
|
||||
"cfg-if 1.0.0",
|
||||
"libc",
|
||||
"log",
|
||||
"wepoll-sys",
|
||||
|
@ -2410,7 +2494,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"version_check 0.9.2",
|
||||
"version_check 0.9.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2421,7 +2505,7 @@ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
|||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"version_check 0.9.2",
|
||||
"version_check 0.9.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2694,7 +2778,7 @@ dependencies = [
|
|||
"serde",
|
||||
"serde_json",
|
||||
"serde_urlencoded",
|
||||
"time 0.2.25",
|
||||
"time 0.2.26",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"url",
|
||||
|
@ -2869,9 +2953,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
|||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.124"
|
||||
version = "1.0.125"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f"
|
||||
checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
@ -2897,9 +2981,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.124"
|
||||
version = "1.0.125"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b"
|
||||
checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -3045,6 +3129,16 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spin"
|
||||
version = "0.5.2"
|
||||
|
@ -3070,11 +3164,11 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
|
|||
|
||||
[[package]]
|
||||
name = "standback"
|
||||
version = "0.2.15"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2beb4d1860a61f571530b3f855a1b538d0200f7871c63331ecd6f17b1f014f8"
|
||||
checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff"
|
||||
dependencies = [
|
||||
"version_check 0.9.2",
|
||||
"version_check 0.9.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3304,9 +3398,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.2.25"
|
||||
version = "0.2.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1195b046942c221454c2539395f85413b33383a067449d78aab2b7b052a142f7"
|
||||
checksum = "08a8cbfbf47955132d0202d1662f49b2423ae35862aee471f3ba4b133358f372"
|
||||
dependencies = [
|
||||
"const_fn",
|
||||
"libc",
|
||||
|
@ -3314,7 +3408,7 @@ dependencies = [
|
|||
"standback",
|
||||
"stdweb",
|
||||
"time-macros",
|
||||
"version_check 0.9.2",
|
||||
"version_check 0.9.3",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
|
@ -3368,9 +3462,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
|
|||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.3.0"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8d56477f6ed99e10225f38f9f75f872f29b8b8bd8c0b946f63345bb144e9eeda"
|
||||
checksum = "134af885d758d645f0f0505c9a8b3f9bf8a348fd822e112ab5248138348f1722"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"bytes",
|
||||
|
@ -3421,9 +3515,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tokio-util"
|
||||
version = "0.6.4"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec31e5cc6b46e653cf57762f36f71d5e6386391d88a72fd6db4508f8f676fb29"
|
||||
checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
|
@ -3583,9 +3677,9 @@ checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb"
|
|||
|
||||
[[package]]
|
||||
name = "vec-arena"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d"
|
||||
checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
|
@ -3595,9 +3689,9 @@ checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
|
|||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.2"
|
||||
version = "0.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
|
||||
checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
|
||||
|
||||
[[package]]
|
||||
name = "waker-fn"
|
||||
|
@ -3607,9 +3701,9 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca"
|
|||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
version = "2.3.1"
|
||||
version = "2.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
|
||||
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
|
||||
dependencies = [
|
||||
"same-file",
|
||||
"winapi",
|
||||
|
@ -3640,9 +3734,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.71"
|
||||
version = "0.2.72"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7"
|
||||
checksum = "8fe8f61dba8e5d645a4d8132dc7a0a66861ed5e1045d2c0ed940fab33bac0fbe"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"serde",
|
||||
|
@ -3652,9 +3746,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.71"
|
||||
version = "0.2.72"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8"
|
||||
checksum = "046ceba58ff062da072c7cb4ba5b22a37f00a302483f7e2a6cdc18fedbdc1fd3"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"lazy_static",
|
||||
|
@ -3667,9 +3761,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-futures"
|
||||
version = "0.4.21"
|
||||
version = "0.4.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab"
|
||||
checksum = "73157efb9af26fb564bb59a009afd1c7c334a44db171d280690d0c3faaec3468"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"js-sys",
|
||||
|
@ -3679,9 +3773,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.71"
|
||||
version = "0.2.72"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b"
|
||||
checksum = "0ef9aa01d36cda046f797c57959ff5f3c615c9cc63997a8d545831ec7976819b"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
|
@ -3689,9 +3783,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.71"
|
||||
version = "0.2.72"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e"
|
||||
checksum = "96eb45c1b2ee33545a813a92dbb53856418bf7eb54ab34f7f7ff1448a5b3735d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -3702,15 +3796,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.71"
|
||||
version = "0.2.72"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1"
|
||||
checksum = "b7148f4696fb4960a346eaa60bbfb42a1ac4ebba21f750f75fc1375b098d5ffa"
|
||||
|
||||
[[package]]
|
||||
name = "web-sys"
|
||||
version = "0.3.48"
|
||||
version = "0.3.49"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b"
|
||||
checksum = "59fe19d70f5dacc03f6e46777213facae5ac3801575d56ca6cbd4c93dcd12310"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
|
@ -3734,11 +3828,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "webauthn-rs"
|
||||
version = "0.3.0-alpha.5"
|
||||
version = "0.3.0-alpha.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b4698b6e320b4c3a6d7ef77fe787c7f270cd8159eb1a87656e8e4eec8d62fa1"
|
||||
checksum = "510bc117ab035a8e6e5f99a56f953e9e610b0a38c19314fc6ddb01bb7c9690cd"
|
||||
dependencies = [
|
||||
"base64 0.13.0",
|
||||
"js-sys",
|
||||
"log",
|
||||
"nom 4.2.3",
|
||||
"openssl",
|
||||
|
@ -3749,6 +3844,8 @@ dependencies = [
|
|||
"serde_derive",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3825,6 +3922,51 @@ version = "0.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214"
|
||||
|
||||
[[package]]
|
||||
name = "yew"
|
||||
version = "0.17.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d8703eb5b883e816cd74c65e2f6dd4144eeedb77c1b3e0284e8f3f593b80ab1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"anymap",
|
||||
"bincode",
|
||||
"cfg-if 0.1.10",
|
||||
"cfg-match",
|
||||
"console_error_panic_hook",
|
||||
"futures",
|
||||
"gloo",
|
||||
"http",
|
||||
"indexmap",
|
||||
"js-sys",
|
||||
"log",
|
||||
"proc-macro-hack",
|
||||
"proc-macro-nested",
|
||||
"ryu",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"slab",
|
||||
"thiserror",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
"yew-macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "yew-macro"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61a9a452e63b6222b28b426dafbc6b207192e0127cdb93324cc7407b8c7e1768"
|
||||
dependencies = [
|
||||
"boolinator",
|
||||
"lazy_static",
|
||||
"proc-macro-hack",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize"
|
||||
version = "1.2.0"
|
||||
|
@ -3859,6 +4001,4 @@ dependencies = [
|
|||
"lazy_static",
|
||||
"quick-error",
|
||||
"regex",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
]
|
||||
|
|
|
@ -8,6 +8,7 @@ debug = true
|
|||
members = [
|
||||
"kanidm_proto",
|
||||
"kanidmd",
|
||||
"kanidmd_web_ui",
|
||||
"kanidm_client",
|
||||
"kanidm_tools",
|
||||
"kanidm_unix_int",
|
||||
|
|
|
@ -10,6 +10,33 @@ cargo doc --document-private-items --open --no-deps
|
|||
|
||||
[designs]: https://github.com/kanidm/kanidm/tree/master/designs
|
||||
|
||||
### Minimum Supported Rust Version
|
||||
|
||||
The project is expected to work on MSRV of 1.47.0.
|
||||
|
||||
### Dependencies
|
||||
|
||||
#### MacOS
|
||||
|
||||
You will need [rustup] to install a rust toolchain.
|
||||
|
||||
[rustup]: https://rustup.rs/
|
||||
|
||||
If you plan to work on the web-ui, you may also need npm for setting up some parts.
|
||||
|
||||
brew install npm
|
||||
|
||||
#### SUSE
|
||||
|
||||
You will need [rustup] to install a rust toolchain.
|
||||
|
||||
[rustup]: https://rustup.rs/
|
||||
|
||||
You will also need some system libraries to build this:
|
||||
|
||||
libudev-devel sqlite3-devel libopenssl-devel npm-default
|
||||
|
||||
|
||||
### Get involved
|
||||
|
||||
To get started, you'll need to fork or branch, and we'll merge based on PR's.
|
||||
|
@ -99,3 +126,17 @@ In a new terminal, you can now build and run the client tools with:
|
|||
cargo run -- self whoami -H https://localhost:8443 -D anonymous -C ../insecure/ca.pem
|
||||
cargo run -- login -H https://localhost:8443 -D admin -C ../insecure/ca.pem
|
||||
cargo run -- self whoami -H https://localhost:8443 -D admin -C ../insecure/ca.pem
|
||||
|
||||
### Building the Web UI
|
||||
|
||||
The web ui uses rust wasm rather than javascript. To build this you need to setup the environment.
|
||||
|
||||
cargo install wasm-pack
|
||||
npm install --global rollup
|
||||
|
||||
Then you are able to build the ui.
|
||||
|
||||
cd kanidmd_web_ui/
|
||||
./build_wasm.sh
|
||||
|
||||
The "developer" profile for kanidmd will automatically use the pkg output in this folder.
|
||||
|
|
75
Makefile
75
Makefile
|
@ -1,4 +1,4 @@
|
|||
.PHONY: help build/kanidmd build/radiusd test/kanidmd push/kanidmd push/radiusd vendor-prep doc install-tools prep
|
||||
.PHONY: help build/kanidmd build/radiusd test/kanidmd push/kanidmd push/radiusd vendor-prep doc install-tools prep vendor
|
||||
|
||||
IMAGE_BASE ?= kanidm
|
||||
IMAGE_VERSION ?= devel
|
||||
|
@ -10,22 +10,40 @@ ARGS ?= --build-arg "SCCACHE_REDIS=redis://172.24.20.4:6379"
|
|||
help:
|
||||
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/\n\t/'
|
||||
|
||||
buildx/kanidmd/simd: ## build multiarch server images
|
||||
buildx/kanidmd/simd:
|
||||
@docker buildx build $(EXT_OPTS) --pull --push --platform "linux/amd64" \
|
||||
--allow security.insecure \
|
||||
-f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:x86_64_$(IMAGE_VERSION) \
|
||||
--build-arg "KANIDM_BUILD_PROFILE=container_x86_64_v3" \
|
||||
--build-arg "KANIDM_FEATURES=simd_support" \
|
||||
$(ARGS) .
|
||||
@docker buildx imagetools $(EXT_OPTS) inspect $(IMAGE_BASE)/server:$(IMAGE_VERSION)
|
||||
|
||||
buildx/kanidmd: ## build multiarch server images
|
||||
buildx/kanidmd:
|
||||
echo @docker buildx build $(EXT_OPTS) --pull --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(ARGS) .
|
||||
@docker buildx build $(EXT_OPTS) --pull --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(ARGS) .
|
||||
@docker buildx build $(EXT_OPTS) --pull --push --platform $(IMAGE_ARCH) \
|
||||
--allow security.insecure \
|
||||
-f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) \
|
||||
--build-arg "KANIDM_BUILD_PROFILE=container_generic" \
|
||||
--build-arg "KANIDM_FEATURES=" \
|
||||
$(ARGS) .
|
||||
@docker buildx imagetools $(EXT_OPTS) inspect $(IMAGE_BASE)/server:$(IMAGE_VERSION)
|
||||
|
||||
buildx/radiusd: ## build multiarch radius images
|
||||
buildx/radiusd:
|
||||
@docker buildx build $(EXT_OPTS) --pull --push --platform $(IMAGE_ARCH) -f kanidm_rlm_python/Dockerfile -t $(IMAGE_BASE)/radius:$(IMAGE_VERSION) kanidm_rlm_python
|
||||
@docker buildx build $(EXT_OPTS) --pull --push --platform $(IMAGE_ARCH) \
|
||||
-f kanidm_rlm_python/Dockerfile -t $(IMAGE_BASE)/radius:$(IMAGE_VERSION) kanidm_rlm_python
|
||||
@docker buildx imagetools $(EXT_OPTS) inspect $(IMAGE_BASE)/radius:$(IMAGE_VERSION)
|
||||
|
||||
buildx: buildx/kanidmd buildx/radiusd
|
||||
|
||||
build/kanidmd: ## build kanidmd images
|
||||
build/kanidmd:
|
||||
@docker build $(EXT_OPTS) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) .
|
||||
@docker build $(EXT_OPTS) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION)
|
||||
--build-arg "KANIDM_BUILD_PROFILE=developer" \
|
||||
--build-arg "KANIDM_FEATURES=" \
|
||||
$(ARGS) .
|
||||
|
||||
build/radiusd: ## build radiusd image
|
||||
build/radiusd:
|
||||
|
@ -33,40 +51,21 @@ build/radiusd:
|
|||
|
||||
build: build/kanidmd build/radiusd
|
||||
|
||||
tag/kanidmd:
|
||||
@docker tag $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(IMAGE_BASE)/server:latest
|
||||
|
||||
tag/radiusd:
|
||||
@docker tag $(IMAGE_BASE)/radius:$(IMAGE_VERSION) $(IMAGE_BASE)/radius:latest
|
||||
|
||||
tag: tag/kanidmd tag/radiusd
|
||||
|
||||
push/kanidmd: ## push kanidmd images
|
||||
push/kanidmd:
|
||||
@docker push $(IMAGE_BASE)/server:$(IMAGE_VERSION)
|
||||
|
||||
push/radiusd: ## push radiusd image
|
||||
push/radiusd:
|
||||
@docker push $(IMAGE_BASE)/radius:$(IMAGE_VERSION)
|
||||
|
||||
push: build push/kanidmd push/radiusd
|
||||
|
||||
pushlatest: build tag push
|
||||
@docker push $(IMAGE_BASE)/server:latest
|
||||
@docker push $(IMAGE_BASE)/radius:latest
|
||||
|
||||
test/kanidmd: ## test kanidmd
|
||||
test/kanidmd:
|
||||
@docker build -f kanidmd/Dockerfile \
|
||||
@docker build \
|
||||
$(EXT_OPTS) -f kanidmd/Dockerfile \
|
||||
--target builder \
|
||||
-t $(IMAGE_BASE)/server:$(IMAGE_VERSION)-builder \
|
||||
.
|
||||
$(ARGS) .
|
||||
@docker run --rm $(IMAGE_BASE)/server:$(IMAGE_VERSION)-builder cargo test
|
||||
|
||||
test/radiusd: build/radiusd ## test radiusd
|
||||
# test/radiusd: build/radiusd ## test radiusd
|
||||
|
||||
vendor-prep:
|
||||
vendor:
|
||||
cargo vendor
|
||||
|
||||
vendor-prep: vendor
|
||||
tar -czf vendor.tar.gz vendor
|
||||
|
||||
doc: ## build doc local
|
||||
|
@ -81,17 +80,3 @@ prep:
|
|||
cargo outdated -R
|
||||
cargo audit
|
||||
|
||||
# update-version: ## update version form VERSION file in all Cargo.toml manifests
|
||||
# update-version: */Cargo.toml
|
||||
# @VERSION=`cat VERSION`; sed -i "0,/^version\ \= .*$$/{s//version = \"$$VERSION\"/}" */Cargo.toml
|
||||
# @echo updated to version "`cat VERSION`" cargo files
|
||||
#
|
||||
# publish:
|
||||
# cd kanidm_proto; cargo package
|
||||
# cd kanidm_proto; cargo publish
|
||||
# cd kanidmd; cargo package
|
||||
# cd kanidmd; cargo publish
|
||||
# cd kanidm_client; cargo package
|
||||
# cd kanidm_client; cargo publish
|
||||
# cd kanidm_tools; cargo package
|
||||
# cd kanidm_tools; cargo publish
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Installing the Server
|
||||
|
||||
Currently we have a pre-release docker image based on git master. They can be found at:
|
||||
Currently we have docker images for the server components. They can be found at:
|
||||
|
||||
https://hub.docker.com/r/kanidm/server
|
||||
https://hub.docker.com/r/kanidm/radius
|
||||
|
@ -10,18 +10,32 @@ You can fetch these with:
|
|||
docker pull kanidm/server:latest
|
||||
docker pull kanidm/radius:latest
|
||||
|
||||
There are a number of configuration steps you must perform before you can run this container.
|
||||
If you wish to use an x86\_64 cpu-optimised version (See System Requirements CPU), you should use:
|
||||
|
||||
docker pull kanidm/server:x86_64_latest
|
||||
|
||||
You may need to adjust your example commands throughout this document to suit.
|
||||
|
||||
## System Requirements
|
||||
|
||||
### CPU
|
||||
|
||||
You must have a CPU that is from 2013 or newer (Haswell, Ryzen). This is due to the usage of
|
||||
SIMD for a number of internal components.
|
||||
If you are using the x86\_64 cpu-optimised version, you must have a CPU that is from 2013 or newer
|
||||
(Haswell, Ryzen). The following instruction flags are used.
|
||||
|
||||
cmov, cx8, fxsr, mmx, sse, sse2, cx16, sahf, popcnt, sse3, sse4.1, sse4.2, avx, avx2,
|
||||
bmi, bmi2, f16c, fma, lzcnt, movbe, xsave
|
||||
|
||||
Older or unsupported CPU's may raise a SIGIL (Illegal Instruction) on hardware that is not supported
|
||||
by the project.
|
||||
|
||||
In this case, you should use the standard server:latest image.
|
||||
|
||||
In the future we may apply a baseline of flags as a requirement for x86\_64 for the server:latest
|
||||
image. These flags will be:
|
||||
|
||||
cmov, cx8, fxsr, mmx, sse, sse2
|
||||
|
||||
### Memory
|
||||
|
||||
Kanidm extensively uses memory caching, trading memory consumption to improve parallel throughput.
|
||||
|
@ -82,11 +96,14 @@ If your chain.pem contains the CA certificate, you can validate this file with t
|
|||
openssl verify -CAfile chain.pem chain.pem
|
||||
|
||||
If your chain.pem does not contain the CA certificate (Let's Encrypt chains do not contain the CA
|
||||
for example) then you can validate with this command. Note that here "untrusted" means a list of
|
||||
further certificates in the chain to build up to the root, not that the verification is bypassed.
|
||||
for example) then you can validate with this command.
|
||||
|
||||
openssl verify -untrusted fullchain.pem fullchain.pem
|
||||
|
||||
> **NOTE** Here "-untrusted" flag means a list of further certificates in the chain to build up
|
||||
> to the root is provided, but that the system CA root should be consulted. Verification is NOT bypassed
|
||||
> or allowed to be invalid.
|
||||
|
||||
If these verifications pass you can now use these certificates with Kanidm. To put the certificates
|
||||
in place you can use a shell container that mounts the volume such as:
|
||||
|
||||
|
@ -129,10 +146,9 @@ Then you can setup the initial admin account and initialise the database into yo
|
|||
|
||||
docker run --rm -i -t -v kanidmd:/data kanidm/server:latest /sbin/kanidmd recover_account -c /data/server.toml -n admin
|
||||
|
||||
> **HINT**
|
||||
> If you want to try the latest development releases instead, use the image tag kanidm/server:devel instead
|
||||
|
||||
You then want to set your domain name so that spn's are generated correctly.
|
||||
You then want to set your domain name so that security principal names (spn's) are generated correctly.
|
||||
This domain name *must* match the url/origin of the server that you plan to use to interact with
|
||||
so that other features work correctly. It is possible to change this domain name later.
|
||||
|
||||
docker run --rm -i -t -v kanidmd:/data kanidm/server:latest /sbin/kanidmd domain_name_change -c /data/server.toml -n idm.example.com
|
||||
|
||||
|
@ -143,7 +159,7 @@ Now we can run the server so that it can accept connections. This defaults to us
|
|||
# Development Version
|
||||
|
||||
If you are interested to run our latest code from development, you can do this by changing the
|
||||
docker tag to `kanidm/server:devel`.
|
||||
docker tag to `kanidm/server:devel` or `kanidm/server:x86_64_v3_devel` instead.
|
||||
|
||||
# Running as non-root in docker
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ serde_derive = "1.0"
|
|||
toml = "0.5"
|
||||
uuid = { version = "0.8", features = ["serde", "v4"] }
|
||||
url = "2.1.1"
|
||||
webauthn-rs = "0.3.0-alpha.1"
|
||||
webauthn-rs = "0.3.0-alpha.7"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1", features = ["rt", "net", "time", "macros", "sync", "signal"] }
|
||||
|
@ -28,4 +28,4 @@ kanidm = { path = "../kanidmd" }
|
|||
futures = "0.3"
|
||||
async-std = "1.6"
|
||||
|
||||
webauthn-authenticator-rs = "0.3.0-alpha.1"
|
||||
webauthn-authenticator-rs = "0.3.0-alpha.7"
|
||||
|
|
|
@ -12,11 +12,10 @@ repository = "https://github.com/kanidm/kanidm/"
|
|||
[dependencies]
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
uuid = { version = "0.8", features = ["serde", "v4"] }
|
||||
zxcvbn = { version = "2.0", features = ["ser"] }
|
||||
uuid = { version = "0.8", features = ["serde", "wasm-bindgen"] }
|
||||
# zxcvbn = { version = "2.0", features = ["ser"] }
|
||||
base32 = "0.4"
|
||||
thiserror = "1.0"
|
||||
webauthn-rs = "0.3.0-alpha.5"
|
||||
webauthn-rs = { version = "0.3.0-alpha.7", default-features = false, features = ["wasm"] }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1.0"
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use std::cmp::Ordering;
|
||||
use std::collections::BTreeMap;
|
||||
use std::fmt;
|
||||
use uuid::Uuid;
|
||||
// use zxcvbn::feedback;
|
||||
use std::cmp::Ordering;
|
||||
use webauthn_rs::proto::{
|
||||
CreationChallengeResponse, PublicKeyCredential, RegisterPublicKeyCredential,
|
||||
RequestChallengeResponse,
|
||||
|
@ -12,26 +11,17 @@ use webauthn_rs::proto::{
|
|||
|
||||
/* ===== errors ===== */
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, thiserror::Error)]
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum SchemaError {
|
||||
#[error("Not Implemented")]
|
||||
NotImplemented,
|
||||
#[error("This entry does not have any classes, which means it can not have structure.")]
|
||||
NoClassFound,
|
||||
#[error("A class or classes are found that do not exist in schema.")]
|
||||
InvalidClass(Vec<String>),
|
||||
#[error("")]
|
||||
MissingMustAttribute(Vec<String>),
|
||||
#[error("")]
|
||||
InvalidAttribute(String),
|
||||
#[error("")]
|
||||
InvalidAttributeSyntax(String),
|
||||
#[error("")]
|
||||
EmptyFilter,
|
||||
#[error("The schema has become internally inconsistent. You must restart and investigate.")]
|
||||
Corrupted,
|
||||
#[error("Phantom attribute types may not be persisted on an entry")]
|
||||
PhantomAttribute(String),
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ qrcode = { version = "0.12", default-features = false }
|
|||
|
||||
zxcvbn = "2.0"
|
||||
|
||||
webauthn-authenticator-rs = "^0.3.0-alpha.6"
|
||||
webauthn-authenticator-rs = "^0.3.0-alpha.7"
|
||||
|
||||
[build-dependencies]
|
||||
structopt = { version = "0.3", default-features = false }
|
||||
|
|
|
@ -84,4 +84,7 @@ kanidm = { path = "../kanidmd" }
|
|||
|
||||
[build-dependencies]
|
||||
structopt = { version = "0.3", default-features = false }
|
||||
toml = "0.5"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
|
||||
|
|
|
@ -1,13 +1,22 @@
|
|||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
use std::env;
|
||||
|
||||
use structopt::clap::Shell;
|
||||
use structopt::StructOpt;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::path::PathBuf;
|
||||
|
||||
include!("src/opt/ssh_authorizedkeys.rs");
|
||||
include!("src/opt/cache_invalidate.rs");
|
||||
include!("src/opt/cache_clear.rs");
|
||||
include!("src/opt/unixd_status.rs");
|
||||
|
||||
include!("../profiles/syntax.rs");
|
||||
|
||||
fn main() {
|
||||
let outdir = match env::var_os("OUT_DIR") {
|
||||
None => return,
|
||||
|
@ -41,4 +50,32 @@ fn main() {
|
|||
|
||||
UnixdStatusOpt::clap().gen_completions("kanidm_unixd_status", Shell::Bash, outdir.clone());
|
||||
UnixdStatusOpt::clap().gen_completions("kanidm_unixd_status", Shell::Zsh, outdir);
|
||||
|
||||
println!("cargo:rerun-if-env-changed=KANIDM_BUILD_PROFILE");
|
||||
let profile = env::var("KANIDM_BUILD_PROFILE").unwrap_or_else(|_| "developer".to_string());
|
||||
|
||||
let profile_path: PathBuf = ["../profiles", format!("{}.toml", profile).as_str()]
|
||||
.iter()
|
||||
.collect();
|
||||
|
||||
println!("cargo:rerun-if-changed={}", profile_path.to_str().unwrap());
|
||||
|
||||
let mut f =
|
||||
File::open(&profile_path).expect(format!("Failed to open {:?}", profile_path).as_str());
|
||||
|
||||
let mut contents = String::new();
|
||||
f.read_to_string(&mut contents)
|
||||
.expect(format!("Failed to read {:?}", profile_path).as_str());
|
||||
|
||||
let profile_cfg: ProfileConfig = toml::from_str(contents.as_str())
|
||||
.expect(format!("Failed to parse {:?}", profile_path).as_str());
|
||||
|
||||
match profile_cfg.cpu_flags {
|
||||
CpuOptLevel::none => {}
|
||||
CpuOptLevel::native => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-cpu=native"),
|
||||
CpuOptLevel::x86_64_v1 => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-feature=+cmov,+cx8,+fxsr,+mmx,+sse,+sse2"),
|
||||
CpuOptLevel::x86_64_v3 => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-feature=+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+cx16,+sahf,+popcnt,+sse3,+sse4.1,+sse4.2,+avx,+avx2,+bmi,+bmi2,+f16c,+fma,+lzcnt,+movbe,+xsave"),
|
||||
}
|
||||
println!("cargo:rustc-env=KANIDM_PROFILE_NAME={}", profile);
|
||||
println!("cargo:rustc-env=KANIDM_CPU_FLAGS={}", profile_cfg.cpu_flags);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ path = "src/lib.rs"
|
|||
|
||||
[dependencies]
|
||||
kanidm_unix_int = { path = "../", version = "1.1.0-alpha" }
|
||||
# libnss = "0.2"
|
||||
libnss = { git = "https://github.com/csnewman/libnss-rs.git", rev = "eab2d93d2438652773699b0807d558ce75b1e748" }
|
||||
libnss = "0.4"
|
||||
# libnss = { git = "https://github.com/csnewman/libnss-rs.git", rev = "eab2d93d2438652773699b0807d558ce75b1e748" }
|
||||
libc = "0.2.0"
|
||||
paste = "1.0"
|
||||
lazy_static = "1.3"
|
||||
|
|
45
kanidm_unix_int/pam_tester/Cargo.lock
generated
45
kanidm_unix_int/pam_tester/Cargo.lock
generated
|
@ -1,45 +0,0 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.67"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "pam"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pam-sys 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"users 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pam-sys"
|
||||
version = "0.5.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pam_tester"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"pam 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "users"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[metadata]
|
||||
"checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018"
|
||||
"checksum pam 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa2bdc959c201c047004a1420a92aaa1dd1a6b64d5ef333aa3a4ac764fb93097"
|
||||
"checksum pam-sys 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cd4858311a097f01a0006ef7d0cd50bca81ec430c949d7bf95cbefd202282434"
|
||||
"checksum users 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fed7d0912567d35f88010c23dbaf865e9da8b5227295e8dc0f2fdd109155ab7"
|
|
@ -370,6 +370,9 @@ async fn main() {
|
|||
// ::std::env::set_var("RUST_LOG", "kanidm=debug,kanidm_client=debug");
|
||||
env_logger::init();
|
||||
|
||||
debug!("Profile -> {}", env!("KANIDM_PROFILE_NAME"));
|
||||
debug!("CPU Flags -> {}", env!("KANIDM_CPU_FLAGS"));
|
||||
|
||||
let cfg_path = Path::new("/etc/kanidm/config");
|
||||
let cfg_path_str = match cfg_path.to_str() {
|
||||
Some(cps) => cps,
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
# cargo-features = ["default-run"]
|
||||
|
||||
[package]
|
||||
name = "kanidm"
|
||||
version = "1.1.0-alpha.3"
|
||||
authors = ["William Brown <william@blackhats.net.au>"]
|
||||
# default-run = "kanidm_core"
|
||||
edition = "2018"
|
||||
license = "MPL-2.0"
|
||||
description = "Kanidm Server Library and Binary"
|
||||
|
@ -30,7 +27,7 @@ tide = "0.15"
|
|||
async-trait = "0.1"
|
||||
async-h1 = "2.0"
|
||||
tide-rustls = "0.1"
|
||||
fernet = { git = "https://github.com/mozilla-services/fernet-rs.git" }
|
||||
fernet = "^0.1.4"
|
||||
|
||||
async-std = "1.6"
|
||||
|
||||
|
@ -78,7 +75,7 @@ base64 = "0.13"
|
|||
|
||||
idlset = { version = "^0.1.12" , features = ["use_smallvec"] }
|
||||
ldap3_server = "0.1"
|
||||
webauthn-rs = "0.3.0-alpha.5"
|
||||
webauthn-rs = "0.3.0-alpha.7"
|
||||
|
||||
libc = "0.2"
|
||||
users = "0.11"
|
||||
|
@ -92,7 +89,7 @@ simd_support = [ "concread/simd_support" ]
|
|||
[dev-dependencies]
|
||||
criterion = { version = "0.3", features = ["html_reports"] }
|
||||
# For testing webauthn
|
||||
webauthn-authenticator-rs = "0.3.0-alpha.5"
|
||||
webauthn-authenticator-rs = "0.3.0-alpha.7"
|
||||
|
||||
[dev-dependencies.cargo-husky]
|
||||
version = "1"
|
||||
|
@ -103,6 +100,7 @@ features = ["precommit-hook", "run-cargo-fmt"]
|
|||
structopt = { version = "0.3", default-features = false }
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
toml = "0.5"
|
||||
|
||||
[[bench]]
|
||||
name = "scaling_10k"
|
||||
|
|
|
@ -11,6 +11,7 @@ RUN zypper -vv ref && \
|
|||
clang lld \
|
||||
make automake autoconf \
|
||||
libopenssl-devel pam-devel \
|
||||
sqlite3-devel \
|
||||
sccache && \
|
||||
zypper clean -a
|
||||
|
||||
|
@ -18,16 +19,12 @@ COPY . /usr/src/kanidm
|
|||
WORKDIR /usr/src/kanidm/kanidmd
|
||||
|
||||
ARG SCCACHE_REDIS
|
||||
ARG KANIDM_FEATURES
|
||||
ARG KANIDM_BUILD_PROFILE
|
||||
|
||||
RUN ln -s -f /usr/bin/clang /usr/bin/cc && \
|
||||
ln -s -f /usr/bin/ld.lld /usr/bin/ld
|
||||
|
||||
RUN if [ "$(uname -m)" == "x86_64" ]; \
|
||||
then export RUSTFLAGS='-Ctarget-cpu=haswell'; \
|
||||
fi && \
|
||||
if [ "$(uname -m)" == "aarch64" ]; \
|
||||
then export RUSTFLAGS=''; \
|
||||
fi && \
|
||||
RUN mkdir /scratch && \
|
||||
ln -s -f /usr/bin/clang /usr/bin/cc && \
|
||||
ln -s -f /usr/bin/ld.lld /usr/bin/ld && \
|
||||
if [ "${SCCACHE_REDIS}" != "" ]; \
|
||||
then \
|
||||
export CC="/usr/bin/sccache /usr/bin/clang" && \
|
||||
|
@ -37,18 +34,16 @@ RUN if [ "$(uname -m)" == "x86_64" ]; \
|
|||
export CC="/usr/bin/clang"; \
|
||||
fi && \
|
||||
export RUSTC_BOOTSTRAP=1 && \
|
||||
echo $RUSTC_BOOTSTRAP && \
|
||||
echo $RUSTC_WRAPPER && \
|
||||
echo $RUSTFLAGS && \
|
||||
echo $CC && \
|
||||
cargo build \
|
||||
--features=simd_support,libsqlite3-sys/bundled \
|
||||
echo $KANIDM_BUILD_PROFILE && \
|
||||
echo $KANIDM_FEATURES && \
|
||||
CARGO_HOME=/scratch/.cargo cargo build \
|
||||
--features=${KANIDM_FEATURES} \
|
||||
--target-dir=/usr/src/kanidm/target/ \
|
||||
--release && \
|
||||
ls -al /usr/src/kanidm/target/release/ && \
|
||||
if [ "${SCCACHE_REDIS}" != "" ]; \
|
||||
then sccache -s; \
|
||||
fi && \
|
||||
ls -al /usr/src/kanidm/target/release/
|
||||
|
||||
fi;
|
||||
|
||||
FROM ${BASE_IMAGE}
|
||||
LABEL mantainer william@blackhats.net.au
|
||||
|
@ -62,6 +57,7 @@ RUN zypper ref && \
|
|||
zypper clean -a
|
||||
|
||||
COPY --from=builder /usr/src/kanidm/target/release/kanidmd /sbin/
|
||||
COPY --from=builder /usr/src/kanidm/kanidmd_web_ui/pkg /pkg
|
||||
|
||||
EXPOSE 8443 3636
|
||||
VOLUME /data
|
||||
|
@ -69,4 +65,3 @@ VOLUME /data
|
|||
ENV RUST_BACKTRACE 1
|
||||
CMD ["/sbin/kanidmd", "server", "-c", "/data/server.toml"]
|
||||
|
||||
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
ARG BASE_IMAGE=ekidd/rust-musl-builder:1.43.0
|
||||
FROM ${BASE_IMAGE} AS builder
|
||||
LABEL mantainer william@blackhats.net.au
|
||||
|
||||
ADD --chown=rust:rust . ./
|
||||
WORKDIR kanidmd
|
||||
RUN cargo build --release
|
||||
|
||||
|
||||
FROM alpine:3.11 AS alpine
|
||||
LABEL mantainer william@blackhats.net.au
|
||||
|
||||
RUN apk --no-cache add ca-certificates
|
||||
COPY --from=builder \
|
||||
/home/rust/src/target/x86_64-unknown-linux-musl/release/kanidmd \
|
||||
/sbin/
|
||||
EXPOSE 8443
|
||||
VOLUME /data
|
||||
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"]
|
||||
|
||||
FROM scratch
|
||||
LABEL mantainer william@blackhats.net.au
|
||||
|
||||
COPY --from=builder \
|
||||
/home/rust/src/target/x86_64-unknown-linux-musl/release/kanidmd \
|
||||
/sbin/
|
||||
EXPOSE 8443
|
||||
VOLUME /data
|
||||
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"]
|
||||
|
|
@ -3,6 +3,9 @@ extern crate serde_derive;
|
|||
|
||||
use std::env;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
use std::path::PathBuf;
|
||||
use structopt::clap::Shell;
|
||||
use structopt::StructOpt;
|
||||
|
@ -10,6 +13,8 @@ use structopt::StructOpt;
|
|||
include!("src/lib/audit_loglevel.rs");
|
||||
include!("src/server/opt.rs");
|
||||
|
||||
include!("../profiles/syntax.rs");
|
||||
|
||||
fn main() {
|
||||
let outdir = match env::var_os("OUT_DIR") {
|
||||
None => return,
|
||||
|
@ -18,4 +23,45 @@ fn main() {
|
|||
|
||||
KanidmdOpt::clap().gen_completions("kanidmd", Shell::Bash, outdir.clone());
|
||||
KanidmdOpt::clap().gen_completions("kanidmd", Shell::Zsh, outdir);
|
||||
|
||||
// transform any requested paths for our server. We do this by reading
|
||||
// our profile that we have been provided.
|
||||
|
||||
println!("cargo:rerun-if-env-changed=KANIDM_BUILD_PROFILE");
|
||||
let profile = env::var("KANIDM_BUILD_PROFILE").unwrap_or_else(|_| "developer".to_string());
|
||||
|
||||
let profile_path: PathBuf = ["../profiles", format!("{}.toml", profile).as_str()]
|
||||
.iter()
|
||||
.collect();
|
||||
|
||||
println!("cargo:rerun-if-changed={}", profile_path.to_str().unwrap());
|
||||
|
||||
let mut f =
|
||||
File::open(&profile_path).expect(format!("Failed to open {:?}", profile_path).as_str());
|
||||
|
||||
let mut contents = String::new();
|
||||
f.read_to_string(&mut contents)
|
||||
.expect(format!("Failed to read {:?}", profile_path).as_str());
|
||||
|
||||
let profile_cfg: ProfileConfig = toml::from_str(contents.as_str())
|
||||
.expect(format!("Failed to parse {:?}", profile_path).as_str());
|
||||
|
||||
/*
|
||||
* x86-64: CMOV, CMPXCHG8B, FPU, FXSR, MMX, FXSR, SCE, SSE, SSE2
|
||||
* x86-64-v2: (close to Nehalem) CMPXCHG16B, LAHF-SAHF, POPCNT, SSE3, SSE4.1, SSE4.2, SSSE3
|
||||
* x86-64-v3: (close to Haswell) AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE
|
||||
*/
|
||||
|
||||
match profile_cfg.cpu_flags {
|
||||
CpuOptLevel::none => {}
|
||||
CpuOptLevel::native => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-cpu=native"),
|
||||
CpuOptLevel::x86_64_v1 => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-feature=+cmov,+cx8,+fxsr,+mmx,+sse,+sse2"),
|
||||
CpuOptLevel::x86_64_v3 => println!("cargo:rustc-env=RUSTFLAGS=-Ctarget-feature=+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+cx16,+sahf,+popcnt,+sse3,+sse4.1,+sse4.2,+avx,+avx2,+bmi,+bmi2,+f16c,+fma,+lzcnt,+movbe,+xsave"),
|
||||
}
|
||||
println!("cargo:rustc-env=KANIDM_PROFILE_NAME={}", profile);
|
||||
println!("cargo:rustc-env=KANIDM_CPU_FLAGS={}", profile_cfg.cpu_flags);
|
||||
println!(
|
||||
"cargo:rustc-env=KANIDM_WEB_UI_PKG_PATH={}",
|
||||
profile_cfg.web_ui_pkg_path
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,5 +4,5 @@ db_path = "/tmp/kanidm.db"
|
|||
db_fs_type = "zfs"
|
||||
tls_chain = "../insecure/chain.pem"
|
||||
tls_key = "../insecure/key.pem"
|
||||
log_level = "verbose"
|
||||
log_level = "quiet"
|
||||
origin = "https://idm.example.com"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::time::Duration;
|
||||
use uuid::Uuid;
|
||||
use webauthn_rs::crypto::COSEKey;
|
||||
use webauthn_rs::proto::COSEKey;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DbCidV1 {
|
||||
|
|
|
@ -1314,6 +1314,10 @@ impl Backend {
|
|||
idxmeta: Set<IdxKey>,
|
||||
vacuum: bool,
|
||||
) -> Result<Self, OperationError> {
|
||||
info!("DB tickets -> {:?}", pool_size);
|
||||
info!("Profile -> {}", env!("KANIDM_PROFILE_NAME"));
|
||||
info!("CPU Flags -> {}", env!("KANIDM_CPU_FLAGS"));
|
||||
|
||||
// If in memory, reduce pool to 1
|
||||
if path == "" {
|
||||
pool_size = 1;
|
||||
|
|
|
@ -134,6 +134,31 @@ macro_rules! new_eventid {
|
|||
}
|
||||
|
||||
// Handle the various end points we need to expose
|
||||
async fn index_view(_req: tide::Request<AppState>) -> tide::Result {
|
||||
let mut res = tide::Response::new(200);
|
||||
res.set_content_type("text/html;charset=utf-8");
|
||||
res.set_body(
|
||||
r#"
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Kanidm</title>
|
||||
<link rel="stylesheet" href="/pkg/external/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T">
|
||||
<script src="/pkg/external/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"></script>
|
||||
<script src="/pkg/external/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"></script>
|
||||
<script src="/pkg/external/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"></script>
|
||||
<script src="/pkg/bundle.js" defer></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
"#,
|
||||
);
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
// pub async fn create((req, session, state): (Json<CreateRequest>, Session, Data<AppState>),
|
||||
pub async fn create(mut req: tide::Request<AppState>) -> tide::Result {
|
||||
|
@ -997,7 +1022,9 @@ pub async fn auth(mut req: tide::Request<AppState>) -> tide::Result {
|
|||
let maybe_sessionid = req.session().get::<Uuid>("auth-session-id");
|
||||
debug!("🍿 {:?}", maybe_sessionid);
|
||||
|
||||
let obj: AuthRequest = req.body_json().await?;
|
||||
let obj: AuthRequest = req.body_json().await
|
||||
.map_err(|e| {debug!("wat? {:?}", e); e})
|
||||
?;
|
||||
|
||||
let auth_msg = AuthMessage::new(obj, maybe_sessionid, eventid);
|
||||
|
||||
|
@ -1216,6 +1243,8 @@ pub fn create_https_server(
|
|||
qe_w_ref: &'static QueryServerWriteV1,
|
||||
qe_r_ref: &'static QueryServerReadV1,
|
||||
) -> Result<(), ()> {
|
||||
info!("WEB_UI_PKG_PATH -> {}", env!("KANIDM_WEB_UI_PKG_PATH"));
|
||||
|
||||
// Create the in memory fernet key
|
||||
let fernet_handle = fernet::Fernet::new(&fernet::Fernet::generate_key()).ok_or_else(|| {
|
||||
error!("Failed to generate fernet key");
|
||||
|
@ -1237,6 +1266,17 @@ pub fn create_https_server(
|
|||
);
|
||||
|
||||
// Add routes
|
||||
tserver.at("/").get(index_view);
|
||||
tserver
|
||||
.at("/pkg")
|
||||
.serve_dir(env!("KANIDM_WEB_UI_PKG_PATH"))
|
||||
.map_err(|e| {
|
||||
error!(
|
||||
"Failed to serve pkg dir {} -> {:?}",
|
||||
env!("KANIDM_WEB_UI_PKG_PATH"),
|
||||
e
|
||||
);
|
||||
})?;
|
||||
tserver.at("/status").get(self::status);
|
||||
|
||||
let mut raw_route = tserver.at("/v1/raw");
|
||||
|
|
|
@ -219,16 +219,16 @@ impl CredHandler {
|
|||
match (cred, pw_mfa.totp.as_ref(), pw_mfa.wan.as_ref()) {
|
||||
(AuthCredential::Webauthn(resp), _, Some((_, wan_state))) => {
|
||||
webauthn.authenticate_credential(&resp, wan_state.clone())
|
||||
.map(|r| {
|
||||
.map(|(cid, auth_data)| {
|
||||
pw_mfa.mfa_state = CredVerifyState::Success;
|
||||
// Success. Determine if we need to update the counter
|
||||
// async from r.
|
||||
if let Some((cid, counter)) = r {
|
||||
if auth_data.counter != 0 {
|
||||
// Do async
|
||||
if let Err(_e) = async_tx.send(DelayedAction::WebauthnCounterIncrement(WebauthnCounterIncrement {
|
||||
target_uuid: who,
|
||||
cid,
|
||||
counter,
|
||||
counter: auth_data.counter,
|
||||
})) {
|
||||
ladmin_warning!(au, "unable to queue delayed webauthn counter increment, continuing ... ");
|
||||
};
|
||||
|
@ -334,16 +334,16 @@ impl CredHandler {
|
|||
AuthCredential::Webauthn(resp) => {
|
||||
// lets see how we go.
|
||||
webauthn.authenticate_credential(&resp, wan_cred.wan_state.clone())
|
||||
.map(|r| {
|
||||
.map(|(cid, auth_data)| {
|
||||
wan_cred.state = CredVerifyState::Success;
|
||||
// Success. Determine if we need to update the counter
|
||||
// async from r.
|
||||
if let Some((cid, counter)) = r {
|
||||
if auth_data.counter != 0 {
|
||||
// Do async
|
||||
if let Err(_e) = async_tx.send(DelayedAction::WebauthnCounterIncrement(WebauthnCounterIncrement {
|
||||
target_uuid: who,
|
||||
cid,
|
||||
counter,
|
||||
counter: auth_data.counter,
|
||||
})) {
|
||||
ladmin_warning!(au, "unable to queue delayed webauthn counter increment, continuing ... ");
|
||||
};
|
||||
|
|
|
@ -771,7 +771,6 @@ impl QueryServer {
|
|||
|
||||
info!("Server ID -> {:?}", s_uuid);
|
||||
info!("Domain ID -> {:?}", d_uuid);
|
||||
info!("DB tickets -> {:?}", pool_size);
|
||||
// log_event!(log, "Starting query worker ...");
|
||||
QueryServer {
|
||||
s_uuid,
|
||||
|
|
|
@ -214,7 +214,7 @@ async fn main() {
|
|||
config.update_log_level(Some(dll.clone() as u32));
|
||||
}
|
||||
|
||||
::std::env::set_var("RUST_LOG", "tide=info,kanidm=info,webauthn=debug");
|
||||
// ::std::env::set_var("RUST_LOG", "tide=info,kanidm=info,webauthn=debug");
|
||||
|
||||
env_logger::builder()
|
||||
.format_timestamp(None)
|
||||
|
|
20
kanidmd_web_ui/Cargo.toml
Normal file
20
kanidmd_web_ui/Cargo.toml
Normal file
|
@ -0,0 +1,20 @@
|
|||
[package]
|
||||
name = "kanidmd_web_ui"
|
||||
version = "1.1.0-alpha.3"
|
||||
authors = ["William Brown <william@blackhats.net.au>"]
|
||||
edition = "2018"
|
||||
license = "MPL-2.0"
|
||||
description = "Kanidm Server Web User Interface"
|
||||
documentation = "https://docs.rs/kanidm/latest/kanidm/"
|
||||
homepage = "https://github.com/kanidm/kanidm/"
|
||||
repository = "https://github.com/kanidm/kanidm/"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
|
||||
wasm-bindgen-futures = { version = "0.4" }
|
||||
yew = "0.17"
|
||||
kanidm_proto = { path = "../kanidm_proto", version = "1.1.0-alpha" }
|
||||
anyhow = "1"
|
4
kanidmd_web_ui/build_wasm.sh
Executable file
4
kanidmd_web_ui/build_wasm.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
wasm-pack build --no-typescript --release --target web && \
|
||||
rollup ./src/main.js --format iife --file ./pkg/bundle.js && \
|
||||
rm ./pkg/.gitignore
|
666
kanidmd_web_ui/pkg/bundle.js
Normal file
666
kanidmd_web_ui/pkg/bundle.js
Normal file
|
@ -0,0 +1,666 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
let wasm;
|
||||
|
||||
const heap = new Array(32).fill(undefined);
|
||||
|
||||
heap.push(undefined, null, true, false);
|
||||
|
||||
function getObject(idx) { return heap[idx]; }
|
||||
|
||||
let heap_next = heap.length;
|
||||
|
||||
function dropObject(idx) {
|
||||
if (idx < 36) return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
||||
|
||||
cachedTextDecoder.decode();
|
||||
|
||||
let cachegetUint8Memory0 = null;
|
||||
function getUint8Memory0() {
|
||||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8Memory0;
|
||||
}
|
||||
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
|
||||
function addHeapObject(obj) {
|
||||
if (heap_next === heap.length) heap.push(heap.length + 1);
|
||||
const idx = heap_next;
|
||||
heap_next = heap[idx];
|
||||
|
||||
heap[idx] = obj;
|
||||
return idx;
|
||||
}
|
||||
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
|
||||
let cachedTextEncoder = new TextEncoder('utf-8');
|
||||
|
||||
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
||||
? function (arg, view) {
|
||||
return cachedTextEncoder.encodeInto(arg, view);
|
||||
}
|
||||
: function (arg, view) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
view.set(buf);
|
||||
return {
|
||||
read: arg.length,
|
||||
written: buf.length
|
||||
};
|
||||
});
|
||||
|
||||
function passStringToWasm0(arg, malloc, realloc) {
|
||||
|
||||
if (realloc === undefined) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
const ptr = malloc(buf.length);
|
||||
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
||||
WASM_VECTOR_LEN = buf.length;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
let len = arg.length;
|
||||
let ptr = malloc(len);
|
||||
|
||||
const mem = getUint8Memory0();
|
||||
|
||||
let offset = 0;
|
||||
|
||||
for (; offset < len; offset++) {
|
||||
const code = arg.charCodeAt(offset);
|
||||
if (code > 0x7F) break;
|
||||
mem[ptr + offset] = code;
|
||||
}
|
||||
|
||||
if (offset !== len) {
|
||||
if (offset !== 0) {
|
||||
arg = arg.slice(offset);
|
||||
}
|
||||
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
||||
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
||||
const ret = encodeString(arg, view);
|
||||
|
||||
offset += ret.written;
|
||||
}
|
||||
|
||||
WASM_VECTOR_LEN = offset;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
function isLikeNone(x) {
|
||||
return x === undefined || x === null;
|
||||
}
|
||||
|
||||
let cachegetInt32Memory0 = null;
|
||||
function getInt32Memory0() {
|
||||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetInt32Memory0;
|
||||
}
|
||||
|
||||
function debugString(val) {
|
||||
// primitive types
|
||||
const type = typeof val;
|
||||
if (type == 'number' || type == 'boolean' || val == null) {
|
||||
return `${val}`;
|
||||
}
|
||||
if (type == 'string') {
|
||||
return `"${val}"`;
|
||||
}
|
||||
if (type == 'symbol') {
|
||||
const description = val.description;
|
||||
if (description == null) {
|
||||
return 'Symbol';
|
||||
} else {
|
||||
return `Symbol(${description})`;
|
||||
}
|
||||
}
|
||||
if (type == 'function') {
|
||||
const name = val.name;
|
||||
if (typeof name == 'string' && name.length > 0) {
|
||||
return `Function(${name})`;
|
||||
} else {
|
||||
return 'Function';
|
||||
}
|
||||
}
|
||||
// objects
|
||||
if (Array.isArray(val)) {
|
||||
const length = val.length;
|
||||
let debug = '[';
|
||||
if (length > 0) {
|
||||
debug += debugString(val[0]);
|
||||
}
|
||||
for(let i = 1; i < length; i++) {
|
||||
debug += ', ' + debugString(val[i]);
|
||||
}
|
||||
debug += ']';
|
||||
return debug;
|
||||
}
|
||||
// Test for built-in
|
||||
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
||||
let className;
|
||||
if (builtInMatches.length > 1) {
|
||||
className = builtInMatches[1];
|
||||
} else {
|
||||
// Failed to match the standard '[object ClassName]'
|
||||
return toString.call(val);
|
||||
}
|
||||
if (className == 'Object') {
|
||||
// we're a user defined class or Object
|
||||
// JSON.stringify avoids problems with cycles, and is generally much
|
||||
// easier than looping through ownProperties of `val`.
|
||||
try {
|
||||
return 'Object(' + JSON.stringify(val) + ')';
|
||||
} catch (_) {
|
||||
return 'Object';
|
||||
}
|
||||
}
|
||||
// errors
|
||||
if (val instanceof Error) {
|
||||
return `${val.name}: ${val.message}\n${val.stack}`;
|
||||
}
|
||||
// TODO we could test for more things here, like `Set`s and `Map`s.
|
||||
return className;
|
||||
}
|
||||
|
||||
function makeMutClosure(arg0, arg1, dtor, f) {
|
||||
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
||||
const real = (...args) => {
|
||||
// First up with a closure we increment the internal reference
|
||||
// count. This ensures that the Rust closure environment won't
|
||||
// be deallocated while we're invoking it.
|
||||
state.cnt++;
|
||||
const a = state.a;
|
||||
state.a = 0;
|
||||
try {
|
||||
return f(a, state.b, ...args);
|
||||
} finally {
|
||||
if (--state.cnt === 0) {
|
||||
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
||||
|
||||
} else {
|
||||
state.a = a;
|
||||
}
|
||||
}
|
||||
};
|
||||
real.original = state;
|
||||
|
||||
return real;
|
||||
}
|
||||
|
||||
let stack_pointer = 32;
|
||||
|
||||
function addBorrowedObject(obj) {
|
||||
if (stack_pointer == 1) throw new Error('out of js stack');
|
||||
heap[--stack_pointer] = obj;
|
||||
return stack_pointer;
|
||||
}
|
||||
function __wbg_adapter_24(arg0, arg1, arg2) {
|
||||
try {
|
||||
wasm._dyn_core__ops__function__FnMut___A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ed9c14451e9c663(arg0, arg1, addBorrowedObject(arg2));
|
||||
} finally {
|
||||
heap[stack_pointer++] = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function __wbg_adapter_27(arg0, arg1, arg2) {
|
||||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1409b27d5a10e953(arg0, arg1, addHeapObject(arg2));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
function run_login_app() {
|
||||
wasm.run_login_app();
|
||||
}
|
||||
|
||||
function handleError(f) {
|
||||
return function () {
|
||||
try {
|
||||
return f.apply(this, arguments);
|
||||
|
||||
} catch (e) {
|
||||
wasm.__wbindgen_exn_store(addHeapObject(e));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function load(module, imports) {
|
||||
if (typeof Response === 'function' && module instanceof Response) {
|
||||
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
||||
try {
|
||||
return await WebAssembly.instantiateStreaming(module, imports);
|
||||
|
||||
} catch (e) {
|
||||
if (module.headers.get('Content-Type') != 'application/wasm') {
|
||||
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
||||
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const bytes = await module.arrayBuffer();
|
||||
return await WebAssembly.instantiate(bytes, imports);
|
||||
|
||||
} else {
|
||||
const instance = await WebAssembly.instantiate(module, imports);
|
||||
|
||||
if (instance instanceof WebAssembly.Instance) {
|
||||
return { instance, module };
|
||||
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function init(input) {
|
||||
if (typeof input === 'undefined') {
|
||||
input = new URL('kanidmd_web_ui_bg.wasm', (document.currentScript && document.currentScript.src || new URL('bundle.js', document.baseURI).href));
|
||||
}
|
||||
const imports = {};
|
||||
imports.wbg = {};
|
||||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
||||
const obj = takeObject(arg0).original;
|
||||
if (obj.cnt-- == 1) {
|
||||
obj.a = 0;
|
||||
return true;
|
||||
}
|
||||
var ret = false;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
||||
var ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
||||
var ret = getObject(arg0) === undefined;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
||||
var ret = getObject(arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_Window_6f26ab8994cdec9b = function(arg0) {
|
||||
var ret = getObject(arg0).Window;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_WorkerGlobalScope_65696f271e05e492 = function(arg0) {
|
||||
var ret = getObject(arg0).WorkerGlobalScope;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_59cb74e423758ede = function() {
|
||||
var ret = new Error();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_stack_558ba5917b466edd = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).stack;
|
||||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_error_4bb6c2a97407129a = function(arg0, arg1) {
|
||||
try {
|
||||
console.error(getStringFromWasm0(arg0, arg1));
|
||||
} finally {
|
||||
wasm.__wbindgen_free(arg0, arg1);
|
||||
}
|
||||
};
|
||||
imports.wbg.__wbg_instanceof_Window_5993230e7331f098 = function(arg0) {
|
||||
var ret = getObject(arg0) instanceof Window;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_document_85584f745133c6ad = function(arg0) {
|
||||
var ret = getObject(arg0).document;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_localStorage_17cc4197ac61d472 = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).localStorage;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_sessionStorage_eb79149ddca2015c = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).sessionStorage;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_fetch_a830023d79222b35 = function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).fetch(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_createElement_9291c0306f179f1e = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_createElementNS_ecbbee6419005089 = handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
||||
var ret = getObject(arg0).createElementNS(arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_createTextNode_cd0249d33c7e5c4a = function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).createTextNode(getStringFromWasm0(arg1, arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_querySelector_8ff6e717f918ac47 = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).querySelector(getStringFromWasm0(arg1, arg2));
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_status_42d679a063e3f40c = function(arg0) {
|
||||
var ret = getObject(arg0).status;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_headers_92965033102a703d = function(arg0) {
|
||||
var ret = getObject(arg0).headers;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_arrayBuffer_aeff0aaf9aec857d = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).arrayBuffer();
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_text_4b57f36d42790087 = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).text();
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_instanceof_HtmlTextAreaElement_85330633857ee50e = function(arg0) {
|
||||
var ret = getObject(arg0) instanceof HTMLTextAreaElement;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_value_4797b74b15a0bc19 = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).value;
|
||||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_setvalue_3ee783318a1b301d = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).value = getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_newwithstrandinit_814c15649f6924a8 = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_instanceof_HtmlButtonElement_87846abf00da2deb = function(arg0) {
|
||||
var ret = getObject(arg0) instanceof HTMLButtonElement;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_settype_1772a824336d2b26 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).type = getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_addEventListener_c11a938b8469ab06 = handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
||||
getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
|
||||
});
|
||||
imports.wbg.__wbg_removeEventListener_992337883d25d832 = handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
||||
getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), arg4 !== 0);
|
||||
});
|
||||
imports.wbg.__wbg_instanceof_HtmlInputElement_631f8bb677bb0897 = function(arg0) {
|
||||
var ret = getObject(arg0) instanceof HTMLInputElement;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_setchecked_e9a4b8ce0e28b973 = function(arg0, arg1) {
|
||||
getObject(arg0).checked = arg1 !== 0;
|
||||
};
|
||||
imports.wbg.__wbg_settype_dfbbea62b5fa060d = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).type = getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_value_98044d455b0093f7 = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).value;
|
||||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_setvalue_2924913056a0a03c = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).value = getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_signal_fbd119dce1c909d1 = function(arg0) {
|
||||
var ret = getObject(arg0).signal;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_049faf1b539ba534 = handleError(function() {
|
||||
var ret = new AbortController();
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_abort_fa1dfe1534bb7a3a = function(arg0) {
|
||||
getObject(arg0).abort();
|
||||
};
|
||||
imports.wbg.__wbg_namespaceURI_ba0083a6b53a9753 = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).namespaceURI;
|
||||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_removeAttribute_ab52d40b0c7386a7 = handleError(function(arg0, arg1, arg2) {
|
||||
getObject(arg0).removeAttribute(getStringFromWasm0(arg1, arg2));
|
||||
});
|
||||
imports.wbg.__wbg_setAttribute_5349d84c3833cecd = handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
||||
getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
||||
});
|
||||
imports.wbg.__wbg_log_be5faf67a2e8b869 = function(arg0) {
|
||||
console.log(getObject(arg0));
|
||||
};
|
||||
imports.wbg.__wbg_fetch_2740e801a1c8d511 = function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).fetch(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_lastChild_d4077e79715ffef3 = function(arg0) {
|
||||
var ret = getObject(arg0).lastChild;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_setnodeValue_83c9aa40c199e1ba = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).nodeValue = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_textContent_06c1d06e1d69ea68 = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).textContent;
|
||||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_appendChild_57f30a01b30ec33c = handleError(function(arg0, arg1) {
|
||||
var ret = getObject(arg0).appendChild(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_insertBefore_30d17168293fa763 = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).insertBefore(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_removeChild_77c0b65b7396e214 = handleError(function(arg0, arg1) {
|
||||
var ret = getObject(arg0).removeChild(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_newwithstrsequencesequence_856c86f363c8a3d6 = handleError(function(arg0) {
|
||||
var ret = new Headers(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_get_47bf656299aac357 = function(arg0, arg1) {
|
||||
var ret = getObject(arg0)[arg1 >>> 0];
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_is_function = function(arg0) {
|
||||
var ret = typeof(getObject(arg0)) === 'function';
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_is_object = function(arg0) {
|
||||
const val = getObject(arg0);
|
||||
var ret = typeof(val) === 'object' && val !== null;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_next_f613b44647788059 = function(arg0) {
|
||||
var ret = getObject(arg0).next;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_next_cf4ec627a2e85bac = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).next();
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_done_4e046ac6e3b595e0 = function(arg0) {
|
||||
var ret = getObject(arg0).done;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_value_6fa14ba8ee7b7c3d = function(arg0) {
|
||||
var ret = getObject(arg0).value;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_iterator_7d4f7917ab7aeca0 = function() {
|
||||
var ret = Symbol.iterator;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_get_4e90ba4e3de362de = handleError(function(arg0, arg1) {
|
||||
var ret = Reflect.get(getObject(arg0), getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_call_e5847d15cc228e4f = handleError(function(arg0, arg1) {
|
||||
var ret = getObject(arg0).call(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_new_7c995f2adeba6fb5 = function() {
|
||||
var ret = new Array();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_from_badf9c2620e47d5a = function(arg0) {
|
||||
var ret = Array.from(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_push_3f7c76b58919ce0d = function(arg0, arg1) {
|
||||
var ret = getObject(arg0).push(getObject(arg1));
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_toString_ebb2190bcbb2fdfe = function(arg0) {
|
||||
var ret = getObject(arg0).toString();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_newnoargs_2349ba6aefe72376 = function(arg0, arg1) {
|
||||
var ret = new Function(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_is_ff18d90ee51cb4a6 = function(arg0, arg1) {
|
||||
var ret = Object.is(getObject(arg0), getObject(arg1));
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_new_59986c8731bebaa1 = function() {
|
||||
var ret = new Object();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_resolve_e0690143406c88cb = function(arg0) {
|
||||
var ret = Promise.resolve(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_then_9caf23122e4fd5d3 = function(arg0, arg1) {
|
||||
var ret = getObject(arg0).then(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_then_16663faf60ffbe95 = function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_self_35a0fda3eb965abe = handleError(function() {
|
||||
var ret = self.self;
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_window_88a6f88dd3a474f1 = handleError(function() {
|
||||
var ret = window.window;
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_globalThis_1d843c4ad7b6a1f5 = handleError(function() {
|
||||
var ret = globalThis.globalThis;
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_global_294ce70448e8fbbf = handleError(function() {
|
||||
var ret = global.global;
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_buffer_0be9fb426f2dd82b = function(arg0) {
|
||||
var ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_newwithbyteoffsetandlength_85b7ce82b001ea08 = function(arg0, arg1, arg2) {
|
||||
var ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_length_3a5138f465b971ad = function(arg0) {
|
||||
var ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_new_4e8d18dbf9cd5240 = function(arg0) {
|
||||
var ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_set_4769de301eb521d7 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
||||
};
|
||||
imports.wbg.__wbg_set_7e15d36563072b19 = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
||||
return ret;
|
||||
});
|
||||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
var ret = typeof(obj) === 'string' ? obj : undefined;
|
||||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
||||
var ret = debugString(getObject(arg1));
|
||||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
imports.wbg.__wbindgen_memory = function() {
|
||||
var ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_closure_wrapper487 = function(arg0, arg1, arg2) {
|
||||
var ret = makeMutClosure(arg0, arg1, 173, __wbg_adapter_24);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_closure_wrapper560 = function(arg0, arg1, arg2) {
|
||||
var ret = makeMutClosure(arg0, arg1, 202, __wbg_adapter_27);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
||||
input = fetch(input);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const { instance, module } = await load(await input, imports);
|
||||
|
||||
wasm = instance.exports;
|
||||
init.__wbindgen_wasm_module = module;
|
||||
|
||||
return wasm;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
await init('/pkg/kanidmd_web_ui_bg.wasm');
|
||||
run_login_app();
|
||||
}
|
||||
main();
|
||||
|
||||
}());
|
7
kanidmd_web_ui/pkg/external/bootstrap.min.css
vendored
Normal file
7
kanidmd_web_ui/pkg/external/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7
kanidmd_web_ui/pkg/external/bootstrap.min.js
vendored
Normal file
7
kanidmd_web_ui/pkg/external/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
kanidmd_web_ui/pkg/external/jquery-3.3.1.slim.min.js
vendored
Normal file
2
kanidmd_web_ui/pkg/external/jquery-3.3.1.slim.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
kanidmd_web_ui/pkg/external/popper.min.js
vendored
Normal file
5
kanidmd_web_ui/pkg/external/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
659
kanidmd_web_ui/pkg/kanidmd_web_ui.js
Normal file
659
kanidmd_web_ui/pkg/kanidmd_web_ui.js
Normal file
|
@ -0,0 +1,659 @@
|
|||
|
||||
let wasm;
|
||||
|
||||
const heap = new Array(32).fill(undefined);
|
||||
|
||||
heap.push(undefined, null, true, false);
|
||||
|
||||
function getObject(idx) { return heap[idx]; }
|
||||
|
||||
let heap_next = heap.length;
|
||||
|
||||
function dropObject(idx) {
|
||||
if (idx < 36) return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
||||
|
||||
cachedTextDecoder.decode();
|
||||
|
||||
let cachegetUint8Memory0 = null;
|
||||
function getUint8Memory0() {
|
||||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetUint8Memory0;
|
||||
}
|
||||
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
|
||||
function addHeapObject(obj) {
|
||||
if (heap_next === heap.length) heap.push(heap.length + 1);
|
||||
const idx = heap_next;
|
||||
heap_next = heap[idx];
|
||||
|
||||
heap[idx] = obj;
|
||||
return idx;
|
||||
}
|
||||
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
|
||||
let cachedTextEncoder = new TextEncoder('utf-8');
|
||||
|
||||
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
||||
? function (arg, view) {
|
||||
return cachedTextEncoder.encodeInto(arg, view);
|
||||
}
|
||||
: function (arg, view) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
view.set(buf);
|
||||
return {
|
||||
read: arg.length,
|
||||
written: buf.length
|
||||
};
|
||||
});
|
||||
|
||||
function passStringToWasm0(arg, malloc, realloc) {
|
||||
|
||||
if (realloc === undefined) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
const ptr = malloc(buf.length);
|
||||
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
||||
WASM_VECTOR_LEN = buf.length;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
let len = arg.length;
|
||||
let ptr = malloc(len);
|
||||
|
||||
const mem = getUint8Memory0();
|
||||
|
||||
let offset = 0;
|
||||
|
||||
for (; offset < len; offset++) {
|
||||
const code = arg.charCodeAt(offset);
|
||||
if (code > 0x7F) break;
|
||||
mem[ptr + offset] = code;
|
||||
}
|
||||
|
||||
if (offset !== len) {
|
||||
if (offset !== 0) {
|
||||
arg = arg.slice(offset);
|
||||
}
|
||||
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
||||
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
||||
const ret = encodeString(arg, view);
|
||||
|
||||
offset += ret.written;
|
||||
}
|
||||
|
||||
WASM_VECTOR_LEN = offset;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
function isLikeNone(x) {
|
||||
return x === undefined || x === null;
|
||||
}
|
||||
|
||||
let cachegetInt32Memory0 = null;
|
||||
function getInt32Memory0() {
|
||||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
||||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachegetInt32Memory0;
|
||||
}
|
||||
|
||||
function debugString(val) {
|
||||
// primitive types
|
||||
const type = typeof val;
|
||||
if (type == 'number' || type == 'boolean' || val == null) {
|
||||
return `${val}`;
|
||||
}
|
||||
if (type == 'string') {
|
||||
return `"${val}"`;
|
||||
}
|
||||
if (type == 'symbol') {
|
||||
const description = val.description;
|
||||
if (description == null) {
|
||||
return 'Symbol';
|
||||
} else {
|
||||
return `Symbol(${description})`;
|
||||
}
|
||||
}
|
||||
if (type == 'function') {
|
||||
const name = val.name;
|
||||
if (typeof name == 'string' && name.length > 0) {
|
||||
return `Function(${name})`;
|
||||
} else {
|
||||
return 'Function';
|
||||
}
|
||||
}
|
||||
// objects
|
||||
if (Array.isArray(val)) {
|
||||
const length = val.length;
|
||||
let debug = '[';
|
||||
if (length > 0) {
|
||||
debug += debugString(val[0]);
|
||||
}
|
||||
for(let i = 1; i < length; i++) {
|
||||
debug += ', ' + debugString(val[i]);
|
||||
}
|
||||
debug += ']';
|
||||
return debug;
|
||||
}
|
||||
// Test for built-in
|
||||
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
||||
let className;
|
||||
if (builtInMatches.length > 1) {
|
||||
className = builtInMatches[1];
|
||||
} else {
|
||||
// Failed to match the standard '[object ClassName]'
|
||||
return toString.call(val);
|
||||
}
|
||||
if (className == 'Object') {
|
||||
// we're a user defined class or Object
|
||||
// JSON.stringify avoids problems with cycles, and is generally much
|
||||
// easier than looping through ownProperties of `val`.
|
||||
try {
|
||||
return 'Object(' + JSON.stringify(val) + ')';
|
||||
} catch (_) {
|
||||
return 'Object';
|
||||
}
|
||||
}
|
||||
// errors
|
||||
if (val instanceof Error) {
|
||||
return `${val.name}: ${val.message}\n${val.stack}`;
|
||||
}
|
||||
// TODO we could test for more things here, like `Set`s and `Map`s.
|
||||
return className;
|
||||
}
|
||||
|
||||
function makeMutClosure(arg0, arg1, dtor, f) {
|
||||
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
||||
const real = (...args) => {
|
||||
// First up with a closure we increment the internal reference
|
||||
// count. This ensures that the Rust closure environment won't
|
||||
// be deallocated while we're invoking it.
|
||||
state.cnt++;
|
||||
const a = state.a;
|
||||
state.a = 0;
|
||||
try {
|
||||
return f(a, state.b, ...args);
|
||||
} finally {
|
||||
if (--state.cnt === 0) {
|
||||
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
||||
|
||||
} else {
|
||||
state.a = a;
|
||||
}
|
||||
}
|
||||
};
|
||||
real.original = state;
|
||||
|
||||
return real;
|
||||
}
|
||||
|
||||
let stack_pointer = 32;
|
||||
|
||||
function addBorrowedObject(obj) {
|
||||
if (stack_pointer == 1) throw new Error('out of js stack');
|
||||
heap[--stack_pointer] = obj;
|
||||
return stack_pointer;
|
||||
}
|
||||
function __wbg_adapter_24(arg0, arg1, arg2) {
|
||||
try {
|
||||
wasm._dyn_core__ops__function__FnMut___A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ed9c14451e9c663(arg0, arg1, addBorrowedObject(arg2));
|
||||
} finally {
|
||||
heap[stack_pointer++] = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function __wbg_adapter_27(arg0, arg1, arg2) {
|
||||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1409b27d5a10e953(arg0, arg1, addHeapObject(arg2));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
export function run_login_app() {
|
||||
wasm.run_login_app();
|
||||
}
|
||||
|
||||
function handleError(f) {
|
||||
return function () {
|
||||
try {
|
||||
return f.apply(this, arguments);
|
||||
|
||||
} catch (e) {
|
||||
wasm.__wbindgen_exn_store(addHeapObject(e));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function load(module, imports) {
|
||||
if (typeof Response === 'function' && module instanceof Response) {
|
||||
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
||||
try {
|
||||
return await WebAssembly.instantiateStreaming(module, imports);
|
||||
|
||||
} catch (e) {
|
||||
if (module.headers.get('Content-Type') != 'application/wasm') {
|
||||
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
||||
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const bytes = await module.arrayBuffer();
|
||||
return await WebAssembly.instantiate(bytes, imports);
|
||||
|
||||
} else {
|
||||
const instance = await WebAssembly.instantiate(module, imports);
|
||||
|
||||
if (instance instanceof WebAssembly.Instance) {
|
||||
return { instance, module };
|
||||
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function init(input) {
|
||||
if (typeof input === 'undefined') {
|
||||
input = new URL('kanidmd_web_ui_bg.wasm', import.meta.url);
|
||||
}
|
||||
const imports = {};
|
||||
imports.wbg = {};
|
||||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
||||
const obj = takeObject(arg0).original;
|
||||
if (obj.cnt-- == 1) {
|
||||
obj.a = 0;
|
||||
return true;
|
||||
}
|
||||
var ret = false;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
||||
var ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
||||
var ret = getObject(arg0) === undefined;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
||||
var ret = getObject(arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_Window_6f26ab8994cdec9b = function(arg0) {
|
||||
var ret = getObject(arg0).Window;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_WorkerGlobalScope_65696f271e05e492 = function(arg0) {
|
||||
var ret = getObject(arg0).WorkerGlobalScope;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_59cb74e423758ede = function() {
|
||||
var ret = new Error();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_stack_558ba5917b466edd = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).stack;
|
||||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_error_4bb6c2a97407129a = function(arg0, arg1) {
|
||||
try {
|
||||
console.error(getStringFromWasm0(arg0, arg1));
|
||||
} finally {
|
||||
wasm.__wbindgen_free(arg0, arg1);
|
||||
}
|
||||
};
|
||||
imports.wbg.__wbg_instanceof_Window_5993230e7331f098 = function(arg0) {
|
||||
var ret = getObject(arg0) instanceof Window;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_document_85584f745133c6ad = function(arg0) {
|
||||
var ret = getObject(arg0).document;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_localStorage_17cc4197ac61d472 = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).localStorage;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_sessionStorage_eb79149ddca2015c = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).sessionStorage;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_fetch_a830023d79222b35 = function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).fetch(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_createElement_9291c0306f179f1e = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_createElementNS_ecbbee6419005089 = handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
||||
var ret = getObject(arg0).createElementNS(arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_createTextNode_cd0249d33c7e5c4a = function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).createTextNode(getStringFromWasm0(arg1, arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_querySelector_8ff6e717f918ac47 = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).querySelector(getStringFromWasm0(arg1, arg2));
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_status_42d679a063e3f40c = function(arg0) {
|
||||
var ret = getObject(arg0).status;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_headers_92965033102a703d = function(arg0) {
|
||||
var ret = getObject(arg0).headers;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_arrayBuffer_aeff0aaf9aec857d = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).arrayBuffer();
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_text_4b57f36d42790087 = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).text();
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_instanceof_HtmlTextAreaElement_85330633857ee50e = function(arg0) {
|
||||
var ret = getObject(arg0) instanceof HTMLTextAreaElement;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_value_4797b74b15a0bc19 = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).value;
|
||||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_setvalue_3ee783318a1b301d = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).value = getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_newwithstrandinit_814c15649f6924a8 = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_instanceof_HtmlButtonElement_87846abf00da2deb = function(arg0) {
|
||||
var ret = getObject(arg0) instanceof HTMLButtonElement;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_settype_1772a824336d2b26 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).type = getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_addEventListener_c11a938b8469ab06 = handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
||||
getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
|
||||
});
|
||||
imports.wbg.__wbg_removeEventListener_992337883d25d832 = handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
||||
getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), arg4 !== 0);
|
||||
});
|
||||
imports.wbg.__wbg_instanceof_HtmlInputElement_631f8bb677bb0897 = function(arg0) {
|
||||
var ret = getObject(arg0) instanceof HTMLInputElement;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_setchecked_e9a4b8ce0e28b973 = function(arg0, arg1) {
|
||||
getObject(arg0).checked = arg1 !== 0;
|
||||
};
|
||||
imports.wbg.__wbg_settype_dfbbea62b5fa060d = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).type = getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_value_98044d455b0093f7 = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).value;
|
||||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_setvalue_2924913056a0a03c = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).value = getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_signal_fbd119dce1c909d1 = function(arg0) {
|
||||
var ret = getObject(arg0).signal;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_049faf1b539ba534 = handleError(function() {
|
||||
var ret = new AbortController();
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_abort_fa1dfe1534bb7a3a = function(arg0) {
|
||||
getObject(arg0).abort();
|
||||
};
|
||||
imports.wbg.__wbg_namespaceURI_ba0083a6b53a9753 = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).namespaceURI;
|
||||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_removeAttribute_ab52d40b0c7386a7 = handleError(function(arg0, arg1, arg2) {
|
||||
getObject(arg0).removeAttribute(getStringFromWasm0(arg1, arg2));
|
||||
});
|
||||
imports.wbg.__wbg_setAttribute_5349d84c3833cecd = handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
||||
getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
||||
});
|
||||
imports.wbg.__wbg_log_be5faf67a2e8b869 = function(arg0) {
|
||||
console.log(getObject(arg0));
|
||||
};
|
||||
imports.wbg.__wbg_fetch_2740e801a1c8d511 = function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).fetch(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_lastChild_d4077e79715ffef3 = function(arg0) {
|
||||
var ret = getObject(arg0).lastChild;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_setnodeValue_83c9aa40c199e1ba = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).nodeValue = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
|
||||
};
|
||||
imports.wbg.__wbg_textContent_06c1d06e1d69ea68 = function(arg0, arg1) {
|
||||
var ret = getObject(arg1).textContent;
|
||||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_appendChild_57f30a01b30ec33c = handleError(function(arg0, arg1) {
|
||||
var ret = getObject(arg0).appendChild(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_insertBefore_30d17168293fa763 = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).insertBefore(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_removeChild_77c0b65b7396e214 = handleError(function(arg0, arg1) {
|
||||
var ret = getObject(arg0).removeChild(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_newwithstrsequencesequence_856c86f363c8a3d6 = handleError(function(arg0) {
|
||||
var ret = new Headers(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_get_47bf656299aac357 = function(arg0, arg1) {
|
||||
var ret = getObject(arg0)[arg1 >>> 0];
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_is_function = function(arg0) {
|
||||
var ret = typeof(getObject(arg0)) === 'function';
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_is_object = function(arg0) {
|
||||
const val = getObject(arg0);
|
||||
var ret = typeof(val) === 'object' && val !== null;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_next_f613b44647788059 = function(arg0) {
|
||||
var ret = getObject(arg0).next;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_next_cf4ec627a2e85bac = handleError(function(arg0) {
|
||||
var ret = getObject(arg0).next();
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_done_4e046ac6e3b595e0 = function(arg0) {
|
||||
var ret = getObject(arg0).done;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_value_6fa14ba8ee7b7c3d = function(arg0) {
|
||||
var ret = getObject(arg0).value;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_iterator_7d4f7917ab7aeca0 = function() {
|
||||
var ret = Symbol.iterator;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_get_4e90ba4e3de362de = handleError(function(arg0, arg1) {
|
||||
var ret = Reflect.get(getObject(arg0), getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_call_e5847d15cc228e4f = handleError(function(arg0, arg1) {
|
||||
var ret = getObject(arg0).call(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_new_7c995f2adeba6fb5 = function() {
|
||||
var ret = new Array();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_from_badf9c2620e47d5a = function(arg0) {
|
||||
var ret = Array.from(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_push_3f7c76b58919ce0d = function(arg0, arg1) {
|
||||
var ret = getObject(arg0).push(getObject(arg1));
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_toString_ebb2190bcbb2fdfe = function(arg0) {
|
||||
var ret = getObject(arg0).toString();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_newnoargs_2349ba6aefe72376 = function(arg0, arg1) {
|
||||
var ret = new Function(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_is_ff18d90ee51cb4a6 = function(arg0, arg1) {
|
||||
var ret = Object.is(getObject(arg0), getObject(arg1));
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_new_59986c8731bebaa1 = function() {
|
||||
var ret = new Object();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_resolve_e0690143406c88cb = function(arg0) {
|
||||
var ret = Promise.resolve(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_then_9caf23122e4fd5d3 = function(arg0, arg1) {
|
||||
var ret = getObject(arg0).then(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_then_16663faf60ffbe95 = function(arg0, arg1, arg2) {
|
||||
var ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_self_35a0fda3eb965abe = handleError(function() {
|
||||
var ret = self.self;
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_window_88a6f88dd3a474f1 = handleError(function() {
|
||||
var ret = window.window;
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_globalThis_1d843c4ad7b6a1f5 = handleError(function() {
|
||||
var ret = globalThis.globalThis;
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_global_294ce70448e8fbbf = handleError(function() {
|
||||
var ret = global.global;
|
||||
return addHeapObject(ret);
|
||||
});
|
||||
imports.wbg.__wbg_buffer_0be9fb426f2dd82b = function(arg0) {
|
||||
var ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_newwithbyteoffsetandlength_85b7ce82b001ea08 = function(arg0, arg1, arg2) {
|
||||
var ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_length_3a5138f465b971ad = function(arg0) {
|
||||
var ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_new_4e8d18dbf9cd5240 = function(arg0) {
|
||||
var ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_set_4769de301eb521d7 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
||||
};
|
||||
imports.wbg.__wbg_set_7e15d36563072b19 = handleError(function(arg0, arg1, arg2) {
|
||||
var ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
||||
return ret;
|
||||
});
|
||||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
var ret = typeof(obj) === 'string' ? obj : undefined;
|
||||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
||||
var ret = debugString(getObject(arg1));
|
||||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
imports.wbg.__wbindgen_memory = function() {
|
||||
var ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_closure_wrapper487 = function(arg0, arg1, arg2) {
|
||||
var ret = makeMutClosure(arg0, arg1, 173, __wbg_adapter_24);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_closure_wrapper560 = function(arg0, arg1, arg2) {
|
||||
var ret = makeMutClosure(arg0, arg1, 202, __wbg_adapter_27);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
||||
input = fetch(input);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const { instance, module } = await load(await input, imports);
|
||||
|
||||
wasm = instance.exports;
|
||||
init.__wbindgen_wasm_module = module;
|
||||
|
||||
return wasm;
|
||||
}
|
||||
|
||||
export default init;
|
||||
|
BIN
kanidmd_web_ui/pkg/kanidmd_web_ui_bg.wasm
Normal file
BIN
kanidmd_web_ui/pkg/kanidmd_web_ui_bg.wasm
Normal file
Binary file not shown.
20
kanidmd_web_ui/pkg/package.json
Normal file
20
kanidmd_web_ui/pkg/package.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "kanidmd_web_ui",
|
||||
"collaborators": [
|
||||
"William Brown <william@blackhats.net.au>"
|
||||
],
|
||||
"description": "Kanidm Server Web User Interface",
|
||||
"version": "1.1.0-alpha.3",
|
||||
"license": "MPL-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/kanidm/kanidm/"
|
||||
},
|
||||
"files": [
|
||||
"kanidmd_web_ui_bg.wasm",
|
||||
"kanidmd_web_ui.js"
|
||||
],
|
||||
"module": "kanidmd_web_ui.js",
|
||||
"homepage": "https://github.com/kanidm/kanidm/",
|
||||
"sideEffects": false
|
||||
}
|
12
kanidmd_web_ui/src/lib.rs
Normal file
12
kanidmd_web_ui/src/lib.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
#![recursion_limit="256"]
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
use yew::prelude::*;
|
||||
|
||||
mod login;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn run_login_app() -> Result<(), JsValue> {
|
||||
yew::start_app::<login::LoginApp>();
|
||||
Ok(())
|
||||
}
|
134
kanidmd_web_ui/src/login.rs
Normal file
134
kanidmd_web_ui/src/login.rs
Normal file
|
@ -0,0 +1,134 @@
|
|||
use wasm_bindgen::prelude::*;
|
||||
use anyhow::Error;
|
||||
use yew::format::{Json, Nothing};
|
||||
use yew::prelude::*;
|
||||
use yew::services::{ConsoleService, StorageService};
|
||||
use yew::services::fetch::{FetchService, FetchTask, Request, Response};
|
||||
|
||||
use kanidm_proto::v1::{AuthRequest, AuthState, AuthStep};
|
||||
|
||||
pub struct LoginApp {
|
||||
link: ComponentLink<Self>,
|
||||
username: String,
|
||||
lstorage: StorageService,
|
||||
ft: Option<FetchTask>,
|
||||
}
|
||||
|
||||
pub enum LoginAppMsg {
|
||||
UserNameInput(String),
|
||||
Begin,
|
||||
Next(AuthState),
|
||||
DoNothing,
|
||||
}
|
||||
|
||||
impl LoginApp {
|
||||
fn auth_begin(&mut self) {
|
||||
let username_copy = self.username.clone();
|
||||
let callback = self.link.callback(
|
||||
move |response: Response<Json<Result<AuthState, Error>>>| {
|
||||
let (parts, body) = response.into_parts();
|
||||
match body {
|
||||
Json(Ok(state)) => {
|
||||
LoginAppMsg::Next(state)
|
||||
}
|
||||
Json(Err(_)) => {
|
||||
LoginAppMsg::DoNothing
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
let authreq = AuthRequest {
|
||||
step: AuthStep::Init(self.username.clone())
|
||||
};
|
||||
// Setup the auth step::init(username);
|
||||
self.ft = Request::post("/v1/auth")
|
||||
.header("Content-Type", "application/json")
|
||||
.body(Json(&authreq))
|
||||
.map_err(|_| ())
|
||||
.and_then(|request| {
|
||||
FetchService::fetch_binary(request, callback)
|
||||
.map_err(|_| ())
|
||||
|
||||
})
|
||||
.map(|ft| Some(ft))
|
||||
.unwrap_or_else(|_e| None);
|
||||
}
|
||||
}
|
||||
|
||||
impl Component for LoginApp {
|
||||
type Message = LoginAppMsg;
|
||||
type Properties = ();
|
||||
|
||||
fn create(_: Self::Properties, link: ComponentLink<Self>) -> Self {
|
||||
ConsoleService::log(format!("create").as_str());
|
||||
|
||||
// First we need to work out what state we are in.
|
||||
let lstorage = StorageService::new(
|
||||
yew::services::storage::Area::Local
|
||||
).unwrap();
|
||||
|
||||
// Get any previous sessions?
|
||||
// Are they still valid?
|
||||
|
||||
LoginApp {
|
||||
link,
|
||||
username: "".to_string(),
|
||||
lstorage,
|
||||
ft: None
|
||||
}
|
||||
}
|
||||
|
||||
fn change(&mut self, _: Self::Properties) -> ShouldRender {
|
||||
false
|
||||
}
|
||||
|
||||
fn update(&mut self, msg: Self::Message) -> ShouldRender {
|
||||
match msg {
|
||||
LoginAppMsg::UserNameInput(mut username) => {
|
||||
std::mem::swap(&mut self.username, &mut username);
|
||||
true
|
||||
}
|
||||
LoginAppMsg::Begin => {
|
||||
ConsoleService::log(format!("begin -> {:?}", self.username).as_str());
|
||||
// Disable the button?
|
||||
self.auth_begin();
|
||||
true
|
||||
}
|
||||
LoginAppMsg::Next(state) => {
|
||||
ConsoleService::log(format!("next -> {:?}", state).as_str());
|
||||
true
|
||||
}
|
||||
LoginAppMsg::DoNothing => {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn view(&self) -> Html {
|
||||
// How do we add a top level theme?
|
||||
html! {
|
||||
<div id="content" class="container">
|
||||
<div class="row d-flex justify-content-center align-items-center" style="min-height: 100vh;">
|
||||
<div class="col">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="container">
|
||||
<h2>{ "Kanidm Alpha 🦀 " }</h2>
|
||||
<p>
|
||||
{" Username: "}
|
||||
</p>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div>
|
||||
<input id="username" type="text" class="form-control" value=self.username oninput=self.link.callback(|e: InputData| LoginAppMsg::UserNameInput(e.value)) />
|
||||
<button type="button" class="btn btn-dark" onclick=self.link.callback(|_| LoginAppMsg::Begin)>{" Begin "}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
6
kanidmd_web_ui/src/main.js
Normal file
6
kanidmd_web_ui/src/main.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import init, { run_login_app } from '../pkg/kanidmd_web_ui.js';
|
||||
async function main() {
|
||||
await init('/pkg/kanidmd_web_ui_bg.wasm');
|
||||
run_login_app();
|
||||
}
|
||||
main()
|
3
profiles/container_generic.toml
Normal file
3
profiles/container_generic.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
web_ui_pkg_path = "/pkg"
|
||||
# Valid options are none, native, x86_64_v1, x86_64_v3
|
||||
cpu_flags = "none"
|
3
profiles/container_x86_64_v3.toml
Normal file
3
profiles/container_x86_64_v3.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
web_ui_pkg_path = "/pkg"
|
||||
# Valid options are none, native, x86_64, x86_64_v3
|
||||
cpu_flags = "x86_64_v3"
|
3
profiles/developer.toml
Normal file
3
profiles/developer.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
web_ui_pkg_path = "../kanidmd_web_ui/pkg"
|
||||
# Valid options are none, native, x86_64, x86_64_v3
|
||||
cpu_flags = "native"
|
2
profiles/release_suse_generic.toml
Normal file
2
profiles/release_suse_generic.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
web_ui_pkg_path = "/usr/share/kanidm/ui/pkg"
|
||||
cpu_flags = "none"
|
2
profiles/release_suse_x86_64.toml
Normal file
2
profiles/release_suse_x86_64.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
web_ui_pkg_path = "/usr/share/kanidm/ui/pkg"
|
||||
cpu_flags = "x86_64_v1"
|
26
profiles/syntax.rs
Normal file
26
profiles/syntax.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
#[derive(Debug, Deserialize)]
|
||||
#[allow(non_camel_case_types)]
|
||||
enum CpuOptLevel {
|
||||
none,
|
||||
native,
|
||||
x86_64_v1,
|
||||
x86_64_v3,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for CpuOptLevel {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match &self {
|
||||
CpuOptLevel::none => write!(f, "none"),
|
||||
CpuOptLevel::native => write!(f, "native"),
|
||||
CpuOptLevel::x86_64_v1 => write!(f, "x86_64_v1"),
|
||||
CpuOptLevel::x86_64_v3 => write!(f, "x86_64_v3"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct ProfileConfig {
|
||||
web_ui_pkg_path: String,
|
||||
cpu_flags: CpuOptLevel,
|
||||
}
|
||||
|
Loading…
Reference in a new issue