You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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!
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
@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.
Initial Checks
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
.model_dump()
and.model_dump_json()
The text was updated successfully, but these errors were encountered: