diff options
| author | David M. Syzdek <david@syzdek.net> | 2019-10-31 22:40:01 -0800 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2019-10-31 22:40:01 -0800 |
| commit | 13a016a996792bd1134f543287978099ce81aab8 (patch) | |
| tree | 36e7063c72476b00969bb7dd0bbc2d1de68ad99f /doc | |
| parent | db9b845f101823d9f915bd9e7aef928a90df1aca (diff) | |
| download | ldap-utils-13a016a996792bd1134f543287978099ce81aab8.tar.gz ldap-utils-13a016a996792bd1134f543287978099ce81aab8.tar.bz2 ldap-utils-13a016a996792bd1134f543287978099ce81aab8.tar.xz ldap-utils-13a016a996792bd1134f543287978099ce81aab8.zip | |
ldap2json: adding utility
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/ldap2json.1.in | 302 |
1 files changed, 302 insertions, 0 deletions
diff --git a/doc/ldap2json.1.in b/doc/ldap2json.1.in new file mode 100644 index 0000000..f865b78 --- /dev/null +++ b/doc/ldap2json.1.in | |||
| @@ -0,0 +1,302 @@ | |||
| 1 | .\" | ||
| 2 | .\" LDAP Utilities | ||
| 3 | .\" Copyright (C) 2019 David M. Syzdek <david@syzdek.net>. | ||
| 4 | .\" | ||
| 5 | .\" Redistribution and use in source and binary forms, with or without | ||
| 6 | .\" modification, are permitted provided that the following conditions are | ||
| 7 | .\" met: | ||
| 8 | .\" | ||
| 9 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 10 | .\" notice, this list of conditions and the following disclaimer. | ||
| 11 | .\" | ||
| 12 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 13 | .\" notice, this list of conditions and the following disclaimer in the | ||
| 14 | .\" documentation and/or other materials provided with the distribution. | ||
| 15 | .\" | ||
| 16 | .\" 3. Neither the name of the copyright holder nor the names of its | ||
| 17 | .\" contributors may be used to endorse or promote products derived from | ||
| 18 | .\" this software without specific prior written permission. | ||
| 19 | .\" | ||
| 20 | .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
| 21 | .\" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
| 22 | .\" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 23 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR | ||
| 24 | .\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
| 25 | .\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| 26 | .\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| 27 | .\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| 28 | .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
| 29 | .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| 30 | .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 31 | .\" | ||
| 32 | .\" doc/ldap2json.1.in - man page for ldap2json | ||
| 33 | .\" | ||
| 34 | .TH "LDAP2JSON" "1" "@RELEASE_MONTH@" "@PACKAGE_NAME@" "User Commands" | ||
| 35 | .SH NAME | ||
| 36 | ldap2json \- LDAP search tool which outputs JSON | ||
| 37 | |||
| 38 | |||
| 39 | .SH SYNOPSIS | ||
| 40 | \fBldap2json\fR | ||
| 41 | [\fB-b\fR \fIbasedn\fR] | ||
| 42 | [\fB-c\fR] | ||
| 43 | [\fB-d\fR \fIlevel\fR] | ||
| 44 | [\fB-D\fR \fIbinddn\fR] | ||
| 45 | [\fB-H\fR \fIURI\fR] | ||
| 46 | [\fB-l\fR \fIlimit\fR] | ||
| 47 | [\fB-L\fR[\fB-L\fR]] | ||
| 48 | [\fB-n\fR] | ||
| 49 | [\fB-v\fR | \fB--version\fR] | ||
| 50 | [\fB-s\fR \fIscope\fR] | ||
| 51 | [\fB-S\fR \fIattr\fR] | ||
| 52 | [\fB-w\fR \fIpasswd\fR] | ||
| 53 | [\fB-W\fR] | ||
| 54 | [\fB-x\fR] | ||
| 55 | [\fB-y\fR \fIfile\fR] | ||
| 56 | [\fB-Y\fR \fImech\fR] | ||
| 57 | [\fB-z\fR \fIlimit\fR] | ||
| 58 | [\fB-Z\fR[\fB-Z\fR]] | ||
| 59 | [\fIfilter\fR] | ||
| 60 | \fIattributes[:value] ...\fR | ||
| 61 | .sp | ||
| 62 | \fBldap2json\fR [ \fB-h\fR | \fB--help\fR ] | ||
| 63 | .sp | ||
| 64 | \fBldap2json\fR [ \fB-V\fR | \fB--version\fR ] | ||
| 65 | |||
| 66 | |||
| 67 | .SH DESCRIPTION | ||
| 68 | ldap2json is a shell utilty which performs an LDAP search and prints the results | ||
| 69 | in JSON format. | ||
| 70 | |||
| 71 | |||
| 72 | .SH OPTIONS | ||
| 73 | .TP | ||
| 74 | \fB-c\fR | ||
| 75 | do not stop if an error is encountered | ||
| 76 | .TP | ||
| 77 | \fB-d\fR | ||
| 78 | set OpenLDAP debug level to `level' | ||
| 79 | .TP | ||
| 80 | \fB-D\fR \fIbinddn\fR | ||
| 81 | bind DN used for simple bind | ||
| 82 | .TP | ||
| 83 | \fB-H\fR \fIURI\fR | ||
| 84 | specifies list of LDAP Uniform Resource Identifier(s) used to connect to LDAP server | ||
| 85 | .TP | ||
| 86 | \fB-l\fR \fIlimit\fR | ||
| 87 | time limit (in seconds) for search | ||
| 88 | .TP | ||
| 89 | \fB-L\fR | ||
| 90 | two \fB-L\fR disables comments | ||
| 91 | .TP | ||
| 92 | \fB-v\fR \fB--version\fR | ||
| 93 | run in verbose mode | ||
| 94 | .TP | ||
| 95 | \fB-s\fR \fIscope\fR | ||
| 96 | specifies search filter. Must be one of \fIbase\fR, \fIone\fR, \fIsub\fR, or \fIchild\fR | ||
| 97 | .TP | ||
| 98 | \fB-S\fR \fIattr\fR | ||
| 99 | sort results by attribute \fIattr\fR | ||
| 100 | .TP | ||
| 101 | \fB-w\fR \fIpasswd\fR | ||
| 102 | bind password used for simple bind | ||
| 103 | .TP | ||
| 104 | \fB-W\fR | ||
| 105 | prompt for bind password used in simple bind | ||
| 106 | .TP | ||
| 107 | \fB-x\fR | ||
| 108 | use simple authentication for bind | ||
| 109 | .TP | ||
| 110 | \fB-y\fR \fIfile\fR | ||
| 111 | read bind password from file | ||
| 112 | .TP | ||
| 113 | \fB-Y\fR \fImech\fR | ||
| 114 | SASL mechanism used during bind | ||
| 115 | .TP | ||
| 116 | \fB-z\fR \fIlimit\fR | ||
| 117 | size limit for search | ||
| 118 | .TP | ||
| 119 | \fB-Z\fR[\fB-Z\fR] | ||
| 120 | Issue StartTLS before bind request. \fB-ZZ\fR requires TLS operations to be successful. | ||
| 121 | .TP | ||
| 122 | \fIfilter\fR | ||
| 123 | The search filter. If not provided, the default filter, \fB(objectclass=*)\fR, | ||
| 124 | is used. | ||
| 125 | .TP | ||
| 126 | \fIattribute\fR | ||
| 127 | The \fIattribute\fR to include in JSON output. The psuedo attributes | ||
| 128 | \fBdn\fR, \fBrdn\fR, \fBufn\fR, \fBadc\fR, and \fBdce\fR are supported. | ||
| 129 | .TP | ||
| 130 | \fIattribute:value\fR | ||
| 131 | The \fIattribute\fR and default value to include in JSON output. The default | ||
| 132 | value is displayed if the entry does not contain the specified attribute. | ||
| 133 | Psuedo attributes cannot be used with default values. | ||
| 134 | .TP | ||
| 135 | \fI...\fR | ||
| 136 | List of additional attribute and default values to include in JSON output. | ||
| 137 | .SH PSUEDO ATTRIBUTES | ||
| 138 | .TP | ||
| 139 | \fBdn\fR | ||
| 140 | distinguished name of entry. The following are examples of distinguished name: | ||
| 141 | .in +4n | ||
| 142 | .nf | ||
| 143 | |||
| 144 | uid=dnullman,ou=People,dc=example,dc=net,o=internet | ||
| 145 | uid=jdough,ou=People,dc=example,dc=net,o=internet | ||
| 146 | uid=syzdek,ou=People,dc=syzdek,dc=net,o=internet | ||
| 147 | uid=administrator,ou=People,dc=foo,dc=org | ||
| 148 | |||
| 149 | .fi | ||
| 150 | .in | ||
| 151 | .TP | ||
| 152 | \fBrdn\fR | ||
| 153 | relative distinguished name of entry. The following are examples of relative | ||
| 154 | distinguished name: | ||
| 155 | .in +4n | ||
| 156 | .nf | ||
| 157 | |||
| 158 | uid=dnullman | ||
| 159 | uid=jdough | ||
| 160 | uid=syzdek | ||
| 161 | uid=administrator | ||
| 162 | |||
| 163 | .fi | ||
| 164 | .in | ||
| 165 | .TP | ||
| 166 | \fBufn\fR | ||
| 167 | User Friendly Name of distinguished name. The following are examples of User | ||
| 168 | Friendly Names: | ||
| 169 | .in +4n | ||
| 170 | .nf | ||
| 171 | |||
| 172 | dnullman, People, syzdek, net, internet | ||
| 173 | jdough, People, example, net, internet | ||
| 174 | syzdek, People, example, net, internet | ||
| 175 | administrator, People, foo.org | ||
| 176 | |||
| 177 | .fi | ||
| 178 | .in | ||
| 179 | .TP | ||
| 180 | \fBadc\fR | ||
| 181 | Active Directory canonical name of entry. The following are examples of Active | ||
| 182 | Directory canonical names: | ||
| 183 | .in +4n | ||
| 184 | .nf | ||
| 185 | |||
| 186 | internet/net/example/People/dnullman/ | ||
| 187 | internet/net/example/People/jdough/ | ||
| 188 | internet/net/syzdek/People/syzdek/ | ||
| 189 | foo.org/People/administrator | ||
| 190 | |||
| 191 | .fi | ||
| 192 | .in | ||
| 193 | .TP | ||
| 194 | \fBdce\fR | ||
| 195 | DCE-style of distinguished name. The following are examples of ADCE-style of | ||
| 196 | distinguished names: | ||
| 197 | .in +4n | ||
| 198 | .nf | ||
| 199 | |||
| 200 | /o=internet/dc=net/dc=example/ou=People/uid=dnullman | ||
| 201 | /o=internet/dc=net/dc=example/ou=People/uid=jdough | ||
| 202 | /o=internet/dc=net/dc=syzdek/ou=People/uid=syzdek | ||
| 203 | /dc=org/dc=foo/ou=People/uid=administrator | ||
| 204 | |||
| 205 | .fi | ||
| 206 | .in | ||
| 207 | |||
| 208 | .SH EXAMPLE | ||
| 209 | The following command: | ||
| 210 | .in +4n | ||
| 211 | .nf | ||
| 212 | |||
| 213 | ldap2json -LLL -x -b o=internet -S sn '(uid=*)' uid givenname sn mail title rdn | ||
| 214 | |||
| 215 | .fi | ||
| 216 | .in | ||
| 217 | |||
| 218 | will perform search on the LDAP server. The output might look something the following: | ||
| 219 | .in +4n | ||
| 220 | .nf | ||
| 221 | |||
| 222 | [ | ||
| 223 | { | ||
| 224 | "uid": "jdough", | ||
| 225 | "givenname": "John", | ||
| 226 | "sn": "Dough", | ||
| 227 | "mail": "doughboy42@example.com", | ||
| 228 | "title": "'Dough' Master", | ||
| 229 | "rdn": "uid=jdough" | ||
| 230 | }, | ||
| 231 | { | ||
| 232 | "uid": "dnullman", | ||
| 233 | "givenname": "Devian", | ||
| 234 | "sn": "Nullman", | ||
| 235 | "mail": "noreply@example.com", | ||
| 236 | "title": "Linux Device : /dev/null", | ||
| 237 | "rdn": "uid=dnullman" | ||
| 238 | }, | ||
| 239 | { | ||
| 240 | "uid": "syzdek", | ||
| 241 | "givenname": "David M.", | ||
| 242 | "sn": "Syzdek", | ||
| 243 | "mail": "david@syzdek.net", | ||
| 244 | "title": "Slackware Linux Administrator", | ||
| 245 | "rdn": "uid=syzdek" | ||
| 246 | } | ||
| 247 | ] | ||
| 248 | .fi | ||
| 249 | .in | ||
| 250 | |||
| 251 | Similar search performed with \fBldapsearch\fR might produce output which looks something like the following: | ||
| 252 | |||
| 253 | .in +4n | ||
| 254 | .nf | ||
| 255 | |||
| 256 | dn: uid=jdough,ou=People,dc=example,dc=net,o=internet | ||
| 257 | uid: jdough | ||
| 258 | givenname: John | ||
| 259 | sn: Dough | ||
| 260 | mail: doughboy42@example.com | ||
| 261 | title: "Dough" Master | ||
| 262 | |||
| 263 | dn: uid=dnullman,ou=People,dc=example,dc=net,o=internet | ||
| 264 | uid: dnullman | ||
| 265 | givenname: Devian | ||
| 266 | sn: Nullman | ||
| 267 | mail: noreply@example.com | ||
| 268 | title: Linux Device | /dev/null | ||
| 269 | |||
| 270 | dn: uid=syzdek,ou=People,dc=syzdek,dc=net,o=internet | ||
| 271 | uid: syzdek | ||
| 272 | givenname: David M. | ||
| 273 | sn: Syzdek | ||
| 274 | mail: david@syzdek.net | ||
| 275 | title: Slackware Linux Administrator | ||
| 276 | |||
| 277 | .fi | ||
| 278 | .in | ||
| 279 | |||
| 280 | |||
| 281 | .SH "SEE ALSO" | ||
| 282 | .BR ldapsearch (1), | ||
| 283 | .BR ldapd2csv (1), | ||
| 284 | .BR ldapdebug (1), | ||
| 285 | .BR ldaptree (1), | ||
| 286 | .BR ldap.conf (5) | ||
| 287 | |||
| 288 | |||
| 289 | .SH AUTHOR | ||
| 290 | David M. Syzdek <david@syzdek.net> | ||
| 291 | |||
| 292 | |||
| 293 | .SH ACKNOWLEDGEMENTS | ||
| 294 | \fB@PACKAGE_NAME@\fR is developed and maintained by David M. Syzdek | ||
| 295 | <david@syzdek.net>. \fB@PACKAGE_NAME@\fR utilizes and is styled after the | ||
| 296 | tools and libraries maintained by the \fBThe OpenLDAP Project\fR | ||
| 297 | <http://www.openldap.org/>. | ||
| 298 | |||
| 299 | |||
| 300 | .Sh CAVEATS | ||
| 301 | |||
| 302 | .\" end of man page | ||
