Trait soup::prelude::AuthExt

source ·
pub trait AuthExt: IsA<Auth> + Sealed + 'static {
Show 23 methods // Provided methods fn authenticate(&self, username: &str, password: &str) { ... } fn can_authenticate(&self) -> bool { ... } fn cancel(&self) { ... } fn authority(&self) -> Option<GString> { ... } fn authorization(&self, msg: &Message) -> Option<GString> { ... } fn info(&self) -> Option<GString> { ... } fn protection_space(&self, source_uri: &Uri) -> Vec<GString> { ... } fn realm(&self) -> Option<GString> { ... } fn scheme_name(&self) -> Option<GString> { ... } fn is_authenticated(&self) -> bool { ... } fn is_cancelled(&self) -> bool { ... } fn is_for_proxy(&self) -> bool { ... } fn is_ready(&self, msg: &Message) -> bool { ... } fn update(&self, msg: &Message, auth_header: &str) -> bool { ... } fn set_authority(&self, authority: Option<&str>) { ... } fn set_is_for_proxy(&self, is_for_proxy: bool) { ... } fn set_realm(&self, realm: Option<&str>) { ... } fn connect_authority_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_is_authenticated_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_is_cancelled_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_is_for_proxy_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_realm_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_scheme_name_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Auth methods.

§Implementors

AuthBasic, AuthDigest, AuthNTLM, AuthNegotiate, Auth

Provided Methods§

source

fn authenticate(&self, username: &str, password: &str)

Call this on an auth to authenticate it.

Normally this will cause the auth’s message to be requeued with the new authentication info.

§username

the username provided by the user or client

§password

the password provided by the user or client

source

fn can_authenticate(&self) -> bool

Tests if @self is able to authenticate by providing credentials to the authenticate().

§Returns

true if @self is able to accept credentials.

source

fn cancel(&self)

Call this on an auth to cancel it.

You need to cancel an auth to complete an asynchronous authenticate operation when no credentials are provided (authenticate() is not called). The #SoupAuth will be cancelled on dispose if it hans’t been authenticated.

source

fn authority(&self) -> Option<GString>

Returns the authority (host:port) that @self is associated with.

§Returns

the authority

source

fn authorization(&self, msg: &Message) -> Option<GString>

Generates an appropriate “Authorization” header for @msg.

(The session will only call this if is_authenticated() returned true.)

§msg

the #SoupMessage to be authorized

§Returns

the “Authorization” header, which must be freed.

source

fn info(&self) -> Option<GString>

Gets an opaque identifier for @self.

The identifier can be used as a hash key or the like. #SoupAuth objects from the same server with the same identifier refer to the same authentication domain (eg, the URLs associated with them take the same usernames and passwords).

§Returns

the identifier

source

fn protection_space(&self, source_uri: &Uri) -> Vec<GString>

Returns a list of paths on the server which @self extends over.

(All subdirectories of these paths are also assumed to be part of @self’s protection space, unless otherwise discovered not to be.)

§source_uri

the URI of the request that @self was generated in response to.

§Returns

the list of paths, which can be freed with Auth::free_protection_space().

source

fn realm(&self) -> Option<GString>

Returns @self’s realm.

This is an identifier that distinguishes separate authentication spaces on a given server, and may be some string that is meaningful to the user. (Although it is probably not localized.)

§Returns

the realm name

source

fn scheme_name(&self) -> Option<GString>

soup_auth_get_scheme_name: (attributes org.gtk.Method.get_property=scheme-name) Returns @self’s scheme name. (Eg, “Basic”, “Digest”, or “NTLM”)

§Returns

the scheme name

source

fn is_authenticated(&self) -> bool

Tests if @self has been given a username and password.

§Returns

true if @self has been given a username and password

source

fn is_cancelled(&self) -> bool

Tests if @self has been cancelled

§Returns

true if @self has been cancelled

source

fn is_for_proxy(&self) -> bool

Tests whether or not @self is associated with a proxy server rather than an “origin” server.

§Returns

true or false

source

fn is_ready(&self, msg: &Message) -> bool

Tests if @self is ready to make a request for @msg with.

For most auths, this is equivalent to is_authenticated(), but for some auth types (eg, NTLM), the auth may be sendable (eg, as an authentication request) even before it is authenticated.

§msg

a #SoupMessage

§Returns

true if @self is ready to make a request with.

source

fn update(&self, msg: &Message, auth_header: &str) -> bool

Updates @self with the information from @msg and @auth_header, possibly un-authenticating it.

As with Auth::new(), this is normally only used by Session.

§msg

the #SoupMessage @self is being updated for

§auth_header

the WWW-Authenticate/Proxy-Authenticate header

§Returns

true if @self is still a valid (but potentially unauthenticated) #SoupAuth. false if something about @auth_params could not be parsed or incorporated into @self at all.

source

fn set_authority(&self, authority: Option<&str>)

The authority (host:port) being authenticated to.

source

fn set_is_for_proxy(&self, is_for_proxy: bool)

Whether or not the auth is for a proxy server.

source

fn set_realm(&self, realm: Option<&str>)

The authentication realm.

source

fn connect_authority_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_is_authenticated_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_is_cancelled_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_is_for_proxy_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_realm_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_scheme_name_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Auth>> AuthExt for O