fix(mcp): the remote door's limits, disk cost, names and front line after review (P15 B1)
Per-address limits count an IPv4 address or an IPv6 /64 (mapped addresses as the IPv4 one) and the table evicts per-address entries only, never a connection's own call limit; waiting requests give way to a new one (an address's oldest, or the fullest address's) instead of filling the window; a stale client document is used when the fetch budget is spent and nothing is fetched from /token. Registrations nobody allowed live in memory only, a redirect is at most 512 bytes and a client's together 4 KiB. An error of a sign-in for a client nobody approved is a page, never a redirect. Names lose invisible and direction-changing characters and are cut to forty; a revoked key frees its place; calls refused for rate or another company's books are counted, not written, the limit asked first. The client document fetch refuses ::/96 and 2002::/16, uses no proxy; the host is read from the request's authority under HTTP/2; remote.json is private on Windows too; every connection must begin with a per-start secret before the PROXY header, given to the app over the admin socket. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
c4fd1580d8
commit
32acdc1c44
8 files changed
+734
-117
No files matched your search
@@ -647,7 +647,10 @@ impl State {
|
||||
let what = if approve {
|
||||
format!("Allow the assistant sent back to {}", request.redirect_host)
|
||||
} else {
|
||||
format!("Don't allow the assistant sent back to {}", request.redirect_host)
|
||||
format!(
|
||||
"Don't allow the assistant sent back to {}",
|
||||
request.redirect_host
|
||||
)
|
||||
};
|
||||
Some((
|
||||
what,
|
||||
@@ -891,7 +894,7 @@ pub const MOST_CARDS: usize = 3;
|
||||
fn newest_waiting(all: &[crate::owner::WebRequest]) -> (Vec<&crate::owner::WebRequest>, usize) {
|
||||
let mut sorted: Vec<&crate::owner::WebRequest> = all.iter().collect();
|
||||
// Most time left is the newest.
|
||||
sorted.sort_by(|a, b| b.expires_in_secs.cmp(&a.expires_in_secs));
|
||||
sorted.sort_by_key(|r| std::cmp::Reverse(r.expires_in_secs));
|
||||
let more = sorted.len().saturating_sub(MOST_CARDS);
|
||||
sorted.truncate(MOST_CARDS);
|
||||
(sorted, more)
|
||||
|
||||
Reference in new issue
Block a user