- 1327
} - 1328
} - 1329
- 1330
#[test] - 1331
fn feed_scope_permissions_only_tighten() { - 1332
assert!(authorize_feed_scope("workspace", PermissionMode::WorkspaceWrite).is_ok()); - 1333
assert!(authorize_feed_scope("workspace", PermissionMode::FullAccess).is_ok()); - 1334
assert!(authorize_feed_scope("global", PermissionMode::FullAccess).is_ok()); - 1335
assert!(authorize_feed_scope("global", PermissionMode::WorkspaceWrite).is_err()); - 1336
assert!(authorize_feed_scope("workspace", PermissionMode::ReadOnly).is_err()); - 1337
assert!(authorize_feed_scope("global", PermissionMode::ReadOnly).is_err()); - 1338
} - 1339
- 1340
#[test] - 1341
fn source_admission_rejects_private_and_malformed_targets() { - 1342
assert!(validate_source_url("https://example.com/feed").is_ok()); - 1343
assert!(validate_source_url("not a url").is_err()); - 1344
assert!(validate_source_url("file:///tmp/feed").is_err()); - 1345
assert!(validate_source_url("http://127.0.0.1/feed").is_err()); - 1346
assert!(validate_source_url("http://192.168.1.10/feed").is_err()); - 1347
assert!(validate_source_url("http://[::1]/feed").is_err()); - 1348
} - 1349
} - 1350
source · Rust
Feeds
crates/vak-server/src/feeds.rs46.3 KB1,350 lines19 anchorsSnapshot ed4ab258