Repository navigation
feat: open URL inputs with protocol options and headers - #14
Conversation
Adapters take optional options and headers, placed before every URL input on the ffmpeg and ffprobe command lines. A local file is opened without them, since ffmpeg refuses a protocol option it has no use for. Header values are a credential, so the command a failure reports carries a mask in their place. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Code review
Adds protocol options and custom request headers to remote FFmpeg and FFprobe inputs, while leaving local-file inputs unchanged. It also masks the Note Not approving while a bug finding is open: Redact headers from captured error output too Findings (1)
Fix with agent prompt### Issue 1
src/Video/Process.php:194
**Redact headers from captured error output too**
At `DEBUG`, libavformat can write its serialized HTTP request, including custom headers, to stderr. This passes that tail unchanged into `Runtime::output()`, so a failed request can expose the credential even though `command()` is masked; redact header values in captured diagnostics too.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Walkthrough (8)
Reviewed Tip Comment |
| throw new Runtime( | ||
| 'Command "'.$command[0].'" failed with exit code '.$status, | ||
| $command, | ||
| self::masked($command), |
There was a problem hiding this comment.
Redact headers from captured error output too
At DEBUG, libavformat can write its serialized HTTP request, including custom headers, to stderr. This passes that tail unchanged into Runtime::output(), so a failed request can expose the credential even though command() is masked; redact header values in captured diagnostics too.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Video/Process.php
Line: 194
Comment:
**Redact headers from captured error output too**
At `DEBUG`, libavformat can write its serialized HTTP request, including custom headers, to stderr. This passes that tail unchanged into `Runtime::output()`, so a failed request can expose the credential even though `command()` is masked; redact header values in captured diagnostics too.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · security · Reply if this doesn't apply.

What
Adapters take two new optional constructor arguments, placed before every URL input on the ffmpeg and ffprobe command lines:
options: protocol options by ffmpeg's own names, for example['request_size' => 1048576, 'multiple_requests' => 1].headers: request headers, for a source that wants a credential the URL cannot carry.Why
ffmpeg asks an HTTP source for everything from an offset to the end of the file. A source that answers in bounded pieces needs to be asked for pieces (
request_size), and one behind an API key needs a header. The Appwrite videos worker needs both to read encrypted uploads through the Storage download endpoint.Behaviour
-request_sizefor a file input.Runtimeexception reports carries***in place of the-headersvalue.Tests
RemoteTest): every range the test server logs is no larger thanrequest_size; a guarded URL is only readable with its header; a failed command does not report the header value.pintandphpstanare clean.Release
Needs a
0.0.7tag after merge. appwrite/appwrite pins this branch until then.🤖 Generated with Claude Code