feat: implement customer add handler#25
Open
alanshaw wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for the /customer/add UCAN command in Sprue so the service can accept customer records (e.g., from Hilt/fil.one) and persist them via the configured customer store implementation.
Changes:
- Implement
/customer/addhandler with subject validation (must target the service DID) and customer-store persistence. - Add unit tests covering success, wrong-subject rejection, and duplicate-customer behavior.
- Wire the new handler into the Fx
ucan_handlersgroup and bumplibforgeto the required version.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/service/handlers/customer_add.go | New /customer/add route handler validating invocation subject and writing to customer.Store. |
| pkg/service/handlers/customer_add_test.go | Tests for handler success, invalid subject failure, and duplicate customer failure. |
| internal/fx/service/handlers/provider.go | Registers NewCustomerAddHandler in the ucan_handlers Fx group. |
| go.mod | Updates github.com/fil-forge/libforge dependency version. |
| go.sum | Adds checksums for the updated libforge version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bajtos
reviewed
Jun 25, 2026
bajtos
left a comment
Contributor
There was a problem hiding this comment.
I'd like to resolve the discussion in fil-forge/libforge#40 and fil-forge/hilt#3 before reviewing this one.
121d680 to
566c8c5
Compare
Member
Author
|
@bajtos GTG now? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
/customer/addhandler, which allows Hilt to inject customers from fil.one into Sprue.Depends on: