GstRtspServer.RTSPAuth¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | check(check) | 
| class | make_basic(user, pass_) | 
| class | new() | 
| add_basic(basic, token) | |
| add_digest(user, pass_, token) | |
| get_default_token() | |
| get_realm() | |
| get_supported_methods() | |
| get_tls_authentication_mode() | |
| get_tls_certificate() | |
| get_tls_database() | |
| parse_htdigest(path, token) | |
| remove_basic(basic) | |
| remove_digest(user) | |
| set_default_token(token) | |
| set_realm(realm) | |
| set_supported_methods(methods) | |
| set_tls_authentication_mode(mode) | |
| set_tls_certificate(cert) | |
| set_tls_database(database) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
| do_accept_certificate(connection, peer_cert, errors) | |
| do_authenticate(ctx) | |
| do_check(ctx, check) | |
| do_generate_authenticate_header(ctx) | 
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| accept-certificate | Emitted during the TLS handshake after the client certificate has been received. | 
Class Details¶
- 
class GstRtspServer.RTSPAuth(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - GstRtspServer.RTSPAuthClass- The authentication structure. - 
classmethod check(check)[source]¶
- Parameters: - check ( - str) – the item to check- Returns: - Falseif check failed.- Return type: - bool- Check if check is allowed in the current context. 
 - 
classmethod make_basic(user, pass_)[source]¶
- Parameters: - Returns: - the base64 encoding of the string user:pass. - GLib.free() after usage.- Return type: - Construct a Basic authorisation token from user and pass. 
 - 
classmethod new()[source]¶
- Returns: - a new - GstRtspServer.RTSPAuth- Return type: - GstRtspServer.RTSPAuth- Create a new - GstRtspServer.RTSPAuthinstance.
 - 
add_basic(basic, token)[source]¶
- Parameters: - basic (str) – the basic token
- token (GstRtspServer.RTSPToken) – authorisation token
 - Add a basic token for the default authentication algorithm that enables the client with privileges listed in token. 
- basic (
 - 
add_digest(user, pass_, token)[source]¶
- Parameters: - user (str) – the digest user name
- pass (str) – the digest password
- token (GstRtspServer.RTSPToken) – authorisation token
 - Add a digest user and pass for the default authentication algorithm that enables the client with privileges listed in token. - New in version 1.12. 
- user (
 - 
get_default_token()[source]¶
- Returns: - the - GstRtspServer.RTSPTokenof self. gst_rtsp_token_unref() after usage.- Return type: - GstRtspServer.RTSPTokenor- None- Get the default token for self. This token will be used for unauthenticated users. 
 - 
get_supported_methods()[source]¶
- Returns: - The supported authentication methods - Return type: - GstRtsp.RTSPAuthMethod- Gets the supported authentication methods of self. - New in version 1.12. 
 - 
get_tls_authentication_mode()[source]¶
- Returns: - the - Gio.TlsAuthenticationMode.- Return type: - Gio.TlsAuthenticationMode- Get the - Gio.TlsAuthenticationMode.
 - 
get_tls_certificate()[source]¶
- Returns: - the - Gio.TlsCertificateof self.- GObject.Object.unref() after usage.- Return type: - Gio.TlsCertificateor- None- Get the - Gio.TlsCertificateused for negotiating TLS self.
 - 
get_tls_database()[source]¶
- Returns: - the - Gio.TlsDatabaseof self.- GObject.Object.unref() after usage.- Return type: - Gio.TlsDatabaseor- None- Get the - Gio.TlsDatabaseused for verifying client certificate.- New in version 1.6. 
 - 
parse_htdigest(path, token)[source]¶
- Parameters: - path (str) – Path to the htdigest file
- token (GstRtspServer.RTSPToken) – authorisation token
 - Returns: - Return type: - 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 - htdigestcommand.- New in version 1.16. 
- path (
 - 
remove_basic(basic)[source]¶
- Parameters: - basic ( - str) – the basic token- Removes basic authentication token. 
 - 
remove_digest(user)[source]¶
- Parameters: - user ( - str) – the digest user name- Removes a digest user. - New in version 1.12. 
 - 
set_default_token(token)[source]¶
- Parameters: - token ( - GstRtspServer.RTSPTokenor- None) – a- GstRtspServer.RTSPToken- Set the default - GstRtspServer.RTSPTokento token in self. The default token will be used for unauthenticated users.
 - 
set_supported_methods(methods)[source]¶
- Parameters: - methods ( - GstRtsp.RTSPAuthMethod) – supported methods- Sets the supported authentication methods for self. - New in version 1.12. 
 - 
set_tls_authentication_mode(mode)[source]¶
- Parameters: - mode ( - Gio.TlsAuthenticationMode) – a- Gio.TlsAuthenticationMode- The - Gio.TlsAuthenticationModeto set on the underlying- Gio.TlsServerConnection. When set to another value than- Gio.TlsAuthenticationMode.NONE,- GstRtspServer.RTSPAuth- ::accept-certificatesignal will be emitted and must be handled.- New in version 1.6. 
 - 
set_tls_certificate(cert)[source]¶
- Parameters: - cert ( - Gio.TlsCertificateor- None) – a- Gio.TlsCertificate- Set the TLS certificate for the auth. Client connections will only be accepted when TLS is negotiated. 
 - 
set_tls_database(database)[source]¶
- Parameters: - database ( - Gio.TlsDatabaseor- None) – a- Gio.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_CAerror.- New in version 1.6. 
 - 
do_accept_certificate(connection, peer_cert, errors) virtual¶
- Parameters: - connection (Gio.TlsConnection) –
- peer_cert (Gio.TlsCertificate) –
- errors (Gio.TlsCertificateFlags) –
 - Return type: 
- connection (
 - 
do_authenticate(ctx) virtual¶
- Parameters: - ctx ( - GstRtspServer.RTSPContext) –- Return type: - bool
 - 
do_check(ctx, check) virtual¶
- Parameters: - ctx (GstRtspServer.RTSPContext) –
- check (str) –
 - Return type: 
- ctx (
 - 
do_generate_authenticate_header(ctx) virtual¶
- Parameters: - ctx ( - GstRtspServer.RTSPContext) –
 
- 
classmethod 
Signal Details¶
- 
GstRtspServer.RTSPAuth.signals.accept_certificate(r_t_s_p_auth, connection, peer_cert, errors)¶
- Signal Name: - accept-certificate- Flags: - Parameters: - r_t_s_p_auth (GstRtspServer.RTSPAuth) – The object which received the signal
- connection (Gio.TlsConnection) – aGio.TlsConnection
- peer_cert (Gio.TlsCertificate) – the peer’sGio.TlsCertificate
- errors (Gio.TlsCertificateFlags) – the problems with peer_cert.
 - Returns: - Trueto accept peer_cert (which will also immediately end the signal emission).- Falseto allow the signal emission to continue, which will cause the handshake to fail if no one else overrides it.- Return type: - Emitted during the TLS handshake after the client certificate has been received. See also - GstRtspServer.RTSPAuth.set_tls_authentication_mode().- New in version 1.6. 
- r_t_s_p_auth (