Skip to content

Commit ef785b2

Browse files
committed
docs: improvements
1 parent 05f2a82 commit ef785b2

File tree

9 files changed

+181
-193
lines changed

9 files changed

+181
-193
lines changed

docs/architecture.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ graph TB
1515
end
1616
1717
subgraph "API Layer"
18-
REST[REST API<br/>Port 3000]
19-
GRPC[gRPC API<br/>Port 3001]
18+
REST[Public REST API<br/>Port 9090]
19+
GRPC[Public gRPC API<br/>Port 9091]
20+
Internal[Internal REST API<br/>Port 9092]
2021
end
2122
2223
subgraph "Application Layer"
@@ -99,7 +100,7 @@ graph LR
99100
end
100101
101102
subgraph "Management API"
102-
API[inferadb-management<br/>HTTP: 3000<br/>gRPC: 3001<br/>Storage: In-Memory]
103+
API[inferadb-management<br/>Public REST: 9090<br/>Public gRPC: 9091<br/>Internal REST: 9092<br/>Storage: In-Memory]
103104
end
104105
105106
subgraph "Services"

docs/audit-logs.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,35 +186,35 @@ Query parameters:
186186
**Get recent audit logs**:
187187

188188
```bash
189-
curl -X GET "http://localhost:3000/v1/organizations/{org}/audit-logs?limit=50" \
189+
curl -X GET "http://localhost:9090/v1/organizations/{org}/audit-logs?limit=50" \
190190
-H "Cookie: infera_session={session_id}"
191191
```
192192

193193
**Filter by event type**:
194194

195195
```bash
196-
curl -X GET "http://localhost:3000/v1/organizations/{org}/audit-logs?event_type=vault_access_granted" \
196+
curl -X GET "http://localhost:9090/v1/organizations/{org}/audit-logs?event_type=vault_access_granted" \
197197
-H "Cookie: infera_session={session_id}"
198198
```
199199

200200
**Filter by user**:
201201

202202
```bash
203-
curl -X GET "http://localhost:3000/v1/organizations/{org}/audit-logs?user_id=456" \
203+
curl -X GET "http://localhost:9090/v1/organizations/{org}/audit-logs?user_id=456" \
204204
-H "Cookie: infera_session={session_id}"
205205
```
206206

207207
**Filter by date range**:
208208

209209
```bash
210-
curl -X GET "http://localhost:3000/v1/organizations/{org}/audit-logs?start_date=2025-11-01T00:00:00Z&end_date=2025-11-18T23:59:59Z" \
210+
curl -X GET "http://localhost:9090/v1/organizations/{org}/audit-logs?start_date=2025-11-01T00:00:00Z&end_date=2025-11-18T23:59:59Z" \
211211
-H "Cookie: infera_session={session_id}"
212212
```
213213

214214
**Combine filters**:
215215

216216
```bash
217-
curl -X GET "http://localhost:3000/v1/organizations/{org}/audit-logs?event_type=user_login&start_date=2025-11-01T00:00:00Z&limit=100" \
217+
curl -X GET "http://localhost:9090/v1/organizations/{org}/audit-logs?event_type=user_login&start_date=2025-11-01T00:00:00Z&limit=100" \
218218
-H "Cookie: infera_session={session_id}"
219219
```
220220

@@ -259,7 +259,7 @@ Investigate suspicious login activity:
259259

260260
```bash
261261
# Find all failed login attempts in the last 24 hours
262-
curl -X GET "http://localhost:3000/v1/organizations/{org}/audit-logs?event_type=user_login&start_date=$(date -u -v-1d +%Y-%m-%dT%H:%M:%SZ)" \
262+
curl -X GET "http://localhost:9090/v1/organizations/{org}/audit-logs?event_type=user_login&start_date=$(date -u -v-1d +%Y-%m-%dT%H:%M:%SZ)" \
263263
-H "Cookie: infera_session={session_id}"
264264
```
265265

@@ -269,7 +269,7 @@ Review vault access grants:
269269

270270
```bash
271271
# List all vault access grants this month
272-
curl -X GET "http://localhost:3000/v1/organizations/{org}/audit-logs?event_type=vault_access_granted&start_date=2025-11-01T00:00:00Z" \
272+
curl -X GET "http://localhost:9090/v1/organizations/{org}/audit-logs?event_type=vault_access_granted&start_date=2025-11-01T00:00:00Z" \
273273
-H "Cookie: infera_session={session_id}"
274274
```
275275

@@ -279,7 +279,7 @@ Track a specific user's activity:
279279

280280
```bash
281281
# Get all actions by user 456
282-
curl -X GET "http://localhost:3000/v1/organizations/{org}/audit-logs?user_id=456&limit=100" \
282+
curl -X GET "http://localhost:9090/v1/organizations/{org}/audit-logs?user_id=456&limit=100" \
283283
-H "Cookie: infera_session={session_id}"
284284
```
285285

@@ -299,7 +299,7 @@ def export_audit_logs(org_id: str, start_date: datetime, end_date: datetime):
299299

300300
while True:
301301
response = requests.get(
302-
f"http://localhost:3000/v1/organizations/{org_id}/audit-logs",
302+
f"http://localhost:9090/v1/organizations/{org_id}/audit-logs",
303303
params={
304304
"limit": limit,
305305
"offset": offset,
@@ -354,7 +354,7 @@ def monitor_security_events(org_id: str, poll_interval: int = 60):
354354
while True:
355355
for event_type in critical_events:
356356
response = requests.get(
357-
f"http://localhost:3000/v1/organizations/{org_id}/audit-logs",
357+
f"http://localhost:9090/v1/organizations/{org_id}/audit-logs",
358358
params={
359359
"event_type": event_type,
360360
"start_date": last_check.isoformat(),

docs/authentication.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,12 +1253,12 @@ Response:
12531253

12541254
The Management API runs **two separate HTTP servers** for security isolation:
12551255

1256-
- **Public Server** (port 3000): User-facing API with session authentication and permission checks
1257-
- **Internal Server** (port 9091): Server-to-server API with JWT authentication for privileged operations
1256+
- **Public Server** (port 9090): User-facing API with session authentication and permission checks
1257+
- **Internal Server** (port 9092): Server-to-server API with JWT authentication for privileged operations
12581258

12591259
This architecture ensures that privileged endpoints are only accessible via the internal network and cannot be reached from the public internet.
12601260

1261-
#### Public Endpoints (Port 3000)
1261+
#### Public Endpoints (Port 9090)
12621262

12631263
User-facing endpoints with session authentication and permission enforcement:
12641264

@@ -1268,9 +1268,9 @@ User-facing endpoints with session authentication and permission enforcement:
12681268
**User Request Example**:
12691269

12701270
```bash
1271-
# Request to public server (port 3000)
1272-
curl -X GET http://localhost:3000/v1/organizations/123456789 \
1273-
-H "Cookie: session_id=987654321"
1271+
# Request to public server (port 9090)
1272+
curl -X GET http://localhost:9090/v1/organizations/123456789 \
1273+
-H "Cookie: infera_session=sess_abc123..."
12741274
```
12751275

12761276
**Authorization**:
@@ -1279,7 +1279,7 @@ curl -X GET http://localhost:3000/v1/organizations/123456789 \
12791279
- User must be a member of the organization
12801280
- User must have appropriate permissions (checked via middleware)
12811281

1282-
#### Internal Endpoints (Port 9091)
1282+
#### Internal Endpoints (Port 9092)
12831283

12841284
Privileged server-to-server endpoints with JWT authentication, **no permission checks**:
12851285

@@ -1289,8 +1289,8 @@ Privileged server-to-server endpoints with JWT authentication, **no permission c
12891289
**Server Request Example**:
12901290

12911291
```bash
1292-
# Request to internal server (port 9091)
1293-
curl -X GET http://localhost:9091/internal/organizations/123456789 \
1292+
# Request to internal server (port 9092)
1293+
curl -X GET http://localhost:9092/internal/organizations/123456789 \
12941294
-H "Authorization: Bearer eyJhbGc...(server JWT)"
12951295
```
12961296

@@ -1303,7 +1303,7 @@ curl -X GET http://localhost:9091/internal/organizations/123456789 \
13031303

13041304
#### Key Differences
13051305

1306-
| Aspect | Public Server (3000) | Internal Server (9091) |
1306+
| Aspect | Public Server (9090) | Internal Server (9092) |
13071307
| ------------------ | -------------------------- | ----------------------------- |
13081308
| **Authentication** | Session cookies | Server JWTs (EdDSA) |
13091309
| **Authorization** | Permission checks required | No permission checks |

docs/deployment.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ This guide provides instructions for deploying the InferaDB Management API in pr
1414
- Storage: Minimal (logs only, data in RAM)
1515

1616
- **Network**:
17-
- HTTP port (default: 3000) - Management REST API
18-
- gRPC port (default: 3001) - Internal gRPC server
17+
- Public REST port (default: 9090) - Client-facing REST API
18+
- Public gRPC port (default: 9091) - Client-facing gRPC server
19+
- Internal REST port (default: 9092) - Server-to-server communication (JWKS, etc.)
1920
- Outbound access to:
2021
- InferaDB policy engine (gRPC)
2122
- SMTP server (for email)
@@ -98,30 +99,32 @@ email:
9899
export SMTP_PASSWORD="your-password"
99100
```
100101

101-
#### Server API Endpoint
102+
#### Policy Service (InferaDB Server) Endpoint
102103

103104
```yaml
104-
server_api:
105-
grpc_endpoint: "https://policy-engine.example.com:8080"
105+
policy_service:
106+
service_url: "https://policy-engine.example.com"
107+
grpc_port: 8081
108+
internal_port: 8082
106109
tls_enabled: true
107110
```
108111

109-
**Action**: Point to your InferaDB policy engine gRPC endpoint. Enable TLS in production.
112+
**Action**: Point to your InferaDB policy engine. The `service_url` is the base URL, and ports specify gRPC (for policy operations) and internal REST (for webhooks). Enable TLS in production.
110113

111114
### 3. Environment-Specific Overrides
112115

113116
Use environment variables to override sensitive configuration:
114117

115118
```bash
116-
# Key encryption secret
117-
export KEY_ENCRYPTION_SECRET="your-32-byte-secret"
119+
# Key encryption secret (use INFERADB_MGMT__ prefix for all config overrides)
120+
export INFERADB_MGMT__AUTH__KEY_ENCRYPTION_SECRET="your-32-byte-secret"
118121
119122
# SMTP credentials
120-
export SMTP_USERNAME="smtp-user"
121-
export SMTP_PASSWORD="smtp-pass"
123+
export INFERADB_MGMT__EMAIL__SMTP_USERNAME="smtp-user"
124+
export INFERADB_MGMT__EMAIL__SMTP_PASSWORD="smtp-pass"
122125
123126
# Worker ID (for multi-instance deployments)
124-
export WORKER_ID="0"
127+
export INFERADB_MGMT__ID_GENERATION__WORKER_ID="0"
125128
```
126129

127130
## Single-Instance Deployment
@@ -158,7 +161,13 @@ spec:
158161
ports:
159162
- name: http
160163
port: 80
161-
targetPort: 3000
164+
targetPort: 9090
165+
- name: grpc
166+
port: 9091
167+
targetPort: 9091
168+
- name: internal
169+
port: 9092
170+
targetPort: 9092
162171
type: LoadBalancer
163172
164173
---

0 commit comments

Comments
 (0)