-
Notifications
You must be signed in to change notification settings - Fork 71
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
Implement DebugSecret for vectors of debuggable types #458
Comments
Thanks for reporting this. For context: one of the goals of this crate (which could definitely be better documented) is preventing accidental secret leakage through mechanisms such as To enforce that concern, I think you're right that having By leveraging Is that what you'd ultimately like for debugging information? If so, it seems possible. |
That definitely sounds like a sensible solution that would solve our problem.
Actually, it's not really debugging that I'm interested in, but serialization. However, We're trying to protect a secret while working with it in memory, but to also be able to serialize it at the right point. Don't know if that would be better achieved through other means, like exposing the contents of the secret and then serializing, but it feels more error-prone. |
You might take a look at the docs for https://docs.rs/secrecy/0.6.0/secrecy/trait.SerializableSecret.html ...which, upon further inspection, does not appear to be properly used in the bounds for the To prevent accidental exfiltration of secrets, The alternatives are:
All that said, it seems this crate could use a little work and documentation improvements. Hopefully I'll have time to make a pass over it in the next few days to clear some of that up and fix the issues brought up here. |
Thanks for pointing that out! For some reason I was completely blind to the existence of I'll probably go down the route of using |
NOTE: addresses #458 The `SerializableSecret` trait was added in #262, however the `Serialize` (as well as `Deserialize`) impls were (unintentionally) bounded on `DebugSecret`. This commit removes the `DebugSecret` bound on the `Deserialize` impl, adds the intended `SerializableSecret` on the `Serialize` impl, and improves the documentation for the `SerializableSecret` trait.
NOTE: addresses #458 The `SerializableSecret` trait was added in #262, however the `Serialize` (as well as `Deserialize`) impls were (unintentionally) bounded on `DebugSecret`. This commit removes the `DebugSecret` bound on the `Deserialize` impl, adds the intended `SerializableSecret` on the `Serialize` impl, and improves the documentation for the `SerializableSecret` trait.
#463 should address the issues with the trait bounds: |
Hi,
Currently
DebugSecret
is implemented only forVec<S>
, whereS
must haveDebugSecret
implemented on it as well (link) - however only arrays of types withDebug
have that trait, so onlyVec<[T]>
will getDebugSecret
implemented.I was wondering if it's possible to have
DebugSecret
implemented onVec<S: Debug>
as well/instead.The text was updated successfully, but these errors were encountered: