GraphRepository: parseAtUri no path-segment validation #45

Closed
opened 2026-06-22 20:10:28 +00:00 by starsetbyte · 0 comments
Owner

What

parseAtUri() used substringBefore("/") and substringAfterLast("/") for AT URI parsing — no validation that the URI has the expected at://did/collection/rkey structure. Malformed URIs (e.g. missing the collection segment) would produce wrong repoDid/rkey pairs for delete operations.

Fix

Now splits on / and requires at least 3 segments (parts.size >= 3) with a clear error message. Uses parts[0] and parts.last() for explicit indexing.

Fixed in PR #36.

## What `parseAtUri()` used `substringBefore("/")` and `substringAfterLast("/")` for AT URI parsing — no validation that the URI has the expected `at://did/collection/rkey` structure. Malformed URIs (e.g. missing the collection segment) would produce wrong repoDid/rkey pairs for delete operations. ## Fix Now splits on `/` and requires at least 3 segments (`parts.size >= 3`) with a clear error message. Uses `parts[0]` and `parts.last()` for explicit indexing. **Fixed in PR #36.**
starsetbyte 2026-06-22 20:10:28 +00:00
Sign in to join this conversation.
No description provided.