16 releases

0.2.2 Jul 30, 2024
0.2.0 Jan 9, 2024
0.1.7 Oct 27, 2023
0.1.4 Jul 31, 2023

#1032 in Database interfaces

Download history 205/week @ 2024-07-29 12/week @ 2024-08-12 8/week @ 2024-09-02 21/week @ 2024-09-09 15/week @ 2024-09-16 12/week @ 2024-09-23 13/week @ 2024-09-30 8/week @ 2024-10-07 16/week @ 2024-10-14 3/week @ 2024-10-21 24/week @ 2024-10-28 25/week @ 2024-11-04

68 downloads per month

MIT license

28KB
458 lines

check test codecov Version dependency status

Sandkasten Client

Sandkasten client library for running untrusted code

Example

use sandkasten_client::{
    schemas::programs::{BuildRequest, BuildRunRequest, MainFile},
    SandkastenClient,
};

#[tokio::main]
async fn main() {
    let client = SandkastenClient::new("http://your-sandkasten-instance".parse().unwrap());
    let result = client
        .build_and_run(&BuildRunRequest {
            build: BuildRequest {
                environment: "python".into(),
                main_file: MainFile {
                    name: Some("test.py".into()),
                    content: "print(6 * 7, end='')".into(),
                },
                ..Default::default()
            },
            run: Default::default(),
        })
        .await
        .unwrap();
    assert_eq!(result.run.stdout, "42");
}

Dependencies

~5–21MB
~309K SLoC