Current section

Files

Jump to
ldap index.html
Raw

index.html

<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>&dot;</center>

        </section>

    </article>
</main>
<footer>
   <br><center>&dot;</center>
   <br>
Namdak Tonpa <span class="heart">❤</span> 2023</footer>
</body>
</html>