Skip to content

PDFCLOUD-5547 Add PDF encryption and restriction client methods#11

Merged
datalogics-kam merged 11 commits intopdfrest:mainfrom
datalogics-cgreen:pdfcloud-5464-security
Feb 11, 2026
Merged

PDFCLOUD-5547 Add PDF encryption and restriction client methods#11
datalogics-kam merged 11 commits intopdfrest:mainfrom
datalogics-cgreen:pdfcloud-5464-security

Conversation

@datalogics-cgreen
Copy link
Copy Markdown
Contributor

@datalogics-cgreen datalogics-cgreen commented Jan 16, 2026

PDFCLOUD-5547

Overview

This PR adds new client functionality for PDF restriction and encryption workflows, along with full sync/async unit test coverage for each new endpoint.

What’s included

  • New PDF restriction methods (restrict/unrestrict) on the sync and async clients
  • New PDF encryption/decryption methods on the sync and async clients
  • Unit tests for restrict/unrestrict and encrypt/decrypt flows (sync + async parity)

@datalogics-cgreen datalogics-cgreen changed the title PDFCLOUD-5464 Add encryption and restriction tools to pdfRest clients PDFCLOUD-5547 Add encryption and restriction tools to pdfRest clients Jan 30, 2026
@datalogics-cgreen datalogics-cgreen changed the title PDFCLOUD-5547 Add encryption and restriction tools to pdfRest clients PDFCLOUD-5547 Add PDF encryption and restriction client methods Jan 30, 2026
@datalogics-cgreen datalogics-cgreen force-pushed the pdfcloud-5464-security branch 2 times, most recently from 68745c8 to 3ec89be Compare February 6, 2026 19:55
@datalogics-cgreen datalogics-cgreen marked this pull request as ready for review February 6, 2026 20:26
datalogics-cgreen and others added 7 commits February 10, 2026 10:08
Assisted-by: Codex
Assisted-by: Codex
Assisted-by: Codex
…rmissions

- Added `test_live_add_permissions_password_invalid_restriction` to verify
  that invalid restrictions raise `PdfRestApiError` in sync client.
- Added `test_live_async_add_permissions_password_invalid_restriction` to
  ensure async client correctly handles invalid restrictions.

Assisted-by: Codex
@datalogics-cgreen datalogics-cgreen force-pushed the pdfcloud-5464-security branch 2 times, most recently from f90f5b8 to 67e9fad Compare February 10, 2026 17:37
Comment thread src/pdfrest/models/payloads.py Outdated
Comment thread src/pdfrest/models/_internal.py
Comment thread src/pdfrest/models/__init__.py Outdated
Comment thread tests/test_encrypt_pdf.py Outdated
Comment thread tests/test_permissions_password.py Outdated
- import `PdfRestFile` from `models.public` inside `_internal.py` to avoid circular imports
- update encrypt/restrict unit tests to build expected request payloads through `PdfEncryptPayload`/`PdfDecryptPayload`/`PdfRestrictPayload`/`PdfUnrestrictPayload`
- replace hand-built payload dicts with `model_validate(...).model_dump(mode="json", by_alias=True, exclude_none=True, exclude_unset=True)`

Assisted-by: Codex
- add shared `assert_pdf_file_response` helpers to live encryption and
  permissions-password suites
- assert additional response attributes on success paths, including file size,
  `.pdf` suffix, and `response.warning is None`
- keep existing MIME type, output-prefix, and input-id checks while reducing
  repeated assertion blocks
- align live assertions with repository testing guidelines for richer
  server-response verification

Assisted-by: Codex
Copy link
Copy Markdown
Contributor

@datalogics-kam datalogics-kam left a comment

Choose a reason for hiding this comment

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

  • Requested changes were made
  • Tests passing
  • Codex PR review found no issues (except the commit messages, but that's not critical)

Thanks, Chris!

@datalogics-kam datalogics-kam merged commit 16120cd into pdfrest:main Feb 11, 2026
14 checks passed
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