GUPnP.Acl

g GObject.GInterface GObject.GInterface GUPnP.Acl GUPnP.Acl GObject.GInterface->GUPnP.Acl

Implementations:

None

Methods

can_sync ()

is_allowed (device, service, path, address, agent)

is_allowed_async (device, service, path, address, agent, cancellable, callback, *user_data)

is_allowed_finish (res)

Virtual Methods

do_can_sync ()

do_is_allowed (device, service, path, address, agent)

do_is_allowed_async (device, service, path, address, agent, cancellable, callback, *user_data)

do_is_allowed_finish (res)

Properties

None

Signals

None

Fields

None

Class Details

class GUPnP.Acl
Bases:

GObject.GInterface

Structure:

GUPnP.AclInterface

Access control provider for [class`GUPnP`.Context]

GUPnP.Acl provides either synchronous or asynchronous functions to check whether a peer should be able to access a resource that is hosted by GUPnP or not.

New in version 0.20.11.

can_sync()
Return type:

bool

Check whether [method`GUPnP`.Acl.is_allowed_async] is supported.

New in version 0.20.11.

is_allowed(device, service, path, address, agent)
Parameters:
  • device (GUPnP.Device or None) – The [class`GUPnP`.Device] associated with path or None if unknown.

  • service (GUPnP.Service or None) – The [class`GUPnP`.Service] associated with path or None if unknown.

  • path (str) – The path being served.

  • address (str) – IP address of the peer.

  • agent (str or None) – The User-Agent header of the peer or None if unknown. returns True if the peer is allowed, False otherwise

Return type:

bool

Check whether an IP address is allowed to access this resource.

New in version 0.20.11.

is_allowed_async(device, service, path, address, agent, cancellable, callback, *user_data)
Parameters:
  • device (GUPnP.Device or None) – The [class`GUPnP`.Device] associated with path or None if unknown.

  • service (GUPnP.Service or None) – The [class`GUPnP`.Service] associated with path or None if unknown.

  • path (str) – The path being served.

  • address (str) – IP address of the peer

  • agent (str or None) – The User-Agent header of the peer or None if not unknown.

  • cancellable (Gio.Cancellable or None) – A cancellable which can be used to cancel the operation.

  • callback (Gio.AsyncReadyCallback or None) – Callback to call after the function is done.

  • user_data (object or None) – Some user data.

Check asynchronously whether an IP address is allowed to access this resource.

This function is optional. [method`GUPnP`.Acl.can_sync] should return True if the implementing class supports it. If it is supported, GUPnP will prefer to use this function over [method`GUPnP`.Acl.is_allowed].

Implement this function if the process of verifying the access right is expected to take some time, for example when using D-Bus etc.

Use [method`GUPnP`.Acl.is_allowed_finish] to retrieve the result.

New in version 0.20.11.

is_allowed_finish(res)
Parameters:

res (Gio.AsyncResult) – [iface`Gio`.AsyncResult] obtained from the callback passed to [method`GUPnP`.Acl.is_allowed_async]

Raises:

GLib.Error

Return type:

bool

Get the result of [method`GUPnP`.Acl.is_allowed_async].

New in version 0.20.11.

do_can_sync() virtual
Return type:

bool

Check whether [method`GUPnP`.Acl.is_allowed_async] is supported.

New in version 0.20.11.

do_is_allowed(device, service, path, address, agent) virtual
Parameters:
  • device (GUPnP.Device or None) – The [class`GUPnP`.Device] associated with path or None if unknown.

  • service (GUPnP.Service or None) – The [class`GUPnP`.Service] associated with path or None if unknown.

  • path (str) – The path being served.

  • address (str) – IP address of the peer.

  • agent (str or None) – The User-Agent header of the peer or None if unknown. returns True if the peer is allowed, False otherwise

Return type:

bool

Check whether an IP address is allowed to access this resource.

New in version 0.20.11.

do_is_allowed_async(device, service, path, address, agent, cancellable, callback, *user_data) virtual
Parameters:
  • device (GUPnP.Device or None) – The [class`GUPnP`.Device] associated with path or None if unknown.

  • service (GUPnP.Service or None) – The [class`GUPnP`.Service] associated with path or None if unknown.

  • path (str) – The path being served.

  • address (str) – IP address of the peer

  • agent (str or None) – The User-Agent header of the peer or None if not unknown.

  • cancellable (Gio.Cancellable or None) – A cancellable which can be used to cancel the operation.

  • callback (Gio.AsyncReadyCallback or None) – Callback to call after the function is done.

  • user_data (object or None) – Some user data.

Check asynchronously whether an IP address is allowed to access this resource.

This function is optional. [method`GUPnP`.Acl.can_sync] should return True if the implementing class supports it. If it is supported, GUPnP will prefer to use this function over [method`GUPnP`.Acl.is_allowed].

Implement this function if the process of verifying the access right is expected to take some time, for example when using D-Bus etc.

Use [method`GUPnP`.Acl.is_allowed_finish] to retrieve the result.

New in version 0.20.11.

do_is_allowed_finish(res) virtual
Parameters:

res (Gio.AsyncResult) – [iface`Gio`.AsyncResult] obtained from the callback passed to [method`GUPnP`.Acl.is_allowed_async]

Return type:

bool

Get the result of [method`GUPnP`.Acl.is_allowed_async].

New in version 0.20.11.