Skip to content

feat: Add SecureEncoder support to PFFileObject #1768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dhoerl
Copy link

@dhoerl dhoerl commented Dec 31, 2023

New Pull Request Checklist

  • [X ] I am not disclosing a vulnerability.
  • [X ] I am creating this PR in reference to an issue.

Issue Description

PFFileObjects can be used outside of a PFObject subclass. When archiving them and other objects using the NSSecureEncoder, the encoder now fails with an error that PFFileObjects are not secure coding compliant.

Fine - in Objective-C, I create a class extension to add it. Works fine. However, when I go to change that extension to Swift, the compilation fails with the error that NSSecureCoding cannot be added in a class extension (but must be done by the original class).

Closes: #1736

Approach

Add NSSecureCoding to PFFileObject:

  • return YES from the class method supportsSecureCoding
  • encode the object using the existing PFEncoder objectEncoder
  • decode the object using PFDecoder objectDecoder

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)

Copy link

parse-github-assistant bot commented Dec 31, 2023

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@dhoerl dhoerl changed the title Add SecureEncoder support to PFFileObject feat: add SecureEncoder support to PFFileObject Dec 31, 2023
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title feat: add SecureEncoder support to PFFileObject feat: Add SecureEncoder support to PFFileObject Dec 31, 2023
@mtrezza
Copy link
Member

mtrezza commented Apr 6, 2024

Would you want to add a test so we can merge this?

Copy link

codecov bot commented Apr 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 82.76%. Comparing base (dd05d41) to head (838b1a6).
Report is 53 commits behind head on master.

Files with missing lines Patch % Lines
Parse/Parse/Source/PFFileObject.m 0.00% 15 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1768       +/-   ##
===========================================
+ Coverage   64.24%   82.76%   +18.52%     
===========================================
  Files         201      282       +81     
  Lines       23233    30741     +7508     
===========================================
+ Hits        14926    25443    +10517     
+ Misses       8307     5298     -3009     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dhoerl dhoerl closed this by deleting the head repository Jul 24, 2025
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.

Add NSSecureCoding to PFFileObject
2 participants