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

[PROPOSAL] FF1 Improvements #242

Closed
adrienaury opened this issue Jun 30, 2023 · 0 comments · Fixed by #243
Closed

[PROPOSAL] FF1 Improvements #242

adrienaury opened this issue Jun 30, 2023 · 0 comments · Fixed by #243

Comments

@adrienaury
Copy link
Member

adrienaury commented Jun 30, 2023

New features

  • possibility to choose a custom domain (list of possible characters on input)
  • automatic preservation of chars outside of domain
  • template to execute on error

Examples

version: "1"
masking:
  - selector:
      jsonpath: "id"
    mask:
      ff1:
        keyFromEnv: "FF1_ENCRYPTION_KEY"
        domain: "ABCD0123456"   # will be used to compute radix (radix and domain can't be used at the same time)
        preserve: true                     # will preserve chars outside of the domain (at the same positions)
        onError: "{{ .id }}"                # will execute this template and use the result on error
Input value Output value Description
1234-ABC A326-1DC The '-' at position 5 is preserved because it is not part of the domain, the rest of the string is encrypted
XXXXX XXXXX There is nothing to encrypt, so ff1 will fail, the "on error" template is executed so the original value is used
version: "1"
masking:
  - selector:
      jsonpath: "id"
    mask:
      ff1:
        keyFromEnv: "FF1_ENCRYPTION_KEY"
        domain: "ABCD0123456"   # will be used to compute radix (radix and domain can't be used at the same time)
        preserve: false                     # default value if not specified
        onError: "{{ .id }}"                # will execute this template and use the result on error
Input value Output value Description
1234-ABC 1234-ABC The '-' at position 5 is not part of the domain, preserve is false, so the ff1 will fail, the "on error" template is executed so the original value is used
XXXXX XXXXX 'X' is not part of the domain, so ff1 will fail, the "on error" template is executed so the original value is used
version: "1"
masking:
  - selector:
      jsonpath: "id"
    mask:
      ff1:
        keyFromEnv: "FF1_ENCRYPTION_KEY"
        domain: "ABCD0123456"   # will be used to compute radix (radix and domain can't be used at the same time)
        preserve: false                     # default value if not specified
        # onError is not specified (null)
Input value Output value Description
1234-ABC error The '-' at position 5 is not part of the domain, preserve is false, so the ff1 will fail, the "on error" parameter is not set, so the mask will fail
XXXXX error 'X' is not part of the domain, so ff1 will fail, the "on error" parameter is not set, so the mask will fail
@adrienaury adrienaury linked a pull request Jun 30, 2023 that will close this issue
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 a pull request may close this issue.

1 participant