aboutsummaryrefslogtreecommitdiffstats
path: root/figures/ldap.tex
blob: 123ab83fa2badf4d586180dfeea19b52bbdb1c95 (plain)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{array}
\usepackage{ae}
\usepackage{tikz}
\usetikzlibrary{trees,calc,external}
\tikzexternalize

\def\dn#1{\texttt{#1}}

\newenvironment{entry}[1]
  {\begin{minipage}[t][0pt][t]{10cm}
     \texttt{#1}
     \\[.1\baselineskip] \phantom{cn=}%
     \begin{tabular}[!t]{@{}>{\ttfamily\bgroup}l<{\egroup}@{:~}%
                            >{\sffamily\bgroup}l<{\egroup}@{}}%
  }
  {  \end{tabular}
   \end{minipage}}

\tikzset{
  ldaptree/.style = {
    grow via three points={one child at (1cm,-1.5\baselineskip) and two children at (1cm,-1.5\baselineskip) and (1cm,-3\baselineskip)},
    growth parent anchor=south west,
    edge from parent path={($(\tikzparentnode.south west)+(2.5ex,0)$) |- (\tikzchildnode.west)},
  },
  every node/.style = {anchor=west},
  dn/.style = {font=\ttfamily}
}

\thispagestyle{empty}
\begin{document}

\tikzsetnextfilename{ldap-cropped}
\begin{tikzpicture}[ldaptree]
  \node[dn] { {o=mailhosting,dc=fripost,dc=org} }
    child {
      node[dn] { ou=managers } 
      child {
        node {
          \begin{entry}{cn=gustav}
            userPassword & \{SSHA\}xxxxxx
          \end{entry}
        }
      } 
      child [missing] {}
      child[dn] {
        node {
          \begin{entry}{cn=ljo}
            userPassword & \dots
          \end{entry}
        }
      }
    }
    child [missing] {}
    child [missing] {}
    child [missing] {}
    child [missing] {}
    child {
      node[dn] { ou=services } 
      child {
        node {
          \begin{entry}{cn=SMTP}
            userPassword & \{SSHA\}xxxxxx
          \end{entry}
        }
      } 
      child [missing] {}
      child {
        node {
          \begin{entry}{cn=SASLauth}
            userPassword & \dots
          \end{entry}
        }
      } 
    }
    child [missing] {}
    child [missing] {}
    child [missing] {}
    child [missing] {}
    child {
      node[dn] { ou=virtual }
      child {
        node {
          \begin{entry}{dc=fripost.org}
            isActive & TRUE
          \end{entry}
        }
        child [missing] {}
        child 
        {
          node {
            \begin{entry}{mailTarget=user@fripost.org}
              mailLocalAddress & user-alias \\
              isActive & TRUE 
            \end{entry}
          }
        }
        child [missing] {}
        child [missing] {}
        child 
        { node { \dn{mailTarget=\dots} } 
        }
        child 
        {
          node {
            \begin{entry}{uid=user}
              userPassword & \{SSHA\}xxxxxx \\
              isactive & TRUE 
            \end{entry}
          }
        }
        child [missing] {}
        child [missing] {}
        child 
        { node { \dn{uid=\dots} } 
        }
      }
      child [missing] {}
      child [missing] {}
      child [missing] {}
      child [missing] {}
      child [missing] {}
      child [missing] {}
      child [missing] {}
      child [missing] {}
      child [missing] {}
      child [missing] {}
      child {
        node {
          \begin{entry}{dc=example.org}
            owner & \texttt{uid=user,dc=fripost.org,ou=virtual,\dots} \\
            isActive & TRUE
          \end{entry}
        }
        child [missing] {}
        child 
          {
          node {
            \begin{entry}{mailTarget=user@fripost.org}
              mailLocalAddress & user \\
              isActive & TRUE
            \end{entry}
          }
        }
        child [missing] {}
        child [missing] {}
        child 
        { node { \dn{mailTarget=\dots} } 
        }
        child 
        { node { \dn{uid=\dots} } 
        }
      }
    };
\end{tikzpicture}

\end{document}