use JSON instead of DDF marshalling
[mech_eap.git] / util_attr.h
index 347842a..1a427f7 100644 (file)
@@ -41,9 +41,7 @@
 #include <string>
 #include <new>
 
-#include <shibsp/remoting/ddf.h>
-
-using namespace shibsp;
+#include <jansson.h>
 
 struct gss_eap_attr_provider;
 struct gss_eap_attr_ctx;
@@ -131,25 +129,28 @@ public:
     {
     }
 
+    /* prefix to be prepended to attributes emitted by gss_get_name_attribute */
     virtual const char *prefix(void) const
     {
         return NULL;
     }
 
-    virtual const char *marshallingKey(void) const
+    /* optional key for storing JSON dictionary */
+    virtual const char *name(void) const
     {
         return NULL;
     }
 
-    virtual bool unmarshallAndInit(const gss_eap_attr_ctx *manager,
-                                   DDF &object GSSEAP_UNUSED)
+    virtual bool initWithJsonObject(const gss_eap_attr_ctx *manager,
+                                    json_t *object GSSEAP_UNUSED)
     {
         return initWithManager(manager);
     }
 
-    virtual DDF marshall(void) const
+
+    virtual json_t *jsonRepresentation(void) const
     {
-        return DDF(NULL);
+        return NULL;
     }
 
     virtual time_t getExpiryTime(void) const { return 0; }
@@ -253,8 +254,8 @@ private:
     unsigned int attributePrefixToType(const gss_buffer_t prefix) const;
     gss_buffer_desc attributeTypeToPrefix(unsigned int type) const;
 
-    bool unmarshallAndInit(DDF &object);
-    DDF marshall(void) const;
+    bool initWithJsonObject(json_t *object);
+    json_t *jsonRepresentation(void) const;
 
     gss_eap_attr_provider *getPrimaryProvider(void) const;