[Bug 30460] Generate client side API for Chan.T.ServerTLSConnection and TLSCertificate

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Apr 18 09:17:48 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=30460

--- Comment #9 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-04-18 07:17:48 UTC ---
(I realise I probably wrote a lot of the code I'm criticizing here. In my
defence, it was over a year ago!)

+typedef struct {
...
+    GHashTable *details;
+} SignalledRejection;

Could this be a GVariant of type G_VARIANT_TYPE_VARDICT, converted from D-Bus
with _tp_asv_to_vardict()?

(I would like new extensibility points to be GVariant-based if possible, so we
don't have to keep adding parallel API.)

+  GPtrArray *cert_data;

I don't know what type we should use for this in the glorious GIO-compatible
future, but I feel that GPtrArray<GArray<guchar>> is probably not it.

Perhaps GList<GByteArray>, or GList<GBytes> with a GLib 2.32 dependency?

Using a GList would mean we can't make it a property.

If in doubt, make it not be a property, and we can give it a GList<GByteArray>
getter now, and a GList<GBytes> getter later?

It's a pity we can't use a GList<GTlsCertificate>, but GTlsCertificate is
X.509-only and only supports PEM (ASCII-armoured), whereas we support either
PGP or X.509 in their respective binary formats.

+void
+tp_tls_certificate_add_rejection (TpTLSCertificate *self,
+    TpTLSCertificateRejectReason reason,
+    const gchar *dbus_error,
+    GHashTable *details)

Again, details should be a GVariant of type G_VARIANT_TYPE_VARDICT, or NULL (to
be treated as an empty dict). tp_account_update_parameters_vardict_async() has
logic you can steal - it'd probably be worth adding a _tp_asv_from_vardict().

+ * tp_tls_certificate_get_nth_rejection:

Perhaps we'd be better off returning a GList<TpTLSCertificateRejection> where
TpTCR is a small object with accessors?

For g-i, it could have a method something like

    gboolean tp_tls_certificate_rejection_raise_error (TpTCR *, GError **);

which g-i bindings would turn into something usable like this:

    try:
        tcr.raise_error()
    except Exception, e:
        # ...

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.



More information about the telepathy-bugs mailing list