Skip to content
API Documentation
BastionGuard™
BastionGuard-secure.hpp
Go to the documentation of this file.
1/*
2 * BastionGuard™
3 * Copyright (C) 2025–2026 Calogero Scarnà
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 *
17 * BastionGuard™ is a trademark of Calogero Scarnà.
18 * The BastionGuard™ name and branding are not licensed under the GPL.
19 */
20
21#pragma once
22
23#include <string>
24#include <vector>
25
27public:
28
29 static bool open_if_allowed(const std::string& url, int argc, char** argv);
30
31 static bool is_payment_domain(const std::string& domain);
32
33 // Provider di pagamento "navigabili" riconosciuti SEMPRE (Stripe, PayPal,
34 // ecc.), indipendentemente da payments.json e dal setting utente: vanno
35 // aperti direttamente in sandbox CEF, mai nel browser di sistema.
36 static bool is_builtin_payment_provider(const std::string& domain);
37
38 static std::string extract_domain(const std::string& url);
39 static std::string clean_domain(const std::string& d);
40 static bool ends_with(const std::string& s, const std::string& suffix);
41
42private:
43 static std::string config_path_payments();
44 static void open_system_browser(const std::string& url);
45
46 static const std::vector<std::string>& payments_cache_only();
47};
static std::string clean_domain(const std::string &d)
static bool open_if_allowed(const std::string &url, int argc, char **argv)
static void open_system_browser(const std::string &url)
static std::string extract_domain(const std::string &url)
static const std::vector< std::string > & payments_cache_only()
static bool ends_with(const std::string &s, const std::string &suffix)
static std::string config_path_payments()
static bool is_payment_domain(const std::string &domain)
static bool is_builtin_payment_provider(const std::string &domain)