feat: accept passwords for encrypted OOXML files - #103
Draft
patriksimms wants to merge 1 commit into
Draft
Conversation
Summary: - decrypt password-protected OOXML before format detection and conversion - expose optional passwords through Node, Python, wasm, and the CLI - cover successful, missing, and incorrect password behavior with fixtures Rationale: - callers with a known password can now convert encrypted Office files without changing the existing behavior for callers without one - explicit Rust variants preserve compatibility with existing signatures Tests: - cargo fmt --all --check - cargo clippy --workspace --all-targets --all-features -- -D warnings - cargo test --locked - npm run build && npm test (node) - maturin build --release --locked and Python unit tests Closes firecrawl#102 AI-Assisted: true AI-Agent: codex AI-Model: openai/gpt-5.6-sol
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.
Problem
Callers who know the password for an encrypted OOXML document cannot convert it through anydoc's bindings or CLI.
Solution
Decrypt encrypted OOXML before detecting and parsing its inner format. Expose optional passwords in the Node, Python, and wasm bindings, plus
--passwordandANYDOC_PASSWORDin the CLI. Existing calls and encrypted-error behavior remain unchanged when no valid password is supplied.Closes #102
Validation
cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --lockedDelivery
No configuration or deployment changes are required.
Changes were made with Codex in T3 Code using
openai/gpt-5.6-sol.Summary by cubic
Adds password support for encrypted OOXML (DOCX/XLSX/PPTX) so callers can convert when they know the password. Previously these files always returned an 'encrypted' error; now they convert with a correct password, and still return 'encrypted' with no or wrong password. Implements #102.
toMarkdown(path, password?),toMarkdownBytes(bytes, format?, password?), andtoDocument(bytes, format?, password?). CLI adds--passwordandANYDOC_PASSWORDin@firecrawl/anydoc. Types updated.passwordkwarg added toto_markdown,to_markdown_bytes, andto_document.passwordarg added totoMarkdownBytesandtoDocument.to_markdown_with_password,to_markdown_bytes_with_password, andto_document_with_password. Existing signatures are unchanged.office-cryptoto decrypt before format detection; the decrypted content decides the format.Review notes
prepare_inputinsrc/lib.rs: if OLE-encrypted OOXML is detected and a password is provided, decrypt withoffice-crypto, then detect the inner format and proceed; otherwise returnEncrypted.Written for commit d3e6b4e. Summary will update on new commits.