2020-12-23 22:21:36 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2014-10-14 12:37:00 +02:00
|
|
|
/*
|
2019-10-01 09:20:35 +02:00
|
|
|
* Copyright (C) 2013 - 2015 Red Hat, Inc.
|
2014-10-14 12:37:00 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __NM_SECRET_AGENT_SIMPLE_H__
|
|
|
|
|
#define __NM_SECRET_AGENT_SIMPLE_H__
|
|
|
|
|
|
2017-03-09 13:02:20 +01:00
|
|
|
#include "nm-secret-agent-old.h"
|
2014-10-14 12:37:00 +02:00
|
|
|
|
2017-11-17 19:14:00 +01:00
|
|
|
typedef enum {
|
|
|
|
|
NM_SECRET_AGENT_SECRET_TYPE_PROPERTY,
|
|
|
|
|
NM_SECRET_AGENT_SECRET_TYPE_SECRET,
|
|
|
|
|
NM_SECRET_AGENT_SECRET_TYPE_VPN_SECRET,
|
2019-01-30 12:36:13 +01:00
|
|
|
NM_SECRET_AGENT_SECRET_TYPE_WIREGUARD_PEER_PSK,
|
2017-11-17 19:14:00 +01:00
|
|
|
} NMSecretAgentSecretType;
|
|
|
|
|
|
2014-10-14 12:37:00 +02:00
|
|
|
typedef struct {
|
2019-01-28 18:18:02 +01:00
|
|
|
NMSecretAgentSecretType secret_type;
|
2017-11-17 19:14:00 +01:00
|
|
|
const char * pretty_name;
|
|
|
|
|
const char * entry_id;
|
|
|
|
|
char * value;
|
|
|
|
|
const char * vpn_type;
|
2019-01-30 12:34:55 +01:00
|
|
|
bool is_secret : 1;
|
|
|
|
|
bool no_prompt_entry_id : 1;
|
2014-10-14 12:37:00 +02:00
|
|
|
} NMSecretAgentSimpleSecret;
|
|
|
|
|
|
2018-09-14 11:13:05 +02:00
|
|
|
#define NM_SECRET_AGENT_ENTRY_ID_PREFX_VPN_SECRETS "vpn.secrets."
|
2017-11-17 19:14:00 +01:00
|
|
|
|
|
|
|
|
#define NM_SECRET_AGENT_VPN_TYPE_OPENCONNECT NM_DBUS_INTERFACE ".openconnect"
|
|
|
|
|
|
2019-01-22 10:14:21 +01:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#define NM_TYPE_SECRET_AGENT_SIMPLE (nm_secret_agent_simple_get_type())
|
|
|
|
|
#define NM_SECRET_AGENT_SIMPLE(obj) \
|
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimple))
|
|
|
|
|
#define NM_SECRET_AGENT_SIMPLE_CLASS(klass) \
|
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimpleClass))
|
|
|
|
|
#define NM_IS_SECRET_AGENT_SIMPLE(obj) \
|
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SECRET_AGENT_SIMPLE))
|
|
|
|
|
#define NM_IS_SECRET_AGENT_SIMPLE_CLASS(klass) \
|
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SECRET_AGENT_SIMPLE))
|
|
|
|
|
#define NM_SECRET_AGENT_SIMPLE_GET_CLASS(obj) \
|
|
|
|
|
(G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimpleClass))
|
|
|
|
|
|
|
|
|
|
#define NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS "request-secrets"
|
|
|
|
|
|
2019-01-22 10:19:35 +01:00
|
|
|
typedef struct _NMSecretAgentSimple NMSecretAgentSimple;
|
|
|
|
|
typedef struct _NMSecretAgentSimpleClass NMSecretAgentSimpleClass;
|
2019-01-22 10:14:21 +01:00
|
|
|
|
2014-10-14 12:37:00 +02:00
|
|
|
GType nm_secret_agent_simple_get_type(void);
|
|
|
|
|
|
2019-01-22 12:51:10 +01:00
|
|
|
NMSecretAgentSimple *nm_secret_agent_simple_new(const char *name);
|
2014-11-20 11:55:54 -05:00
|
|
|
|
2014-11-20 11:53:19 -05:00
|
|
|
void nm_secret_agent_simple_response(NMSecretAgentSimple *self,
|
|
|
|
|
const char * request_id,
|
|
|
|
|
GPtrArray * secrets);
|
2014-11-20 11:55:54 -05:00
|
|
|
|
2014-11-20 11:53:19 -05:00
|
|
|
void nm_secret_agent_simple_enable(NMSecretAgentSimple *self, const char *path);
|
2014-10-14 12:37:00 +02:00
|
|
|
|
|
|
|
|
#endif /* __NM_SECRET_AGENT_SIMPLE_H__ */
|