Top | ![]() |
![]() |
![]() |
![]() |
gboolean | zpj_authorizer_is_authorized_for_domain () |
void | zpj_authorizer_process_call () |
void | zpj_authorizer_process_message () |
gboolean | zpj_authorizer_refresh_authorization () |
void | zpj_authorizer_refresh_authorization_async () |
gboolean | zpj_authorizer_refresh_authorization_finish () |
The ZpjAuthorizer interface provides a uniform way to implement authentication and authorization processes for use by ZpjSkydrive. Client code will construct a new ZpjAuthorizer instance of their choosing, such as ZpjGoaAuthorizer, and create a ZpjSkydrive with with it.
ZpjGoaAuthorizer is an implementation of ZpjAuthorizer for using authorization tokens provided by GNOME Online Accounts. It is quite possible for clients to write their own implementations. For example, on platforms that do not use GNOME Online Accounts a client might want to implement the
OAuth 2.0 authorization flow itself.It must be noted that all ZpjAuthorizer implementations must be
thread safe, as methods such as
zpj_authorizer_refresh_authorization()
may be called from any
thread (such as the thread performing an asynchronous ZpjSkydrive
operation) at any time.
gboolean zpj_authorizer_is_authorized_for_domain (ZpjAuthorizer *iface
,ZpjAuthorizationDomain *domain
);
Whether the authorization tokens held by iface
are valid for
domain
.
This method is thread safe.
void zpj_authorizer_process_call (ZpjAuthorizer *iface
,ZpjAuthorizationDomain *domain
,RestProxyCall *call
);
Adds the necessary authorization to call
.
This method modifies call
in place and is thread safe.
void zpj_authorizer_process_message (ZpjAuthorizer *iface
,ZpjAuthorizationDomain *domain
,SoupMessage *message
);
Adds the necessary authorization to message
. The type of message
can be DELETE, GET and POST.
This method modifies message
in place and is thread safe.
gboolean zpj_authorizer_refresh_authorization (ZpjAuthorizer *iface
,GCancellable *cancellable
,GError **error
);
Synchronously forces iface
to refresh any authorization tokens
held by it. See zpj_authorizer_refresh_authorization_async()
for the
asynchronous version of this call.
This method is thread safe.
void zpj_authorizer_refresh_authorization_async (ZpjAuthorizer *iface
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously forces iface
to refresh any authorization tokens
held by it. See zpj_authorizer_refresh_authorization()
for the
synchronous version of this call.
When the operation is finished, callback
will be called. You can
then call zpj_authorizer_refresh_authorization_finish()
to get the
result of the operation.
This method is thread safe.
gboolean zpj_authorizer_refresh_authorization_finish (ZpjAuthorizer *iface
,GAsyncResult *res
,GError **error
);
Finishes an asynchronous operation started with
zpj_authorizer_refresh_authorization_async()
.
struct ZpjAuthorizerInterface { GTypeInterface parent_iface; gboolean (*is_authorized_for_domain) (ZpjAuthorizer *iface, ZpjAuthorizationDomain *domain); void (*process_call) (ZpjAuthorizer *iface, ZpjAuthorizationDomain *domain, RestProxyCall *call); void (*process_message) (ZpjAuthorizer *iface, ZpjAuthorizationDomain *domain, SoupMessage *message); gboolean (*refresh_authorization) (ZpjAuthorizer *iface, GCancellable *cancellable, GError **error); };
Interface structure for ZpjAuthorizer. All methods should be thread safe.
The parent interface. |
||
A method to check if the authorization tokens are valid for a ZpjAuthorizationDomain. |
||
A method to append authorization headers to a RestProxyCall. |
||
A method to append authorization headers to a SoupMessage. Types of messages include DELETE, GET and POST. |
||
A synchronous method to force a refresh of
any authorization tokens held by the authorizer. It should return
|