mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-02 03:11:12 +00:00
c7dba5d695
Previously a connection object was required to retrieve the auth credentials. This patch adds the option to call the retrieval functions only using the connection URI or path to the configuration file. This will allow to use this toolkit to request passwords for ssh authentication in the libssh2 connection driver. Changes: *virAuthGetConfigFilePathURI(): use URI to retrieve the config file path *virAuthGetCredential(): Remove the need to propagate conn object virAuthGetPasswordPath(): *virAuthGetUsernamePath(): New functions, that use config file path instead of conn object
57 lines
2.1 KiB
C
57 lines
2.1 KiB
C
/*
|
|
* virauth.h: authentication related utility functions
|
|
*
|
|
* Copyright (C) 2013 Red Hat, Inc.
|
|
* Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library. If not, see
|
|
* <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
#ifndef __VIR_AUTH_H__
|
|
# define __VIR_AUTH_H__
|
|
|
|
# include "internal.h"
|
|
# include "viruri.h"
|
|
|
|
int virAuthGetConfigFilePath(virConnectPtr conn,
|
|
char **path);
|
|
|
|
int virAuthGetConfigFilePathURI(virURIPtr uri,
|
|
char **path);
|
|
|
|
|
|
char *virAuthGetUsername(virConnectPtr conn,
|
|
virConnectAuthPtr auth,
|
|
const char *servicename,
|
|
const char *defaultUsername,
|
|
const char *hostname);
|
|
char *virAuthGetPassword(virConnectPtr conn,
|
|
virConnectAuthPtr auth,
|
|
const char *servicename,
|
|
const char *username,
|
|
const char *hostname);
|
|
char * virAuthGetUsernamePath(const char *path,
|
|
virConnectAuthPtr auth,
|
|
const char *servicename,
|
|
const char *defaultUsername,
|
|
const char *hostname);
|
|
char * virAuthGetPasswordPath(const char *path,
|
|
virConnectAuthPtr auth,
|
|
const char *servicename,
|
|
const char *username,
|
|
const char *hostname);
|
|
#endif /* __VIR_AUTH_H__ */
|