76ENTROPIC_EXPORT
bool tokens_equal(
const std::string&
a,
const std::string&
b);
126 const std::string& token, std::string&
err);
139 using Clock = std::chrono::steady_clock;
147 bool blocked(Clock::time_point now)
const;
154 void record_failure(Clock::time_point now);
157 mutable std::mutex mu_;
159 Clock::time_point window_start_{};
160 Clock::time_point blocked_until_{};
194 bool start(std::string&
err);
207 int port()
const {
return port_.load(); }
214 const std::filesystem::path&
token_file()
const {
return token_file_; }
226 std::string publish_token(
int bound);
233 std::string await_running();
235 std::unique_ptr<Impl> impl_;
237 std::atomic<int> port_{0};
238 std::filesystem::path token_file_;
Unix socket MCP bridge for external client access.
Refuses after repeated authentication failures (decision #84).
Streamable-HTTP front end for an ExternalBridge (gh#204).
int port() const
The port actually bound.
const std::filesystem::path & token_file() const
Where this listener's token was written.
Symbol visibility macro for all exported symbols.
std::string err
size_exceeded, when set
std::filesystem::path token_path_for(int port)
Where the token for a port is written.
bool host_allowed(const std::string &host, int port)
Whether a Host header names this listener's loopback endpoint.
bool write_token_file(const std::filesystem::path &path, const std::string &token, std::string &err)
Write token to path atomically (temp + rename), mode 0600.
bool tokens_equal(const std::string &a, const std::string &b)
Compare two tokens in time independent of where they differ.
bool prepare_private_dir(const std::filesystem::path &dir, std::string &err)
Create or verify the token directory: 0700, ours, not a symlink.
std::string generate_token()
A fresh bearer token: 256 bits from getrandom(), hex-encoded.
std::string bearer_token(const std::string &header)
The token in an Authorization: Bearer <t> header, or "".
Activate model on GPU (WARM → ACTIVE).
@ optional
optional: every escape asks the host's path approver