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

Unify filename size limit for V2 API #2414

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Conversation

whabanks
Copy link
Contributor

@whabanks whabanks commented Jan 10, 2025

Summary | Résumé

Schema validation now validates that length of filename does not exceed 255 characters when the user uses the link method to attach a file to an email notification via the V2 api.

Test instructions | Instructions pour tester la modification

  1. Send an email with an attachment via the API using attachment_content.txt for the personalisation.
  2. Note the following error is returned:
"status_code": 400,
    "errors": [
        {
            "error": "ValidationError",
            "message": "personalisation <content of the property> is too long
        }

Release Instructions | Instructions pour le déploiement

None.

Reviewer checklist | Liste de vérification du réviseur

  • This PR does not break existing functionality.
  • This PR does not violate GCNotify's privacy policies.
  • This PR does not raise new security concerns. Refer to our GC Notify Risk Register document on our Google drive.
  • This PR does not significantly alter performance.
  • Additional required documentation resulting of these changes is covered (such as the README, setup instructions, a related ADR or the technical documentation).

⚠ If boxes cannot be checked off before merging the PR, they should be moved to the "Release Instructions" section with appropriate steps required to verify before release. For example, changes to celery code may require tests on staging to verify that performance has not been affected.

- The filename property is now limited to a 255 char length for both 'link' and 'attach' file sending via the V2 api.
@whabanks whabanks changed the title Unify filename size limit Unify filename size limit for V2 API Jan 10, 2025
Copy link
Contributor

@smcmurtry smcmurtry left a comment

Choose a reason for hiding this comment

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

I tested locally and I now see the expected error when I attach a file with a really long name in "link" mode.

@whabanks whabanks merged commit 429d2f7 into main Jan 13, 2025
5 checks passed
@whabanks whabanks deleted the task/validate-filename-size branch January 13, 2025 17:55
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