EDataServerUI.CredentialsPrompter

g EDataServer.Extensible EDataServer.Extensible EDataServerUI.CredentialsPrompter EDataServerUI.CredentialsPrompter EDataServer.Extensible->EDataServerUI.CredentialsPrompter GObject.GInterface GObject.GInterface GObject.GInterface->EDataServer.Extensible GObject.Object GObject.Object GObject.Object->EDataServerUI.CredentialsPrompter

Subclasses:None

Methods

Inherited:GObject.Object (37), EDataServer.Extensible (2)
Structs:GObject.ObjectClass (5)
class new (registry)
  complete_prompt_call (async_result, source, credentials, error)
  get_auto_prompt ()
  get_auto_prompt_disabled_for (source)
  get_dialog_parent ()
  get_provider ()
  get_registry ()
  loop_prompt_sync (source, flags, func, user_data, cancellable)
  process_awaiting_credentials ()
  process_source (source)
  prompt (source, error_text, flags, callback, *user_data)
  prompt_finish (result, out_source, out_credentials)
  register_impl (authentication_method, prompter_impl)
  set_auto_prompt (auto_prompt)
  set_auto_prompt_disabled_for (source, is_disabled)
  unregister_impl (authentication_method, prompter_impl)

Virtual Methods

Inherited:GObject.Object (7)
  do_get_dialog_parent ()

Properties

Name Type Flags Short Description
auto-prompt bool r/w/c/en Whether can response to credential requests automatically
provider EDataServer.SourceCredentialsProvider r An EDataServer.SourceCredentialsProvider
registry EDataServer.SourceRegistry r/w/co An EDataServer.SourceRegistry

Signals

Inherited:GObject.Object (1)
Name Short Description
get-dialog-parent Emitted when a new dialog will be shown, to get the right parent window for it.

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class EDataServerUI.CredentialsPrompter(**kwargs)
Bases:GObject.Object, EDataServer.Extensible
Abstract:No
Structure:EDataServerUI.CredentialsPrompterClass

Contains only private data that should be read and manipulated using the functions below.

New in version 3.16.

classmethod new(registry)
Parameters:registry (EDataServer.SourceRegistry) – an EDataServer.SourceRegistry to have the prompter listen to
Returns:a new EDataServerUI.CredentialsPrompter
Return type:EDataServerUI.CredentialsPrompter

Creates a new EDataServerUI.CredentialsPrompter, which listens for credential requests from registry.

New in version 3.16.

complete_prompt_call(async_result, source, credentials, error)
Parameters:

Completes an ongoing credentials prompt on idle, by finishing the async_result. This function is meant to be used by an EDataServerUI.CredentialsPrompterImpl implementation. To actually finish the credentials prompt previously started with EDataServerUI.CredentialsPrompter.prompt(), the EDataServerUI.CredentialsPrompter.prompt_finish() should be called from the provided callback.

Using None credentials will result in a Gio.IOErrorEnum.CANCELLED error, if no other error is provided.

New in version 3.16.

get_auto_prompt()
Returns:Whether can respond to credential prompts automatically.
Return type:bool

Returns, whether can respond to credential prompts automatically. Default value is True.

This property does not influence direct calls of EDataServerUI.CredentialsPrompter.prompt().

New in version 3.16.

get_auto_prompt_disabled_for(source)
Parameters:source (EDataServer.Source) – an EDataServer.Source
Returns:Whether the auto-prompt is disabled for the given source
Return type:bool

Returns whether the auto-prompt is disabled for the given source. All sources can be auto-prompted by default. This is a complementary value for the EDataServerUI.CredentialsPrompter ::auto-prompt property.

This value does not influence direct calls of EDataServerUI.CredentialsPrompter.prompt().

New in version 3.16.

get_dialog_parent()
Returns:a Gtk.Window, to be used as a dialog parent, or None.
Return type:Gtk.Window

Returns a Gtk.Window, which should be used as a dialog parent. This is determined by an EDataServerUI.CredentialsPrompter ::get-dialog-parent signal emission. If there is no callback registered or the current callbacks don’t have any suitable window, then there’s chosen the last active window from the default Gio.Application, if any available.

New in version 3.16.

get_provider()
Returns:an EDataServer.SourceCredentialsProvider, which the self uses.
Return type:EDataServer.SourceCredentialsProvider

Returns an EDataServer.SourceCredentialsProvider, which the self uses.

New in version 3.16.

get_registry()
Returns:an EDataServer.SourceRegistry, to which the self listens.
Return type:EDataServer.SourceRegistry

Returns an EDataServer.SourceRegistry, to which the self listens.

New in version 3.16.

loop_prompt_sync(source, flags, func, user_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True, when the credentials were provided sucessfully and they can be used to authenticate the source; False otherwise.

Return type:

bool

Runs a credentials prompt loop for source, as long as the func doesn’t indicate that the provided credentials can be used to successfully authenticate against source ‘s server, or that the func returns False. The loop is also teminated when a used cancels the credentials prompt or the cancellable is cancelled, though not sooner than the credentials prompt dialog is closed.

Note: The function doesn’t return until the loop is terminated, either successfully or unsuccessfully. The function can be called from any thread, though a dedicated thread is preferred.

New in version 3.16.

process_awaiting_credentials()

Process all enabled sources with connection state EDataServer.SourceConnectionStatus.AWAITING_CREDENTIALS, like if they just asked for its credentials for the first time.

New in version 3.16.

process_source(source)
Parameters:source (EDataServer.Source) – an EDataServer.Source
Returns:Whether continues with the credentials prompt.
Return type:bool

Continues a credential prompt for source. Returns, whether anything will be done. The False either means that the source ‘s connection status is not the EDataServer.SourceConnectionStatus.AWAITING_CREDENTIALS or it is disabled.

New in version 3.16.

prompt(source, error_text, flags, callback, *user_data)
Parameters:

Asks the self to prompt for credentials, which are returned to the caller through callback, when available.The flags are ignored, when the callback is None; the credentials are passed to the source with EDataServer.Source.invoke_authenticate() directly, in this case. Call EDataServerUI.CredentialsPrompter.prompt_finish() in callback to get to the provided credentials.

New in version 3.16.

prompt_finish(result, out_source, out_credentials)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False otherwise.

Return type:

bool

Finishes a credentials prompt previously started with EDataServerUI.CredentialsPrompter.prompt(). The out_source will have set a referenced EDataServer.Source, for which the prompt was started. Unref it, when no longer needed. Similarly the out_credentials will have set a newly allocated EDataServer.NamedParameters structure with provided credentials, which should be freed with e_named_credentials_free() when no longer needed. Both output arguments will be set to None on error and False will be returned.

New in version 3.16.

register_impl(authentication_method, prompter_impl)
Parameters:
Returns:

True on success, False on failure or when there was another prompter implementation registered for the given authentication method.

Return type:

bool

Registers a prompter implementation for a given authentication method. If there is registered a prompter for the same authentication_method, then the function does nothing, otherwise it adds its own reference on the prompter_impl, and uses it for that authentication method. One prompter_impl can be registered for multiple authentication methods.

A special value None can be used for the authentication_method, which means a default credentials prompter, that is to be used when there is no prompter registered for the exact authentication method.

New in version 3.16.

set_auto_prompt(auto_prompt)
Parameters:auto_prompt (bool) – new value of the auto-prompt property

Sets whether can respond to credential prompts automatically. That means that whenever any EDataServer.Source will ask for credentials, it’ll try to provide them.

Use EDataServerUI.CredentialsPrompter.set_auto_prompt_disabled_for() to influence auto-prompt per an EDataServer.Source.

This property does not influence direct calls of EDataServerUI.CredentialsPrompter.prompt().

New in version 3.16.

set_auto_prompt_disabled_for(source, is_disabled)
Parameters:

Sets whether the auto-prompt should be disabled for the given source. All sources can be auto-prompted by default. This is a complementary value for the EDataServerUI.CredentialsPrompter ::auto-prompt property.

This value does not influence direct calls of EDataServerUI.CredentialsPrompter.prompt().

New in version 3.16.

unregister_impl(authentication_method, prompter_impl)
Parameters:

Unregisters previously registered prompter_impl for the given autnetication_method with EDataServerUI.CredentialsPrompter.register_impl(). Function does nothing, if no such authentication method is registered or if it has set a different prompter implementation.

New in version 3.16.

do_get_dialog_parent() virtual
Returns:a Gtk.Window, to be used as a dialog parent, or None.
Return type:Gtk.Window

Returns a Gtk.Window, which should be used as a dialog parent. This is determined by an EDataServerUI.CredentialsPrompter ::get-dialog-parent signal emission. If there is no callback registered or the current callbacks don’t have any suitable window, then there’s chosen the last active window from the default Gio.Application, if any available.

New in version 3.16.

Signal Details

EDataServerUI.CredentialsPrompter.signals.get_dialog_parent(credentials_prompter)
Signal Name:get-dialog-parent
Flags:RUN_LAST
Parameters:credentials_prompter (EDataServerUI.CredentialsPrompter) – The object which received the signal
Returns:a Gtk.Window, to be used as a dialog parent, or None.
Return type:Gtk.Window

Emitted when a new dialog will be shown, to get the right parent window for it. If the result of the call is None, then it tries to get the window from the default Gtk.Application.

New in version 3.16.

Property Details

EDataServerUI.CredentialsPrompter.props.auto_prompt
Name:auto-prompt
Type:bool
Default Value:True
Flags:READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Whether the EDataServerUI.CredentialsPrompter can response to credential requests automatically.

New in version 3.16.

EDataServerUI.CredentialsPrompter.props.provider
Name:provider
Type:EDataServer.SourceCredentialsProvider
Default Value:None
Flags:READABLE

The EDataServer.SourceCredentialsProvider object, which the prompter uses.

New in version 3.16.

EDataServerUI.CredentialsPrompter.props.registry
Name:registry
Type:EDataServer.SourceRegistry
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

The EDataServer.SourceRegistry object, to whose credential requests the prompter listens.

New in version 3.16.