Re: Qustion regarding schema quirk mode

2018-05-03 Thread Emmanuel Lécharny
Ok, I'm almost done with the new parsers.

i'm currently implementing the other Schema Elements (DitContentRule,
DirStructureRule, LdapComparator, LdapSyntax, MatchingRule,
MatchingRuleUse, Normalizer, NomrForm and SyntxChecker), which are
pretty trivial now that AT and OC are done.

For the record, here are the checks we do when quirkMode is not enabled
(ie, in strict mode), beside the ones I listed in a previous mail :

AT :
* must have at least a Syntax or a SUP
* COLLECTIVE requires USAGE userApplications
* NO-USER-MODIFICATION requires an operational USAGE

MR :
* SYNTAX is required

MRU :
* APPLIES is required

DSR :
* FORM is required

NF :
* MUST is required
* OC is required

LC :
* FQCN is required
* BYTECODE is required

N:
* FQCN is required
* BYTECODE is required

SC :
* FQCN is required
* BYTECODE is required


For all the SchemaObjects, we also check that we don't use each element
more than once (like NAME tice, or DESC twice...)

Beside those semantic tests, quickMode is also relaxing many constraints
on underscores, hyphen, etc.


Beside being faster (40x now that I have added some more checks), it
will also be thread safe. Antlr parser is not thread safe, so we had to
add synchronized methods in the server to access to the SchemaObjects
parsers. Not that it makes a lot of difference in term of performance,
as we don't frequently call those parsers, but it removes one of the
existing burden.

I have to polish the parsers hierarchy, and add some 'negative' tests
which are lacking (ie tests that prove the parsers correctly reject
wrong descriptions, on both strict or quicks mode).

I hope to be done by the end of this week.

Le 23/04/2018 à 18:07, Emmanuel Lecharny a écrit :
> That will be when I’ll be back from vacations :-)
> 
> 
> Le lun. 23 avr. 2018 à 12:40, Radovan Semancik <
> radovan.seman...@evolveum.com> a écrit :
> 
>> Hi,
> 
>> As far as I remember it should also contain:
> 
>> * Allow (pretty much any) string as OID. E.g. "whatever-oid" is often
>> used instead of real OID by Sun/Oracle servers. And I have even see it
>> recommended practice.
> 
>> * Do not die when some of the schema parts is not there at all. E.g.
>> Active Directory does not have SYNTAX definitions at all. It is OK to
>> have these parts as null in the parsed schema, just the schema parser
>> must not die on NPE or similar error during parsing.
> 
>> Once you have the new parser working for your scenarios I can update my
>> connector to a new Dir API version. And the I can run the tests with my
>> private directory server ZOO.
> 
>> -- 
>> Radovan Semancik
>> Software Architect
>> evolveum.com
> 
> 
> 
>> On 04/15/2018 11:03 PM, Emmanuel Lécharny wrote:
>> > Hi guys,
>> >
>> > I'm trying to speedup the schema parsing (it's currently quite slow,
>> due
>> > to the 3 embedded Antlr parsers we use).
>> >
>> > We use a quirksMode to be able to process more than just the RFC 4512
>> > syntax. AFAICT, here are the relaxed rules :
>> >
>> > o Allow prefixed numericOID, like attributeType ( DUAConfSchemaOID:1.0
>> > NAME 'defaultServerList' (assuming we have a DUAConfSchemaOID
>> > definedusing an objectidentifier definition)
>> >
>> > o Avoid checking references (SUP, SYNTAX) between schema elements
>> >
>> > o Allow the presence of special chars like '.', '_', ';', ':' and
>> '#' in
>> > a NAME
>> >
>> > o Null OID are accepted for DitStructureRules
>> >
>> >
>> > Is there anything I'm missing ?
>> >
>> > Thanks !
>> >
> 
> 
>> -- 
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com

-- 
Emmanuel Lecharny

Symas.com
directory.apache.org



pEpkey.asc
Description: application/pgp-keys


Re: Qustion regarding schema quirk mode

2018-04-23 Thread Emmanuel Lecharny
That will be when I’ll be back from vacations :-)


Le lun. 23 avr. 2018 à 12:40, Radovan Semancik <
radovan.seman...@evolveum.com> a écrit :

> Hi,
>
> As far as I remember it should also contain:
>
> * Allow (pretty much any) string as OID. E.g. "whatever-oid" is often
> used instead of real OID by Sun/Oracle servers. And I have even see it
> recommended practice.
>
> * Do not die when some of the schema parts is not there at all. E.g.
> Active Directory does not have SYNTAX definitions at all. It is OK to
> have these parts as null in the parsed schema, just the schema parser
> must not die on NPE or similar error during parsing.
>
> Once you have the new parser working for your scenarios I can update my
> connector to a new Dir API version. And the I can run the tests with my
> private directory server ZOO.
>
> --
> Radovan Semancik
> Software Architect
> evolveum.com
>
>
>
> On 04/15/2018 11:03 PM, Emmanuel Lécharny wrote:
> > Hi guys,
> >
> > I'm trying to speedup the schema parsing (it's currently quite slow, due
> > to the 3 embedded Antlr parsers we use).
> >
> > We use a quirksMode to be able to process more than just the RFC 4512
> > syntax. AFAICT, here are the relaxed rules :
> >
> > o Allow prefixed numericOID, like attributeType ( DUAConfSchemaOID:1.0
> > NAME 'defaultServerList' (assuming we have a DUAConfSchemaOID
> > definedusing an objectidentifier definition)
> >
> > o Avoid checking references (SUP, SYNTAX) between schema elements
> >
> > o Allow the presence of special chars like '.', '_', ';', ':' and '#' in
> > a NAME
> >
> > o Null OID are accepted for DitStructureRules
> >
> >
> > Is there anything I'm missing ?
> >
> > Thanks !
> >
>
>
> --
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Qustion regarding schema quirk mode

2018-04-23 Thread Radovan Semancik

Hi,

As far as I remember it should also contain:

* Allow (pretty much any) string as OID. E.g. "whatever-oid" is often 
used instead of real OID by Sun/Oracle servers. And I have even see it 
recommended practice.


* Do not die when some of the schema parts is not there at all. E.g. 
Active Directory does not have SYNTAX definitions at all. It is OK to 
have these parts as null in the parsed schema, just the schema parser 
must not die on NPE or similar error during parsing.


Once you have the new parser working for your scenarios I can update my 
connector to a new Dir API version. And the I can run the tests with my 
private directory server ZOO.


--
Radovan Semancik
Software Architect
evolveum.com



On 04/15/2018 11:03 PM, Emmanuel Lécharny wrote:

Hi guys,

I'm trying to speedup the schema parsing (it's currently quite slow, due
to the 3 embedded Antlr parsers we use).

We use a quirksMode to be able to process more than just the RFC 4512
syntax. AFAICT, here are the relaxed rules :

o Allow prefixed numericOID, like attributeType ( DUAConfSchemaOID:1.0
NAME 'defaultServerList' (assuming we have a DUAConfSchemaOID
definedusing an objectidentifier definition)

o Avoid checking references (SUP, SYNTAX) between schema elements

o Allow the presence of special chars like '.', '_', ';', ':' and '#' in
a NAME

o Null OID are accepted for DitStructureRules


Is there anything I'm missing ?

Thanks !






Re: Qustion regarding schema quirk mode

2018-04-16 Thread Emmanuel Lécharny


Le 17/04/2018 à 07:33, Stefan Seelmann a écrit :
> On 04/16/2018 11:40 PM, Emmanuel Lécharny wrote:
>> Hi guys,
>>
>> I'm trying to speedup the schema parsing (it's currently quite slow, due
>> to the 3 embedded Antlr parsers we use).
>>
>> We use a quirksMode to be able to process more than just the RFC 4512
>> syntax. AFAICT, here are the relaxed rules :
>>
>> o Allow prefixed numericOID, like attributeType ( DUAConfSchemaOID:1.0
>> NAME 'defaultServerList' (assuming we have a DUAConfSchemaOID
>> definedusing an objectidentifier definition)
> 
> I think that's for OpenLDAP OID macros
> 
>> o Avoid checking references (SUP, SYNTAX) between schema elements
>>
>> o Allow the presence of special chars like '.', '_', ';', ':' and '#' in
>> a NAME
> 
> Yes, because some LDAP servers allow such characters in names
> 
>> o Null OID are accepted for DitStructureRules
> 
> Hm, this is not quirk mode, DitStructureRules don't have an OID, right?

Well, they do have a ruleId, so my question would be : can it be null ?

> 
>> Is there anything I'm missing ?
> I think that's it. I hope we have tests to cover all those special cases.

If we don't, I'll add them.

Thanks Stefan  !

-- 
Emmanuel Lecharny

Symas.com
directory.apache.org



pEpkey.asc
Description: application/pgp-keys


Re: Qustion regarding schema quirk mode

2018-04-16 Thread Stefan Seelmann
On 04/16/2018 11:40 PM, Emmanuel Lécharny wrote:
> Hi guys,
> 
> I'm trying to speedup the schema parsing (it's currently quite slow, due
> to the 3 embedded Antlr parsers we use).
> 
> We use a quirksMode to be able to process more than just the RFC 4512
> syntax. AFAICT, here are the relaxed rules :
> 
> o Allow prefixed numericOID, like attributeType ( DUAConfSchemaOID:1.0
> NAME 'defaultServerList' (assuming we have a DUAConfSchemaOID
> definedusing an objectidentifier definition)

I think that's for OpenLDAP OID macros

> o Avoid checking references (SUP, SYNTAX) between schema elements
> 
> o Allow the presence of special chars like '.', '_', ';', ':' and '#' in
> a NAME

Yes, because some LDAP servers allow such characters in names

> o Null OID are accepted for DitStructureRules

Hm, this is not quirk mode, DitStructureRules don't have an OID, right?

> Is there anything I'm missing ?
I think that's it. I hope we have tests to cover all those special cases.

Thanks,
Stefan


Qustion regarding schema quirk mode

2018-04-16 Thread Emmanuel Lécharny
Hi guys,

I'm trying to speedup the schema parsing (it's currently quite slow, due
to the 3 embedded Antlr parsers we use).

We use a quirksMode to be able to process more than just the RFC 4512
syntax. AFAICT, here are the relaxed rules :

o Allow prefixed numericOID, like attributeType ( DUAConfSchemaOID:1.0
NAME 'defaultServerList' (assuming we have a DUAConfSchemaOID
definedusing an objectidentifier definition)

o Avoid checking references (SUP, SYNTAX) between schema elements

o Allow the presence of special chars like '.', '_', ';', ':' and '#' in
a NAME

o Null OID are accepted for DitStructureRules


Is there anything I'm missing ?

Thanks !

--   Emmanuel Lecharny

Symas.com
directory.apache.org





pEpkey.asc
Description: application/pgp-keys


Qustion regarding schema quirk mode

2018-04-15 Thread Emmanuel Lécharny
Hi guys,

I'm trying to speedup the schema parsing (it's currently quite slow, due
to the 3 embedded Antlr parsers we use).

We use a quirksMode to be able to process more than just the RFC 4512
syntax. AFAICT, here are the relaxed rules :

o Allow prefixed numericOID, like attributeType ( DUAConfSchemaOID:1.0
NAME 'defaultServerList' (assuming we have a DUAConfSchemaOID
definedusing an objectidentifier definition)

o Avoid checking references (SUP, SYNTAX) between schema elements

o Allow the presence of special chars like '.', '_', ';', ':' and '#' in
a NAME

o Null OID are accepted for DitStructureRules


Is there anything I'm missing ?

Thanks !

-- 
Emmanuel Lecharny

Symas.com
directory.apache.org



pEpkey.asc
Description: application/pgp-keys