Skip to content
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

Update symmetric key API documentation #631

Merged
merged 5 commits into from
May 6, 2020
Merged

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Apr 28, 2020

This is a companion PR for #630, updating existing symmetric key API documentation, code examples, and tests to correctly use symmetric keys, not passphrases. Various bits of documentation are also updated and unified.

On the one hand, this is a lot of API documentation, much more extensive than any other wrapper has. On the other hand, I find it valuable for those who don't ever bother browsing third-party documentation sites. Plus, it's kinda dishonest to lower the quality bar.

Checklist

  • Change is covered by automated tests
  • The coding guidelines are followed
  • Public API has proper documentation
  • Example projects and code samples are up-to-date
  • Changelog is updated (nothing notable)

Reuse common test suite for Secure Cell modes with symmetric keys.
Update them to use SymmetricKey instead of passphrases to avoid giving
incorrect ideas that you can use short passphrases with key API.

Yes, you *can* pass strings to this API but you shouldn't. There is no
easy way to forbid that since &str implements AsRef<[u8]> and this is
kinda fundamental property of strings in Rust. Even if we accepted &[u8]
directly, users can still easily pass strings there.
Similarly, update documentation for existing methods to match the one
used for passphrase API. Use properly generated symmetric keys there,
setting a good example. Note passphrase API in the top-level docs too.
@ilammy ilammy added docs 📚 Documentation, both offline and online W-RustThemis 🦀 Wrapper: Rust-Themis, Rust API, Cargo crates labels Apr 28, 2020
@ilammy
Copy link
Collaborator Author

ilammy commented Apr 28, 2020

@karenswry, I know that you're working on something in RustThemis docs too. I don't see any conflicts with your branch right now, but this is a heads up about some changed files that might cause conflicts later. Please consider syncing with master once this PR is merged.

Copy link
Contributor

@vixentael vixentael left a comment

Choose a reason for hiding this comment

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

That’s A LOT of docs!!!

src/wrappers/themis/rust/src/secure_cell.rs Outdated Show resolved Hide resolved
@ilammy ilammy merged commit f13e957 into cossacklabs:master May 6, 2020
@ilammy ilammy deleted the sc-rust branch May 6, 2020 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs 📚 Documentation, both offline and online W-RustThemis 🦀 Wrapper: Rust-Themis, Rust API, Cargo crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants