MCPcopy Create free account
hub / github.com/AI45Lab/Code / s3_workspace_backend_maps_to_rust_session_options

Function s3_workspace_backend_maps_to_rust_session_options

sdk/node/src/lib.rs:6160–6188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6158
6159 #[test]
6160 fn s3_workspace_backend_maps_to_rust_session_options() {
6161 let opts = js_session_options_to_rust(Some(SessionOptions {
6162 workspace_backend: Some(JsWorkspaceBackend {
6163 kind: "s3".to_string(),
6164 root: None,
6165 s3: Some(JsS3BackendConfig {
6166 endpoint: Some("https://minio.local:9000".to_string()),
6167 region: Some("us-east-1".to_string()),
6168 access_key_id: "AKIA".to_string(),
6169 secret_access_key: "secret".to_string(),
6170 session_token: None,
6171 bucket: "workspace".to_string(),
6172 prefix: "users/u1/sessions/s1".to_string(),
6173 force_path_style: Some(true),
6174 ..Default::default()
6175 }),
6176 }),
6177 ..Default::default()
6178 }))
6179 .unwrap();
6180
6181 let services = opts.workspace_services.expect("s3 backend builds services");
6182 let caps = services.capabilities();
6183 assert!(caps.read);
6184 assert!(caps.write);
6185 assert!(!caps.exec, "S3 must not expose bash");
6186 assert!(!caps.git, "S3 must not expose git");
6187 assert!(!caps.search, "S3 must not expose grep/glob");
6188 }
6189
6190 #[test]
6191 fn workspace_backend_rejects_missing_s3_config() {

Callers

nothing calls this directly

Calls 3

expectMethod · 0.80
capabilitiesMethod · 0.45

Tested by

no test coverage detected