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;
}