[GH-ISSUE #1059] [BUG] Support passwords with special characters #382

Closed
opened 2026-02-27 08:16:58 +03:00 by kerem · 3 comments
Owner

Originally created by @ionesculiviucristian on GitHub (Dec 9, 2024).
Original GitHub issue: https://github.com/lldap/lldap/issues/1059

Describe the bug
If I use:

export LLDAP_DATABASE_URL=postgres://${POSTGRES_LLDAP_USER}:${POSTGRES_LLDAP_PASSWORD}@postgres:5432/${POSTGRES_LLDAP_DATABASE}

and the password is:

6C#5yVCBgHWss90K

I get this error:

dp-lldap  | > Setup permissions..
dp-lldap  | > Starting lldap..
dp-lldap  | 
dp-lldap  | thread 'main' panicked at server/src/infra/database_string.rs:16:30:
dp-lldap  | Invalid database URL: InvalidPort
dp-lldap  | stack backtrace:
dp-lldap  |    0:     0x7c2ffba1765a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h358afad87e02ca76
dp-lldap  |    1:     0x7c2ffaeac45b - core::fmt::write::hb19b5b269a2fe458
dp-lldap  |    2:     0x7c2ffb9e5cf2 - std::io::Write::write_fmt::he5a92676a45ef09d
dp-lldap  |    3:     0x7c2ffba18ad7 - std::panicking::default_hook::{{closure}}::h3bff550b24d93725
dp-lldap  |    4:     0x7c2ffba19d2c - std::panicking::rust_panic_with_hook::h9fdd87cddb2763da
dp-lldap  |    5:     0x7c2ffba19575 - std::panicking::begin_panic_handler::{{closure}}::h089783ab6b5cba45
dp-lldap  |    6:     0x7c2ffba194d9 - std::sys::backtrace::__rust_end_short_backtrace::hed34776d77ef7922
dp-lldap  |    7:     0x7c2ffba194c4 - rust_begin_unwind
dp-lldap  |    8:     0x7c2ffacce192 - core::panicking::panic_fmt::h300583f35f37447a
dp-lldap  |    9:     0x7c2ffacce655 - core::result::unwrap_failed::h83aef6e0d2ac917f
dp-lldap  |   10:     0x7c2ffb2c04d9 - <clap_builder::builder::value_parser::MapValueParser<P,F> as clap_builder::builder::value_parser::TypedValueParser>::parse_ref::h6deabe232709ea41
dp-lldap  |   11:     0x7c2ffb2c01f2 - <P as clap_builder::builder::value_parser::AnyValueParser>::parse_ref_::h333230b3c7afb58d
dp-lldap  |   12:     0x7c2ffae79904 - clap_builder::parser::parser::Parser::push_arg_values::hf912d61227883b67
dp-lldap  |   13:     0x7c2ffae76d31 - clap_builder::parser::parser::Parser::react::h6b28b442db33355c
dp-lldap  |   14:     0x7c2ffae78b64 - clap_builder::parser::parser::Parser::add_env::hb6def6350b8175d5
dp-lldap  |   15:     0x7c2ffae70056 - clap_builder::parser::parser::Parser::get_matches_with::h3a6f5585bd422e3b
dp-lldap  |   16:     0x7c2ffae70d5a - clap_builder::parser::parser::Parser::get_matches_with::h3a6f5585bd422e3b
dp-lldap  |   17:     0x7c2ffae7ffeb - clap_builder::builder::command::Command::_do_parse::hcd300af0605b4cc1
dp-lldap  |   18:     0x7c2ffb36d9c2 - lldap::main::{{closure}}::h4a087d0d0a6d286d
dp-lldap  |   19:     0x7c2ffb3d4ab7 - <core::pin::Pin<P> as core::future::future::Future>::poll::h84ce6b38a299dfeb
dp-lldap  |   20:     0x7c2ffb30e86f - lldap::main::hacb78c2c1ff2970d
dp-lldap  |   21:     0x7c2ffb448843 - std::sys::backtrace::__rust_begin_short_backtrace::h61d95b60b89bc118
dp-lldap  |   22:     0x7c2ffb30bf5b - main

Expected behavior
To use the password as is and to url encoded it if need it

Originally created by @ionesculiviucristian on GitHub (Dec 9, 2024). Original GitHub issue: https://github.com/lldap/lldap/issues/1059 **Describe the bug** If I use: ``` export LLDAP_DATABASE_URL=postgres://${POSTGRES_LLDAP_USER}:${POSTGRES_LLDAP_PASSWORD}@postgres:5432/${POSTGRES_LLDAP_DATABASE} ``` and the password is: ``` 6C#5yVCBgHWss90K ``` I get this error: ``` dp-lldap | > Setup permissions.. dp-lldap | > Starting lldap.. dp-lldap | dp-lldap | thread 'main' panicked at server/src/infra/database_string.rs:16:30: dp-lldap | Invalid database URL: InvalidPort dp-lldap | stack backtrace: dp-lldap | 0: 0x7c2ffba1765a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h358afad87e02ca76 dp-lldap | 1: 0x7c2ffaeac45b - core::fmt::write::hb19b5b269a2fe458 dp-lldap | 2: 0x7c2ffb9e5cf2 - std::io::Write::write_fmt::he5a92676a45ef09d dp-lldap | 3: 0x7c2ffba18ad7 - std::panicking::default_hook::{{closure}}::h3bff550b24d93725 dp-lldap | 4: 0x7c2ffba19d2c - std::panicking::rust_panic_with_hook::h9fdd87cddb2763da dp-lldap | 5: 0x7c2ffba19575 - std::panicking::begin_panic_handler::{{closure}}::h089783ab6b5cba45 dp-lldap | 6: 0x7c2ffba194d9 - std::sys::backtrace::__rust_end_short_backtrace::hed34776d77ef7922 dp-lldap | 7: 0x7c2ffba194c4 - rust_begin_unwind dp-lldap | 8: 0x7c2ffacce192 - core::panicking::panic_fmt::h300583f35f37447a dp-lldap | 9: 0x7c2ffacce655 - core::result::unwrap_failed::h83aef6e0d2ac917f dp-lldap | 10: 0x7c2ffb2c04d9 - <clap_builder::builder::value_parser::MapValueParser<P,F> as clap_builder::builder::value_parser::TypedValueParser>::parse_ref::h6deabe232709ea41 dp-lldap | 11: 0x7c2ffb2c01f2 - <P as clap_builder::builder::value_parser::AnyValueParser>::parse_ref_::h333230b3c7afb58d dp-lldap | 12: 0x7c2ffae79904 - clap_builder::parser::parser::Parser::push_arg_values::hf912d61227883b67 dp-lldap | 13: 0x7c2ffae76d31 - clap_builder::parser::parser::Parser::react::h6b28b442db33355c dp-lldap | 14: 0x7c2ffae78b64 - clap_builder::parser::parser::Parser::add_env::hb6def6350b8175d5 dp-lldap | 15: 0x7c2ffae70056 - clap_builder::parser::parser::Parser::get_matches_with::h3a6f5585bd422e3b dp-lldap | 16: 0x7c2ffae70d5a - clap_builder::parser::parser::Parser::get_matches_with::h3a6f5585bd422e3b dp-lldap | 17: 0x7c2ffae7ffeb - clap_builder::builder::command::Command::_do_parse::hcd300af0605b4cc1 dp-lldap | 18: 0x7c2ffb36d9c2 - lldap::main::{{closure}}::h4a087d0d0a6d286d dp-lldap | 19: 0x7c2ffb3d4ab7 - <core::pin::Pin<P> as core::future::future::Future>::poll::h84ce6b38a299dfeb dp-lldap | 20: 0x7c2ffb30e86f - lldap::main::hacb78c2c1ff2970d dp-lldap | 21: 0x7c2ffb448843 - std::sys::backtrace::__rust_begin_short_backtrace::h61d95b60b89bc118 dp-lldap | 22: 0x7c2ffb30bf5b - main ``` **Expected behavior** To use the password as is and to url encoded it if need it
kerem 2026-02-27 08:16:58 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@nitnelave commented on GitHub (Dec 9, 2024):

It's a URL, so the # sign is expected to be escaped as %23

<!-- gh-comment-id:2527972893 --> @nitnelave commented on GitHub (Dec 9, 2024): It's a URL, so the `#` sign is expected to be escaped as `%23`
Author
Owner

@ionesculiviucristian commented on GitHub (Dec 9, 2024):

I know, my point is to be able to use them without having to pre-encode them.

<!-- gh-comment-id:2528074511 --> @ionesculiviucristian commented on GitHub (Dec 9, 2024): I know, my point is to be able to use them without having to pre-encode them.
Author
Owner

@ionesculiviucristian commented on GitHub (Dec 9, 2024):

Used this solution to make it work, inside the entrypoint:

POSTGRES_LLDAP_PASSWORD=$(cat /run/secrets/POSTGRES_LLDAP_PASSWORD | jq "@uri" -jRr)
export LLDAP_DATABASE_URL=postgres://${POSTGRES_LLDAP_USER}:${POSTGRES_LLDAP_PASSWORD}@postgres:5432/${POSTGRES_LLDAP_DATABASE}
<!-- gh-comment-id:2528135595 --> @ionesculiviucristian commented on GitHub (Dec 9, 2024): Used this solution to make it work, inside the entrypoint: ``` POSTGRES_LLDAP_PASSWORD=$(cat /run/secrets/POSTGRES_LLDAP_PASSWORD | jq "@uri" -jRr) export LLDAP_DATABASE_URL=postgres://${POSTGRES_LLDAP_USER}:${POSTGRES_LLDAP_PASSWORD}@postgres:5432/${POSTGRES_LLDAP_DATABASE} ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#382
No description provided.