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 SHA256 encryption method #2818

Closed
ben-schulz-mh opened this issue Dec 27, 2024 · 1 comment · Fixed by #2819
Closed

feat: Add SHA256 encryption method #2818

ben-schulz-mh opened this issue Dec 27, 2024 · 1 comment · Fixed by #2819

Comments

@ben-schulz-mh
Copy link
Contributor

Feature scope

Inline mapping (stream maps, flattening, etc.)

Description

Currently only MD5 is supported. SHA256 is a more secure encryption method that is used widely and is desired. For context, another ETL provider (Fivetran) use SHA256 and this would allow feature parity with that solution.

@edgarrmondragon
Copy link
Collaborator

edgarrmondragon commented Dec 27, 2024

PRs welcome @ben-schulz-mh!

EDIT: if someone wants to contribute this, the places to look at are:

sdk/singer_sdk/mapper.py

Lines 54 to 63 in 920d630

def md5(string: str) -> str:
"""Digest a string using MD5. This is a function for inline calculations.
Args:
string: String to digest.
Returns:
A string digested into MD5.
"""
return hashlib.md5(string.encode("utf-8")).hexdigest() # noqa: S324

sdk/singer_sdk/mapper.py

Lines 309 to 312 in 920d630

funcs["md5"] = md5
funcs["datetime"] = datetime
funcs["bool"] = bool
funcs["json"] = json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants