BIND 10 #983: Python wrappers for ACLs

BIND 10 Development do-not-reply at isc.org
Wed Jul 13 09:29:52 UTC 2011


#983: Python wrappers for ACLs
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jinmei
  vorner                             |                Status:  reviewing
                       Type:  task   |             Milestone:
                   Priority:  major  |  Sprint-20110802
                  Component:         |            Resolution:
  Unclassified                       |             Sensitive:  0
                   Keywords:         |           Sub-Project:  DNS
            Defect Severity:  N/A    |  Estimated Difficulty:  5.0
Feature Depending on Ticket:  ACL    |           Total Hours:  0
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by jinmei):

 I believe I've addressed all open issues.

 Replying to [comment:10 vorner]:

 > > One thing we can do within this ticket would be to introduce a wrapper
 > > for (Request)Loader which would currently only has the load() method.
 > > That way, if and when we introduce more extensions the code for
 > > loading() won't have to be modified.  If you like I'm okay with doing
 > > this in this ticket.  Do you?
 >
 > That was what I originally thought, so it would be nice to have the
 limited class wrapper, where we can add the register in future.

 Done.  The module now has RequestLoader class.

 > > Would this be better?
 > > {{{
 > >         // Install module constants.  Note that we can let
 Py_BuildValue
 > >         // "steal" the references to these object (by specifying false
 to
 > >         // installToModule), because, unlike the exception cases
 above,
 > >         // we don't have corresponding C++ variables (see the note in
 > >         // pycppwrapper_util for more details).
 > > }}}
 >
 > Yes, probably.

 Replaced the comment with this.

 > > >  * The functions that construct the ACLs take strings. I get it is
 the same as with the logging, but the logging is not really exposed, it is
 used from within the ModuleConfig thing. This might be used externally, do
 you think it makes sense to accept the list argument directly (and call
 the conversion to string to be used from within the C++ code)?
 [...]
 > Well, I didn't really mean writing C++ code to do the conversion. My
 idea was to take the object passed as a parameter, somehow load the
 json.dumps function (which is the python function used to convert to
 string) and call it with `PyObject_CallObject`, so effectively using the
 python function from C++ code. It should even handle parameter parsing.
 >
 > Having a python wrapper sounds reasonably as well, but it looks more
 tricky to me.
 >
 > Anyway, it probably isn't so much a problem, so if the solutions both
 look complicated, I'm OK with the current interface ‒ I just thought it
 could be more convenient.

 I thought this would be on borderline in that we'd probably want to
 keep the bindings as straightforward as possible.  But as I tried it I
 found it did not require too much of new code in this specific case,
 so I implemented it anyway.  I'm still not sure if we want to
 including this portion or not, so I'm okay either with or without it.
 Note also that I've updated pycppwrapper_util.h to help implement this
 feature (it was not absolutely necessary, but I wanted to keep the
 code concise and still safer with the help of the wrapper interfaces).

 And,

 > Just two details. The dns.h is not mentioned in Makefile.am, and there
 seems to be a double negative in „and there shouldn't be no operation“.

 dns.h should have been in Makefile.am when you made this comment...
 {{{
 dns_la_SOURCES = dns.h dns.cc dns_requestacl_python.h
 dns_requestacl_python.cc
 }}}
 I've fixed the latter one.  Thanks for pointing it out.

-- 
Ticket URL: <http://bind10.isc.org/ticket/983#comment:15>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list