mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-28 16:06:22 +00:00
fixup! feat: add read-only access view for members, groups and service accounts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2bfe34901b
commit
2ee95e80cd
@@ -0,0 +1,35 @@
|
||||
//! Another member's access lists paths the caller may not be able to read, so only a workspace
|
||||
//! admin may ask for it.
|
||||
|
||||
use sqlx::{Pool, Postgres};
|
||||
|
||||
use windmill_test_utils::*;
|
||||
|
||||
#[sqlx::test(fixtures("base"))]
|
||||
async fn test_member_cannot_read_another_members_access(db: Pool<Postgres>) -> anyhow::Result<()> {
|
||||
initialize_tracing().await;
|
||||
let server = ApiServer::start(db.clone()).await?;
|
||||
let url = format!(
|
||||
"http://localhost:{}/api/w/test-workspace/access/get",
|
||||
server.addr.port()
|
||||
);
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
let resp = client
|
||||
.get(&url)
|
||||
.query(&[("principal", "u/test-user")])
|
||||
.header("Authorization", "Bearer SECRET_TOKEN_2")
|
||||
.send()
|
||||
.await?;
|
||||
assert_eq!(resp.status(), 403, "{}", resp.text().await?);
|
||||
|
||||
let resp = client
|
||||
.get(&url)
|
||||
.query(&[("principal", "u/test-user-2")])
|
||||
.header("Authorization", "Bearer SECRET_TOKEN_2")
|
||||
.send()
|
||||
.await?;
|
||||
assert_eq!(resp.status(), 200, "{}", resp.text().await?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user