fix: complete ApiAuthed initializers in feature-gated tests after merge

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-08-05 17:02:11 +02:00
parent 3241fa2095
commit 21218f8f6d
2 changed files with 24 additions and 7 deletions
@@ -32,6 +32,7 @@ fn outsider() -> ApiAuthed {
is_session_token: false,
token_prefix: None,
read_only: false,
job_id: None,
}
}
@@ -417,9 +418,16 @@ async fn an_editor_graph_renders_only_through_its_own_job(db: Pool<Postgres>) {
// Through the PATH — which is what the workspace graph and every run of the
// deployed version ask for — a buffer parse must not appear at all. It
// describes an editor's unsaved state, not what the script owns.
let workspace = asset_graph_for(&admin, WS, UserDB::new(db.clone()), db.clone(), query(), None)
.await
.unwrap();
let workspace = asset_graph_for(
&admin,
WS,
UserDB::new(db.clone()),
db.clone(),
query(),
None,
)
.await
.unwrap();
let workspace = serde_json::to_value(&workspace.0).unwrap().to_string();
assert!(
!workspace.contains("u/a/wh/analytics/draft"),
+13 -4
View File
@@ -1124,6 +1124,8 @@ mod tests {
folders: vec![],
scopes: None,
username_override: None,
username_override_is_token_label: false,
is_session_token: false,
token_prefix: None,
read_only: false,
job_id,
@@ -1170,11 +1172,18 @@ mod tests {
server.abort();
let header = captured.lock().unwrap().clone().expect("no auth header captured");
let header = captured
.lock()
.unwrap()
.clone()
.expect("no auth header captured");
let token = header.strip_prefix("Bearer ").unwrap().to_string();
let jwt = token.strip_prefix("jwt_").expect("expected an internal jwt_ token");
let claims: JWTAuthClaims =
windmill_common::jwt::decode_with_internal_secret(jwt).await.unwrap();
let jwt = token
.strip_prefix("jwt_")
.expect("expected an internal jwt_ token");
let claims: JWTAuthClaims = windmill_common::jwt::decode_with_internal_secret(jwt)
.await
.unwrap();
claims.job_id
}