NM.SecretAgentOld¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Gio.AsyncInitable (4), Gio.Initable (2)
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
|||
r/w/c |
|||
r/w/co |
|||
r/w/co |
|||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class NM.SecretAgentOld(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- delete_secrets(connection, callback, *user_data)¶
- Parameters:
connection (
NM.Connection
) – aNM.Connection
callback (
NM.SecretAgentOldDeleteSecretsFunc
) – a callback, to be invoked when the operation is doneuser_data (
object
orNone
) – caller-specific data to be passed to callback
Asynchronously asks the agent to delete all saved secrets belonging to connection.
- destroy()¶
Since 1.24, the instance will already register a D-Bus object on the D-Bus connection during initialization. That object will stay registered until self gets unrefed (destroyed) or this function is called. This function performs the necessary cleanup to tear down the instance. Afterwards, the function can not longer be used. This is optional, but necessary to ensure unregistering the D-Bus object at a define point, when other users might still have a reference on self.
You may call this function any time and repeatedly. However, after destroying the instance, it is a bug to still use the instance for other purposes. The instance becomes defunct and cannot re-register.
New in version 1.24.
- enable(enable)¶
- Parameters:
enable (
bool
) – whether to enable or disable the listener.
This has the same effect as setting
NM.SECRET_AGENT_OLD_AUTO_REGISTER
property.Unlike most other functions, you may already call this function before initialization completes.
New in version 1.24.
- get_context_busy_watcher()¶
- Returns:
a
GObject.Object
that you may register a weak pointer to know that theGLib.MainContext
is still kept busy by self.- Return type:
Returns a
GObject.Object
that stays alive as long as there are pending requests in theGio.DBusConnection
. Such requests keep theGLib.MainContext
alive, and thus you may want to keep iterating the context as long until a weak reference indicates that this object is gone. This is useful because even when you destroy the instance right away (and all the internally pending requests get cancelled), any pendingGio.DBusConnection.call
() requests will still invoke the result on theGLib.MainContext
. Hence, this allows you to know how long you must iterate the context to know that all remains are cleaned up.New in version 1.24.
- get_dbus_connection()¶
- Returns:
the
Gio.DBusConnection
used by the secret agent. You may either set this as construct propertyNM.SECRET_AGENT_OLD_DBUS_CONNECTION
, or it will automatically set during initialization.- Return type:
New in version 1.24.
- get_dbus_name_owner()¶
- Returns:
the current D-Bus name owner. While this property is set while registering, it really only makes sense when the
NM.SecretAgentOld.get_registered
() indicates that registration is successful.- Return type:
New in version 1.24.
- get_main_context()¶
- Returns:
the
GLib.MainContext
instance associate with the instance. This is theGLib.MainContext.get_thread_default
() at the time when creating the instance.- Return type:
New in version 1.24.
- get_registered()¶
-
Note that the secret agent transparently registers and re-registers as the D-Bus name owner appears. Hence, this property is not really useful. Also, to be graceful against races during registration, the instance will already accept requests while being in the process of registering. If you need to avoid races and want to wait until self is registered, call
NM.SecretAgentOld.register_async
(). If that function completes with success, you know the instance is registered.
- get_secrets(connection, setting_name, hints, flags, callback, *user_data)¶
- Parameters:
connection (
NM.Connection
) – theNM.Connection
for which we’re asked secretssetting_name (
str
) – the name of the secret settinghints ([
str
]) – hints to the agentflags (
NM.SecretAgentGetSecretsFlags
) – flags that modify the behavior of the requestcallback (
NM.SecretAgentOldGetSecretsFunc
) – a callback, to be invoked when the operation is doneuser_data (
object
orNone
) – caller-specific data to be passed to callback
Asynchronously retrieves secrets belonging to connection for the setting setting_name. flags indicate specific behavior that the secret agent should use when performing the request, for example returning only existing secrets without user interaction, or requesting entirely new secrets from the user.
- register(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
True
if registration was successful,False
on error.Since 1.24, this can no longer fail unless the cancellable gets cancelled. Contrary to
NM.SecretAgentOld.register_async
(), this also does not wait for the registration to succeed. You cannot synchronously (without iterating the caller’sGLib.MainContext
) wait for registration.Since 1.24, registration is idempotent. It has the same effect as setting
NM.SECRET_AGENT_OLD_AUTO_REGISTER
toTrue
orNM.SecretAgentOld.enable
().- Return type:
Registers the
NM.SecretAgentOld
with the NetworkManager secret manager, indicating to NetworkManager that the agent is able to provide and save secrets for connections on behalf of its user.Deprecated since version 1.24: Use
NM.SecretAgentOld.enable
() orNM.SecretAgentOld.register_async
().
- register_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to call when the agent is registered
Asynchronously registers the
NM.SecretAgentOld
with the NetworkManager secret manager, indicating to NetworkManager that the agent is able to provide and save secrets for connections on behalf of its user.Since 1.24, registration cannot fail and is idempotent. It has the same effect as setting
NM.SECRET_AGENT_OLD_AUTO_REGISTER
toTrue
orNM.SecretAgentOld.enable
().Since 1.24, the asynchronous result indicates whether the instance is successfully registered. In any case, this call enables the agent and it will automatically try to register and handle secret requests. A failure of this function only indicates that currently the instance might not be ready (but since it will automatically try to recover, it might be ready in a moment afterwards). Use this function if you want to check and ensure that the agent is registered.
- register_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
True
if registration was successful,False
on error.Since 1.24, registration cannot fail and is idempotent. It has the same effect as setting
NM.SECRET_AGENT_OLD_AUTO_REGISTER
toTrue
orNM.SecretAgentOld.enable
().- Return type:
Gets the result of a call to
NM.SecretAgentOld.register_async
().
- save_secrets(connection, callback, *user_data)¶
- Parameters:
connection (
NM.Connection
) – aNM.Connection
callback (
NM.SecretAgentOldSaveSecretsFunc
) – a callback, to be invoked when the operation is doneuser_data (
object
orNone
) – caller-specific data to be passed to callback
Asynchronously ensures that all secrets inside connection are stored to disk.
- unregister(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
True
if unregistration was successful,False
on errorSince 1.24, registration cannot fail and is idempotent. It has the same effect as setting
NM.SECRET_AGENT_OLD_AUTO_REGISTER
toFalse
orNM.SecretAgentOld.enable
().- Return type:
Unregisters the
NM.SecretAgentOld
with the NetworkManager secret manager, indicating to NetworkManager that the agent will no longer provide or store secrets on behalf of this user.Deprecated since version 1.24: Use
NM.SecretAgentOld.enable
().
- unregister_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to call when the agent is unregistered
Asynchronously unregisters the
NM.SecretAgentOld
with the NetworkManager secret manager, indicating to NetworkManager that the agent will no longer provide or store secrets on behalf of this user.Since 1.24, registration cannot fail and is idempotent. It has the same effect as setting
NM.SECRET_AGENT_OLD_AUTO_REGISTER
toFalse
orNM.SecretAgentOld.enable
().Deprecated since version 1.24: Use
NM.SecretAgentOld.enable
().
- unregister_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to theGio.AsyncReadyCallback
- Raises:
- Returns:
True
if unregistration was successful,False
on error.Since 1.24, registration cannot fail and is idempotent. It has the same effect as setting
NM.SECRET_AGENT_OLD_AUTO_REGISTER
toFalse
orNM.SecretAgentOld.enable
().- Return type:
Gets the result of a call to
NM.SecretAgentOld.unregister_async
().Deprecated since version 1.24: Use
NM.SecretAgentOld.enable
().
- do_cancel_get_secrets(connection_path, setting_name) virtual¶
- do_delete_secrets(connection, connection_path, callback, *user_data) virtual¶
- Parameters:
connection (
NM.Connection
) – aNM.Connection
connection_path (
str
) –callback (
NM.SecretAgentOldDeleteSecretsFunc
) – a callback, to be invoked when the operation is doneuser_data (
object
orNone
) – caller-specific data to be passed to callback
Asynchronously asks the agent to delete all saved secrets belonging to connection.
- do_get_secrets(connection, connection_path, setting_name, hints, flags, callback, *user_data) virtual¶
- Parameters:
connection (
NM.Connection
) – theNM.Connection
for which we’re asked secretsconnection_path (
str
) –setting_name (
str
) – the name of the secret settinghints ([
str
]) – hints to the agentflags (
NM.SecretAgentGetSecretsFlags
) – flags that modify the behavior of the requestcallback (
NM.SecretAgentOldGetSecretsFunc
) – a callback, to be invoked when the operation is doneuser_data (
object
orNone
) – caller-specific data to be passed to callback
Asynchronously retrieves secrets belonging to connection for the setting setting_name. flags indicate specific behavior that the secret agent should use when performing the request, for example returning only existing secrets without user interaction, or requesting entirely new secrets from the user.
- do_save_secrets(connection, connection_path, callback, *user_data) virtual¶
- Parameters:
connection (
NM.Connection
) – aNM.Connection
connection_path (
str
) –callback (
NM.SecretAgentOldSaveSecretsFunc
) – a callback, to be invoked when the operation is doneuser_data (
object
orNone
) – caller-specific data to be passed to callback
Asynchronously ensures that all secrets inside connection are stored to disk.
Property Details¶
- NM.SecretAgentOld.props.auto_register¶
-
If
True
(the default), the agent will always be registered when NetworkManager is running; if NetworkManager exits and restarts, the agent will re-register itself automatically.In particular, if this property is
True
at construct time, then the agent will register itself with NetworkManager during construction/initialization and initialization will only complete after registration is completed (either successfully or unsuccessfully). Since 1.24, a failure to register will no longer cause initialization ofNM.SecretAgentOld
to fail.If the property is
False
, the agent will not automatically register with NetworkManager, andNM.SecretAgentOld.enable
() orNM.SecretAgentOld.register_async
() must be called to register it.Calling
NM.SecretAgentOld.enable
() has the same effect as setting this property.
- NM.SecretAgentOld.props.capabilities¶
- Name:
capabilities
- Type:
- Default Value:
- Flags:
A bitfield of
NM.SecretAgentCapabilities
.Changing this property is possible at any time. In case the secret agent is currently registered, this will cause a re-registration.
- NM.SecretAgentOld.props.dbus_connection¶
- Name:
dbus-connection
- Type:
- Default Value:
- Flags:
The
Gio.DBusConnection
used by the instance. You may either set this as construct-only property, or otherwiseNM.SecretAgentOld
will choose a connection viaGio.bus_get
() during initialization.New in version 1.24.
- NM.SecretAgentOld.props.identifier¶
- Name:
identifier
- Type:
- Default Value:
- Flags:
Identifies this agent; only one agent in each user session may use the same identifier. Identifier formatting follows the same rules as D-Bus bus names with the exception that the ‘:’ character is not allowed. The valid set of characters is “‘A-Z [a-z]’[0-9]_-.” and the identifier is limited in length to 255 characters with a minimum of 3 characters. An example valid identifier is ‘org.gnome.nm-applet’ (without quotes).