1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-12 07:37:35 +00:00

Introduce CallsSecretStore to store credentials

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-07-08 17:34:40 +02:00 committed by Evangelos Ribeiro Tzaras
parent e1e6704b91
commit c5e4c80a47
3 changed files with 83 additions and 0 deletions

45
src/calls-secret-store.c Normal file
View file

@ -0,0 +1,45 @@
/*
* Copyright (C) 2021 Purism SPC
*
* This file is part of Calls.
*
* Calls is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calls 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calls. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Evangelos Ribeiro Tzaras <evangelos.tzaras@puri.sm>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#define G_LOG_DOMAIN "CallsSecretStore"
#include "calls-secret-store.h"
#include <libsecret/secret.h>
const SecretSchema *
calls_secret_get_schema (void)
{
static const SecretSchema schema = {
"sm.puri.Calls", SECRET_SCHEMA_NONE,
{
{ CALLS_USERNAME_ATTRIBUTE, SECRET_SCHEMA_ATTRIBUTE_STRING },
{ CALLS_SERVER_ATTRIBUTE, SECRET_SCHEMA_ATTRIBUTE_STRING },
{ CALLS_PROTOCOL_ATTRIBUTE, SECRET_SCHEMA_ATTRIBUTE_STRING },
{ NULL, 0 },
}
};
return &schema;
}

36
src/calls-secret-store.h Normal file
View file

@ -0,0 +1,36 @@
/*
* Copyright (C) 2021 Purism SPC
*
* This file is part of Calls.
*
* Calls is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calls 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calls. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Evangelos Ribeiro Tzaras <evangelos.tzaras@puri.sm>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#pragma once
#include <libsecret/secret.h>
#define CALLS_USERNAME_ATTRIBUTE "username"
#define CALLS_SERVER_ATTRIBUTE "server"
#define CALLS_PROTOCOL_ATTRIBUTE "protocol"
const SecretSchema *calls_secret_get_schema (void) G_GNUC_CONST;
#define CALLS_SECRET_SCHEMA calls_secret_get_schema ()

View file

@ -38,6 +38,7 @@ calls_deps = [ dependency('gobject-2.0', version: '>= 2.58'),
dependency('libebook-contacts-1.2'),
dependency('folks'),
dependency('libcallaudio-0.1'),
dependency('libsecret-1'),
]
calls_vala_deps = [
@ -111,6 +112,7 @@ calls_sources = files(['calls-message-source.c', 'calls-message-source.h',
'calls-account-overview.c', 'calls-account-overview.h',
'calls-account-row.c', 'calls-account-row.h',
'calls-settings.c', 'calls-settings.h',
'calls-secret-store.c', 'calls-secret-store.h',
]) + calls_generated_sources
calls_config_data = config_data