Skip to content
Snippets Groups Projects
Commit ec4686e3 authored by Dmitry Ivanov's avatar Dmitry Ivanov Committed by Yaroslav Dynnikov
Browse files

fix: pass env variables for LDAP configuration in `main_run`

parent bf06417a
No related branches found
No related tags found
1 merge request!639fix: Pass env variables for LDAP configuration in `main_run`
Pipeline #22223 failed
......@@ -59,7 +59,10 @@ fn main_run(args: args::Run) -> ! {
// Tarantool implicitly parses some environment variables.
// We don't want them to affect the behavior and thus filter them out.
for (k, _) in std::env::vars() {
if k.starts_with("TT_") || k.starts_with("TARANTOOL_") {
// NB: For the moment we'd rather allow LDAP-related variables,
// but see https://git.picodata.io/picodata/tarantool/-/issues/25.
let is_relevant = k.starts_with("TT_") || k.starts_with("TARANTOOL_");
if !k.starts_with("TT_LDAP") && is_relevant {
std::env::remove_var(k)
}
}
......
from conftest import Cluster, Instance
import pytest
TT_LDAP_URL = "ldap://localhost:1389"
TT_LDAP_DN_FMT = "cn=$USER,ou=users,dc=example,dc=org"
@pytest.fixture
def instance(cluster: Cluster):
instance = cluster.add_instance(wait_online=False)
instance.env["TT_LDAP_URL"] = TT_LDAP_URL
instance.env["TT_LDAP_DN_FMT"] = TT_LDAP_DN_FMT
instance.start()
instance.wait_online()
return instance
# Related: https://git.picodata.io/picodata/tarantool/-/issues/25
def test_ldap_env_variables(instance: Instance):
res = instance.eval("return require('os').getenv('TT_LDAP_URL')")
assert res == TT_LDAP_URL
res = instance.eval("return require('os').getenv('TT_LDAP_DN_FMT')")
assert res == TT_LDAP_DN_FMT
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment