directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: Qustion regarding schema quirk mode
Date Thu, 03 May 2018 08:54:35 GMT
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.semancik@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


Mime
View raw message