Trait gstreamer_rtsp_server::prelude::RTSPAuthExt
source · pub trait RTSPAuthExt:
IsA<RTSPAuth>
+ Sealed
+ 'static {
Show 17 methods
// Provided methods
fn add_basic(&self, basic: &str, token: &RTSPToken) { ... }
fn add_digest(&self, user: &str, pass: &str, token: &RTSPToken) { ... }
fn default_token(&self) -> Option<RTSPToken> { ... }
fn realm(&self) -> Option<GString> { ... }
fn supported_methods(&self) -> RTSPAuthMethod { ... }
fn tls_authentication_mode(&self) -> TlsAuthenticationMode { ... }
fn tls_certificate(&self) -> Option<TlsCertificate> { ... }
fn tls_database(&self) -> Option<TlsDatabase> { ... }
fn parse_htdigest(&self, path: impl AsRef<Path>, token: &RTSPToken) -> bool { ... }
fn remove_basic(&self, basic: &str) { ... }
fn remove_digest(&self, user: &str) { ... }
fn set_realm(&self, realm: Option<&str>) { ... }
fn set_supported_methods(&self, methods: RTSPAuthMethod) { ... }
fn set_tls_authentication_mode(&self, mode: TlsAuthenticationMode) { ... }
fn set_tls_certificate(&self, cert: Option<&impl IsA<TlsCertificate>>) { ... }
fn set_tls_database(&self, database: Option<&impl IsA<TlsDatabase>>) { ... }
fn connect_accept_certificate<F: Fn(&Self, &TlsConnection, &TlsCertificate, TlsCertificateFlags) -> bool + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Provided Methods§
sourcefn add_digest(&self, user: &str, pass: &str, token: &RTSPToken)
fn add_digest(&self, user: &str, pass: &str, token: &RTSPToken)
sourcefn default_token(&self) -> Option<RTSPToken>
fn default_token(&self) -> Option<RTSPToken>
sourcefn supported_methods(&self) -> RTSPAuthMethod
fn supported_methods(&self) -> RTSPAuthMethod
sourcefn tls_authentication_mode(&self) -> TlsAuthenticationMode
fn tls_authentication_mode(&self) -> TlsAuthenticationMode
sourcefn tls_certificate(&self) -> Option<TlsCertificate>
fn tls_certificate(&self) -> Option<TlsCertificate>
Get the gio::TlsCertificate
used for negotiating TLS self
.
§Returns
the gio::TlsCertificate
of self
. g_object_unref()
after
usage.
sourcefn tls_database(&self) -> Option<TlsDatabase>
fn tls_database(&self) -> Option<TlsDatabase>
Get the gio::TlsDatabase
used for verifying client certificate.
§Returns
the gio::TlsDatabase
of self
. g_object_unref()
after
usage.
sourcefn parse_htdigest(&self, path: impl AsRef<Path>, token: &RTSPToken) -> bool
fn parse_htdigest(&self, path: impl AsRef<Path>, token: &RTSPToken) -> bool
Parse the contents of the file at path
and enable the privileges
listed in token
for the users it describes.
The format of the file is expected to match the format described by
https://en.wikipedia.org/wiki/Digest_access_authentication`The_.htdigest_file`,
as output by the htdigest
command.
§path
Path to the htdigest file
§token
authorisation token
§Returns
sourcefn remove_basic(&self, basic: &str)
fn remove_basic(&self, basic: &str)
sourcefn remove_digest(&self, user: &str)
fn remove_digest(&self, user: &str)
sourcefn set_supported_methods(&self, methods: RTSPAuthMethod)
fn set_supported_methods(&self, methods: RTSPAuthMethod)
sourcefn set_tls_authentication_mode(&self, mode: TlsAuthenticationMode)
fn set_tls_authentication_mode(&self, mode: TlsAuthenticationMode)
The gio::TlsAuthenticationMode
to set on the underlying GTlsServerConnection.
When set to another value than gio::TlsAuthenticationMode::None
,
accept-certificate
signal will be emitted and must be handled.
§mode
sourcefn set_tls_certificate(&self, cert: Option<&impl IsA<TlsCertificate>>)
fn set_tls_certificate(&self, cert: Option<&impl IsA<TlsCertificate>>)
Set the TLS certificate for the auth. Client connections will only be accepted when TLS is negotiated.
§cert
sourcefn set_tls_database(&self, database: Option<&impl IsA<TlsDatabase>>)
fn set_tls_database(&self, database: Option<&impl IsA<TlsDatabase>>)
Sets the certificate database that is used to verify peer certificates.
If set to None
(the default), then peer certificate validation will always
set the gio::TlsCertificateFlags::UNKNOWN_CA
error.
§database
sourcefn connect_accept_certificate<F: Fn(&Self, &TlsConnection, &TlsCertificate, TlsCertificateFlags) -> bool + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_accept_certificate<F: Fn(&Self, &TlsConnection, &TlsCertificate, TlsCertificateFlags) -> bool + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
Emitted during the TLS handshake after the client certificate has
been received. See also set_tls_authentication_mode()
.
§connection
§peer_cert
the peer’s gio::TlsCertificate
§errors
the problems with peer_cert
.
§Returns
true
to accept peer_cert
(which will also
immediately end the signal emission). false
to allow the signal
emission to continue, which will cause the handshake to fail if
no one else overrides it.