MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / ParseTokenPath

Function ParseTokenPath

src/platform/linux/token_store_linux.cpp:91–98  ·  view source on GitHub ↗

Parse "tokens_gdrive.json" -> provider="gdrive", account from path

Source from the content-addressed store, hash-verified

89
90// Parse "tokens_gdrive.json" -> provider="gdrive", account from path
91static bool ParseTokenPath(const std::string& path, std::string& provider, std::string& account) {
92 auto filename = std::filesystem::path(path).stem().string();
93 auto sep = filename.find('_');
94 if (sep == std::string::npos) return false;
95 provider = filename.substr(0, sep);
96 account = filename.substr(sep + 1);
97 return !provider.empty() && !account.empty();
98}
99
100static std::string ReadTokenFromSecretService(const std::string& provider, const std::string& account) {
101 std::call_once(g_secretInitOnce, InitSecretService);

Callers 2

ReadMethod · 0.85
WriteMethod · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected