ldap-client-0.1.0: Pure Haskell LDAP Client Library

Safe HaskellNone
LanguageHaskell2010

Ldap.Asn1.FromAsn1

Description

This module contains convertions from ASN.1 to LDAP types.

Synopsis

Documentation

parseAsn1 :: FromAsn1 a => [ASN1] -> Maybe ([ASN1], a) Source

Convert a part of ASN.1 stream to a LDAP type returning the remainder of the stream.

class FromAsn1 a Source

ASN.1 stream parsers.

When it's relevant, instances include the part of RFC describing the encoding.

Minimal complete definition

fromAsn1

Instances

FromAsn1 LdapOid
LDAPOID ::= OCTET STRING -- Constrained to <numericoid>
FromAsn1 LdapString
LDAPString ::= OCTET STRING -- UTF-8 encoded,
FromAsn1 Uri
URI ::= LDAPString
FromAsn1 ReferralUris
Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI
FromAsn1 LdapDn
LDAPDN ::= LDAPString
FromAsn1 PartialAttribute
PartialAttribute ::= SEQUENCE {
     type       AttributeDescription,
     vals       SET OF value AttributeValue }
FromAsn1 AttributeValue
AttributeValue ::= OCTET STRING
FromAsn1 AttributeDescription
AttributeDescription ::= LDAPString
FromAsn1 LdapResult
LDAPResult ::= SEQUENCE {
     resultCode         ENUMERATED {
          success                      (0),
          operationsError              (1),
          protocolError                (2),
          timeLimitExceeded            (3),
          sizeLimitExceeded            (4),
          compareFalse                 (5),
          compareTrue                  (6),
          authMethodNotSupported       (7),
          strongerAuthRequired         (8),
          -- 9 reserved --
          referral                     (10),
          adminLimitExceeded           (11),
          unavailableCriticalExtension (12),
          confidentialityRequired      (13),
          saslBindInProgress           (14),
          noSuchAttribute              (16),
          undefinedAttributeType       (17),
          inappropriateMatching        (18),
          constraintViolation          (19),
          attributeOrValueExists       (20),
          invalidAttributeSyntax       (21),
          -- 22-31 unused --
          noSuchObject                 (32),
          aliasProblem                 (33),
          invalidDNSyntax              (34),
          -- 35 reserved for undefined isLeaf --
          aliasDereferencingProblem    (36),
          -- 37-47 unused --
          inappropriateAuthentication  (48),
          invalidCredentials           (49),
          insufficientAccessRights     (50),
          busy                         (51),
          unavailable                  (52),
          unwillingToPerform           (53),
          loopDetect                   (54),
          -- 55-63 unused --
          namingViolation              (64),
          objectClassViolation         (65),
          notAllowedOnNonLeaf          (66),
          notAllowedOnRDN              (67),
          entryAlreadyExists           (68),
          objectClassModsProhibited    (69),
          -- 70 reserved for CLDAP --
          affectsMultipleDSAs          (71),
          -- 72-79 unused --
          other                        (80),
          ...  },
     matchedDN          LDAPDN,
     diagnosticMessage  LDAPString,
     referral           [3] Referral OPTIONAL }
FromAsn1 PartialAttributeList
PartialAttributeList ::= SEQUENCE OF partialAttribute PartialAttribute
FromAsn1 ProtocolServerOp
BindResponse ::= [APPLICATION 1] SEQUENCE {
     COMPONENTS OF LDAPResult,
     serverSaslCreds    [7] OCTET STRING OPTIONAL }
SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
     objectName      LDAPDN,
     attributes      PartialAttributeList }
SearchResultReference ::= [APPLICATION 19] SEQUENCE
                          SIZE (1..MAX) OF uri URI
SearchResultDone ::= [APPLICATION 5] LDAPResult
ModifyResponse ::= [APPLICATION 7] LDAPResult
AddResponse ::= [APPLICATION 9] LDAPResult
DelResponse ::= [APPLICATION 11] LDAPResult
ModifyDNResponse ::= [APPLICATION 13] LDAPResult
CompareResponse ::= [APPLICATION 15] LDAPResult
ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
     COMPONENTS OF LDAPResult,
     responseName     [10] LDAPOID OPTIONAL,
     responseValue    [11] OCTET STRING OPTIONAL }
IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
     responseName     [0] LDAPOID OPTIONAL,
     responseValue    [1] OCTET STRING OPTIONAL }
FromAsn1 Id
MessageID ::= INTEGER (0 ..  maxInt)
FromAsn1 op => FromAsn1 (LdapMessage op)
LDAPMessage ::= SEQUENCE {
     messageID       MessageID,
     protocolOp      CHOICE {
          bindRequest           BindRequest,
          bindResponse          BindResponse,
          unbindRequest         UnbindRequest,
          searchRequest         SearchRequest,
          searchResEntry        SearchResultEntry,
          searchResDone         SearchResultDone,
          searchResRef          SearchResultReference,
          addRequest            AddRequest,
          addResponse           AddResponse,
          ... },
     controls       [0] Controls OPTIONAL }
(FromAsn1 a, FromAsn1 b) => FromAsn1 (a, b)