VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Credential API:

Data Structures

struct  vlc_credential

Macros

#define vlc_credential_get(a, b, c, d, e, f, ...)
#define vlc_credential_store(a, b)
#define vlc_credential_get_bearer(a, b)

Functions

void vlc_credential_init (vlc_credential *p_credential, const vlc_url_t *p_url)
 Init a credential struct.
void vlc_credential_clean (vlc_credential *p_credential)
 Clean a credential struct.
int vlc_credential_get (vlc_credential *p_credential, vlc_object_t *p_parent, const char *psz_option_username, const char *psz_option_password, const char *psz_dialog_title, const char *psz_dialog_fmt,...)
 Get a username/password couple.
bool vlc_credential_store (vlc_credential *p_credential, vlc_object_t *p_parent)
 Store the last dialog credential returned by vlc_credential_get().
int vlc_credential_get_bearer (vlc_credential *p_credential, vlc_object_t *p_parent)
 Look up a bearer token for the URL, realm and scopes set on p_credential.
int libvlc_InternalHttpBearerStore (libvlc_int_t *p_libvlc, const char *psz_origin, const char *psz_realm, const char *const *ppsz_scopes, size_t i_scopes, const char *psz_token)
 Store a bearer token for an HTTPS origin URL in the per-libvlc memory keystore.

Detailed Description

Macro Definition Documentation

◆ vlc_credential_get

#define vlc_credential_get ( a,
b,
c,
d,
e,
f,
... )
Value:
vlc_credential_get(a, VLC_OBJECT(b), c, d, e, f, ##__VA_ARGS__)
#define vlc_credential_get(a, b, c, d, e, f,...)
Definition vlc_keystore.h:258
#define VLC_OBJECT(x)
Type-safe vlc_object_t cast.
Definition vlc_objects.h:83

Referenced by Open().

◆ vlc_credential_get_bearer

#define vlc_credential_get_bearer ( a,
b )
Value:
#define vlc_credential_get_bearer(a, b)
Definition vlc_keystore.h:283

Referenced by Open().

◆ vlc_credential_store

#define vlc_credential_store ( a,
b )
Value:
#define vlc_credential_store(a, b)
Definition vlc_keystore.h:273

Referenced by Open().

Function Documentation

◆ libvlc_InternalHttpBearerStore()

int libvlc_InternalHttpBearerStore ( libvlc_int_t * p_libvlc,
const char * psz_origin,
const char * psz_realm,
const char *const * ppsz_scopes,
size_t i_scopes,
const char * psz_token )

Store a bearer token for an HTTPS origin URL in the per-libvlc memory keystore.

The token replaces, scope by scope, any token previously stored for the same origin and realm. A NULL realm matches any realm and an empty scope list matches any scope, so a token stored with neither replaces all tokens of the origin.

If psz_token is NULL, the matching tokens are removed.

References bearer_values_init(), get_memory_keystore(), vlc_url_t::i_port, is_url_valid(), KEY_MAX, KEY_SCOPE, VLC_EGENERIC, vlc_keystore_remove(), vlc_keystore_store(), VLC_OBJECT, VLC_SUCCESS, vlc_UrlClean(), and vlc_UrlParse().

◆ vlc_credential_clean()

◆ vlc_credential_get()

int vlc_credential_get ( vlc_credential * p_credential,
vlc_object_t * p_parent,
const char * psz_option_username,
const char * psz_option_password,
const char * psz_dialog_title,
const char * psz_dialog_fmt,
... )

Get a username/password couple.

This will search for a credential using url, VLC options, the vlc_keystore or by asking the user via dialog_Login(). This function can be called indefinitely, it will first return the user/password from the url (if any), then from VLC options (if any), then from the keystore (if any), and finally from the dialog (if any). This function will return true as long as the user fill the dialog texts and will return false when the user cancel it.

Parameters
p_credentiala credential instance initialized with TODO
p_parentthe parent object (for var, keystore and dialog)
psz_option_usernameVLC option name for the username
psz_option_passwordVLC option name for the password
psz_dialog_titledialog title, if NULL, this function won't use the keystore or the dialog
psz_dialog_fmtdialog text using format
Returns
0 if vlc_credential.psz_username and vlc_credential.psz_password are valid, or a negative errno code.

References vlc_credential::b_from_keystore, vlc_credential::b_store, credential_find_keystore(), get_memory_keystore(), vlc_credential::i_get_order, is_credential_valid(), is_url_valid(), msg_Err, msg_Warn, vlc_credential::p_keystore, vlc_credential::p_url, protocol_is_smb(), vlc_credential::psz_dialog_password, vlc_credential::psz_dialog_username, vlc_credential::psz_password, vlc_url_t::psz_password, vlc_credential::psz_username, vlc_url_t::psz_username, vlc_credential::psz_var_password, vlc_credential::psz_var_username, smb_split_domain(), var_InheritString(), vlc_dialog_wait_login_va(), vlc_keystore_create, and vlc_killed().

◆ vlc_credential_get_bearer()

int vlc_credential_get_bearer ( vlc_credential * p_credential,
vlc_object_t * p_parent )

Look up a bearer token for the URL, realm and scopes set on p_credential.

Returns
0 if p_credential->psz_token is valid, or a negative errno code.

References vlc_credential::b_from_keystore, bearer_lookup(), bearer_values_init(), get_memory_keystore(), is_url_valid(), KEY_MAX, msg_Err, vlc_credential::p_url, vlc_credential::psz_realm, and vlc_credential::psz_token.

◆ vlc_credential_init()

void vlc_credential_init ( vlc_credential * p_credential,
const vlc_url_t * p_url )

Init a credential struct.

Note
to be cleaned with vlc_credential_clean()
Parameters
p_credentiala credential instance to initialize
p_urlurl to store or to search

References vlc_credential::i_get_order, and vlc_credential::p_url.

Referenced by Open().

◆ vlc_credential_store()

bool vlc_credential_store ( vlc_credential * p_credential,
vlc_object_t * p_parent )

Store the last dialog credential returned by vlc_credential_get().

This function will store the credential in the memory keystore if it's valid, or will store in the permanent one if it comes from the dialog and if the user asked for it.

Returns
true if the credential was stored or comes from the keystore, false otherwise

References asprintf(), vlc_credential::b_from_keystore, vlc_credential::b_store, get_memory_keystore(), is_credential_valid(), KEY_AUTHTYPE, KEY_MAX, KEY_PATH, KEY_PORT, KEY_PROTOCOL, KEY_REALM, KEY_SERVER, KEY_USER, vlc_credential::p_keystore, vlc_credential::p_url, protocol_is_smb(), protocol_set_port(), protocol_store_path(), vlc_credential::psz_authtype, vlc_url_t::psz_host, psz_label, vlc_credential::psz_password, vlc_url_t::psz_path, vlc_url_t::psz_protocol, vlc_credential::psz_realm, vlc_credential::psz_username, vlc_keystore_store(), VLC_SUCCESS, and vlc_uri_decode_duplicate().