SnapdAuthData

SnapdAuthData — Authorization data

Functions

Properties

GStrv discharges Read / Write
gchar * macaroon Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── SnapdAuthData

Includes

#include <snapd-glib/snapd-glib.h>

Description

A SnapdAuthData contains authorization data to Prices can be queried using snapd_snap_get_prices() and are used in snapd_client_buy_sync().

Functions

snapd_auth_data_new ()

SnapdAuthData *
snapd_auth_data_new (const gchar *macaroon,
                     gchar **discharges);

Create some authorization data.

Parameters

macaroon

serialzied macaroon used to authorize access to snapd.

 

discharges

serialized discharges.

[array zero-terminated=1]

Returns

a new SnapdAuthData

Since: 1.0


snapd_auth_data_get_macaroon ()

const gchar *
snapd_auth_data_get_macaroon (SnapdAuthData *auth_data);

Get the Macaroon that this authorization uses.

Parameters

auth_data

a SnapdAuthData.

 

Returns

the serialized Macaroon used to authorize access to snapd.

Since: 1.0


snapd_auth_data_get_discharges ()

gchar **
snapd_auth_data_get_discharges (SnapdAuthData *auth_data);

Get the discharges that this authorization uses.

Parameters

auth_data

a SnapdAuthData.

 

Returns

the discharges as serialized strings.

[transfer none][array zero-terminated=1]

Since: 1.0

Types and Values

SnapdAuthData

typedef struct _SnapdAuthData SnapdAuthData;

SnapdAuthData is an opaque data structure and can only be accessed using the provided functions.

Since: 1.0

Property Details

The “discharges” property

  “discharges”               GStrv

Serialized discharges.

Flags: Read / Write


The “macaroon” property

  “macaroon”                 gchar *

Serialized macaroon.

Flags: Read / Write

Default value: NULL