chiave primaria in ldap - entryuuid
Come referenziare univocamente una entry ldap? Come legare una entry ldap con un record di un database relazionale?
Il campo entryUUID di ldap è l'esatto equivalente del campo "chiave primaria" di un db relazionale ed è un cosiddetto "attributo di sistema della entry".
Viene creato quando viene creata l'entry e non viene piu modificata. Questo è un esempio del valore che assume
entryUUID: cdc6c42e-e0c5-102c-8f62-639fb2049104
Si legge nell'RFC
A Universally Unique Identifier (UUID) is "an identifier unique across both space and time, with respect to the space of all UUIDs" [RFC 4122]. UUIDs are used in a wide range of systems. This document describes the 'entryUUID' operational attribute, which holds the UUID assigned to the object by the server. Clients may use this attribute to distinguish objects identified by a particular distinguished name or to locate a particular object after renaming.
Ecco un esempio di entry senza attributi di sistema generata da phpldapadmin:
version: 1
# LDIF Export for: cn=Damiano Venturin,ou=contatti,dc=smoke,dc=2v,dc=ntw
# Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on October 10, 2008 8:46 pm
# Server: My LDAP Server (localhost)
# Search Scope: base
# Search Filter: (objectClass=*)
# Total Entries: 1
dn: cn=Damiano Venturin,ou=contatti,dc=smoke,dc=2v,dc=ntw
cn: Damiano Venturin
sn: Venturin
telephoneNumber: 031212375
mobile: 0312170xxx
otherFacsimileTelephoneNumber: 0312170xxx
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: evolutionPerson
objectClass: calEntry
homePhone: 0311234567
category: VIP
category: Business
o: 2V S.r.l.
title: Mr.
anniversary: 1005-01-04
birthDate: 1977-03-23
homePostalAddress: via San Fermo, 41$Cavallasca, Como$22020$12345$Italia
otherPostalAddress: via dei fiori, 22$Torino, Torino$22334$67890$Italy
l: Cavallasca
otherPhone: 031212375
fileAs: Venturin Damiano
note: He is really a handsome man :-D
assistantName: someone else
labeledURI: http://www.squadrainformatica.com/smak/
managerName: someone
ou: Problem solving
roomNumber: office
spouseName: someone
businessRole: IT professionist
categories: administrator
postalAddress: via delle petunie, 666$Cavallasca, Como$22020$54321$Italy$Cav
allasca$Cavallasca$Cavallasca
uid: dam
mail: a@squadrainformatica.com
userPassword: {md5}DIgCi/OqamoUPthG8r4epAsw==
ora la stessa entry con gli attributi di sistema:
version: 1 # LDIF Export for: cn=Damiano Venturin,ou=contatti,dc=smoke,dc=2v,dc=ntw # Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on October 10, 2008 8:50 pm # Server: My LDAP Server (localhost) # Search Scope: base # Search Filter: (objectClass=*) # Total Entries: 1 dn: cn=Damiano Venturin,ou=contatti,dc=smoke,dc=2v,dc=ntw cn: Damiano Venturin sn: Venturin telephoneNumber: 031212375 mobile: 0312170xxx otherFacsimileTelephoneNumber: 0312170xxx objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: evolutionPerson objectClass: calEntry homePhone: 0311234567 category: VIP category: Business o: 2V S.r.l. title: Mr. anniversary: 1005-01-04 birthDate: 1977-03-23 homePostalAddress: via San Fermo, 41$Cavallasca, Como$22020$12345$Italia otherPostalAddress: via dei fiori, 22$Torino, Torino$22334$67890$Italy l: Cavallasca otherPhone: 031212375 structuralObjectClass: evolutionPerson entryUUID: cdc6c42e-e0c5-102c-8f62-639fb2049104 creatorsName: cn=admin,dc=smoke,dc=2v,dc=ntw createTimestamp: 20080707231141Z fileAs: Venturin Damiano note: He is really a handsome man :-D assistantName: someone else labeledURI: http://www.squadrainformatica.com/smak/ managerName: someone ou: Problem solving roomNumber: office spouseName: someone businessRole: IT professionis categories: administrator postalAddress: via delle petunie, 666$Cavallasca, Como$22020$54321$Italy$Cav allasca$Cavallasca$Cavallasca uid: dam mail: a@squadrainformatica.com userPassword: {md5}DIgCi/OqamoUPthG8r4epAsw== entryCSN: 20081005235625.520873Z#000000#000#000000 modifiersName: cn=admin,dc=smoke,dc=2v,dc=ntw modifyTimestamp: 20081005235625Z entryDN: cn=Damiano Venturin,ou=contatti,dc=smoke,dc=2v,dc=ntw subschemaSubentry: cn=Subschema hasSubordinates: FALSE
Pertanto si presta ad esser un buon hook da usare per correlare entries di ldap con record di mysql o di un qualunque altro db relazionale.
La questione poi però è: "che succede se si verifica qualche guaio e perdo i dati?" "quando ripristino il backup le UUID rimangono tali?" Ripristinando con phpldapadmin la risposta è no! Le entryUUID dei dati ripristinati differiscono dagli originali, a meno che non si utilizzino gli accorgimenti indicati nel post backup e restore di ldap
- Blog di dam
- 1805 letture
Versione stampabile


















Commenti
Problem with activation
Hi there, I dont know if I am writing in a proper board but I have got a problem with activation, link i receive in email is not working... http://www.squadrainformatica.com/?a088b487dc7b615d79ec07908aa,
Invia nuovo commento