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 { ... }
}
Provided Methods§
sourcefn authenticate(&self, username: &str, password: &str)
fn authenticate(&self, username: &str, password: &str)
sourcefn can_authenticate(&self) -> bool
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.
sourcefn cancel(&self)
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.
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.
sourcefn info(&self) -> Option<GString>
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
sourcefn protection_space(&self, source_uri: &Uri) -> Vec<GString>
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()
.
sourcefn realm(&self) -> Option<GString>
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
sourcefn scheme_name(&self) -> Option<GString>
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
sourcefn is_authenticated(&self) -> bool
fn is_authenticated(&self) -> bool
sourcefn is_cancelled(&self) -> bool
fn is_cancelled(&self) -> bool
sourcefn is_for_proxy(&self) -> bool
fn is_for_proxy(&self) -> bool
sourcefn is_ready(&self, msg: &Message) -> bool
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.
sourcefn update(&self, msg: &Message, auth_header: &str) -> bool
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.
The authority (host:port) being authenticated to.
sourcefn set_is_for_proxy(&self, is_for_proxy: bool)
fn set_is_for_proxy(&self, is_for_proxy: bool)
Whether or not the auth is for a proxy server.