diff --git a/CHANGELOG.md b/CHANGELOG.md index bab1eae1..0cfd7ab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,16 @@ and listed with their assets on the ## [Unreleased] +### Fixed + +- **An MCP upstream's tools show right after its login**: for up to a minute + after logging in, giving a token or logging out, agents still got what the + hub had asked with the old credential (a `__login` instead of the + tools); a change of the credential now forgets it. +- **The pool's MCP upstreams card no longer says it keeps nothing secret**: + it can hold an OAuth app's client secret (never shown) since 0.31.0, and it + says where a member uses or logs in to an upstream. + ## [0.31.0] - 2026-10-30 The hub follows every stack's worktrees, so a new one shows in the diff --git a/crates/devstack-hub/src/upstreams.rs b/crates/devstack-hub/src/upstreams.rs index 5addef3f..6a671cc8 100644 --- a/crates/devstack-hub/src/upstreams.rs +++ b/crates/devstack-hub/src/upstreams.rs @@ -886,12 +886,24 @@ impl Upstreams { &Secret::Token { token: token.into(), }, - ) + )?; + self.logged_in_anew(name); + Ok(()) } pub fn logout(&self, name: &str) -> Result<(), String> { self.get(name)?; - self.secrets.delete(name) + self.secrets.delete(name)?; + self.logged_in_anew(name); + Ok(()) + } + + /// The credential of `name` changed: what it was asked with the old one + /// (its tools, or that it wanted a login, kept for a minute) and its + /// session go, so an agent sees the change at once. + fn logged_in_anew(&self, name: &str) { + self.listed.lock().unwrap().remove(name); + self.sessions.lock().unwrap().remove(name); } fn put_secret(&self, name: &str, s: &Secret) -> Result<(), String> { @@ -1001,6 +1013,7 @@ impl Upstreams { resource: flow.resource, }, )?; + self.logged_in_anew(&flow.upstream); Ok(flow.upstream) } @@ -2001,8 +2014,8 @@ mod tests { assert_eq!(tools[0]["name"], "tr__login"); assert!(ups.call(&http, "tr__login", json!({}))["isError"] == true); + // Logged in: its tools at once, not the answer kept from before. ups.set_token(&name, "good").unwrap(); - ups.listed.lock().unwrap().clear(); let tools = ups.tools(&http); let names: Vec<&str> = tools.iter().filter_map(|t| t["name"].as_str()).collect(); assert_eq!(names, ["tr__search"], "the allowlist keeps `drop` out"); @@ -2036,8 +2049,6 @@ mod tests { // A refused token: its tools stay listed, a call says to log in again. ups.set_token(&name, "revoked").unwrap(); - ups.sessions.lock().unwrap().clear(); - ups.listed.lock().unwrap().clear(); let tools = ups.tools(&http); assert_eq!(tools.len(), 1); assert!( @@ -2092,7 +2103,6 @@ mod tests { let tools = ups.tools(&http); assert_eq!(tools[0]["name"], format!("{name}__login"), "{tools:?}"); ups.set_token(&name, "tk-1").unwrap(); - ups.listed.lock().unwrap().clear(); let tools = ups.tools(&http); assert_eq!(tools[0]["name"], format!("{name}__env"), "{tools:?}"); let r = ups.call( diff --git a/ui/src/components/PoolUpstreams.vue b/ui/src/components/PoolUpstreams.vue index 6fedda3b..27c29ccd 100644 --- a/ui/src/components/PoolUpstreams.vue +++ b/ui/src/components/PoolUpstreams.vue @@ -125,8 +125,8 @@ function how(u: PoolUpstream): string {

MCP servers this pool names for its members. Each member's hub offers them on its MCP upstreams page - and uses one only once its user accepts it, with that user's own login; nothing secret is kept here. A URL over https only, never a - command. + (use or log in there) and uses one only once its user accepts it, with that user's own login. No member's credential is kept here, only an + OAuth app's client secret where a server needs one, never shown. A URL over https only, never a command.

{{ problem }}