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

Resolves Validation for Encrypted Numeric and Alpha Custom Fields #15818

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

spencerrlongg
Copy link
Collaborator

Description

This adds two validation rules: NumericEncrypted and AlphaEncrypted - the rules are written in the new object syntax. They do the same validation as the basic Laravel rules, but add a step to decrypt the value. The value is decrypted only in the context of the Rule class, and remains encrypted when saving to the db.

Screen.Recording.2024-11-14.at.11.46.15.mov

Fixes SC-27213

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Copy link

what-the-diff bot commented Nov 14, 2024

PR Summary

  • Enhancement to the CustomFieldset Model
    The code has been updated to standardize custom 'alpha' (alphabetical) and 'numeric' (numerical) validation rules. This is particularly important when the fields are dealing with encrypted or secret data, thus improving the security margin.

  • Introduction of AlphaEncrypted Rule
    A new validation rule has been created that will specifically verify whether a decrypted value contains only alphabetical characters, enhancing our data checking procedures.

  • Introduction of NumericEncrypted Rule
    Another new validation rule has been introduced, this time concentrating on numeric data, which checks whether the decrypted value is made up of numerical characters. This step further makes our data validation more robust.

  • Improvement in Validating Language File
    Changes have been made to add new error messages related to the alpha and numeric encrypted validation rules. This will help us in better issue handling and prompt resolution by giving us clearer error feedback.

Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

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

Tested and works 👍🏾

We talked about it while pairing and you already know about the translation strings 😉

app/Rules/AlphaEncrypted.php Outdated Show resolved Hide resolved
app/Rules/NumericEncrypted.php Outdated Show resolved Hide resolved
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