mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-25 00:01:55 +00:00
fix: complete ApiAuthed initializers in feature-gated tests after merge
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -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"),
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user