EDataServerUI4.CredentialsPrompter¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c/en |
Whether can response to credential requests automatically |
||
r |
|||
r/w/co |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a new dialog will be shown, to get the right parent window for it. |
|
Emitted when a new dialog will be shown, to get the right parent window for it. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class EDataServerUI4.CredentialsPrompter(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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
) – anEDataServer.SourceRegistry
to have the prompter listen to- Returns:
- Return type:
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:
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
) – anEDataServer.Source
- Returns:
Whether the auto-prompt is disabled for the given source
- Return type:
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, orNone
.- Return type:
Gtk.Window
orNone
Returns a
Gtk.Window
, which should be used as a dialog parent. This is determined by anEDataServerUI4.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 defaultGio.Application
, if any available.New in version 3.16.
- get_dialog_parent_full(auth_source)¶
- Parameters:
auth_source (
EDataServer.Source
orNone
) – anEDataServer.Source
- Returns:
a
Gtk.Window
, to be used as a dialog parent, orNone
.- Return type:
Gtk.Window
orNone
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 anEDataServerUI4.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 defaultGio.Application
, if any available.New in version 3.42.
- get_provider()¶
- Returns:
an
EDataServer.SourceCredentialsProvider
, which the self uses.- Return type:
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:
Returns an
EDataServer.SourceRegistry
, to which the self listens.New in version 3.16.
- loop_prompt_sync(source, flags, func, user_data, cancellable)¶
- Parameters:
source (
EDataServer.Source
) – anEDataServer.Source
to be prompted credentials forflags (
EDataServerUI4.CredentialsPrompterPromptFlags
) – a bit-or ofEDataServerUI4.CredentialsPrompterPromptFlags
initial flagsfunc (
EDataServerUI4.CredentialsPrompterLoopPromptFunc
) – anEDataServerUI4.CredentialsPrompterLoopPromptFunc
user function to call to check provided credentialscancellable (
Gio.Cancellable
orNone
) – an optionalGio.Cancellable
, orNone
- Raises:
- Returns:
True
, when the credentials were provided successfully and they can be used to authenticate the source;False
otherwise.- Return type:
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
) – anEDataServer.Source
- Returns:
Whether continues with the credentials prompt.
- Return type:
Continues a credential prompt for source. Returns, whether anything will be done. The
False
either means that the source ‘s connection status is not theEDataServer.SourceConnectionStatus.AWAITING_CREDENTIALS
or it is disabled.New in version 3.16.
- prompt(source, error_text, flags, callback, *user_data)¶
- Parameters:
source (
EDataServer.Source
) – anEDataServer.Source
, which prompt the credentials forerror_text (
str
orNone
) – Additional error text to show to a user, orNone
flags (
EDataServerUI4.CredentialsPrompterPromptFlags
) – a bit-or ofEDataServerUI4.CredentialsPrompterPromptFlags
callback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the credentials are ready, orNone
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 withEDataServer.Source.invoke_authenticate
() directly, in this case. CallEDataServerUI4.CredentialsPrompter.prompt_finish
() in callback to get to the provided credentials.New in version 3.16.
- prompt_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
True
on success,False
otherwise.- out_source:
optionally set to an
EDataServer.Source
, on which the prompt was started; can beNone
- out_credentials:
set to an
EDataServer.NamedParameters
with provided credentials
- Return type:
(
bool
, out_source:EDataServer.Source
orNone
, out_credentials:EDataServer.NamedParameters
orNone
)
Finishes a credentials prompt previously started with
EDataServerUI4.CredentialsPrompter.prompt
(). The out_source will have set a referencedEDataServer.Source
, for which the prompt was started. Unref it, when no longer needed. Similarly the out_credentials will have set a newly allocatedEDataServer.NamedParameters
structure with provided credentials, which should be freed with e_named_credentials_free() when no longer needed. Both output arguments will be set toNone
on error andFalse
will be returned.New in version 3.16.
- register_impl(authentication_method, prompter_impl)¶
- Parameters:
authentication_method (
str
orNone
) – an authentication method to registr prompter_impl for; orNone
prompter_impl (
EDataServerUI4.CredentialsPrompterImpl
) – anEDataServerUI4.CredentialsPrompterImpl
- Returns:
True
on success,False
on failure or when there was another prompter implementation registered for the given authentication method.- Return type:
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 anEDataServer.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:
source (
EDataServer.Source
) – anEDataServer.Source
is_disabled (
bool
) – whether the auto-prompt should be disabled for this source
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:
authentication_method (
str
orNone
) – an authentication method to registr prompter_impl for; orNone
prompter_impl (
EDataServerUI4.CredentialsPrompterImpl
) – anEDataServerUI4.CredentialsPrompterImpl
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, orNone
.- Return type:
Gtk.Window
orNone
Returns a
Gtk.Window
, which should be used as a dialog parent. This is determined by anEDataServerUI4.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 defaultGio.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:
- Parameters:
credentials_prompter (
EDataServerUI4.CredentialsPrompter
) – The object which received the signal- Returns:
a
Gtk.Window
, to be used as a dialog parent, orNone
.- Return type:
Gtk.Window
orNone
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 defaultGtk.Application
.New in version 3.16.
- EDataServerUI4.CredentialsPrompter.signals.get_dialog_parent_full(credentials_prompter, auth_source)¶
- Signal Name:
get-dialog-parent-full
- Flags:
- Parameters:
credentials_prompter (
EDataServerUI4.CredentialsPrompter
) – The object which received the signalauth_source (
EDataServer.Source
orNone
) – anEDataServer.Source
, for which to show the credentials prompt
- Returns:
a
Gtk.Window
, to be used as a dialog parent, orNone
.- Return type:
Gtk.Window
orNone
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 defaultGtk.Application
.New in version 3.42.
Property Details¶
- EDataServerUI4.CredentialsPrompter.props.auto_prompt¶
- Name:
auto-prompt
- Type:
- Default Value:
- Flags:
Whether the
EDataServerUI4.CredentialsPrompter
can response to credential requests automatically.New in version 3.16.
- EDataServerUI4.CredentialsPrompter.props.provider¶
- Name:
provider
- Type:
- Default Value:
- Flags:
The
EDataServer.SourceCredentialsProvider
object, which the prompter uses.New in version 3.16.
- EDataServerUI4.CredentialsPrompter.props.registry¶
- Name:
registry
- Type:
- Default Value:
- Flags:
The
EDataServer.SourceRegistry
object, to whose credential requests the prompter listens.New in version 3.16.