Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:latest
FROM node:22-bookworm-slim
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD ["npm", "run", "start-aggregation"]
CMD ["npm", "run", "start"]
36,911 changes: 36,911 additions & 0 deletions aggregator_resource_used-2026-04-16-15-06-50.csv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions aggregator_resource_used-2026-04-17-08-48-53.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
timestamp, cpu_user, cpu_system, rss, heapTotal, heapUsed, external
1 change: 1 addition & 0 deletions aggregator_resource_used-2026-04-17-08-52-40.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
timestamp, cpu_user, cpu_system, rss, heapTotal, heapUsed, external
1 change: 1 addition & 0 deletions aggregator_resource_used-2026-04-17-08-53-34.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
timestamp, cpu_user, cpu_system, rss, heapTotal, heapUsed, external
11 changes: 11 additions & 0 deletions benchmark-input/flow.query.rspql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PREFIX saref: <https://saref.etsi.org/core/>
PREFIX : <https://rsp.js/>

REGISTER RStream <output> AS
SELECT (AVG(?o) AS ?avgValue)
FROM NAMED WINDOW :w1 ON STREAM <http://localhost:3000/alice/acc-x/> [RANGE 20000 STEP 5000]
WHERE {
WINDOW :w1 {
?s saref:hasValue ?o .
}
}
1 change: 1 addition & 0 deletions benchmark-input/flow.targets.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://localhost:3000/alice/acc-x/bfa2f1f1-bc44-466d-aa54-69b0394818b4
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
id,group,status,avg_total_flow_latency_ms,p95_total_flow_latency_ms,avg_initial_challenge_latency_ms,avg_token_exchange_latency_ms,avg_authorized_request_latency_ms,avg_http_round_trips,avg_network_ms,avg_cpu_ms,summary_path,note
simple_localhost_warm,simple-vs-complex,failed,,,,,,,,,,"[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
complex_localhost_warm,simple-vs-complex,failed,,,,,,,,,,"[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
simple_localhost_cold,cold-vs-warm,failed,,,,,,,,,,"[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
simple_localhost_warm_compare,cold-vs-warm,failed,,,,,,,,,,"[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
simple_localhost_no_reuse,reuse-vs-no-reuse,failed,,,,,,,,,,"[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
simple_localhost_reuse,reuse-vs-no-reuse,failed,,,,,,,,,,"[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
simple_distributed_no_reuse,localhost-vs-distributed,skipped,,,,,,,,,,"Set PANDA_UMA_RESOURCE_DISTRIBUTED and PANDA_UMA_AUTH_SERVER_DISTRIBUTED."
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"matrix_id": "2026-04-16T13-08-41-857Z",
"generated_at": "2026-04-16T13:08:42.407Z",
"output_dir": "/Users/kushbisen/Code/PANDA Platform/PANDA/benchmark-results/uma-latency-matrix-2026-04-16T13-08-41-857Z",
"base_config": {
"resource": "http://localhost:3000/ruben/private/derived/age",
"claimToken": "http://localhost:3000/alice/profile/card#me",
"authServer": "http://localhost:4000/uma",
"iterations": 22,
"warmupIterations": 2,
"interIterationDelayMs": 150,
"traceTimings": true
},
"scenarios": [
{
"id": "simple_localhost_warm",
"group": "simple-vs-complex",
"description": "Simple UMA ticket request, localhost, warm run.",
"status": "failed",
"error": "[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
},
{
"id": "complex_localhost_warm",
"group": "simple-vs-complex",
"description": "Complex ODRL token request from JSON file, localhost, warm run.",
"status": "failed",
"error": "[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
},
{
"id": "simple_localhost_cold",
"group": "cold-vs-warm",
"description": "Simple UMA request, cold run (no warmup iterations).",
"status": "failed",
"error": "[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
},
{
"id": "simple_localhost_warm_compare",
"group": "cold-vs-warm",
"description": "Simple UMA request, warm run (configured warmup iterations).",
"status": "failed",
"error": "[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
},
{
"id": "simple_localhost_no_reuse",
"group": "reuse-vs-no-reuse",
"description": "Simple UMA request without token reuse.",
"status": "failed",
"error": "[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
},
{
"id": "simple_localhost_reuse",
"group": "reuse-vs-no-reuse",
"description": "Simple UMA request with token reuse enabled.",
"status": "failed",
"error": "[benchmark:uma-odrl] FAILED: Account login failed (403) for ruben@example.org."
},
{
"id": "simple_distributed_no_reuse",
"group": "localhost-vs-distributed",
"description": "Simple UMA request against distributed endpoints (no token reuse).",
"status": "skipped",
"reason": "Set PANDA_UMA_RESOURCE_DISTRIBUTED and PANDA_UMA_AUTH_SERVER_DISTRIBUTED."
}
]
}
158 changes: 158 additions & 0 deletions documents/EXACT_CURL_COMMANDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# EXACT CURL COMMANDS FOR DERIVED RESOURCE AUTHORIZATION TEST

**STATUS**: Script created at `/PANDA/scripts/uma/EXACT_TEST_COMMANDS.sh`

**REQUIREMENT**: CSS pod server (localhost:3000) and UMA authorization server (localhost:4000) must be running

## Configuration Verification from Source Code

### 1. Token Endpoint - VERIFIED

**Verified location**: [user-managed-access/packages/css/config/seed.json](user-managed-access/packages/css/config/seed.json#L9)

```json
{
"authz": {
"server": "http://localhost:4000/uma"
}
}
```

**Conclusion**: Token endpoint is `http://localhost:4000/uma/token` ✅

---

### 2. Claim Token Format - VERIFIED

**Verified location**: [user-managed-access/packages/uma/src/credentials/Formats.ts](user-managed-access/packages/uma/src/credentials/Formats.ts#L2-L3)

```typescript
export const JWT = 'urn:solidlab:uma:claims:formats:jwt';
export const UNSECURE = 'urn:solidlab:uma:claims:formats:webid';
```

**Usage in tests**: [policy-aware-decentralized-stream-replayer/src/scripts/UMA-test/uma-ODRL.ts](policy-aware-decentralized-stream-replayer/src/scripts/UMA-test/uma-ODRL.ts#L8)

```typescript
const claim_token_format = 'urn:solidlab:uma:claims:formats:webid'
```

**Conclusion**: Claim token format is `urn:solidlab:uma:claims:formats:webid` (NOT JWT) ✅

---

### 3. Claim Token Type - VERIFIED

**Verified location**: [policy-aware-decentralized-stream-replayer/src/scripts/UMA-test/uma-ODRL.ts](policy-aware-decentralized-stream-replayer/src/scripts/UMA-test/uma-ODRL.ts#L6)

```typescript
const claim_token = "http://n063-04b.wall2.ilabt.iminds.be/replayer#me"
```

**Conclusion**: Claim token is a plain WebID URL (e.g., `http://localhost:3000/bob/profile/card#me`) ✅

---

## Exact CURL Commands

### COMMAND 1: Create Policy

```bash
curl -X POST http://localhost:3000/alice/settings/policies/ \
-H "Content-Type: text/turtle" \
-d @/tmp/derived-acc-x-policy.ttl
```

**Expected Response**: `201 Created` with `Location` header

---

### COMMAND 2: Tokenless GET (Get UMA Challenge)

```bash
curl -v http://localhost:3000/alice/derived/acc-x/
```

**Expected Response**: `403 Forbidden` with `WWW-Authenticate` header containing UMA ticket

```
HTTP/1.1 403 Forbidden
WWW-Authenticate: UMA realm="http://localhost:4000/uma", error="insufficient_scope", error_description="...", ticket="<ticket_value>"
```

---

### COMMAND 3: Exchange Ticket for Access Token

```bash
curl -X POST http://localhost:4000/uma/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=urn:ietf:params:oauth:grant-type:uma-ticket" \
-d "ticket=<TICKET_FROM_STEP_2>" \
-d "claim_token=http://localhost:3000/bob/profile/card#me" \
-d "claim_token_format=urn:solidlab:uma:claims:formats:webid"
```

**Expected Response**: `200 OK` with JSON body

```json
{
"access_token": "rpt_...",
"token_type": "Bearer",
"expires_in": 1800
}
```

---

### COMMAND 4: Authorized Retry with Bearer Token

```bash
curl -v -H "Authorization: Bearer <ACCESS_TOKEN_FROM_STEP_3>" \
http://localhost:3000/alice/derived/acc-x/
```

**Expected Response**: `200 OK` with resource data

```
HTTP/1.1 200 OK
Content-Type: text/turtle
...
<resource-data>
```

---

## How to Run the Test

```bash
# Make script executable
chmod +x /Users/kushbisen/Code/PANDA\ Platform/PANDA/scripts/uma/EXACT_TEST_COMMANDS.sh

# Run the test (requires servers running on localhost:3000 and localhost:4000)
bash /Users/kushbisen/Code/PANDA\ Platform/PANDA/scripts/uma/EXACT_TEST_COMMANDS.sh
```

---

## Justification for Configuration

| Setting | Value | Verified From | Reason |
|---------|-------|---------------|--------|
| UMA Token Endpoint | `http://localhost:4000/uma/token` | [seed.json](user-managed-access/packages/css/config/seed.json#L9) | CSS package explicitly configures UMA on port 4000 |
| Claim Token Format | `urn:solidlab:uma:claims:formats:webid` | [Formats.ts](user-managed-access/packages/uma/src/credentials/Formats.ts#L3) | Defined as UNSECURE constant for plain WebID URLs |
| Claim Token Type | Plain WebID URL | [uma-ODRL.ts](policy-aware-decentralized-stream-replayer/src/scripts/UMA-test/uma-ODRL.ts#L6-L8) | Actual test usage shows WebID, not JWT |

---

## Current Status

❌ **Servers not running** - CSS (localhost:3000) and UMA (localhost:4000) not accessible
✅ **Configuration verified** - All endpoints and formats validated from source code
✅ **Policy file created** - Ready to POST to policy container
✅ **Commands documented** - Exact curl commands provided above

**To get runtime evidence of 200 response:**
1. Start both servers (CSS on :3000, UMA on :4000)
2. Run the test script created above
3. It will display raw curl responses including the final `200 OK`
Loading