Return-Path: Delivered-To: apmail-incubator-directory-dev-archive@www.apache.org Received: (qmail 14474 invoked from network); 18 Apr 2004 20:03:14 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 18 Apr 2004 20:03:14 -0000 Received: (qmail 4080 invoked by uid 500); 18 Apr 2004 20:03:02 -0000 Delivered-To: apmail-incubator-directory-dev-archive@incubator.apache.org Received: (qmail 4028 invoked by uid 500); 18 Apr 2004 20:03:02 -0000 Mailing-List: contact directory-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Directory Developers List" Reply-To: "Apache Directory Developers List" Delivered-To: mailing list directory-dev@incubator.apache.org Received: (qmail 4014 invoked from network); 18 Apr 2004 20:03:02 -0000 Received: from unknown (HELO exchange.sun.com) (192.18.33.10) by daedalus.apache.org with SMTP; 18 Apr 2004 20:03:02 -0000 Received: (qmail 5415 invoked from network); 18 Apr 2004 20:03:53 -0000 Received: from localhost (HELO nagoya) (127.0.0.1) by nagoya.betaversion.org with SMTP; 18 Apr 2004 20:03:53 -0000 Message-ID: <1590837707.1082318633416.JavaMail.apache@nagoya> Date: Sun, 18 Apr 2004 13:03:53 -0700 (PDT) From: jira@apache.org To: directory-dev@incubator.apache.org Subject: [jira] Closed: (DIRSNICKERS-7) Work on BindRequest construction with BERDigester In-Reply-To: <1411382980.1081142083379.JavaMail.apache@nagoya> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Message: The following issue has been closed. Resolver: Alex Karasulu Date: Sun, 18 Apr 2004 1:02 PM Completed and checked in the last set of tests to show the bind request being built properly see commit rev 10086 for details. --------------------------------------------------------------------- View the issue: http://issues.apache.org/jira/browse/DIRSNICKERS-7 Here is an overview of the issue: --------------------------------------------------------------------- Key: DIRSNICKERS-7 Summary: Work on BindRequest construction with BERDigester Type: Task Status: Closed Priority: Major Resolution: FIXED Project: Directory Snickers Components: BER Runtime Assignee: Alex Karasulu Reporter: Alex Karasulu Created: Sun, 4 Apr 2004 10:13 PM Updated: Sun, 18 Apr 2004 1:02 PM Description: BindRequest for Simple Binding ============================== * The LOW level BER operation should not have to create objects for simple types that need to be used with a stack. These types can be pushed and poped off of primitive stacks which we have added to the digester. * We must recognize that there will be different kinds of rules. Some will be non protocol specific or rather BER specific which will perhaps be used to transform primitive types. Other rules will be protocol specific and then there will be PDU specific rules. We found that primitive rule types can be extended for customization. Now for our specific problem of building a BindRequest lets keep the scope constrained to simple binds without any controls. Below we have the raw tag nesting patterns of such a bind request with the primitive bit turned off: .|..0x10000000 <-------- SEQUENCE .|......0x02000000 <-------- INTEGER (messageId) .|......0x40000000 <-------- BindRequest (APPLICATION 0) .|..........0x02000000 <-------- INTEGER (version) .|..........0x04000000 <-------- OCTET STRING (name) .|..........0x80000000 <-------- OCTET STRING (CONTEXT-SPECIFIC 0) (simple) .|......0x80000000 <------------ Control (CONTEXT-SPECIFIC 0) (OPTIONAL) v time The BindRequest pattern would then be { 0x10000000, 0x40000000 } however before it comes the messageId which we need to create the BindRequest bean. A protocol non specific rule can be devised to accumulate and decode the message id integer by matching for { 0x10000000, 0x02000000 }. It could be called PrimitiveIntDecodeRule. Lets say that it accumulates, decodes and pushes a primitive int onto the primitive int stack for use later as a parameter. To summerize this step: addRule( { 0x10000000, 0x02000000 }, PrimitiveIntDecodeRule ) ; A PDU specific rule, BindRequestRule would then match the tag pattern, { 0x10000000, 0x40000000 }, pop the primitive int stack, instantiate a BindRequest bean and push it onto the object stack. addRule( { 0x10000000, 0x40000000 }, BindRequestRule ) ; Next we encounter the sequence of members we need for this PDU. For the version INTEGER we register the following rule which extends the PrimitiveIntDecodeRule. addRule( { 0x10000000, 0x40000000, 0x02000000 }, BindVersionRule ) ; Continuing on we set the distinguished name of the user that is binding. The BindNameRule is derived from the PrimitiveOctetStringRule which pushes the collected octets for the name field onto the object stack. The finish() method override after calling the super method pops the octets off of the stack and uses it for constructing the name field. Here's the add for the rule: addRule( { 0x10000000, 0x40000000, 0x04000000 }, BindNameRule ) ; Now for the last step we're reading an OCTET STRING that is tagged as a context specific [0] tag for the simple credentials. Again this rule extends the PrimitiveOctetStringRule and encounters the same dynamics. Here's how it is added: addRule( { 0x10000000, 0x40000000, 0x80000000 }, BindSimpleCredentialsRule ) ; Here the rule simply collects the credential data into a byte array and pushes it onto the object stack. The finish() method override pops the byte[] off of the object stack and sets the BindRequest bean's credentials which is the root object as well as the current top of the object stack. The rule also sets the 'simple' boolean property to true. Finally the LdapBindRequestRule finishes at which point the completed BindRequest bean can be popped off of the object stack and handed off to a higher facility. Rules to be created and added:
  1. PrimitiveIntDecodeRule
  2. BindRequestRule
  3. BindVersionRule
  4. BindNameRule
  5. BindSimpleCredentialsRule
--------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira