Commit Graph

45 Commits

Author SHA1 Message Date
Nick Mathewson 04628ca5ab Remove semver.md files now that 1.1.1 is tagged. 2023-02-01 12:46:01 -05:00
Nick Mathewson 7c1b6a5a81 Bump the patch version of every crate that had API additions
These crates had API or behavior changes that may affect downstream
crates. Fortunately, they're all version 0.x, and don't need minor
bumps for this.
2023-02-01 10:36:29 -05:00
Nick Mathewson a6dd92843e Allow clippy::unchecked_duration_subtraction in tests
This panics on error, and we're fine with a panic on misbehavior in
tests.
2023-01-27 08:28:02 -05:00
Nick Mathewson bf04641c68 Disable clippy::unlinlined-format-args
This warning kind of snuck up on us! (See #748)  For now, let's
disable it.  (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)

Closes #748.
2023-01-27 08:27:47 -05:00
Nick Mathewson 707efc944d upgrade to latest serial_test 2023-01-20 08:06:30 -05:00
eta 118050e54c Merge branch 'test-lints' into 'main'
Add test lint blocks to all "mod test"

See merge request tpo/core/arti!937
2023-01-06 17:16:09 +00:00
Emil Engler 8579bc66a8
doc: consistent summary line for the READMEs
This commit introduces a consistency to the summary line of all
README.md files in each and every crate.
2022-12-20 14:31:47 +01:00
Ian Jackson 125a455bdc test lint blocks: Add many many automatically
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
2022-12-12 18:00:30 +00:00
Ian Jackson 5611d5cb0c Rename Sensitive::into_inner() from ::unwrap()
By analogy with similar methods on Mutex, Cell, BufReader, etc. etc.

Discussed here
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/890#note_2856885

Make it a method, as per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/928
2022-12-12 11:52:34 +00:00
Nick Mathewson 3ab548eb1c safelog: tests for accessors. 2022-12-06 10:31:40 -05:00
Nick Mathewson 417dda9547 safelog: tests for BoxSensitive. 2022-12-06 10:28:53 -05:00
Nick Mathewson 993b4202c7 safelog: more tests for Redacted. 2022-12-06 09:34:26 -05:00
Nick Mathewson e0aeda3071 Remove semver.md files now that 1.1.0 is released. 2022-11-30 17:10:29 -05:00
Nick Mathewson 38bef96b99 Bump the minor version of every crate.
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Nick Mathewson 4688ee9165 safelog: Apply #[serial] to test_redacted()
Closes #675.
2022-11-30 12:00:17 -05:00
Nick Mathewson f0084e3fd4 Fix a logic error in Redacted.
Previously it was redacting exactly when safelogging was _disabled_,
which obviously isn't correct.

Fixes #671. Regression test included.
2022-11-30 09:07:33 -05:00
Nick Mathewson a77172e20d safelog: Make MaybeRedacted<T> opaque. 2022-11-28 08:01:53 -05:00
Nick Mathewson c62958c76f Add a default debug_redacted impl to save space. 2022-11-28 08:01:53 -05:00
Nick Mathewson f2c91ef56e safelog: Add a MaybeRedacted wrapper too.
This is super helpful for cases where we want to write two nearly
identical implementations to format a type.
2022-11-28 08:01:10 -05:00
Nick Mathewson f91218c78d safelog: implement Redactable for network addr types. 2022-11-28 08:01:10 -05:00
Nick Mathewson d3f4956728 safelog: Define a "Redactable" trait
A "redactable" object is one that can be _partially_ scrubbed in
sensitive contexts.  This can be very helpful for UX, but is not
risk-free: see comments.
2022-11-28 08:01:10 -05:00
Ian Jackson bbc84bf9f4 safelog: Provide BoxSensitive 2022-11-23 18:28:38 +00:00
Ian Jackson 4f193f1017 safelog: Remove type argument from `impl_display_traits`
We're going to have this same macro implement the same traits for a
second type.  And its function is specific to `Sensitive`, so have it
know that.
2022-11-23 18:28:34 +00:00
Ian Jackson b77fd893a4 safelog: Provide some more accessors
We're about to use `.as_inner()` in a few places, and `.as_ref()` (by
analogy with `Option`) seems obviously necessary.
2022-11-23 18:28:34 +00:00
Nick Mathewson 936920b26e bump rust-version to 1.60 in every crate. 2022-11-10 10:57:33 -05:00
Nick Mathewson 932fe48eaf Run add_warnings. 2022-11-03 11:06:02 -04:00
Ian Jackson f84d8777db cargo fmt to remove blank lines
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.

This commit is precisely the result of `cargo fmt`.
2022-10-12 15:29:04 +01:00
Ian Jackson d9910dba08 Replace all README copies in src/lib.rs with includes
The feature we want is `#[doc = include_str!("README.md")]`, which is
stable since 1.54 and our MSRV is now 1.56.

This commit is precisely the result of the following Perl rune:
  perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
2022-10-12 15:29:03 +01:00
Ian Jackson af07e17b45 README doctests: fix safelog
Add some dummy definitions that support the example.
2022-10-12 15:27:02 +01:00
Nick Mathewson b3f989d689 Update patch-versions on crates without API changes.
Since our last round of releases, these crates have had either
trivial changes, or changes that did not affect their APIs.
Therefore we are bumping their versions, but not changing which
versions of them other crates depend on.
2022-09-01 08:45:02 -04:00
Nick Mathewson db50d57880 Upgrade serial_test in preparation for release. 2022-08-30 20:09:19 -04:00
trinity-1686a 7f939fa480 enable doc_auto_cfg feature on every crate when documenting for docs.rs 2022-08-24 18:22:41 +02:00
Nick Mathewson dc67c9864b Manually bump the patch version on safelog.
The changes on safelog do not affect its APIs or behavior, so
there is no need to adjust any dependencies.
2022-08-01 10:01:03 -04:00
Nick Mathewson 131d880c7f Upgrade to latest phf, serde_with, serial_test. 2022-07-19 16:49:44 -04:00
Nick Mathewson d5170d5318 Increment versions of crates with trivial changes only.
"Trivial" here includes stuff like cargo reformatting, comment
edits, error message string changes, and clippy warning changes.
Crates that depend on these do not need to increment.
2022-06-24 11:43:02 -04:00
Ian Jackson 589c6e52bb Run maint/add_warning crates/*/src/{lib,main}.rs
Update all lint blocks
2022-06-23 19:15:42 +01:00
Nick Mathewson 9102948045 Style fixes to safelog errors. 2022-06-22 08:07:37 -04:00
Nick Mathewson aa3a81c3ba Upgrade serial_test dev-dependency to 0.7.0 2022-06-07 09:22:24 -04:00
Ian Jackson 4f42101554 lints: Add let_unit_value allow to all crates
From running add_warning, with manual picking of the right
hunks/lines.
2022-05-31 15:23:52 +01:00
Ian Jackson ba0843da4a lints: Add lint block delimiters to every crate
This was the result of:
  maint/add_warning crates/*/src/{lib,main}.rs
and then manually curating the results.
2022-05-31 13:00:31 +01:00
Orhun Parmaksız bfd41ddb5f
Lexically sort Cargo.toml dependencies
Utilize cargo-sort: https://github.com/DevinR528/cargo-sort

Signed-off-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2022-05-28 20:05:51 +03:00
Nick Mathewson 89b38b16c7 Change safelog version to 0.1.0.
(This is okay because we haven't published it yet, or any crate that
uses it.)
2022-05-06 09:59:13 -04:00
Nick Mathewson 9447e69355 Update README.md files (automated). 2022-05-06 09:51:11 -04:00
eta 373934efbf Punctuation fix. 2022-05-06 07:38:16 -04:00
Nick Mathewson 7aacc6e30c Implement a safe-logging facility.
This is a rough first-cut of an API that I think might help us with
keeping limited categories of sensitive information out of our logs.
I'll refine it based on experiences with using it.
2022-05-06 07:36:48 -04:00