📄 todo.proxy
字号:
back-proxyA proxy that handles a pool of URI associated to a unique suffix.Each request is spread over the different URIs and results aremasqueraded to appear as coming from a unique server.Suppose a company has two branches, whose existing DS have URIs"ldap://ldap.branch1.com/o=Branch 1, c=US""ldap://ldap.branch2.it/o=Branch 2, c=IT"and it wants to propose to the outer world as a unique URI"ldap://ldap.company.net/dc=company, dc=net"It could do some rewriting to map everything that comes in with a base DNof "o=Branch 1, dc=company, dc=net" as the URI of the Branch 1, andeverything that comes in with a base DN of "o=Branch 2, dc=company, dc=net"as the URI of Branch 2, and by rewriting all the DNs back to the new, uniform base. Everything that comes in with a base DN of "dc=company, dc=net" should be handled locally and propagated to the two branch URIs if a subtree (or at least onelevel) search is required.Operations:- bind- unbind- search- compare- add- modify- modrdn- delete- abandonThe input of each operation may be related to: exact DN exact parent ancestor-------------------------------------------------------------bind xunbindsearch x x xcompare xadd xmodify xmodrdn xdelete xabandonThe backend must rely on a DN fetching mechanism. Each operation requiresto determine as early as possible which URI will be able to satisfy it.Apart from searches, which by definition are usually allowed to returnmultiple results, and apart from unbind and abandon, which do not return anyresult, all the remaining operations require the related entry to be unique.A major problem isposed by the uniqueness of the DNs. As far as the suffixesare masqueraded by a common suffix, the DNs are no longer guaranteed to beunique. This backend relies on the assumption that the uniqueness of theDNs is guaranteed.Two layers of depth in DN fetching are envisaged.The first layer is provided by a backend-side cache made of previouslyretrieved entries. The cache relates each RDN (i.e. the DN apart from thecommon suffix) to the pool of URIs that are expected to contain a subsetof its children.The second layer is provided by a fetching function that spawns a search foreach URI in the pool determined by the cache if the correct URI has not been directly determined.Note that, as the remote servers may have been updated by some directoperation, this mechanism does not guarantee the uniqueness of the result.So write operations will require to skip the cache search and to performthe exaustive search of all the URIs unless some hint mechanism is providedto the backend (e.g. a server is read-only).Again, the lag between the fetching of the required DN and the actualread/write may result in a failure; however, this applies to any LDAP operation AFAIK.- bindif updates are to be strictly honored, a bind operation is performed againsteach URI; otherwise, it is performed against the URIs resulting from acache-level DN fetch.- unbindnothing to say; all the open handles related to the connection are reset.- searchif updates are to be strictly honored, a search operation is performed agaisteach URI. Note that this needs be performed also when the backend suffixis used as base. In case the base is stricter, the URI pool may be restricted by performing a cache DN fetch of the base first.- comparethe same applies to the compare DN.- addthis operation is delicate. Unless the DN up to the top-level part excludedcan be uniquely associated to a URI, and unless its uniqueness can be trusted,no add operation should be allowed.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -