Redid build.sh and removed files
This commit is contained in:
@@ -1 +1,3 @@
|
||||
/target
|
||||
build.sh
|
||||
pythontest.py
|
||||
Generated
+10
@@ -719,6 +719,7 @@ version = "0.27.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc1989dbf2b60852e0782c7487ebf0b4c7f43161ffe820849b56cf05f945cee1"
|
||||
dependencies = [
|
||||
"python3-dll-a",
|
||||
"target-lexicon",
|
||||
]
|
||||
|
||||
@@ -757,6 +758,15 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python3-dll-a"
|
||||
version = "0.2.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d381ef313ae70b4da5f95f8a4de773c6aa5cd28f73adec4b4a31df70b66780d8"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.41"
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ edition = "2024"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
pyo3 = { version = "0.27.0", features = ["extension-module"] }
|
||||
pyo3 = { version = "0.27.0", features = ["extension-module", "generate-import-lib"] }
|
||||
reqwest = "0.12.24"
|
||||
serde = "1.0.228"
|
||||
|
||||
|
||||
@@ -1,4 +1,41 @@
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
class AirlockAPIWrapper:
|
||||
"""
|
||||
A wrapper class for interacting with the Airlock API.
|
||||
Provides methods for managing agents, policies, hashes, OTPs, and execution history.
|
||||
"""
|
||||
|
||||
def __init__(self, base_url: str, api_key: str):
|
||||
"""
|
||||
Initialize the API wrapper.
|
||||
|
||||
Parameters:
|
||||
- base_url (str): Base URL of the Airlock API.
|
||||
- api_key (str): API key for authentication.
|
||||
"""
|
||||
self.base_url = base_url.rstrip("/")
|
||||
self.api_key = api_key
|
||||
self.headers = {"X-APIKey": self.api_key}
|
||||
|
||||
def pull_policy_exec_histories(self, type: List[str], checkpoint: str, policy: List[str]) -> str:
|
||||
"""Retrieve execution history logs."""
|
||||
|
||||
def api(AirlockAPIWrapper):
|
||||
"""
|
||||
An implementation of the python AirlockAPIWrapper class to pass Python data into Rust
|
||||
|
||||
Parameters
|
||||
----------
|
||||
base_url : str
|
||||
(Required) Base URL of the Airlock API, this should be in your .env file.
|
||||
api_key : str
|
||||
(Required) API Key for your profile in airlock, this should be in your credential manager.
|
||||
headers : {"X-APIKey": self.api_key}
|
||||
|
||||
```def __init__(self, base_url: str, api_key: str):
|
||||
self.base_url = base_ur.rstrip("/")
|
||||
self.api_key = api_key
|
||||
self.headers = {"X-APIKey": self.api_key}
|
||||
```
|
||||
"""
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
cargo clean
|
||||
maturin build
|
||||
python3 -m pip uninstall airlock_libs --break-system-packages
|
||||
python3 -m pip install target/wheels/airlock_libs-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl --break-system-packages
|
||||
@@ -1,3 +0,0 @@
|
||||
import airlock_libs
|
||||
|
||||
airlock_libs.pull_policy_exec_histories()
|
||||
+3
-2
@@ -6,6 +6,7 @@ pub fn pull_policy_exec_histories() {
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
pub fn api(x: String) {
|
||||
println!("{}", x);
|
||||
pub fn api(py: Python<'_>, x: Py<PyAny>) {
|
||||
let base_url: String = x.getattr(py, "base_url").unwrap().to_string();
|
||||
println!("{}", base_url);
|
||||
}
|
||||
Reference in New Issue
Block a user