Skip to content

refactor(dgw): use secrecy::SecretString for decrypted passwords#1692

Merged
Benoît Cortier (CBenoit) merged 3 commits intoDGW-326from
copilot/sub-pr-1689
Feb 26, 2026
Merged

refactor(dgw): use secrecy::SecretString for decrypted passwords#1692
Benoît Cortier (CBenoit) merged 3 commits intoDGW-326from
copilot/sub-pr-1689

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

  • Analyze existing DecryptedPassword struct usage across the codebase
  • Replace DecryptedPassword with secrecy::SecretString in crypto.rs
  • Update mod.rs to remove re-export and update decrypt_password() return type
  • Avoid .into() outside generic code — use SecretString::from(plaintext) explicitly
  • Build and test changes (all 7 credential tests pass)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…assword struct

Co-authored-by: CBenoit <3809077+CBenoit@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to use secrecy::SecretString for credentials encryption refactor(dgw): use secrecy::SecretString for decrypted passwords Feb 26, 2026
let plaintext = String::from_utf8(plaintext_bytes).context("decrypted password is not valid UTF-8")?;

Ok(DecryptedPassword(plaintext))
Ok(SecretString::new(plaintext.into()))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot avoid into() outside of generic code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 4bcb701. Changed to SecretString::from(plaintext) which uses the explicit From<String> impl.

…conversion

Co-authored-by: CBenoit <3809077+CBenoit@users.noreply.github.com>
@CBenoit Benoît Cortier (CBenoit) marked this pull request as ready for review February 26, 2026 11:03
@CBenoit Benoît Cortier (CBenoit) merged commit bada7f5 into DGW-326 Feb 26, 2026
@CBenoit Benoît Cortier (CBenoit) deleted the copilot/sub-pr-1689 branch February 26, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants