KDC Audit project

Dmitri Pal dpal at redhat.com
Mon Jan 14 20:44:44 EST 2013


On 01/14/2013 10:38 AM, Nico Williams wrote:
> On Mon, Jan 14, 2013 at 6:55 AM, Dmitri Pal <dpal at redhat.com> wrote:
>> This is nice but not exactly what I had in mind.
>> What is missing IMO is ability to combine objects into objects.
>> May be I am missing something but array or dictionary interfaces manage
>> objects but not objects themselves which does not allow for hierarchy
>> creation.
> Nested objects are fully supported.  My JSON example was intended to
> show this.  You thought that the JSON and dict stuff are completely
> distinct, but they are not: JSON bits is just a serialization.

If I am wrong do you have a code example to illustrate it?
Because I looked at the header and have not seen any place where you do
the type casting.
So I do not see a function or macro that will return you a
heim_object_tout of the heim_array_tand also would allow to look at the
object of heim_object_ttype and detect that it is actually an array.

Also I do not see the support of the KVP lists.

Here is an example of the code that I want to be able to execute.
If this is is something that can be done with this library great, if not
but a minor change need, also great, if there is a major chunk of work
then I would prefer something like json-c and BTW yes this is the right
link.

   
    event_t ev = NULL;
   
   /* Construct event from different parts and pieces.
       This shows several values that can be of basic types and then an
array */

    err = create_event(&ev, name1, format1, value1, name2, format2, value2);
    ...

    err = add_to_event(ev, name3, format3, value3, name4, format4, value4);

    ...

    err = create_array(&array);
    ...
    err = add_element_to_array(array, data_to_add);
    ...

    err = add_to_event(ev, name_array, format_array, array);
   
   
    /* Call plugin interface */
    err = log_event(ev);

   destroy_event(ev);


   Inside the plugin there will be something like this:

   ...

   traverse_event(ev, my_callback, my_data)

   this will traverse the event and allow the caller to examine
different parts of the event and transform it into whatever the
implementer needs: syslog call, message bus call, amqp message, database
insert statement, JSON, XML, CSV or something else.


While I see a lot of basic elements available in the library you provide
but I do not see the name value hierarchical management I am talking
about here.
ELAPI is very close to what I describe but it did not support arrays so
IMO JSON library is probably the safest bet off the shelf.
Which implementation? I do not know someone would need to research it more.

>
> You can have dicts and arrays as values in arrays and dicts.  Heck,
> this even allows you to have dicts and arrays as keys of dicts (which
> JSON does not allow).
>
>> By a quick look it seems that a c-JSON like library would fit better.
> Link?
>
>> If on the other hand you plan to add ability to construct nested objects
>> to the library then it would also solve the problem and make the library
>> very useful.
> Nested objects are already fully supported, with even more power than
> in in JS/JSON.
>
> Nico
> --


-- 
Thank you,
Dmitri Pal

Sr. Engineering Manager for IdM portfolio
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/





More information about the krbdev mailing list