Skip to content
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

feat: Add SecureEncoder support to PFFileObject #1768

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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 are missing coverage. Please review.

Project coverage is 3.77%. Comparing base (dd05d41) to head (0d28a0f).
Report is 3 commits behind head on master.

❗ Current head 0d28a0f differs from pull request most recent head ea4346d. Consider uploading reports for the commit ea4346d to get more accurate results

Files Patch % Lines
Parse/Parse/Source/PFFileObject.m 0.00% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #1768       +/-   ##
==========================================
- Coverage   64.24%   3.77%   -60.48%     
==========================================
  Files         201     155       -46     
  Lines       23233   17952     -5281     
==========================================
- Hits        14926     677    -14249     
- Misses       8307   17275     +8968     

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

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
3 participants