GUPnP.Acl¶
- Implementations:
None
Methods¶
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class GUPnP.Acl¶
- Bases:
- Structure:
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:
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
orNone
) – The [class`GUPnP`.Device] associated with path orNone
if unknown.service (
GUPnP.Service
orNone
) – The [class`GUPnP`.Service] associated with path orNone
if unknown.path (
str
) – The path being served.address (
str
) – IP address of the peer.agent (
str
orNone
) – The User-Agent header of the peer orNone
if unknown. returnsTrue
if the peer is allowed,False
otherwise
- Return type:
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
orNone
) – The [class`GUPnP`.Device] associated with path orNone
if unknown.service (
GUPnP.Service
orNone
) – The [class`GUPnP`.Service] associated with path orNone
if unknown.path (
str
) – The path being served.address (
str
) – IP address of the peeragent (
str
orNone
) – The User-Agent header of the peer orNone
if not unknown.cancellable (
Gio.Cancellable
orNone
) – A cancellable which can be used to cancel the operation.callback (
Gio.AsyncReadyCallback
orNone
) – Callback to call after the function is done.
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:
- Return type:
Get the result of [method`GUPnP`.Acl.is_allowed_async].
New in version 0.20.11.
- do_can_sync() virtual¶
- Return type:
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
orNone
) – The [class`GUPnP`.Device] associated with path orNone
if unknown.service (
GUPnP.Service
orNone
) – The [class`GUPnP`.Service] associated with path orNone
if unknown.path (
str
) – The path being served.address (
str
) – IP address of the peer.agent (
str
orNone
) – The User-Agent header of the peer orNone
if unknown. returnsTrue
if the peer is allowed,False
otherwise
- Return type:
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
orNone
) – The [class`GUPnP`.Device] associated with path orNone
if unknown.service (
GUPnP.Service
orNone
) – The [class`GUPnP`.Service] associated with path orNone
if unknown.path (
str
) – The path being served.address (
str
) – IP address of the peeragent (
str
orNone
) – The User-Agent header of the peer orNone
if not unknown.cancellable (
Gio.Cancellable
orNone
) – A cancellable which can be used to cancel the operation.callback (
Gio.AsyncReadyCallback
orNone
) – Callback to call after the function is done.
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:
Get the result of [method`GUPnP`.Acl.is_allowed_async].
New in version 0.20.11.