EDataServerUI4.CredentialsPrompter

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

Subclasses:

None

Methods

Inherited:

GObject.Object (37), EDataServer.Extensible (3)

Structs:

GObject.ObjectClass (5)

class

new (registry)

get_auto_prompt ()

get_auto_prompt_disabled_for (source)

get_dialog_parent ()

get_dialog_parent_full (auth_source)

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)

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.

get-dialog-parent-full

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 EDataServerUI4.CredentialsPrompter(**kwargs)
Bases:

GObject.Object, EDataServer.Extensible

Abstract:

No

Structure:

EDataServerUI4.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 EDataServerUI4.CredentialsPrompter

Return type:

EDataServerUI4.CredentialsPrompter

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

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 EDataServerUI4.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 EDataServerUI4.CredentialsPrompter ::auto-prompt property.

This value does not influence direct calls of EDataServerUI4.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 or None

Returns a Gtk.Window, which should be used as a dialog parent. This is determined by an EDataServerUI4.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_dialog_parent_full(auth_source)
Parameters:

auth_source (EDataServer.Source or None) – an EDataServer.Source

Returns:

a Gtk.Window, to be used as a dialog parent, or None.

Return type:

Gtk.Window or None

Returns a Gtk.Window, which should be used as a dialog parent for the auth_source.

This is determined by an EDataServerUI4.CredentialsPrompter ::get-dialog-parent-full signal emission and an EDataServerUI4.CredentialsPrompter ::get-dialog-parent when the first doesn’t return anything. 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.42.

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 successfully 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 EDataServerUI4.CredentialsPrompter.prompt_finish() in callback to get to the provided credentials.

New in version 3.16.

prompt_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True on success, False otherwise.

out_source:

optionally set to an EDataServer.Source, on which the prompt was started; can be None

out_credentials:

set to an EDataServer.NamedParameters with provided credentials

Return type:

(bool, out_source: EDataServer.Source or None, out_credentials: EDataServer.NamedParameters or None)

Finishes a credentials prompt previously started with EDataServerUI4.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 EDataServerUI4.CredentialsPrompter.set_auto_prompt_disabled_for() to influence auto-prompt per an EDataServer.Source.

This property does not influence direct calls of EDataServerUI4.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 EDataServerUI4.CredentialsPrompter ::auto-prompt property.

This value does not influence direct calls of EDataServerUI4.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 EDataServerUI4.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 or None

Returns a Gtk.Window, which should be used as a dialog parent. This is determined by an EDataServerUI4.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

EDataServerUI4.CredentialsPrompter.signals.get_dialog_parent(credentials_prompter)
Signal Name:

get-dialog-parent

Flags:

RUN_LAST

Parameters:

credentials_prompter (EDataServerUI4.CredentialsPrompter) – The object which received the signal

Returns:

a Gtk.Window, to be used as a dialog parent, or None.

Return type:

Gtk.Window or None

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.

EDataServerUI4.CredentialsPrompter.signals.get_dialog_parent_full(credentials_prompter, auth_source)
Signal Name:

get-dialog-parent-full

Flags:

RUN_LAST

Parameters:
Returns:

a Gtk.Window, to be used as a dialog parent, or None.

Return type:

Gtk.Window or None

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.42.

Property Details

EDataServerUI4.CredentialsPrompter.props.auto_prompt
Name:

auto-prompt

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

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

New in version 3.16.

EDataServerUI4.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.

EDataServerUI4.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.