KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIPLATFORM::SECRETS Namespace Reference

Functions

bool StoreSecret (const wxString &aService, const wxString &aKey, const wxString &aSecret)
 
void StoreSecretAsync (const wxString &aService, const wxString &aKey, const wxString &aSecret, std::function< void(bool)> aDone=nullptr)
 Like StoreSecret(), but never blocks the event loop while the platform asks the user to unlock the store.
 
bool GetSecret (const wxString &aService, const wxString &aKey, wxString &aSecret)
 
void GetSecretAsync (const wxString &aService, const wxString &aKey, std::function< void(bool, const wxString &)> aDone)
 Like GetSecret(), but never blocks the event loop while the platform asks the user to unlock the store.
 
bool GetSecretNoPrompt (const wxString &aService, const wxString &aKey, wxString &aSecret)
 Like GetSecret(), but never waits on the user.
 
bool DeleteSecret (const wxString &aService, const wxString &aKey)
 
static void storeFinished (GObject *aSource, GAsyncResult *aResult, gpointer aDone)
 
static void lookupFinished (GObject *aSource, GAsyncResult *aResult, gpointer aDone)
 

Variables

static const SecretSchema schema
 

Function Documentation

◆ DeleteSecret()

bool KIPLATFORM::SECRETS::DeleteSecret ( const wxString & aService,
const wxString & aKey )

Definition at line 203 of file unix/secrets.cpp.

References schema.

Referenced by PLATFORM_SECRET_BACKEND::DeleteSecret(), and StoreDatabasePassword().

◆ GetSecret()

bool KIPLATFORM::SECRETS::GetSecret ( const wxString & aService,
const wxString & aKey,
wxString & aSecret )

Definition at line 96 of file unix/secrets.cpp.

References schema.

Referenced by PLATFORM_SECRET_BACKEND::GetSecret().

◆ GetSecretAsync()

void KIPLATFORM::SECRETS::GetSecretAsync ( const wxString & aService,
const wxString & aKey,
std::function< void(bool, const wxString &)> aDone )

Like GetSecret(), but never blocks the event loop while the platform asks the user to unlock the store.

Call it from the main thread; aDone runs there with whether the secret was found and its value, possibly before this returns on platforms that read without prompting.

Definition at line 143 of file unix/secrets.cpp.

References lookupFinished(), and schema.

Referenced by KIGIT_COMMON::DeferForSecret(), and PROJECT_TREE_PANE::onGitRemoteSettings().

◆ GetSecretNoPrompt()

bool KIPLATFORM::SECRETS::GetSecretNoPrompt ( const wxString & aService,
const wxString & aKey,
wxString & aSecret )

Like GetSecret(), but never waits on the user.

A locked keyring is reported as not found instead of showing an unlock prompt, so it is safe on paths that must not block.

Definition at line 155 of file unix/secrets.cpp.

References schema, and text.

Referenced by DefaultDatabaseSecretLookup(), KIGIT_COMMON::GetPassword(), and IsNoPromptSecretLookup().

◆ lookupFinished()

static void KIPLATFORM::SECRETS::lookupFinished ( GObject * aSource,
GAsyncResult * aResult,
gpointer aDone )
static

Definition at line 124 of file unix/secrets.cpp.

Referenced by GetSecretAsync().

◆ storeFinished()

static void KIPLATFORM::SECRETS::storeFinished ( GObject * aSource,
GAsyncResult * aResult,
gpointer aDone )
static

Definition at line 70 of file unix/secrets.cpp.

Referenced by StoreSecretAsync().

◆ StoreSecret()

bool KIPLATFORM::SECRETS::StoreSecret ( const wxString & aService,
const wxString & aKey,
const wxString & aSecret )

Definition at line 40 of file unix/secrets.cpp.

References schema.

Referenced by StoreDatabasePassword(), and PLATFORM_SECRET_BACKEND::StoreSecret().

◆ StoreSecretAsync()

void KIPLATFORM::SECRETS::StoreSecretAsync ( const wxString & aService,
const wxString & aKey,
const wxString & aSecret,
std::function< void(bool)> aDone = nullptr )

Like StoreSecret(), but never blocks the event loop while the platform asks the user to unlock the store.

Call it from the main thread; aDone, when given, runs there with the outcome, possibly before this returns on platforms that store without prompting.

Definition at line 79 of file unix/secrets.cpp.

References schema, and storeFinished().

Referenced by KICAD_MANAGER_CONTROL::NewFromRepository(), KIGIT::PromptForCredentials(), and saveAcceptedRemoteSettings().

Variable Documentation

◆ schema

const SecretSchema KIPLATFORM::SECRETS::schema
static
Initial value:
=
{
"org.kicad.kicad", SECRET_SCHEMA_NONE,
{
{ "service", SECRET_SCHEMA_ATTRIBUTE_STRING },
{ "key", SECRET_SCHEMA_ATTRIBUTE_STRING },
{ nullptr, SECRET_SCHEMA_ATTRIBUTE_STRING }
}
}

Definition at line 30 of file unix/secrets.cpp.

Referenced by DeleteSecret(), GetSecret(), GetSecretAsync(), GetSecretNoPrompt(), StoreSecret(), and StoreSecretAsync().