XEP-0494: Client Access Management¶
- class slixmpp.plugins.xep_0494.XEP_0494(xmpp, config=None)[source]¶
XEP-0494: Client Access Management
- async get_clients(*, timeout=None, **iqargs)[source]¶
Return a list of clients that have accessed the account.
Stanza elements¶
- class slixmpp.plugins.xep_0494.stanza.Auth(xml=None, parent=None)[source]¶
Auth element.
<auth> <fast/> <custom-element xmlns="urn:custom"/> </auth>
- bool_interfaces: ClassVar[set[str]] = {'fast', 'password'}¶
A subset of
interfaceswhich maps the presence of subelements to boolean values. Using this set allows for quickly checking for the existence of empty subelements like<required />.Added in version 1.1.
- interfaces: ClassVar[set[str]] = {'all', 'fast', 'password'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attribvalue of any registered stanza plugins.
- name: ClassVar[str] = 'auth'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:cam:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- overrides: ClassVar[list[str]] = {'get_auths'}¶
In some cases you may wish to override the behaviour of one of the parent stanza’s interfaces. The
overrideslist specifies the interface name and access method to be overridden. For example, to override setting the parent’s'condition'interface you would use:overrides = ['set_condition']
Getting and deleting the
'condition'interface would not be affected.Added in version 1.0-Beta5.
- plugin_attrib: ClassVar[str] = 'auth'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0494.stanza.Client(xml=None, parent=None)[source]¶
Client element.
<client xmlns="urn:xmpp:cam:0" type="session" id="a" connected="true"> … </client>
Many of the substanzas defined are using overrides to access and set data from this element, e.g.:
client = Client() client['user_agent'] = {'software': 'slixmpp', 'device': 'toto'}
will actually create
<client xmlns="urn:xmpp:cam:0"> <user-agent> <software>slixmpp</software> <device>toto</device> </user-agent> </client>
- interfaces: ClassVar[set[str]] = {'connected', 'first_seen', 'id', 'last_seen', 'permission', 'permission_extra', 'type'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attribvalue of any registered stanza plugins.
- name: ClassVar[str] = 'client'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:cam:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'client'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0494.stanza.ClientType(value)[source]¶
Enum representing the
typeattribute of the<client/>element.- ACCESS = 'access'¶
- SESSION = 'session'¶
- class slixmpp.plugins.xep_0494.stanza.Clients(xml=None, parent=None)[source]¶
List of clients.
Iterate on it to get all substanzas.
<clients xmlns="urn:xmpp:cam:0"> … </clients>- name: ClassVar[str] = 'clients'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:cam:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'clients'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0494.stanza.Grant(xml=None, parent=None)[source]¶
<grant/>element.- name: ClassVar[str] = 'grant'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:cam:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'grant'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0494.stanza.List(xml=None, parent=None)[source]¶
Element used to request a list of devices to the server.
- interfaces: ClassVar[set[str]] = {}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attribvalue of any registered stanza plugins.
- name: ClassVar[str] = 'list'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:cam:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'list'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0494.stanza.Permission(xml=None, parent=None)[source]¶
Permission element.
- get_permission_extra()[source]¶
- Return type:
list[ElementBase]
- interfaces: ClassVar[set[str]] = {'permission', 'permission_extra'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attribvalue of any registered stanza plugins.
- name: ClassVar[str] = 'permission'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:cam:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- overrides: ClassVar[list[str]] = {'del_permission_extra', 'get_permission', 'get_permission_extra', 'set_permission', 'set_permission_extra'}¶
In some cases you may wish to override the behaviour of one of the parent stanza’s interfaces. The
overrideslist specifies the interface name and access method to be overridden. For example, to override setting the parent’s'condition'interface you would use:overrides = ['set_condition']
Getting and deleting the
'condition'interface would not be affected.Added in version 1.0-Beta5.
- plugin_attrib: ClassVar[str] = 'permission'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0494.stanza.PermissionEnum(value)[source]¶
Enum representing the
statusof the<permission/>element, e.g:<permission status="normal/>
- NORMAL = 'normal'¶
- RESTRICTED = 'restricted'¶
- UNRESTRICTED = 'unrestricted'¶
- class slixmpp.plugins.xep_0494.stanza.Revoke(xml=None, parent=None)[source]¶
Element used to revoke a device.
- interfaces: ClassVar[set[str]] = {'id'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attribvalue of any registered stanza plugins.
- name: ClassVar[str] = 'revoke'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:cam:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'revoke'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0494.stanza.UserAgent(xml=None, parent=None)[source]¶
-
- interfaces: ClassVar[set[str]] = {'device', 'software', 'uri'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attribvalue of any registered stanza plugins.
- name: ClassVar[str] = 'user-agent'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'urn:xmpp:cam:0'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'user_agent'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- sub_interfaces: ClassVar[set[str]] = {'device', 'software', 'uri'}¶
A subset of
interfaceswhich maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.