Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<prefix>__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
Expand Down
22 changes: 16 additions & 6 deletions crates/devstack-hub/src/upstreams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down Expand Up @@ -1001,6 +1013,7 @@ impl Upstreams {
resource: flow.resource,
},
)?;
self.logged_in_anew(&flow.upstream);
Ok(flow.upstream)
}

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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!(
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/PoolUpstreams.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ function how(u: PoolUpstream): string {
<div class="card-body">
<p class="muted small">
MCP servers this pool names for its members. Each member's hub offers them on its <router-link to="/upstreams">MCP upstreams</router-link> 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.
</p>
<p v-if="problem" class="err">{{ problem }}</p>

Expand Down
Loading