Repository navigation
feat(imports): import webhooks with per-namespace tokens - #155
Merged
Merged
Conversation
A namespace's owners make import webhooks (name, optional collection and pipeline) and get a token shown once; only its hash is kept. Anything with the token can POST /api/v1/hooks/import a file (raw body or multipart), a web address or text, which lands in the namespace as an upload or import would, audited as the hook. Hooks can be paused, re-keyed or deleted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012n4GFU7rnEd6r6S44JXnYa
Owner
Author
|
Local CI: green. The self-hosted runner is down, so I replayed every PR job from Local CI on PR #155 head db1b7b1 merged into main f69d6af, 2026-10-05 08:28 UTC
Generated by Claude Code |
4 of 8 tasks
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.
Requested by Adeel · project thread
Description
Before: to get something into Lens you had to sign in and upload it, or set up a watched source. Other services (a scanner, a phone shortcut, Zapier/n8n, a conversion node) had no way to push files in.
After: a namespace's owners can make import webhooks. Each has its own token (shown once, only a hash kept), and anything with the token can
POST /api/v1/hooks/import:?filename=,Content-DispositionorX-Filename), or multipart form files: audio, video, documents and images go through the same path as uploads (dedupe, encryption at rest, the namespace's pipeline);.srt/.vtt/.json/.jsonl/.icsare imported as transcripts;{url}: a PDF link or web page kept as a document (pages need Chromium; a PDF link doesn't);{text}: imported as a transcript, like pasted text.Hooks can be paused, given a new token, or deleted under
/api/v1/namespaces/{name}/import-hooks. Each import is audited asimport.hookunder the hook (import_hook:<id>), not a person.How: a new
import_hooktable andapp/domain/import_hooks.py; files are spooled to the uploads disk (bounded byuploads.max_mb) and handed to a newuploads.take(), which runs the normal upload finish. The web app page to manage hooks follows in the next PR; a callback for a remote conversion node after that.Motivation and Context
Adeel asked for an import webhook alongside offloading conversion to a separate anytopdf node, keeping Lens light on a Raspberry Pi. Nothing heavy is added: no new dependency, no background work.
Types of changes
!in the title)Checklist:
tests/api/test_import_hooks.py; full backend suite passes locally excepttest_conversion's Office case, which fails on main too in this container's LibreOffice).docs/accordingly (docs/api.md#import-webhooks).## UnreleasedinCHANGELOG.md.OpenAPI and the client were regenerated with
make openapi.🤖 Generated with Claude Code
https://claude.ai/code/session_012n4GFU7rnEd6r6S44JXnYa
Generated by Claude Code