SlideShare a Scribd company logo
1 of 22
Download to read offline
LDAP em VDM++

     Pedro Pereira             Ulisses Costa

 M´todos Formais em Engenharia de Software
  e


          12 de Fevereiro de 2009




Pedro Pereira, Ulisses Costa   LDAP em VDM++
Sum´rio
   a



 1   LDAP
       O que ´ o LDAP e a DIT
              e
       Estrutura do LDAP
       Propriedades do LDAP



 2   VDM
      DIT - Tree? & Forest
      Servidor



 3   Opera¸˜es do Servidor
          co




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
Sum´rio
   a



 1   LDAP
       O que ´ o LDAP e a DIT
              e
       Estrutura do LDAP
       Propriedades do LDAP



 2   VDM
      DIT - Tree? & Forest
      Servidor



 3   Opera¸˜es do Servidor
          co




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
LDAP




       LDAP vs DAP - Lightweight porque opera em TCP/IP
       LDAP ´ pelo menos uma DIT
            e
       Uma directoria ´ uma maneira de organizar informa¸˜o
                      e                                 ca
       complexa, tornando f´cil a sua pesquisa.
                           a




                 Pedro Pereira, Ulisses Costa   LDAP em VDM++
Sum´rio
   a



 1   LDAP
       O que ´ o LDAP e a DIT
              e
       Estrutura do LDAP
       Propriedades do LDAP



 2   VDM
      DIT - Tree? & Forest
      Servidor



 3   Opera¸˜es do Servidor
          co




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
Estrutura da DIT




  Fun¸˜o da DIT
     ca
  Guardar a hierarquia

      Composta por entradas
      Entradas s˜o instˆncias de ObjectClass
                a      a
      ObjectClass’s podem ter atributos
      Atributos relacionam a informa¸˜o
                                    ca




                 Pedro Pereira, Ulisses Costa   LDAP em VDM++
Estrutura das entradas




      Contˆm uma instˆncia de ObjectClass
          e          a
      Atributos obrigat´rios da ObjectClass
                       o
      Um DN (Distinguished Name))
          ´
          Unico em toda a ´rvore
                          a
      Um RDN (Relative Distinguished Name)
          ´
          Unico entre irm˜os
                         a




                Pedro Pereira, Ulisses Costa   LDAP em VDM++
Sum´rio
   a



 1   LDAP
       O que ´ o LDAP e a DIT
              e
       Estrutura do LDAP
       Propriedades do LDAP



 2   VDM
      DIT - Tree? & Forest
      Servidor



 3   Opera¸˜es do Servidor
          co




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
Propriedades do LDAP




     Floresta de DIT’s
     DN’s s˜o unicos na DIT
           a´
     Um DN ´: O DN do antecessor e o seu RDN
           e
     Cada atributo tem pares de (identificador,valor)




               Pedro Pereira, Ulisses Costa   LDAP em VDM++
Sum´rio
   a



 1   LDAP
       O que ´ o LDAP e a DIT
              e
       Estrutura do LDAP
       Propriedades do LDAP



 2   VDM
      DIT - Tree? & Forest
      Servidor



 3   Opera¸˜es do Servidor
          co




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
Sum´rio
   a



 1   LDAP
       O que ´ o LDAP e a DIT
              e
       Estrutura do LDAP
       Propriedades do LDAP



 2   VDM
      DIT - Tree? & Forest
      Servidor



 3   Opera¸˜es do Servidor
          co




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
DIT - Tree?




     Grafo ac´
             ıclico e ligado (uma ra´
                                    ız)
     The root of the DIT is a DSA-specific Entry (DSE) and not
     part of any naming context


               Pedro Pereira, Ulisses Costa   LDAP em VDM++
DIT - Forest




      Grafo ac´
              ıclico e n˜o ligado (m´ltiplas ra´
                        a           u          ızes)




                Pedro Pereira, Ulisses Costa   LDAP em VDM++
Sum´rio
   a



 1   LDAP
       O que ´ o LDAP e a DIT
              e
       Estrutura do LDAP
       Propriedades do LDAP



 2   VDM
      DIT - Tree? & Forest
      Servidor



 3   Opera¸˜es do Servidor
          co




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
Servidor Estrutura



  class Server

  types
      public String = seq of char ;

      public OName = String ;
      public AName = String ;
      public Value = String ;

      public ObjClass :: must : set of AName
                         may : set of AName ;

  instance variables
                                                             --   entradas existentes
      private entries      :   map   nat1 to Entry ;
                                                             --   hierarquia das entradas
      private dit          :   map   nat1 to set of nat1 ;
                                                             --   objectos definidos
      private def_objs     :   map   OName to ObjClass ;
                                                             --   atributos definidos
      private def_attrs    :   set   of AName ;

      inv ServerINV () ;




                      Pedro Pereira, Ulisses Costa   LDAP em VDM++
Servidor Invariantes

      The root of the DIT is a DSA-specific Entry (DSE) and not part of any naming
      context;
      Entries have names: one or more attribute values from the entry form its relative
      distinguished name (RDN), which MUST be unique among all its siblings;
      The concatenation of the relative distinguished names of the sequence of entries
      from a particular entry to an immediate subordinate of the root of the tree
      forms that entry’s Distinguished Name (DN), which is unique in the tree;
      Each entry MUST have an objectClass attribute which specifies the object
      classes of that entry ;
      Servers MUST NOT permit clients to add attributes to an entry unless those
      attributes are permitted by the object class definitions, the schema controlling
      that entry ;
      Entries consist of a set of attributes;
      An attribute is a type with one or more associated values and is identified by a
      short descriptive name (...);
      Schema is the collection of attribute type definitions, object class definitions and
      other information (...);




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
Servidor Invariantes
     public ServerINV : () == > bool
     ServerINV () ==
     (
         return (

         -- dit aciclica
         ( not exists e in set dom dit & e in set Tra nsi tive Clo sur e ( e ) ) and

         -- todos os elementos que existem estao na dit
         ( forall e in set ( dom dit union rng dit ) & e in set dom entries ) and

         -- objectos apenas contem atributos definidos
         ( forall o in set rng def_objs & ( forall a in set ( o . must union o . may
              ) & a in set def_attrs ) ) and

         -- dn unico entre todos os elementos da floresta
         ( forall e1 , e2 in set rng entries & e1 . GetDN () <> e2 . GetDN () ) and

         -- dn do pai contido no do filho
         ( forall p in set dom dit & ( forall c in set Tr ans itiv eCl osu re ( p ) & (
              elems entries ( c ) . GetDN () ) subset ( elems entries ( p ) . GetDN () ) ) )
              and

         -- rdn unico entre irmaos
         ( forall p in set dom dit & ( forall c1 , c2 in set dit ( p ) & entries ( c1 ) .
              GetRDN () <> entries ( c2 ) . GetRDN () ) ) and

         -- rdn faz parte do dn
         ( forall e in set rng entries & e . GetRDN () in set elems e . GetDN () ) and

         -- rdn composto por um atributo
         ( forall e in set rng entries & e . GetRDN () in set dom e . GetAttrs () ) ) ) ;

                     Pedro Pereira, Ulisses Costa   LDAP em VDM++
Sum´rio
   a



 1   LDAP
       O que ´ o LDAP e a DIT
              e
       Estrutura do LDAP
       Propriedades do LDAP



 2   VDM
      DIT - Tree? & Forest
      Servidor



 3   Opera¸˜es do Servidor
          co




                    Pedro Pereira, Ulisses Costa   LDAP em VDM++
Servidor Opera¸oes
              c˜



  CRUD
  Create Read Update Delete

      Add Entry
      Del Entry
      Modify DN
      Search Entry
      Search Attributes




                  Pedro Pereira, Ulisses Costa   LDAP em VDM++
Modify DN

  public ModDN : seq of AName * AName == > ()
  ModDN ( old_dn , new_rdn ) ==
  (
     dcl new_dn : seq of AName := [];
     dcl pos : nat1 := len old_dn - 1;
     dcl e : nat1 := GetID ( old_dn ) ;

     for i = 1 to pos do
        new_dn := new_dn ^ [ old_dn ( i ) ];

     new_dn := new_dn ^ [ new_rdn ];
     entries ( e ) . SetDN ( new_dn ) ;

     for all c in set Tra nsi tiv eCl osur e ( e ) do
     (
        new_dn := [];

        for i = 1 to ( len entries ( c ) . GetDN () ) do
                 if i = pos
                 then new_dn := new_dn ^ [ new_rdn ]
                 else new_dn := new_dn ^ entries ( c ) . GetDN () ( i ) ;

         entries ( c ) . SetDN ( new_dn ) ;
     );
  )
  pre ( exists i in set dom entries & entries ( i ) . GetDN () = old_dn )
  post ( exists i in set dom entries & forall c in set Tran sit ive Clo sure ( i ) &
        new_rdn in set elems entries ( i ) . GetDN () and new_rdn in set elems entries ( c )
        . GetDN () ) ;




                       Pedro Pereira, Ulisses Costa   LDAP em VDM++
GetID




  public GetID : seq of AName == > nat
  GetID ( dn ) ==
  (
     for all i in set dom entries do
          if entries ( i ) . GetDN () = dn
          then return i ;

     return 0;
  )
  post ( not exists i in set dom entries & entries ( i ) . GetDN () = dn = > RESULT = 0 )
        or
       ( exists i in set dom entries & entries ( i ) . GetDN () = dn = > RESULT = i ) ;




                       Pedro Pereira, Ulisses Costa   LDAP em VDM++
Transitive Closure


  public T r ans iti veCl osu re : nat1 == > set of nat1
  T r a n s i t i v eCl osu re ( origem ) ==
  (
        dcl res : set of nat1 := {};
        dcl childs : set of nat1 := dit ( origem ) ;

     while childs   <> {} do
     (
        for all c   in set childs do
        (
           childs   := childs union dit ( c ) ;
           res :=   res union { c };
        );

          childs := childs  res ;
     );

     return res ;
  )
  pre origem in set dom entries
  post forall e in set RESULT & ( elems entries ( origem ) . GetDN () ) subset ( elems
       entries ( e ) . GetDN () ) ;




                       Pedro Pereira, Ulisses Costa   LDAP em VDM++

More Related Content

What's hot

Object-Oriented Programming with Perl and Moose
Object-Oriented Programming with Perl and MooseObject-Oriented Programming with Perl and Moose
Object-Oriented Programming with Perl and Moose
Dave Cross
 

What's hot (8)

Plc (1)
Plc (1)Plc (1)
Plc (1)
 
Plc (1)
Plc (1)Plc (1)
Plc (1)
 
Column Stride Fields aka. DocValues
Column Stride Fields aka. DocValues Column Stride Fields aka. DocValues
Column Stride Fields aka. DocValues
 
VNSISPL_DBMS_Concepts_ch4
VNSISPL_DBMS_Concepts_ch4VNSISPL_DBMS_Concepts_ch4
VNSISPL_DBMS_Concepts_ch4
 
Akiban Technologies: Renormalize
Akiban Technologies: RenormalizeAkiban Technologies: Renormalize
Akiban Technologies: Renormalize
 
From DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and BobsFrom DNA Sequence Variation to .NET Bits and Bobs
From DNA Sequence Variation to .NET Bits and Bobs
 
LDAP - Lightweight Directory Access Protocol
LDAP - Lightweight Directory Access ProtocolLDAP - Lightweight Directory Access Protocol
LDAP - Lightweight Directory Access Protocol
 
Object-Oriented Programming with Perl and Moose
Object-Oriented Programming with Perl and MooseObject-Oriented Programming with Perl and Moose
Object-Oriented Programming with Perl and Moose
 

Viewers also liked

1918 Vasario 16 Oji
1918 Vasario 16 Oji1918 Vasario 16 Oji
1918 Vasario 16 Oji
guestf83eae
 
Què és un blog?
Què és un blog?Què és un blog?
Què és un blog?
neusymarta
 
Tubefin2
Tubefin2Tubefin2
Tubefin2
mrtomn
 
Simple tech-talk
Simple tech-talkSimple tech-talk
Simple tech-talk
liltos
 

Viewers also liked (17)

Expenses and revenues of MIT
Expenses and revenues of MITExpenses and revenues of MIT
Expenses and revenues of MIT
 
DatorPaps biedribam
DatorPaps biedribamDatorPaps biedribam
DatorPaps biedribam
 
1918 Vasario 16 Oji
1918 Vasario 16 Oji1918 Vasario 16 Oji
1918 Vasario 16 Oji
 
Centre for Traditional Governance, Proposal
Centre for Traditional Governance, ProposalCentre for Traditional Governance, Proposal
Centre for Traditional Governance, Proposal
 
Esoko
Esoko Esoko
Esoko
 
Inovacijos 2009
Inovacijos   2009Inovacijos   2009
Inovacijos 2009
 
Ejercicio 5
Ejercicio 5Ejercicio 5
Ejercicio 5
 
Què és un blog?
Què és un blog?Què és un blog?
Què és un blog?
 
Pasakumi Jurmala 2008 (Tava Infodienai)
Pasakumi Jurmala 2008 (Tava Infodienai)Pasakumi Jurmala 2008 (Tava Infodienai)
Pasakumi Jurmala 2008 (Tava Infodienai)
 
Tubefin2
Tubefin2Tubefin2
Tubefin2
 
Simple tech-talk
Simple tech-talkSimple tech-talk
Simple tech-talk
 
Relationsverkstan
RelationsverkstanRelationsverkstan
Relationsverkstan
 
The Passage Samui Resort - by Hotel Kungfu Digital Marketing
The Passage Samui Resort - by Hotel Kungfu Digital MarketingThe Passage Samui Resort - by Hotel Kungfu Digital Marketing
The Passage Samui Resort - by Hotel Kungfu Digital Marketing
 
Hotel Kungfu: Digital Marketing for Hotels
Hotel Kungfu: Digital Marketing for HotelsHotel Kungfu: Digital Marketing for Hotels
Hotel Kungfu: Digital Marketing for Hotels
 
Login 2009 1
Login 2009 1Login 2009 1
Login 2009 1
 
Login 2009 1
Login 2009 1Login 2009 1
Login 2009 1
 
iPhone + Psykologi
iPhone + PsykologiiPhone + Psykologi
iPhone + Psykologi
 

Similar to LDAP em VDM++

Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
Configuring Domino To Be An Ldap Directory And To Use An Ldap DirectoryConfiguring Domino To Be An Ldap Directory And To Use An Ldap Directory
Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
Edson Oliveira
 
DBIx::Class vs. DBix::DataModel
DBIx::Class vs. DBix::DataModelDBIx::Class vs. DBix::DataModel
DBIx::Class vs. DBix::DataModel
Laurent Dami
 
Practical-LDAP-and-Linux
Practical-LDAP-and-LinuxPractical-LDAP-and-Linux
Practical-LDAP-and-Linux
Balaji Ravi
 

Similar to LDAP em VDM++ (20)

Class Diagram Uml
Class Diagram UmlClass Diagram Uml
Class Diagram Uml
 
Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
Configuring Domino To Be An Ldap Directory And To Use An Ldap DirectoryConfiguring Domino To Be An Ldap Directory And To Use An Ldap Directory
Configuring Domino To Be An Ldap Directory And To Use An Ldap Directory
 
DBIx::Class vs. DBix::DataModel
DBIx::Class vs. DBix::DataModelDBIx::Class vs. DBix::DataModel
DBIx::Class vs. DBix::DataModel
 
Using OpenLDAP
Using OpenLDAPUsing OpenLDAP
Using OpenLDAP
 
UnderstandingLDAP.ppt
UnderstandingLDAP.pptUnderstandingLDAP.ppt
UnderstandingLDAP.ppt
 
The Ldap Protocol
The Ldap ProtocolThe Ldap Protocol
The Ldap Protocol
 
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...
Apache Spark - Dataframes & Spark SQL - Part 1 | Big Data Hadoop Spark Tutori...
 
Practical-LDAP-and-Linux
Practical-LDAP-and-LinuxPractical-LDAP-and-Linux
Practical-LDAP-and-Linux
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
Ldap
LdapLdap
Ldap
 
LDAP
LDAPLDAP
LDAP
 
LDAP
LDAPLDAP
LDAP
 
A Tale of Three Apache Spark APIs: RDDs, DataFrames, and Datasets with Jules ...
A Tale of Three Apache Spark APIs: RDDs, DataFrames, and Datasets with Jules ...A Tale of Three Apache Spark APIs: RDDs, DataFrames, and Datasets with Jules ...
A Tale of Three Apache Spark APIs: RDDs, DataFrames, and Datasets with Jules ...
 
User administration without you - integrating LDAP
User administration without you - integrating LDAPUser administration without you - integrating LDAP
User administration without you - integrating LDAP
 
Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2
 
LDAP Injection & Blind LDAP Injection
LDAP Injection & Blind LDAP InjectionLDAP Injection & Blind LDAP Injection
LDAP Injection & Blind LDAP Injection
 
Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.
 
SQL introduction
SQL introductionSQL introduction
SQL introduction
 
ivanova-samba_backend.pdf
ivanova-samba_backend.pdfivanova-samba_backend.pdf
ivanova-samba_backend.pdf
 
JDD 2016 - Pawel Szulc - Writing Your Wwn RDD For Fun And Profit
JDD 2016 - Pawel Szulc - Writing Your Wwn RDD For Fun And ProfitJDD 2016 - Pawel Szulc - Writing Your Wwn RDD For Fun And Profit
JDD 2016 - Pawel Szulc - Writing Your Wwn RDD For Fun And Profit
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

LDAP em VDM++

  • 1. LDAP em VDM++ Pedro Pereira Ulisses Costa M´todos Formais em Engenharia de Software e 12 de Fevereiro de 2009 Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 2. Sum´rio a 1 LDAP O que ´ o LDAP e a DIT e Estrutura do LDAP Propriedades do LDAP 2 VDM DIT - Tree? & Forest Servidor 3 Opera¸˜es do Servidor co Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 3. Sum´rio a 1 LDAP O que ´ o LDAP e a DIT e Estrutura do LDAP Propriedades do LDAP 2 VDM DIT - Tree? & Forest Servidor 3 Opera¸˜es do Servidor co Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 4. LDAP LDAP vs DAP - Lightweight porque opera em TCP/IP LDAP ´ pelo menos uma DIT e Uma directoria ´ uma maneira de organizar informa¸˜o e ca complexa, tornando f´cil a sua pesquisa. a Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 5. Sum´rio a 1 LDAP O que ´ o LDAP e a DIT e Estrutura do LDAP Propriedades do LDAP 2 VDM DIT - Tree? & Forest Servidor 3 Opera¸˜es do Servidor co Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 6. Estrutura da DIT Fun¸˜o da DIT ca Guardar a hierarquia Composta por entradas Entradas s˜o instˆncias de ObjectClass a a ObjectClass’s podem ter atributos Atributos relacionam a informa¸˜o ca Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 7. Estrutura das entradas Contˆm uma instˆncia de ObjectClass e a Atributos obrigat´rios da ObjectClass o Um DN (Distinguished Name)) ´ Unico em toda a ´rvore a Um RDN (Relative Distinguished Name) ´ Unico entre irm˜os a Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 8. Sum´rio a 1 LDAP O que ´ o LDAP e a DIT e Estrutura do LDAP Propriedades do LDAP 2 VDM DIT - Tree? & Forest Servidor 3 Opera¸˜es do Servidor co Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 9. Propriedades do LDAP Floresta de DIT’s DN’s s˜o unicos na DIT a´ Um DN ´: O DN do antecessor e o seu RDN e Cada atributo tem pares de (identificador,valor) Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 10. Sum´rio a 1 LDAP O que ´ o LDAP e a DIT e Estrutura do LDAP Propriedades do LDAP 2 VDM DIT - Tree? & Forest Servidor 3 Opera¸˜es do Servidor co Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 11. Sum´rio a 1 LDAP O que ´ o LDAP e a DIT e Estrutura do LDAP Propriedades do LDAP 2 VDM DIT - Tree? & Forest Servidor 3 Opera¸˜es do Servidor co Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 12. DIT - Tree? Grafo ac´ ıclico e ligado (uma ra´ ız) The root of the DIT is a DSA-specific Entry (DSE) and not part of any naming context Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 13. DIT - Forest Grafo ac´ ıclico e n˜o ligado (m´ltiplas ra´ a u ızes) Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 14. Sum´rio a 1 LDAP O que ´ o LDAP e a DIT e Estrutura do LDAP Propriedades do LDAP 2 VDM DIT - Tree? & Forest Servidor 3 Opera¸˜es do Servidor co Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 15. Servidor Estrutura class Server types public String = seq of char ; public OName = String ; public AName = String ; public Value = String ; public ObjClass :: must : set of AName may : set of AName ; instance variables -- entradas existentes private entries : map nat1 to Entry ; -- hierarquia das entradas private dit : map nat1 to set of nat1 ; -- objectos definidos private def_objs : map OName to ObjClass ; -- atributos definidos private def_attrs : set of AName ; inv ServerINV () ; Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 16. Servidor Invariantes The root of the DIT is a DSA-specific Entry (DSE) and not part of any naming context; Entries have names: one or more attribute values from the entry form its relative distinguished name (RDN), which MUST be unique among all its siblings; The concatenation of the relative distinguished names of the sequence of entries from a particular entry to an immediate subordinate of the root of the tree forms that entry’s Distinguished Name (DN), which is unique in the tree; Each entry MUST have an objectClass attribute which specifies the object classes of that entry ; Servers MUST NOT permit clients to add attributes to an entry unless those attributes are permitted by the object class definitions, the schema controlling that entry ; Entries consist of a set of attributes; An attribute is a type with one or more associated values and is identified by a short descriptive name (...); Schema is the collection of attribute type definitions, object class definitions and other information (...); Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 17. Servidor Invariantes public ServerINV : () == > bool ServerINV () == ( return ( -- dit aciclica ( not exists e in set dom dit & e in set Tra nsi tive Clo sur e ( e ) ) and -- todos os elementos que existem estao na dit ( forall e in set ( dom dit union rng dit ) & e in set dom entries ) and -- objectos apenas contem atributos definidos ( forall o in set rng def_objs & ( forall a in set ( o . must union o . may ) & a in set def_attrs ) ) and -- dn unico entre todos os elementos da floresta ( forall e1 , e2 in set rng entries & e1 . GetDN () <> e2 . GetDN () ) and -- dn do pai contido no do filho ( forall p in set dom dit & ( forall c in set Tr ans itiv eCl osu re ( p ) & ( elems entries ( c ) . GetDN () ) subset ( elems entries ( p ) . GetDN () ) ) ) and -- rdn unico entre irmaos ( forall p in set dom dit & ( forall c1 , c2 in set dit ( p ) & entries ( c1 ) . GetRDN () <> entries ( c2 ) . GetRDN () ) ) and -- rdn faz parte do dn ( forall e in set rng entries & e . GetRDN () in set elems e . GetDN () ) and -- rdn composto por um atributo ( forall e in set rng entries & e . GetRDN () in set dom e . GetAttrs () ) ) ) ; Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 18. Sum´rio a 1 LDAP O que ´ o LDAP e a DIT e Estrutura do LDAP Propriedades do LDAP 2 VDM DIT - Tree? & Forest Servidor 3 Opera¸˜es do Servidor co Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 19. Servidor Opera¸oes c˜ CRUD Create Read Update Delete Add Entry Del Entry Modify DN Search Entry Search Attributes Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 20. Modify DN public ModDN : seq of AName * AName == > () ModDN ( old_dn , new_rdn ) == ( dcl new_dn : seq of AName := []; dcl pos : nat1 := len old_dn - 1; dcl e : nat1 := GetID ( old_dn ) ; for i = 1 to pos do new_dn := new_dn ^ [ old_dn ( i ) ]; new_dn := new_dn ^ [ new_rdn ]; entries ( e ) . SetDN ( new_dn ) ; for all c in set Tra nsi tiv eCl osur e ( e ) do ( new_dn := []; for i = 1 to ( len entries ( c ) . GetDN () ) do if i = pos then new_dn := new_dn ^ [ new_rdn ] else new_dn := new_dn ^ entries ( c ) . GetDN () ( i ) ; entries ( c ) . SetDN ( new_dn ) ; ); ) pre ( exists i in set dom entries & entries ( i ) . GetDN () = old_dn ) post ( exists i in set dom entries & forall c in set Tran sit ive Clo sure ( i ) & new_rdn in set elems entries ( i ) . GetDN () and new_rdn in set elems entries ( c ) . GetDN () ) ; Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 21. GetID public GetID : seq of AName == > nat GetID ( dn ) == ( for all i in set dom entries do if entries ( i ) . GetDN () = dn then return i ; return 0; ) post ( not exists i in set dom entries & entries ( i ) . GetDN () = dn = > RESULT = 0 ) or ( exists i in set dom entries & entries ( i ) . GetDN () = dn = > RESULT = i ) ; Pedro Pereira, Ulisses Costa LDAP em VDM++
  • 22. Transitive Closure public T r ans iti veCl osu re : nat1 == > set of nat1 T r a n s i t i v eCl osu re ( origem ) == ( dcl res : set of nat1 := {}; dcl childs : set of nat1 := dit ( origem ) ; while childs <> {} do ( for all c in set childs do ( childs := childs union dit ( c ) ; res := res union { c }; ); childs := childs res ; ); return res ; ) pre origem in set dom entries post forall e in set RESULT & ( elems entries ( origem ) . GetDN () ) subset ( elems entries ( e ) . GetDN () ) ; Pedro Pereira, Ulisses Costa LDAP em VDM++