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

SecretField other than str and bytes #8441

Closed
3 tasks done
conradogarciaberrotaran opened this issue Dec 27, 2023 · 4 comments · Fixed by #8519
Closed
3 tasks done

SecretField other than str and bytes #8441

conradogarciaberrotaran opened this issue Dec 27, 2023 · 4 comments · Fixed by #8519

Comments

@conradogarciaberrotaran
Copy link
Contributor

conradogarciaberrotaran commented Dec 27, 2023

Initial Checks

  • I have searched Google & GitHub for similar requests and couldn't find anything
  • I have read and followed the docs and still think this feature is missing

Description

Hi, I'm interested in marking some fields as PII using SecretFields. This means handling other types of data such as dates and enums. (see resource)
I've seen the implementation for _SecretField to try to implement my own but it's asserting that if it's not a string, then it must be bytes (see link)
Is there any way to handle dates and enums as a secret field?

Thanks!

Affected Components

@sydney-runkle
Copy link
Member

@conradogarciaberrotaran,

Great question! We don't currently support the handling of fields that aren't str or bytes types as secret. I do think this is a valuable feature request, though!

@conradogarciaberrotaran
Copy link
Contributor Author

Hi @sydney-runkle, thank you for your reply.
I went ahead and tried to implement it, with some difficulties, but the basic functionality is working. I may have some things missing.
#8519

is there anyone who can assist me?

Thanks!

@conradogarciaberrotaran
Copy link
Contributor Author

Hi @expobrain! I saw your contribution creating the generic _SecretType. Would you be interested in helping out?

@expobrain
Copy link
Contributor

@conradogarciaberrotaran sure! I made this PR #3717 back in the days of Pydantic 1.x to be able to freely extend the secret type to beyond the ones provided by Pydantic.

I reckon we can re-apply the same concept again.

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.

3 participants