orchestrator-core icon indicating copy to clipboard operation
orchestrator-core copied to clipboard

[Feature]: Change secret env variables to use pydantic `Secret` generic typing

Open tjeerddie opened this issue 5 months ago • 1 comments

Contact Details

No response

What should we build?

pydantic Secret generic type masks the property value immediately and makes the value only available with .get_secret_value().

This would make the masking specifically for exposing the env variables unnecessary since they are masked from the start and makes less likely for something to accidentally not be masked unless not typed with Secret[{type}].

https://docs.pydantic.dev/2.8/examples/secrets/#serialize-secretstr-and-secretbytes-as-plain-text

tjeerddie avatar Jul 23 '25 12:07 tjeerddie

Do you mean to use Secret also for variables like CACHE_URI i.e. as Secret[RedisDsn]?

I'm not sure if we considered this for #964 but I don't quite remember - @Igoranze do you recall?


It would make it a breaking change because people will need to add .get_secret_value() in their code that uses core settings

Mark90 avatar Aug 04 '25 16:08 Mark90