Skip to content

Feature: Storage Anchor#173

Open
sephynox wants to merge 5 commits intostorage-anchor-basefrom
feat/storage-anchor-split
Open

Feature: Storage Anchor#173
sephynox wants to merge 5 commits intostorage-anchor-basefrom
feat/storage-anchor-split

Conversation

@sephynox
Copy link
Contributor

@sephynox sephynox commented Feb 2, 2026

Summary

This PR introduces a new storage anchor service:

  • API with PUT, GET, DELETE, and SEARCH operations
  • PathPolicy handles policies for anchor path management
  • Client-side encryption via EncryptedContainer with optional author signing (RFC 5652 CMS SignerInfo)
  • Public/private visibility with pre-signed URLs for anonymous public access
  • Quota enforcement with configurable limits per object size, object count, and total storage

Key Changes

  • Server (server.ts): HTTP server implementation with authenticated endpoints
  • Client (client.ts): Client SDK with provider discovery

@sephynox sephynox requested a review from rkeene February 2, 2026 21:58
@sephynox sephynox self-assigned this Feb 2, 2026
@sephynox sephynox added the enhancement New feature or request label Feb 2, 2026
@sephynox sephynox requested a review from Copilot February 2, 2026 21:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a comprehensive storage anchor service that provides encrypted object storage with PUT, GET, DELETE, and SEARCH operations. The implementation includes client-side encryption via EncryptedContainer, path-based access control policies, public/private visibility with pre-signed URLs, and quota enforcement with configurable limits.

Changes:

  • Server implementation with authenticated HTTP endpoints and validation framework
  • Client SDK with provider discovery and session-based API
  • Memory backend with atomic operations and upload reservation system

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/services/storage/test-utils.ts Test utilities including TestPathPolicy for path validation and MemoryStorageBackend for testing
src/services/storage/test-utils.test.ts Comprehensive test suite for MemoryStorageBackend operations and path traversal prevention
src/services/storage/server.ts HTTP server implementation with PUT/GET/DELETE/SEARCH endpoints and pre-signed URL support
src/services/storage/server.test.ts Server integration tests covering authorization, validation, and security scenarios
src/services/storage/lib/validators.ts Namespace validator framework for content validation with glob pattern matching
src/services/storage/lib/validators.test.ts Tests for validator pattern matching and content validation logic
src/services/storage/common.ts Shared types, error classes, and backend interfaces for storage service
src/services/storage/common.test.ts Tests for path policy validation and parsing
src/services/storage/client.ts Client SDK with provider discovery, session API, and operation methods
src/services/storage/client.test.ts Client integration tests covering CRUD operations, search, quota, and sessions
src/lib/utils/tests/node.ts Added setResolverInfo helper for test setup
src/lib/resolver.ts Added storage service type definitions and lookup implementation
src/lib/resolver.test.ts Refactored to use shared setResolverInfo helper
src/lib/http-server/index.ts Added wildcard route support with priority for exact matches
src/lib/http-server/index.test.ts Tests for wildcard routing behavior
src/lib/error.ts Registered storage error classes for deserialization
src/client/index.ts Exported Storage namespace with client config and class
Comments suppressed due to low confidence (1)

src/services/storage/server.ts:1

  • Parameter prefixed with _ignore suggests it's intentionally unused, but the parameter name operation would be clearer if the underscore prefix is removed or the entire parameter name is _operation to match project conventions for unused parameters.
import type { ServiceMetadata } from '../../lib/resolver.ts';

@sephynox sephynox changed the base branch from feat/encrypted-container-v3 to feat/http-wildcard-routes February 3, 2026 18:27
@sephynox sephynox force-pushed the feat/http-wildcard-routes branch from 3340788 to 8053c1a Compare February 3, 2026 19:52
@sephynox sephynox force-pushed the feat/storage-anchor-split branch 2 times, most recently from b787490 to 627be64 Compare February 3, 2026 20:17
@sephynox sephynox force-pushed the feat/storage-anchor-split branch from 627be64 to 7d5652c Compare February 3, 2026 20:26
@sephynox sephynox changed the base branch from feat/http-wildcard-routes to storage-anchor-base February 3, 2026 20:26
Comment on lines +206 to +212
quotas?: {
maxObjectSize: number;
maxObjectsPerUser: number;
maxStoragePerUser: number;
maxSearchLimit: number;
maxSignedUrlTTL: number;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Determine if these should be here.

Comment on lines +298 to +300
'storage': {
/* No search criteria - TODO? */
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: How should we search?

* Full storage backend combining all capabilities.
* Use this type when a backend supports CRUD, search, and quota management.
*/
export type FullStorageBackend = StorageBackend & SearchableStorage & QuotaManagedStorage;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Support partial backends?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant