Skip to content

Feature: Storage Anchor#164

Closed
sephynox wants to merge 35 commits intofeat/encrypted-container-v3from
feat/storage-anchor
Closed

Feature: Storage Anchor#164
sephynox wants to merge 35 commits intofeat/encrypted-container-v3from
feat/storage-anchor

Conversation

@sephynox
Copy link
Contributor

@sephynox sephynox commented Jan 26, 2026

Summary

This PR introduces a new storage anchor service:

  • API with PUT, GET, DELETE, and SEARCH operations
  • Path-based namespacing (/user//...) with owner-enforced access control
  • 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
  • Namespace validators for content validation (e.g., user icons)

Key Changes

Encrypted Container (src/lib/encrypted-container.ts)

  • Added RFC 5652 CMS SignerInfo support for author signatures
  • Added structured error handling with EncryptedContainerError and typed error codes

Storage Service (src/services/storage/)

  • Server (server.ts): HTTP server implementation with authenticated endpoints
  • Client (client.ts): Client SDK with provider discovery
  • Memory Backend (drivers/memory.ts): In-memory backend with atomic operations (copy-on-write)

@sephynox sephynox self-assigned this Jan 26, 2026
@sephynox sephynox added the enhancement New feature or request label Jan 26, 2026
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

Introduces a new Storage Anchor service with HTTP server + client support, including path-based object storage, quota reporting, namespace validation, and public access via pre-signed URLs. It also extends the resolver metadata model and enhances EncryptedContainer with structured error handling and optional signing.

Changes:

  • Added Storage Anchor server routes (put/get/delete/search/quota/public) with quota/validator hooks and service metadata publishing.
  • Added Storage Anchor client/provider for discovery via resolver, CRUD operations, search/quota, and pre-signed public URLs.
  • Extended core libraries: resolver types/lookup, error deserialization mapping, and EncryptedContainer error/signing support (with tests).

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/services/storage/server.ts Implements Storage Anchor HTTP API endpoints and publishes storage service metadata
src/services/storage/server.test.ts Adds basic server/serviceMetadata and error-path tests
src/services/storage/lib/validators.ts Adds namespace validator framework + built-in icon validator
src/services/storage/lib/validators.test.ts Tests validator matching and icon validation logic
src/services/storage/common.ts Defines storage types, requests/responses, signing data, and storage-specific errors
src/services/storage/common.test.ts Adds path utility tests and an in-memory backend for test usage
src/services/storage/client.ts Adds resolver-driven client/provider with signed requests and public URL generation
src/services/storage/client.test.ts Adds integration-style tests for provider discovery and CRUD/search/quota/public flows
src/lib/utils/tests/node.ts Adds helper to publish resolver metadata in tests
src/lib/resolver.ts Extends resolver metadata schema and lookup logic for storage services
src/lib/resolver.test.ts Refactors to reuse shared resolver-metadata helper
src/lib/error.ts Registers storage service errors for JSON deserialization
src/lib/encrypted-container.ts Adds structured error type/codes and optional signing (v3) support
src/lib/encrypted-container.test.ts Updates tests for buffer conversions + adds error/signing coverage
src/client/index.ts Exposes Storage client entrypoint alongside other service clients

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

Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.

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

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

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

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

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

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

@sephynox sephynox requested a review from Copilot January 27, 2026 23:46
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

Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.

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

Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.

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

Copilot reviewed 22 out of 23 changed files in this pull request and generated 6 comments.

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

Copilot reviewed 22 out of 23 changed files in this pull request and generated 6 comments.

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

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

@sephynox sephynox requested a review from rkeene January 31, 2026 00:21
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@sephynox sephynox changed the base branch from main to feat/encrypted-container-v3 February 2, 2026 21:02
@sephynox sephynox closed this Feb 2, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2026

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.

2 participants