Configurations.jl icon indicating copy to clipboard operation
Configurations.jl copied to clipboard

Feature Request: Special SecretString type

Open schlichtanders opened this issue 1 year ago • 3 comments

For configurations it would be awesome to have a special SecretString type which acts for all standards as a normal String (maybe even is a normal String), but will be printed as "********" in case a whole config object is printed.

schlichtanders avatar Mar 28 '24 17:03 schlichtanders

I don't see why this should be included in this package instead of overloading the option type interface in a separate package?

Roger-luo avatar Mar 28 '24 18:03 Roger-luo

Can you sketch how this could be done?

schlichtanders avatar Mar 29 '24 07:03 schlichtanders

I guess your are referring to https://configurations.rogerluo.dev/stable/convert/

Looking into the interface, it would be nice if all fieldnames starting with a certain prefix or matching a certain regex would be masked in the Option's print.

Not sure how to implement something like this using the interface. On the other hand it might also be useful to have a real SecretString type which masks its output when printed.

schlichtanders avatar Mar 29 '24 08:03 schlichtanders