Skip to content

feat: server side support for authorized retrievals#250

Merged
alanshaw merged 12 commits intoash/feat/authorized-retrievals-clientfrom
ash/feat/authorized-retrievals-server
Oct 21, 2025
Merged

feat: server side support for authorized retrievals#250
alanshaw merged 12 commits intoash/feat/authorized-retrievals-clientfrom
ash/feat/authorized-retrievals-server

Conversation

@alanshaw
Copy link
Member

@alanshaw alanshaw commented Oct 9, 2025

This PR add server side support for authorized retrievals. This involves 2 different authorized retrieval types:

  1. Users can send a delegation for retrieving data from a space (per feat: client support for authorized retrievals #249) and it will now be used by the indexer to make a UCAN authorized retrieval (space/content/retrieve) from the relevant node (if not cached).
  2. When an upload service invokes assert/index, the indexer will now obtain a service delegation from the node that is storing the index (using access/grant) before making a UCAN authorized retrieval (blob/retrieve) to obtain the index. See rfc: on-demand service authorization RFC#68 for details of on-demand service retrievals.

TODO: a test for (2)

@alanshaw alanshaw force-pushed the ash/feat/authorized-retrievals-server branch from 6694c43 to 4684250 Compare October 17, 2025 08:53
@alanshaw alanshaw force-pushed the ash/feat/authorized-retrievals-client branch from f4f0e09 to 793f289 Compare October 17, 2025 13:00
@alanshaw alanshaw force-pushed the ash/feat/authorized-retrievals-server branch from c262d19 to 9654108 Compare October 17, 2025 13:09
@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 61.35458% with 97 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/service/service.go 68.00% 28 Missing and 12 partials ⚠️
pkg/service/blobindexlookup/simplelookup.go 57.53% 22 Missing and 9 partials ⚠️
cmd/query.go 0.00% 11 Missing ⚠️
pkg/construct/construct.go 0.00% 9 Missing ⚠️
pkg/server/server.go 66.66% 4 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
pkg/service/blobindexlookup/cachinglookup.go 100.00% <100.00%> (ø)
pkg/types/types.go 94.87% <100.00%> (+2.56%) ⬆️
pkg/server/server.go 38.66% <66.66%> (+1.41%) ⬆️
pkg/construct/construct.go 0.00% <0.00%> (ø)
cmd/query.go 0.00% <0.00%> (ø)
pkg/service/blobindexlookup/simplelookup.go 58.88% <57.53%> (-16.12%) ⬇️
pkg/service/service.go 77.73% <68.00%> (-3.10%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alanshaw alanshaw marked this pull request as ready for review October 17, 2025 14:30
@alanshaw alanshaw requested a review from volmedo as a code owner October 17, 2025 14:30
Copy link
Member

@volmedo volmedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good overall. I think the code is becoming a bit unwieldy but and it'd be nice to do a refactor at some point.

to confirm: the indexing-service can be authorized to retrieve (index) blobs by the node that has the blob or directly by the client, yes? In the latter scenario, Alice would issue a delegation to the indexing-service so it can retrieve from a space they have access to, right?

@alanshaw
Copy link
Member Author

to confirm: the indexing-service can be authorized to retrieve (index) blobs by the node that has the blob or directly by the client, yes? In the latter scenario, Alice would issue a delegation to the indexing-service so it can retrieve from a space they have access to, right?

Yes exactly right.

@alanshaw alanshaw merged commit 1f21462 into ash/feat/authorized-retrievals-client Oct 21, 2025
7 checks passed
@alanshaw alanshaw deleted the ash/feat/authorized-retrievals-server branch October 21, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants