Skip to content

Commit be6c536

Browse files
authored
Merge pull request #14 from devonartis/fix/dead-internal-paths
Refs devonartis/agentwrit#31
2 parents 10d384a + 38b153c commit be6c536

14 files changed

Lines changed: 44 additions & 46 deletions

src/agentwrit/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
entry point, Agent is an ephemeral per-task principal created by the app.
55
All agent authority flows from the app's scope ceiling set by the operator.
66
7-
Spec: .plans/specs/NEW_SPECS_TO_USED.md
8-
ADRs: .plans/specs/SPEC_ADR.md (SDK-001 through SDK-012)
97
"""
108

119
from __future__ import annotations

tests/sdk-core/evidence/story10_natural_expiry.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WHY: Broker must enforce TTL even if the agent disappears
88
EXPECTED: Token valid immediately, invalid after expiry,
99
broker returns 'token is invalid or expired'
1010
=================================================================
11-
agent_id: spiffe://agentauth.local/agent/short-lived-service/quick-task-001/3602e8aa5e82ef38
11+
agent_id: spiffe://agentwrit.local/agent/short-lived-service/quick-task-001/7cf9a9d996cdd63d
1212
scope: ['read:data:temp-resource']
1313
token: eyJhbGciOiJFZERTQSIsInR5cCI6Ik...
1414
expires_in: 5s (requested 5s)

tests/sdk-core/evidence/story11_rfc7807_error.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ WHY: Developers need actionable error info, not raw HTTP
88
EXPECTED: AuthorizationError contains ProblemDetail with
99
type, title, status, detail, and error_code
1010
=================================================================
11-
Agent A: spiffe://agentauth.local/agent/error-test/trigger-403/060f75ca7d5a32db
11+
Agent A: spiffe://agentwrit.local/agent/error-test/trigger-403/2eefc09f1143bb0e
1212
Agent A scope: ['read:data:only-this']
1313

1414
Triggering 403 by delegating scope agent doesn't have...
1515
Caught: AuthorizationError
1616
exception.status_code: 403
1717

1818
ProblemDetail fields:
19-
type: urn:agentauth:error:scope_violation
19+
type: urn:agentwrit:error:scope_violation
2020
title: Forbidden
2121
status: 403
2222
detail: delegated scope exceeds delegator scope
2323
instance: /v1/delegate
2424
error_code: scope_violation
25-
request_id: bd4b257e53efe7f2
25+
request_id: 44e1b6e877801b01
2626
hint: None
2727

2828
PASS: status_code is 403
29-
PASS: type is present: urn:agentauth:error:scope_violation
29+
PASS: type is present: urn:agentwrit:error:scope_violation
3030
PASS: title is present: Forbidden
3131
PASS: detail is present: delegated scope exceeds delegator scope
3232
PASS: error_code is present: scope_violation

tests/sdk-core/evidence/story12_multi_agent_isolation.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ WHY: Compromised agent A cannot access agent B's data
88
EXPECTED: 3 unique SPIFFE IDs, 3 non-overlapping scopes,
99
scope_is_subset confirms no cross-access
1010
=================================================================
11-
Agent: spiffe://agentauth.local/agent/multi-agent-service/read-customers/0c1591e7c0c444dd
11+
Agent: spiffe://agentwrit.local/agent/multi-agent-service/read-customers/2fe3952df998df75
1212
task_id: read-customers
1313
scope: ['read:data:customers-west']
1414
token: eyJhbGciOiJFZERTQSIsInR5cCI6Ik...
15-
Agent: spiffe://agentauth.local/agent/multi-agent-service/read-inventory/1544cfa5533fbe1c
15+
Agent: spiffe://agentwrit.local/agent/multi-agent-service/read-inventory/a4533026580f7a0f
1616
task_id: read-inventory
1717
scope: ['read:data:inventory-warehouse-3']
1818
token: eyJhbGciOiJFZERTQSIsInR5cCI6Ik...
19-
Agent: spiffe://agentauth.local/agent/multi-agent-service/write-reports/c3f99bc97cde4bb1
19+
Agent: spiffe://agentwrit.local/agent/multi-agent-service/write-reports/f9af4372b1008b83
2020
task_id: write-reports
2121
scope: ['write:data:quarterly-report-q3']
2222
token: eyJhbGciOiJFZERTQSIsInR5cCI6Ik...
@@ -34,13 +34,13 @@ EXPECTED: 3 unique SPIFFE IDs, 3 non-overlapping scopes,
3434

3535
Validating each agent's token:
3636
agent[0] (read-customers): valid=True
37-
sub: spiffe://agentauth.local/agent/multi-agent-service/read-customers/0c1591e7c0c444dd
37+
sub: spiffe://agentwrit.local/agent/multi-agent-service/read-customers/2fe3952df998df75
3838
scope: ['read:data:customers-west']
3939
agent[1] (read-inventory): valid=True
40-
sub: spiffe://agentauth.local/agent/multi-agent-service/read-inventory/1544cfa5533fbe1c
40+
sub: spiffe://agentwrit.local/agent/multi-agent-service/read-inventory/a4533026580f7a0f
4141
scope: ['read:data:inventory-warehouse-3']
4242
agent[2] (write-reports): valid=True
43-
sub: spiffe://agentauth.local/agent/multi-agent-service/write-reports/c3f99bc97cde4bb1
43+
sub: spiffe://agentwrit.local/agent/multi-agent-service/write-reports/f9af4372b1008b83
4444
scope: ['write:data:quarterly-report-q3']
4545

4646
═══ STORY 12: PASS ═══

tests/sdk-core/evidence/story13_renew_released.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ ACCEPTANCE TEST: STORY 13 — RENEW A RELEASED AGENT
55
WHO: Developer code that tries to renew a dead agent
66
WHAT: Agent was released, then renew() is called
77
WHY: SDK must fail fast with a clear error, not hit broker
8-
EXPECTED: AgentAuthError raised with message about release
8+
EXPECTED: AgentWritError raised with message about release
99
=================================================================
10-
agent_id: spiffe://agentauth.local/agent/lifecycle-test/renew-after-release/383cb9ef845a1c6d
10+
agent_id: spiffe://agentwrit.local/agent/lifecycle-test/renew-after-release/c4733268162b1a1a
1111
scope: ['read:data:test-resource']
1212
expires_in: 300s
1313

1414
release() called — agent is now dead
1515

1616
Attempting renew() on released agent...
17-
Caught: AgentAuthError
17+
Caught: AgentWritError
1818
Message: agent has been released and cannot be renewed
1919

2020
PASS: Error message mentions 'released'
2121

2222
Attempting delegate() on released agent...
23-
Caught: AgentAuthError
23+
Caught: AgentWritError
2424
Message: agent has been released and cannot delegate
2525

2626
PASS: Error message mentions 'released'

tests/sdk-core/evidence/story15_health_check.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ EXPECTED: HealthStatus with status='ok', version, uptime,
1111
health() returned:
1212
status: ok
1313
version: 2.0.0
14-
uptime: 153912s
14+
uptime: 146s
1515
db_connected: True
16-
audit_events_count: 3046
16+
audit_events_count: 96
1717

1818
PASS: Broker status is 'ok'
1919
PASS: Version reported: 2.0.0
20-
PASS: Uptime is 153912s (broker is running)
20+
PASS: Uptime is 146s (broker is running)
2121
PASS: Database is connected
2222

2323
═══ STORY 15: PASS ═══

tests/sdk-core/evidence/story1_create_agent.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WHY: Every agent must have a verifiable identity and scope
88
EXPECTED: Agent has a SPIFFE ID containing the orch_id,
99
and scope matches exactly what was requested
1010
=================================================================
11-
agent_id: spiffe://agentauth.local/agent/data-service/lookup-artis/0162615af9783c2c
11+
agent_id: spiffe://agentwrit.local/agent/data-service/lookup-artis/8d345a20521992c8
1212
scope: ['read:data:customer-artis']
1313
token: eyJhbGciOiJFZERTQSIsInR5cCI6Ik...
1414
expires_in: 300s

tests/sdk-core/evidence/story2_renew_token.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WHY: Tokens expire — renewal keeps the agent alive
88
EXPECTED: New token issued, old token revoked,
99
agent identity (SPIFFE ID) unchanged
1010
=================================================================
11-
agent_id: spiffe://agentauth.local/agent/export-service/export-job-001/afe74b0eb9deb34d
11+
agent_id: spiffe://agentwrit.local/agent/export-service/export-job-001/115c91bed2324aa0
1212
old token: eyJhbGciOiJFZERTQSIsInR5cCI6Ik...
1313
old expires_in: 300s
1414

tests/sdk-core/evidence/story3_release_token.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WHAT: Agent calls release() to revoke its own token
77
WHY: Dead tokens cannot be misused if leaked
88
EXPECTED: Token revoked at broker, second release() is safe
99
=================================================================
10-
agent_id: spiffe://agentauth.local/agent/cleanup-service/cleanup-job-001/f5046a50e548fc1c
10+
agent_id: spiffe://agentwrit.local/agent/cleanup-service/cleanup-job-001/1e5a9b06e79c23dc
1111
token: eyJhbGciOiJFZERTQSIsInR5cCI6Ik...
1212
expires_in: 300s
1313

tests/sdk-core/evidence/story4_validate_token.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ WHY: Zero-trust — never assume a token is valid
88
EXPECTED: Broker returns valid=true with claims that
99
match the agent's scope, identity, and task
1010
=================================================================
11-
agent_id: spiffe://agentauth.local/agent/reporting-service/quarterly-report/d100ed335e95cd8a
11+
agent_id: spiffe://agentwrit.local/agent/reporting-service/quarterly-report/f49ff998df436800
1212
scope: ['read:data:report-q3', 'write:data:summary-q3']
1313

1414
validate() returned: valid=True
15-
iss: agentauth
16-
sub: spiffe://agentauth.local/agent/reporting-service/quarterly-report/d100ed335e95cd8a
15+
iss:
16+
sub: spiffe://agentwrit.local/agent/reporting-service/quarterly-report/f49ff998df436800
1717
scope: ['read:data:report-q3', 'write:data:summary-q3']
1818
orch_id: reporting-service
1919
task_id: quarterly-report
20-
jti: fa81df2f42570e0eff9ad5c9b9488993
21-
exp: 1775583493
22-
iat: 1775583193
20+
jti: de250a1c0bfb2123c3b0cc52d7da360f
21+
exp: 1776198669
22+
iat: 1776198369
2323

2424
PASS: Claims scope matches requested ['read:data:report-q3', 'write:data:summary-q3']
2525
PASS: Claims sub matches agent_id

0 commit comments

Comments
 (0)