This repository was archived by the owner on Nov 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Create "labeling" (package metadata) service #377
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
We need to be able to hang arbitrary metadata off of packages and individual versions of packages. To this end, AC needs a pair of service endpoints that implements more or less a key-value store to store and retrieve arbitrary JSON documents. This should be fairly free-form to start with, but we'll start tightening up the requirements as we progress
We'll start with a few requirements:
- An API key will be required, with the necessary permissions. See the /admin endpoints for an example of how this is currently done. Even read access will require a key with read permissions for the moment.
- Documents should be assigned two internal ids: a ULID or UUIDv7 (haven't decided which) and a hash of their normalized content. Documents should retrievable by either of these, as well as the human-readable key they were uploaded with.
- Keys should be prefixed with the package DID (plc or web) -- any non-matching key should be rejected.
- Bodies should be valid JSON and no larger than 16 Kilobytes. This limit should be configurable, but it will never be large. Large metadata will have to be done in the form of pointers to documents elsewhere (which will have their own requirements, such as signing).
- Multiple documents may be stored under a single key, in an append-only fashion. Deletion of a document by one of its internal ids should be possible with the right permissions, as well as deleting all documents stored under a key.
- Retrieval of documents by key or prefix should return all documents as ndjson, using cursor pagination based on the ULID/UUIDv7 ids.
While Redis is practically made for this purpose, I'd prefer the initial implementation be done with Postgres. We'll research alernative durable KV stores later, which won't rule out Redis, but we'll also consider things like Cassandra, DynamoDB, or possibly more exotic solutions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request