Skip to content

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

Merged
datalogics-kam merged 4 commits into
mainfrom
pdfcloud-6569-img-passwords
Oct 19, 2026
Merged

datalogics-kam merged 4 commits into
mainfrom
pdfcloud-6569-img-passwords

Conversation

@datalogics-tsmith

@datalogics-tsmith datalogics-tsmith commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

PDFCLOUD-6569

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.

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 endpoint-owned unit coverage, live success and wrong-password coverage for every image format through both clients, documentation, and an end-to-end example that protects a PDF and converts it to PNG. Live success assertions verify the requested prefix, deterministic output count, MIME type, suffix, size, URL, warning state, and input ID.

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

  • uvx nox -s tests -- -m 'not live' — Python 3.10–3.14 each passed 2,923 tests with 10 expected skips and 95% total coverage
  • Focused live password suite — 20 passed across five formats, correct and incorrect passwords, and both clients
  • Focused image endpoint unit suites — 218 passed
  • uv run ruff format .
  • uv run ruff check .
  • Basedpyright — 0 errors, warnings, or notes with the project virtual environment selected explicitly
  • Client class-function coverage gate — passed at the 90% threshold

Risks and follow-ups

The new argument is optional and uses the existing graphic payload and transport paths, so existing unencrypted conversion calls are unaffected. Route-specific wrong-password behavior is now covered live for every supported output format to catch service drift.

@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pdfrest-python ready!

Name Link
🔨 Latest commit 55adabf
🔍 Latest deploy log https://app.netlify.com/projects/pdfrest-python/deploys/6ad6633308019627e77ea67d
😎 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

@datalogics-kam datalogics-kam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Codex running the pr-review-auditor skill against f411bae..f5837e0.

Requesting changes for the three inline test-coverage and repository-policy findings: cover wrong passwords for all five formats through both clients, strengthen the new live output assertions, and keep client validation cases in the endpoint test modules. No production correctness bug or CI regression was observed.

Validation completed during the audit: non-live tests passed across Python 3.10-3.14, all five client class-function coverage gates passed, all 12 new live password cases passed, and the protected-PDF example passed. Changed-file formatting/lint and basedpyright passed. Repository-wide lint reports only unrelated untracked notebook errors. The complete live suite was not repeated locally; exact-head hosted CI passed it. The PR head is unchanged, and git diff --check passed again before submission.

Please also refresh the PR description: its first-line Jira key disagrees with the branch/title, and the prerequisite/stack and blocked-live-validation text is stale relative to the current diff and passing CI.

Comment thread tests/live/test_live_graphic_conversions.py Outdated
Comment thread tests/live/test_live_graphic_conversions.py Outdated
Comment thread tests/test_graphic_payload_validation.py Outdated
- Verify wrong passwords for every image format through both clients
- Assert live output count, prefix, URL, and warning state
- Keep empty-password client checks in each endpoint test module

Assisted-by: Codex

@datalogics-kam datalogics-kam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed interface by hand. Codex reviewed, and ran the PR Review Auditor.

@datalogics-kam
datalogics-kam merged commit f7df1fd into main Oct 19, 2026
19 checks passed
@datalogics-kam
datalogics-kam deleted the pdfcloud-6569-img-passwords branch October 19, 2026 20:32

This branch was successfully deployed

1 active deployment
ci-live — 55adabf1 Deployed Oct 19, 2026 by datalogics-tsmith via Examples (Python 3.13) #573
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