-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.html
103 lines (95 loc) · 3.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<html><head><meta charset="utf-8" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" /><meta name="author" content="Maxim Sokhatsky" />
<title>LDAP</title>
<link rel="stylesheet" href="https://n2o.dev/blank.css" />
<link rel="stylesheet" href="https://n2o.dev/zima.css" />
<link rel="stylesheet" href="https://n2o.dev/pro/pro.css" />
</head><body><nav>
<a href="https://erp.uno/en/">ERP</a>
<a href="https://ldap.erp.uno" style="background:#ededed;">LDAP</a>
</nav><header>
<a href="https://github.com/synrc/ldap"><img src="https://openmoji.org/data/color/svg/1F310.svg" /></a>
<h1>LDAP</h1>
</header><aside>
<article>
<section>
<h3>SYNOPSIS</h3>
<div>SYNRC LDAP is a high-performant IETF 3296 3671-3673 3866 4510-4518 4522 4525 4526 4929 5480 compatible
LDAP directory server with SQLITE, LMDB, MONGODB backends in 300 LOC of Elixir.</div>
</section>
<section>
<h3>SPEC</h3>
<div><ul><li><a href="man/ldap.htm">LDAPv3 ASN.1</a></li>
<li><a href="man/ldif.htm">LDIF</a></li>
<li><a href="man/conf.htm">CONF</a></li>
<li><a href="man/schm.htm">SCHEMA</a></li>
<li><a href="man/arch.htm">ARCH</a></li></ul></div>
<br />
<div>
JUN 2023 © <a href="https://github.com/5HT">5HT</a> DHARMA 2.0<br />
VER 13.7.24
</div>
</section>
</article>
</aside>
<main>
<article>
<section>
<h3>SYNRC LDAP</h3>
<figure><img src="priv/design/ldap-shaders.png" width=900></figure>
</section>
<section>
<h3>MIX</h3>
<h4>RUN</h4>
<figure><code>$ mix deps.get
$ iex -S mix
Erlang/OTP 24 [erts-12.2.1] [source] [64-bit]
[smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Interactive Elixir (1.12.2) - press Ctrl+C to exit (type h() ENTER for help)
> :application.which_applications
[
{:ldap, 'LDAP Directory and Identity Server', '8.6.0'},
{:eldap, 'Ldap api', '1.2.9'},
{:mix, 'mix', '1.12.2'},
{:iex, 'iex', '1.12.2'},
{:elixir, 'elixir', '1.12.2'},
{:compiler, 'ERTS CXC 138 10', '8.0.4'},
{:stdlib, 'ERTS CXC 138 10', '3.17'},
{:kernel, 'ERTS CXC 138 10', '8.2'}
]</code></figure>
<h4>CODE</h4>
<figure><code> def testConnection() do
# {:ok, conn} = :eldap.open(['127.0.0.1'], [{:port, 389}, {:ssl, false}])
{:ok, conn} = :eldap.open(['127.0.0.1'], [{:port, 636}, {:ssl, true}])
:eldap.start_tls(conn, [])
:ok = :eldap.simple_bind(conn, 'cn=admin,dc=synrc,dc=com', 'secret')
filter = {:filter, :eldap.and([ ])}
scope = {:scope, :wholeSubtree}
base = {:base, 'dc=synrc,dc=com'}
attrs = {:attributes, ['cn','mail']}
{:ok, x} = :eldap.search(conn, [base, scope, filter, attrs])
:lists.map(fn {:eldap_entry, dn, attrs} ->
{:dn,dn,attrs} end, :erlang.element(2, x))
end</code></figure>
<h4>TEST</h4>
<figure><code>> LDAP.testConnection
[
{:dn, 'cn=Maxim Sokhatsky,ou=People,dc=synrc,dc=com',
[{'mail', ['maxim@synrc.com']}, {'cn', ['Maxim Sokhatsky']}]},
{:dn, 'cn=Namdak Tonpa,ou=People,dc=synrc,dc=com',
[{'mail', ['namdak@tonpa.guru']}, {'cn', ['Namdak Tonpa']}]},
{:dn, 'uid=admin,dc=synrc,dc=com', []},
{:dn, 'ou=People,dc=synrc,dc=com', []},
{:dn, 'dc=synrc,dc=com', []}
]</code></figure>
<br><center>˙</center>
</section>
</article>
</main>
<footer>
<br><center>˙</center>
<br>
Namdak Tonpa <span class="heart">❤</span> 2023</footer>
</body>
</html>