mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-13 10:57:13 +00:00
47e65658c7
Security: _is_sensitive now flags underscore-prefixed names (api_token.txt, oauth_token.json) by replacing \b with lookarounds; adds _SENSITIVE_DIRS check on parent path components (parts[:-1]) so .ssh/, secrets/, .aws/ directories are always skipped; aligns both patterns to (?![a-zA-Z]) for consistent underscore-after-keyword behavior (#920) Fix: --wiki Relationships section always empty because _cross_community_links read community from node attrs (always None) instead of the communities dict; _god_node_article had the same bug and never linked to the owning community; fixed by building a node->community map in to_wiki() and threading it through (#925) Fix: --watch now respects .graphifyignore; patterns loaded once at startup, handler checks _is_ignored before extension filter so node_modules/, .venv/, build/ churn no longer triggers rebuilds (#928) Fix: C++ struct inheritance edges via base_class_clause; initialize base="" per iteration to prevent stale carryover (#915) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
993 B
C++
44 lines
993 B
C++
#include <iostream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class HttpClient {
|
|
public:
|
|
HttpClient(const std::string& baseUrl) : baseUrl_(baseUrl) {}
|
|
|
|
std::string get(const std::string& path) {
|
|
return buildRequest("GET", path);
|
|
}
|
|
|
|
std::string post(const std::string& path, const std::string& body) {
|
|
return buildRequest("POST", path);
|
|
}
|
|
|
|
private:
|
|
std::string baseUrl_;
|
|
|
|
std::string buildRequest(const std::string& method, const std::string& path) {
|
|
return method + " " + baseUrl_ + path;
|
|
}
|
|
};
|
|
|
|
class AuthedHttpClient : public HttpClient {
|
|
public:
|
|
AuthedHttpClient(const std::string& baseUrl, const std::string& token)
|
|
: HttpClient(baseUrl), token_(token) {}
|
|
|
|
private:
|
|
std::string token_;
|
|
};
|
|
|
|
struct RetryingHttpClient : HttpClient {
|
|
int maxRetries;
|
|
};
|
|
|
|
int main() {
|
|
HttpClient client("https://api.example.com");
|
|
std::string response = client.get("/users");
|
|
std::cout << response << std::endl;
|
|
return 0;
|
|
}
|