Skip to content

Commit e0f163a

Browse files
committed
docs: Intial documentation for NTLS MVP
1 parent 419aa72 commit e0f163a

File tree

14 files changed

+859
-234
lines changed

14 files changed

+859
-234
lines changed

.github/workflows/docs.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Documentation
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- 'docs/**'
8+
- 'mkdocs.yml'
9+
- '.github/workflows/docs.yml'
10+
pull_request:
11+
paths:
12+
- 'docs/**'
13+
- 'mkdocs.yml'
14+
- '.github/workflows/docs.yml'
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.x'
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install mkdocs-material
32+
pip install mkdocs-minify-plugin
33+
pip install mkdocs-git-revision-date-localized-plugin
34+
35+
- name: Build documentation
36+
run: mkdocs build
37+
38+
- name: Deploy to GitHub Pages
39+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
40+
uses: peaceiris/actions-gh-pages@v3
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
publish_dir: ./site
44+
force_orphan: true

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ bin/
2727
/obj
2828
/lib
2929

30-
start.sh
30+
start.sh
31+
32+
/site/*

docs/api/endpoints/data-pool.md

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Data Pool APIs
2+
3+
The Data Pool APIs allow you to create and manage data pools within the SGX enclave.
4+
5+
## Create Data Pool
6+
7+
Creates a new data pool with the provided data, pending DRT verification.
8+
9+
### Endpoint
10+
11+
```sh
12+
POST /create_data_pool
13+
```
14+
15+
### Headers
16+
17+
Content-Type: `application/json`
18+
19+
### Request Body
20+
21+
```json
22+
{
23+
"data": {
24+
"Column_1": [
25+
"value1",
26+
"value2",
27+
"value3"
28+
],
29+
"Column_2": [
30+
"valueA",
31+
"valueB",
32+
"valueC"
33+
]
34+
}
35+
}
36+
```
37+
38+
### Response
39+
40+
#### Success Response
41+
42+
Status Code: `200 OK`
43+
44+
#### Content
45+
46+
```sh
47+
Data sealed and saved successfully
48+
```
49+
50+
### Error Response
51+
52+
#### In case of server issues:
53+
54+
Status Code: `500 Internal Server Error`
55+
56+
#### Content:
57+
58+
```sh
59+
"error": "Error message details"
60+
```
61+
62+
## Append Data Pool
63+
64+
Appends new data to an existing data pool, pending DRT verification.
65+
66+
### Endpoint
67+
68+
```sh
69+
POST /append_data
70+
```
71+
72+
### Headers
73+
74+
Content-Type: `application/json`
75+
76+
### Request Body
77+
78+
```json
79+
{
80+
"data": {
81+
"Column_1": [
82+
"new_value1",
83+
"new_value2"
84+
],
85+
"Column_2": [
86+
"new_valueA",
87+
"new_valueB"
88+
]
89+
}
90+
}
91+
```
92+
93+
### Response
94+
95+
#### Success Response
96+
97+
Status Code: `200 OK`
98+
99+
#### Content
100+
101+
```sh
102+
Data merged, sealed, and saved successfully
103+
```
104+
105+
### Error Response
106+
107+
#### In case of server issues:
108+
109+
Status Code: `500 Internal Server Error`
110+
111+
#### Content:
112+
113+
```sh
114+
"error": "Error message details"
115+
```

docs/api/endpoints/health.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Health Check API
2+
3+
A simple endpoint to verify that the server is running and responsive.
4+
5+
## Endpoint
6+
7+
```sh
8+
GET /health
9+
```
10+
11+
## Headers
12+
None required
13+
14+
## Response
15+
16+
### Success Response
17+
18+
Status Code: `200 OK`
19+
20+
### Content
21+
22+
```sh
23+
Server is running
24+
```
25+
26+
## Error Response
27+
28+
### In case of server issues:
29+
30+
Status Code: `500 Internal Server Error`
31+
32+
### Content
33+
34+
```sh
35+
"error": "Error message details"
36+
```
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Python Execution API
2+
3+
Execute Python scripts (hosted on GitHub) within the SGX enclave on the secured data pool.
4+
The script must be verified using its SHA256 hash before execution.
5+
6+
## Endpoint
7+
8+
```sh
9+
POST /execute_python
10+
```
11+
12+
## Headers
13+
14+
Content-Type: `application/json`
15+
16+
## Request Body
17+
18+
```json
19+
{
20+
"github_url": "URL to the Python script on GitHub",
21+
"expected_hash": "SHA256 hash of the Python script"
22+
}
23+
```
24+
25+
## Response
26+
27+
### Success Response
28+
29+
Status Code: `200 OK`
30+
31+
### Content
32+
33+
```json
34+
{
35+
"result": {
36+
"Column_1": "computed_value1",
37+
"Column_2": "computed_value2"
38+
}
39+
}
40+
```
41+
42+
## Error Response
43+
44+
### In case of server issues:
45+
46+
Status Code: `500 Internal Server Error`
47+
48+
### Content
49+
50+
```sh
51+
"error": "Error message details"
52+
```

docs/api/endpoints/wasm-execution.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# WebAssembly Execution API
2+
3+
Execute WebAssembly (WASM) binaries (hosted on GitHub) within the SGX enclave on the secured data pool.
4+
The binary must be verified using its SHA256 hash before execution. The API also requires the JSON schema.
5+
6+
## Endpoint
7+
8+
```sh
9+
POST /execute_wasm
10+
```
11+
12+
## Headers
13+
14+
Content-Type: `application/json`
15+
16+
## Request Body
17+
18+
```json
19+
{
20+
"github_url": "URL to the WASM binary on GitHub",
21+
"expected_hash": "SHA256 hash of the WASM binary",
22+
"json_schema": ...
23+
}
24+
```
25+
26+
## Response
27+
28+
### Success Response
29+
30+
Status Code: `200 OK`
31+
32+
### Content
33+
34+
```json
35+
{
36+
"result": {
37+
"Column_1": "computed_value1",
38+
"Column_2": "computed_value2"
39+
}
40+
}
41+
```
42+
43+
## Error Response
44+
45+
### In case of server issues:
46+
47+
Status Code: `500 Internal Server Error`
48+
49+
### Content
50+
51+
```sh
52+
"error": "Error message details"
53+
```

docs/api/overview.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Overview
2+
3+
The Nautilus MVP provides a REST API for interacting with the SGX enclave and performing secure data operations. All endpoints are served over HTTPS and support remote attestation (RA-TLS).
4+
5+
## Base URL
6+
7+
```
8+
https://127.0.0.1:8080
9+
```
10+
11+
## Authentication
12+
Currently, the API does not require authentication. However, all connections must optionally pass SGX remote attestation verification.
13+
14+
## Response Format
15+
16+
Responses are in JSON format, unless otherwise specified. The general structure is:
17+
18+
```json
19+
{
20+
"result": {}, // Success response data
21+
"error": "" // Error message if applicable
22+
}
23+
```
24+
25+
## Common HTTP Status Codes
26+
27+
* `200 OK`: Request successful
28+
* `400 Bad Request`: Invalid request parameters
29+
* `500 Internal Server Error`: Server-side error
30+
31+
## API Endpoints
32+
33+
| Endpoint | Method | Description |
34+
|------------------|--------|----------------------------|
35+
| `/health` | GET | Health check endpoint |
36+
| `/create_data_pool` | POST | Create a new data pool |
37+
| `/append_data` | POST | Append data to existing pool |
38+
| `/execute_python`| POST | Execute Python script |
39+
| `/execute_wasm` | POST | Execute WASM binary |
40+
41+
## Postman Collection
42+
43+
A Postman collection is available for testing. See the [Postman Guide](postman-collection/usage-guide.md) for details.

0 commit comments

Comments
 (0)