Add net/lldap: Light LDAP implementation for authentication

Differential Revision:	https://reviews.freebsd.org/D49986
This commit is contained in:
SHENGYI HONG 2025-04-26 00:53:50 +08:00 committed by Li-Wen Hsu
parent 7570a777e7
commit 0cb08811e8
No known key found for this signature in database
GPG key ID: 7377A4A02A2954DD
8 changed files with 1659 additions and 0 deletions

View file

@ -453,6 +453,7 @@
SUBDIR += linux-rl9-tcp_wrappers-libs SUBDIR += linux-rl9-tcp_wrappers-libs
SUBDIR += liveMedia SUBDIR += liveMedia
SUBDIR += lla SUBDIR += lla
SUBDIR += lldap
SUBDIR += lua-luasocket SUBDIR += lua-luasocket
SUBDIR += lualdap SUBDIR += lualdap
SUBDIR += mDNSResponder SUBDIR += mDNSResponder

45
net/lldap/Makefile Normal file
View file

@ -0,0 +1,45 @@
PORTNAME= lldap
DISTVERSIONPREFIX= v
DISTVERSION= 0.6.1
CATEGORIES= net
MAINTAINER= aokblast@FreeBSD.org
COMMENT= Light LDAP implementation for authentication
WWW= https://github.com/lldap/lldap
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= gzip:archivers/gzip \
wasm-pack:www/wasm-pack \
wasm-bindgen:www/wasm-bindgen-cli
LIB_DEPENDS= libzstd.so:archivers/zstd
USES= cargo
USE_GITHUB= yes
GH_ACCOUNT= inejge:ldap3
GH_PROJECT= ldap3:ldap3
GH_SUBDIR= third_party/ldap3:ldap3
GH_TAGNAME= ba38bc573d63b:ldap3
CARGO_INSTALL_PATH= server set-password migration-tool
USERS= ldap
GROUPS= ldap
post-build:
cd ${WRKSRC} && WASM_PACK_CACHE=.wasm-pack-cache ./app/build.sh
post-install:
${MKDIR} ${STAGEDIR}${PREFIX}/lldap_server/app
${INSTALL_SCRIPT} ${WRKSRC}/example_configs/freebsd/rc.d_lldap ${STAGEDIR}${PREFIX}/etc/rc.d/lldap
cd ${WRKSRC}/app && \
${COPYTREE_SHARE} pkg ${STAGEDIR}${PREFIX}/lldap_server/app && \
${COPYTREE_SHARE} static ${STAGEDIR}${PREFIX}/lldap_server/app && \
${CP} index.html ${STAGEDIR}${PREFIX}/lldap_server/app
${INSTALL_PROGRAM} ${STAGEDIR}${PREFIX}/bin/lldap ${STAGEDIR}${PREFIX}/lldap_server
${MKDIR} ${STAGEDIR}${PREFIX}/share/lldap
${INSTALL_DATA} ${WRKSRC}/lldap_config.docker_template.toml ${STAGEDIR}${PREFIX}/share/lldap/ldap_config.toml.example
.include <bsd.port.mk>

522
net/lldap/Makefile.crates Normal file
View file

@ -0,0 +1,522 @@
CARGO_CRATES= actix-0.13.5 \
actix-codec-0.5.2 \
actix-files-0.6.6 \
actix-http-3.9.0 \
actix-macros-0.2.4 \
actix-router-0.5.3 \
actix-rt-2.10.0 \
actix-server-2.5.0 \
actix-service-2.0.2 \
actix-tls-3.4.0 \
actix-utils-3.0.1 \
actix-web-4.9.0 \
actix-web-codegen-4.3.0 \
actix-web-httpauth-0.8.2 \
actix_derive-0.6.2 \
addr2line-0.24.2 \
adler2-2.0.0 \
ahash-0.8.11 \
aho-corasick-1.1.3 \
aliasable-0.1.3 \
alloc-no-stdlib-2.0.4 \
alloc-stdlib-0.2.2 \
allocator-api2-0.2.18 \
android-tzdata-0.1.1 \
android_system_properties-0.1.5 \
anstream-0.6.17 \
anstyle-1.0.10 \
anstyle-parse-0.2.6 \
anstyle-query-1.1.2 \
anstyle-wincon-3.0.6 \
anyhow-1.0.92 \
arrayref-0.3.9 \
arrayvec-0.5.2 \
ascii-0.9.3 \
asn1-rs-0.5.2 \
asn1-rs-derive-0.4.0 \
asn1-rs-impl-0.1.0 \
assert_cmd-2.0.16 \
async-stream-0.3.6 \
async-stream-impl-0.3.6 \
async-trait-0.1.83 \
atoi-2.0.0 \
atomic-0.6.0 \
autocfg-1.4.0 \
backtrace-0.3.74 \
base64-0.13.1 \
base64-0.21.7 \
base64-0.22.1 \
base64ct-1.6.0 \
bincode-1.3.3 \
bitflags-1.3.2 \
bitflags-2.6.0 \
blake2b_simd-0.5.11 \
block-buffer-0.9.0 \
block-buffer-0.10.4 \
boolinator-2.4.0 \
brotli-6.0.0 \
brotli-decompressor-4.0.1 \
bson-1.2.4 \
bstr-1.10.0 \
bumpalo-3.16.0 \
bytemuck-1.19.0 \
byteorder-1.5.0 \
bytes-1.8.0 \
bytestring-1.3.1 \
cc-1.1.33 \
cfg-if-1.0.0 \
chrono-0.4.38 \
clap-4.5.20 \
clap_builder-4.5.20 \
clap_derive-4.5.18 \
clap_lex-0.7.2 \
color_quant-1.1.0 \
colorchoice-1.0.3 \
combine-3.8.1 \
console_error_panic_hook-0.1.7 \
const-oid-0.9.6 \
constant_time_eq-0.1.5 \
convert_case-0.4.0 \
cookie-0.16.2 \
core-foundation-0.9.4 \
core-foundation-sys-0.8.7 \
cpufeatures-0.2.14 \
crc-3.2.1 \
crc-catalog-2.4.0 \
crc32fast-1.4.2 \
cron-0.12.1 \
crossbeam-channel-0.5.13 \
crossbeam-queue-0.3.11 \
crossbeam-utils-0.8.20 \
crossterm-0.23.2 \
crossterm_winapi-0.9.1 \
crypto-common-0.1.6 \
crypto-mac-0.10.1 \
crypto-mac-0.11.1 \
ct-codecs-1.1.2 \
curve25519-dalek-3.2.0 \
darling-0.14.4 \
darling_core-0.14.4 \
darling_macro-0.14.4 \
dashmap-5.5.3 \
data-encoding-2.6.0 \
der-0.7.9 \
der-parser-8.2.0 \
deranged-0.3.11 \
derivative-2.2.0 \
derive_builder-0.12.0 \
derive_builder_core-0.12.0 \
derive_builder_macro-0.12.0 \
derive_more-0.99.18 \
derive_more-1.0.0 \
derive_more-impl-1.0.0 \
derive_utils-0.11.2 \
diff-0.1.13 \
difflib-0.4.0 \
digest-0.9.0 \
digest-0.10.7 \
displaydoc-0.1.7 \
displaydoc-0.2.5 \
doc-comment-0.3.3 \
dotenvy-0.15.7 \
downcast-0.11.0 \
either-1.13.0 \
email-encoding-0.2.1 \
email_address-0.2.9 \
encoding_rs-0.8.35 \
equivalent-1.0.1 \
errno-0.3.9 \
etcetera-0.8.0 \
event-listener-2.5.3 \
failure-0.1.8 \
failure_derive-0.1.8 \
fastrand-1.9.0 \
fastrand-2.1.1 \
fiat-crypto-0.2.9 \
figment-0.10.19 \
figment_file_provider_adapter-0.1.1 \
flate2-1.0.34 \
float-cmp-0.9.0 \
flume-0.11.1 \
fnv-1.0.7 \
form_urlencoded-1.2.1 \
fragile-2.0.0 \
fslock-0.2.1 \
futures-0.3.31 \
futures-channel-0.3.31 \
futures-core-0.3.31 \
futures-enum-0.1.17 \
futures-executor-0.3.31 \
futures-intrusive-0.5.0 \
futures-io-0.3.31 \
futures-macro-0.3.31 \
futures-sink-0.3.31 \
futures-task-0.3.31 \
futures-util-0.3.31 \
generic-array-0.14.7 \
generic-bytes-0.1.0 \
getrandom-0.1.16 \
getrandom-0.2.15 \
gimli-0.31.1 \
gloo-0.4.2 \
gloo-console-0.2.3 \
gloo-dialogs-0.1.1 \
gloo-events-0.1.2 \
gloo-file-0.2.3 \
gloo-net-0.6.0 \
gloo-render-0.1.1 \
gloo-storage-0.2.2 \
gloo-timers-0.2.6 \
gloo-utils-0.1.7 \
gloo-utils-0.2.0 \
graphql-introspection-query-0.2.0 \
graphql-parser-0.2.3 \
graphql-parser-0.3.0 \
graphql-parser-0.4.0 \
graphql_client-0.10.0 \
graphql_client-0.11.0 \
graphql_client_codegen-0.10.0 \
graphql_client_codegen-0.11.0 \
graphql_query_derive-0.10.0 \
graphql_query_derive-0.11.0 \
h2-0.3.26 \
hashbrown-0.9.1 \
hashbrown-0.14.5 \
hashbrown-0.15.0 \
hashlink-0.8.4 \
heck-0.3.3 \
heck-0.4.1 \
heck-0.5.0 \
hermit-abi-0.3.9 \
hex-0.4.3 \
hkdf-0.11.0 \
hkdf-0.12.4 \
hmac-0.10.1 \
hmac-0.11.0 \
hmac-0.12.1 \
home-0.5.9 \
http-0.2.12 \
http-1.1.0 \
http-body-0.4.6 \
http-range-0.1.5 \
httparse-1.9.5 \
httpdate-1.0.3 \
hyper-0.14.31 \
hyper-rustls-0.24.2 \
iana-time-zone-0.1.61 \
iana-time-zone-haiku-0.1.2 \
ident_case-1.0.1 \
idna-0.2.3 \
idna-0.3.0 \
idna-0.5.0 \
if_chain-1.0.2 \
image-0.24.9 \
impl-more-0.1.8 \
indexmap-1.6.2 \
indexmap-2.6.0 \
inherent-1.0.11 \
inlinable_string-0.1.15 \
instant-0.1.13 \
ipnet-2.10.1 \
is_terminal_polyfill-1.70.1 \
itertools-0.10.5 \
itoa-1.0.11 \
jobserver-0.1.32 \
jpeg-decoder-0.3.1 \
js-sys-0.3.72 \
juniper-0.15.12 \
juniper_codegen-0.15.9 \
jwt-0.13.0 \
jwt-0.16.0 \
language-tags-0.3.2 \
lazy_static-1.5.0 \
ldap3-0.11.5 \
ldap3_proto-0.5.2 \
lettre-0.10.4 \
libc-0.2.161 \
libm-0.2.11 \
libsqlite3-sys-0.27.0 \
linked-hash-map-0.5.6 \
linux-raw-sys-0.4.14 \
local-channel-0.1.5 \
local-waker-0.1.4 \
lock_api-0.4.12 \
log-0.4.22 \
matchers-0.1.0 \
matches-0.1.10 \
md-5-0.10.6 \
memchr-2.7.4 \
memoffset-0.7.1 \
mime-0.3.17 \
mime_guess-2.0.5 \
minimal-lexical-0.2.1 \
miniz_oxide-0.8.0 \
mio-0.8.11 \
mio-1.0.2 \
mockall-0.11.4 \
mockall_derive-0.11.4 \
mutually_exclusive_features-0.1.0 \
nix-0.26.4 \
nom-7.1.3 \
normalize-line-endings-0.3.0 \
nu-ansi-term-0.46.0 \
num-bigint-0.4.6 \
num-bigint-dig-0.8.4 \
num-conv-0.1.0 \
num-integer-0.1.46 \
num-iter-0.1.45 \
num-traits-0.2.19 \
object-0.36.5 \
oid-registry-0.6.1 \
once_cell-1.20.2 \
opaque-debug-0.3.1 \
opaque-ke-0.7.0 \
openssl-probe-0.1.5 \
ordered-float-3.9.2 \
orion-0.17.7 \
ouroboros-0.17.2 \
ouroboros_macro-0.17.2 \
overload-0.1.1 \
parking_lot-0.12.3 \
parking_lot_core-0.9.10 \
paste-1.0.15 \
pear-0.2.9 \
pear_codegen-0.2.9 \
peg-0.8.4 \
peg-macros-0.8.4 \
peg-runtime-0.8.3 \
pem-rfc7468-0.7.0 \
percent-encoding-2.3.1 \
pin-project-1.1.7 \
pin-project-internal-1.1.7 \
pin-project-lite-0.2.15 \
pin-utils-0.1.0 \
pkcs1-0.7.5 \
pkcs8-0.10.2 \
pkg-config-0.3.31 \
powerfmt-0.2.0 \
ppv-lite86-0.2.20 \
predicates-2.1.5 \
predicates-3.1.2 \
predicates-core-1.0.8 \
predicates-tree-1.0.11 \
pretty_assertions-1.4.1 \
proc-macro-error-1.0.4 \
proc-macro-error-attr-1.0.4 \
proc-macro-error-attr2-2.0.0 \
proc-macro-error2-2.0.1 \
proc-macro2-1.0.89 \
proc-macro2-diagnostics-0.10.1 \
quote-1.0.37 \
quoted_printable-0.4.8 \
rand-0.7.3 \
rand-0.8.5 \
rand_chacha-0.2.2 \
rand_chacha-0.3.1 \
rand_core-0.5.1 \
rand_core-0.6.4 \
rand_hc-0.2.0 \
redox_syscall-0.5.7 \
regex-1.11.1 \
regex-automata-0.1.10 \
regex-automata-0.4.8 \
regex-lite-0.1.6 \
regex-syntax-0.6.29 \
regex-syntax-0.8.5 \
requestty-0.4.1 \
requestty-ui-0.4.1 \
reqwest-0.11.27 \
ring-0.16.20 \
ring-0.17.8 \
route-recognizer-0.3.1 \
rsa-0.9.6 \
rust-argon2-0.8.3 \
rustc-demangle-0.1.24 \
rustc_version-0.4.1 \
rusticata-macros-4.1.0 \
rustix-0.38.38 \
rustls-0.20.9 \
rustls-0.21.12 \
rustls-native-certs-0.6.3 \
rustls-pemfile-1.0.4 \
rustls-webpki-0.100.3 \
rustls-webpki-0.101.7 \
rustversion-1.0.18 \
ryu-1.0.18 \
schannel-0.1.26 \
scoped-tls-hkt-0.1.5 \
scopeguard-1.2.0 \
sct-0.7.1 \
sea-bae-0.2.1 \
sea-orm-0.12.15 \
sea-orm-macros-0.12.15 \
sea-query-0.30.7 \
sea-query-binder-0.5.0 \
secstr-0.5.1 \
security-framework-2.11.1 \
security-framework-sys-2.12.0 \
semver-1.0.23 \
serde-1.0.214 \
serde-wasm-bindgen-0.3.1 \
serde_bytes-0.11.15 \
serde_derive-1.0.214 \
serde_json-1.0.132 \
serde_spanned-0.6.8 \
serde_urlencoded-0.7.1 \
serial_test-2.0.0 \
serial_test_derive-2.0.0 \
sha1-0.10.6 \
sha2-0.9.9 \
sha2-0.10.8 \
sharded-slab-0.1.7 \
shlex-1.3.0 \
signal-hook-0.3.17 \
signal-hook-mio-0.2.4 \
signal-hook-registry-1.4.2 \
signature-2.2.0 \
slab-0.4.9 \
smallvec-1.13.2 \
smartstring-1.0.1 \
smawk-0.3.2 \
socket2-0.4.10 \
socket2-0.5.7 \
spin-0.5.2 \
spin-0.9.8 \
spki-0.7.3 \
sqlformat-0.2.6 \
sqlx-0.7.4 \
sqlx-core-0.7.4 \
sqlx-macros-0.7.4 \
sqlx-macros-core-0.7.4 \
sqlx-mysql-0.7.4 \
sqlx-postgres-0.7.4 \
sqlx-sqlite-0.7.4 \
static_assertions-1.1.0 \
stringprep-0.1.5 \
strsim-0.10.0 \
strsim-0.11.1 \
strum-0.25.0 \
strum_macros-0.25.3 \
subtle-2.4.1 \
syn-1.0.109 \
syn-2.0.86 \
sync_wrapper-0.1.2 \
synstructure-0.12.6 \
system-configuration-0.5.1 \
system-configuration-sys-0.5.0 \
tempfile-3.13.0 \
termtree-0.4.1 \
textwrap-0.15.2 \
thiserror-1.0.66 \
thiserror-impl-1.0.66 \
thread_local-1.1.8 \
time-0.3.36 \
time-core-0.1.2 \
time-macros-0.2.18 \
tinyvec-1.8.0 \
tinyvec_macros-0.1.1 \
tokio-1.41.0 \
tokio-macros-2.4.0 \
tokio-rustls-0.23.4 \
tokio-rustls-0.24.1 \
tokio-stream-0.1.16 \
tokio-util-0.7.12 \
toml-0.8.19 \
toml_datetime-0.6.8 \
toml_edit-0.22.22 \
tower-service-0.3.3 \
tracing-0.1.40 \
tracing-actix-web-0.7.14 \
tracing-attributes-0.1.27 \
tracing-core-0.1.32 \
tracing-forest-0.1.6 \
tracing-log-0.2.0 \
tracing-subscriber-0.3.18 \
try-lock-0.2.5 \
typenum-1.17.0 \
uncased-0.9.10 \
unicase-2.8.0 \
unicode-bidi-0.3.17 \
unicode-ident-1.0.13 \
unicode-linebreak-0.1.5 \
unicode-normalization-0.1.24 \
unicode-properties-0.1.3 \
unicode-segmentation-1.12.0 \
unicode-width-0.1.14 \
unicode-xid-0.2.6 \
unicode_categories-0.1.1 \
unreachable-1.0.0 \
untrusted-0.7.1 \
untrusted-0.9.0 \
url-2.5.2 \
url-escape-0.1.1 \
urlencoding-2.1.3 \
utf8parse-0.2.2 \
uuid-0.8.2 \
uuid-1.11.0 \
v_htmlescape-0.15.8 \
validator-0.14.0 \
validator_derive-0.14.0 \
validator_types-0.14.0 \
valuable-0.1.0 \
vcpkg-0.2.15 \
version_check-0.9.5 \
void-1.0.2 \
wait-timeout-0.2.0 \
want-0.3.1 \
wasi-0.9.0+wasi-snapshot-preview1 \
wasi-0.11.0+wasi-snapshot-preview1 \
wasite-0.1.0 \
wasm-bindgen-0.2.95 \
wasm-bindgen-backend-0.2.95 \
wasm-bindgen-futures-0.4.45 \
wasm-bindgen-macro-0.2.95 \
wasm-bindgen-macro-support-0.2.95 \
wasm-bindgen-shared-0.2.95 \
web-sys-0.3.72 \
webpki-0.22.4 \
webpki-roots-0.22.6 \
webpki-roots-0.23.1 \
webpki-roots-0.25.4 \
whoami-1.5.2 \
winapi-0.3.9 \
winapi-i686-pc-windows-gnu-0.4.0 \
winapi-x86_64-pc-windows-gnu-0.4.0 \
windows-core-0.52.0 \
windows-sys-0.48.0 \
windows-sys-0.52.0 \
windows-sys-0.59.0 \
windows-targets-0.48.5 \
windows-targets-0.52.6 \
windows_aarch64_gnullvm-0.48.5 \
windows_aarch64_gnullvm-0.52.6 \
windows_aarch64_msvc-0.48.5 \
windows_aarch64_msvc-0.52.6 \
windows_i686_gnu-0.48.5 \
windows_i686_gnu-0.52.6 \
windows_i686_gnullvm-0.52.6 \
windows_i686_msvc-0.48.5 \
windows_i686_msvc-0.52.6 \
windows_x86_64_gnu-0.48.5 \
windows_x86_64_gnu-0.52.6 \
windows_x86_64_gnullvm-0.48.5 \
windows_x86_64_gnullvm-0.52.6 \
windows_x86_64_msvc-0.48.5 \
windows_x86_64_msvc-0.52.6 \
winnow-0.6.20 \
winreg-0.50.0 \
x509-parser-0.15.1 \
yansi-1.0.1 \
yew-0.19.3 \
yew-macro-0.19.3 \
yew-router-0.16.0 \
yew-router-macro-0.16.0 \
zerocopy-0.7.35 \
zerocopy-derive-0.7.35 \
zeroize-1.8.1 \
zeroize_derive-1.4.2 \
zstd-0.13.2 \
zstd-safe-7.2.1 \
zstd-sys-2.0.13+zstd.1.5.6 \
lber@git+https://github.com/inejge/ldap3/\#ba38bc573d63b109b92dca80898633512d5c47df \
yew_form,yew_form_derive@git+https://github.com/jfbilodeau/yew_form?rev=4b9fabffb63393ec7626a4477fd36de12a07fac9\#4b9fabffb63393ec7626a4477fd36de12a07fac9

1049
net/lldap/distinfo Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
--- Cargo.toml.orig 2024-11-22 21:47:49 UTC
+++ Cargo.toml
@@ -18,4 +18,4 @@ opt-level = 's'
opt-level = 's'
[patch.crates-io.lber]
-git = 'https://github.com/inejge/ldap3/'
+path = 'third_party/ldap3/lber'

View file

@ -0,0 +1,10 @@
--- example_configs/freebsd/rc.d_lldap.orig 2025-04-23 19:15:55 UTC
+++ example_configs/freebsd/rc.d_lldap
@@ -22,6 +22,6 @@ command="/usr/sbin/daemon"
procname=/usr/local/lldap_server/lldap
command="/usr/sbin/daemon"
-command_args="-u www -o ${logfile} -t ${name} /usr/local/lldap_server/lldap run"
+command_args="-u ldap -o ${logfile} -t ${name} /usr/local/lldap_server/lldap run"
run_rc_command "$1"

2
net/lldap/pkg-descr Normal file
View file

@ -0,0 +1,2 @@
This project is a lightweight authentication server that provides an
opinionated, simplified LDAP interface for authentication.

22
net/lldap/pkg-plist Normal file
View file

@ -0,0 +1,22 @@
bin/lldap
bin/lldap_migration_tool
bin/lldap_set_password
etc/rc.d/lldap
@(root,wheel,755) %%DATADIR%%/ldap_config.toml.example
@owner ldap
@group ldap
@dir lldap_server
lldap_server/app/index.html
lldap_server/app/pkg/.gitignore
lldap_server/app/pkg/lldap_app.d.ts
lldap_server/app/pkg/lldap_app.js
lldap_server/app/pkg/lldap_app_bg.wasm
lldap_server/app/pkg/lldap_app_bg.wasm.d.ts
lldap_server/app/pkg/lldap_app_bg.wasm.gz
lldap_server/app/static/fonts.css
lldap_server/app/static/fonts/fonts.txt
lldap_server/app/static/libraries.txt
lldap_server/app/static/main.js
lldap_server/app/static/spinner.gif
lldap_server/app/static/style.css
lldap_server/lldap