Skip to content

PDFCLOUD-6569 Add passwords to image conversions- #52 - #53

Open
datalogics-tsmith wants to merge 3 commits into
mainfrom
pdfcloud-6569-img-passwords
Open

datalogics-tsmith wants to merge 3 commits into
mainfrom
pdfcloud-6569-img-passwords

Conversation

@datalogics-tsmith

Copy link
Copy Markdown
Contributor

PDFCLOUD-6559

Why this change

The pdfRest image conversion routes accept an open password for encrypted PDFs, but the Python SDK did not expose that option. Users therefore could not convert password-protected PDFs through the typed BMP, GIF, JPEG, PNG, or TIFF helpers.

Prerequisite: PR #51 must be merged before this PR. This branch is stacked on the joboptions work from that PR.

What changed (high level)

The shared graphic payload now accepts an optional non-empty password, and all five synchronous and asynchronous image helpers pass it through to the service. Keeping the field on the shared payload gives every image format the same validation and serialization behavior.

The change also adds focused unit and live coverage, documents the option, and provides an end-to-end example that protects a PDF and then converts it to PNG.

Behavior changes

Callers can now pass password= to convert_to_bmp, convert_to_gif, convert_to_jpeg, convert_to_png, and convert_to_tiff, including their asynchronous equivalents. Omitting the argument preserves existing behavior; an empty password is rejected locally before transport execution.

This is a backward-compatible public API addition.

Validation

  • uv run pytest -n auto --maxschedchunk 2 -m 'not live' — 2,883 passed and 10 skipped
  • uv run ruff format .
  • uv run ruff check .
  • Basedpyright with an explicit project virtual-environment configuration
  • uv run mkdocs build --strict
  • uv build
  • Manual live service smoke tests converted one password-protected PDF through all five image formats and returned the expected MIME types
  • The new live pytest module was not run end to end because the supplied test credential does not satisfy the SDK's existing UUID-format check; the service accepted it when only that local format check was bypassed

Risks and follow-ups

The primary integration risk is merge ordering: PR #51 must land first because this branch contains its commits. After PR #51 merges, this PR should be refreshed against main so reviewers see only the image-password changes.

The new argument is optional and uses the existing graphic payload and transport paths, so existing unencrypted conversion calls are unaffected.

@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pdfrest-python ready!

Name Link
🔨 Latest commit f5837e0
🔍 Latest deploy log https://app.netlify.com/projects/pdfrest-python/deploys/6ad26a2fa2836c92c64e0bdf
😎 Deploy Preview https://deploy-preview-53--pdfrest-python.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@datalogics-kam
datalogics-kam self-requested a review October 15, 2026 16:59
@datalogics-kam datalogics-kam self-assigned this Oct 15, 2026
- Accept open passwords for PNG, BMP, GIF, JPEG, and TIFF helpers
- Serialize passwords through the shared sync and async payload contract
- Cover request serialization and empty-password rejection

Assisted-by: Codex
- Verify encrypted inputs across PNG, BMP, GIF, JPEG, and TIFF
- Exercise correct passwords through synchronous and asynchronous clients
- Confirm incorrect passwords return an API error

Assisted-by: Codex
- Add a runnable protected-PDF-to-PNG workflow using an open password
- Link the example from the inventory and API guide for discoverability

Assisted-by: Codex

This branch was successfully deployed

1 active deployment
ci-live — f5837e0d Deployed Oct 16, 2026 by datalogics-tsmith via Examples (Python 3.12) #569
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants