CFScript: implement LDAP querying properly

Description

Copied from https://issues.jboss.org/browse/RAILO-3286

See http://blog.adamcameron.me/2014/12/fixing-cfscript-cfldap.html for full narrative. Warning: it is not kind to either Adobe or Railo
Detail:
CFLDAP does have over 20 attributes, which might seem a challenge here. But it needn't be if we group them sensibly:
result = queryLdap(actionParams, connectionParams, queryParams);
Three arguments are OK, I think. Each of those param arguments would be structs, which include the one or more of the following attributes of <cfldap>:
actionParams:
action = "action"
modifyType = "replace|add|delete"
connectionParams:
server = "server name"
password = "password"
port = "port number"
rebind = "yes|no"
referral = "number of allowed hops"
secure = "multifield security string"
timeout = "milliseconds"
username = "user name"
clientcert = "path to client certificate"
clientcertpassword = "password for the client certificate"
usetls = "true|false"
queryParams:
attributes = "attribute, attribute"
delimiter = "delimiter character"
dn = "distinguished name"
filter = "filter"
maxRows = "number"
returnAsBinary = "column name, column name"
scope = "scope"
separator = "separator character"
sort = "attribute[, attribute]..."
sortControl = "nocase|desc|asc"
start = "distinguished name"
startRow = "row number"
(those're just copied from the docs).
It'd actually be quite nice to be able to define an LDAP connection like one can a datasource. This stuff generally doesn't need to be defined in the code every time one needs to make a call, after all.
This makes the LDAP-querying functionality easy, predictable, and in-keeping with CFScript's existing corpus. And this should be a primary language design consideration when implementing anything: does it fit with the rest of the language? This is something neither the Railo nor the Adobe language designers (I am certain neither organisation as anyone in that role, actually) seem to consider.

Activity

Show:

Adam Cameron 5 November 2015 at 06:35

Agreed: very low priority, and not one for the CFML engine at all, now that there's the .lucee option for things that diverge from ColdFusion's way of going about things.

This was more an exercise in looking at how tag functionality ought to have been ported to a script approach, rather than there being any specific need for it.

Sean Corfield 5 November 2015 at 01:47

LDAP feels like something that should be moved to an extension. Is it really core to CFML?

As for providing a queryLDAP() function, yes, that seems reasonable but I wonder how many people care enough to make the effort worthwhile (given there is a script-based solution already, despite it being horrible).

Details

Assignee

Reporter

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Priority

Created 1 February 2015 at 15:47
Updated 7 February 2021 at 11:12

Flag notifications