summaryrefslogtreecommitdiff
path: root/crates/tor-checkable/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-checkable: TODO for TimerangeBound from TimeboundClara Engler2026-06-231-0/+4
|
* tor-checkable: Specify Timebound inclusiveness in rustdocClara Engler2026-06-111-0/+5
| | | | | This commit updates Timebound's rustdoc to require inclusiveness when checking the timeliness of a given object.
* tor-checkable: TimerangeBound: test edge casesIan Jackson2026-06-101-0/+10
|
* tor-checkable: TimeRangebound: document inclusivityIan Jackson2026-06-101-1/+2
|
* tor-checkable: TimerangeBound: is_valid: Treat bounds as inclusive (fmt)Ian Jackson2026-06-101-2/+6
|
* tor-checkable: TimerangeBound: is_valid: Treat bounds as inclusiveIan Jackson2026-06-101-2/+2
| | | | | | | | | | | | | | | This makes more sense because: * `start_bound` and `end_bound` return `Bound::Included` * It doesn't make sense to say that a document isn't valid at the very start of its validity period. (And we don't want a half-open range.) * NotYetValid(0ns) and Expired(0ns) are rather nonsensical errors. In real timeliness tests it will make no difference since the current time is only equal to the bound for a nanosecond. But tests that like to test corner cases might be affected, and possibly some synthetic situations (where the document's own validity time start is used somehow) might change.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-093-0/+3
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-checkable: Port to web-time-compatNick Mathewson2026-03-262-9/+10
|
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-063-3/+3
| | | | Run maint/add_warning
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* TimerangeBound: Stop using std::ops::Bound.Wesley Aptekar-Cassels2024-11-251-5/+16
| | | | Fixes: #1691
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Run maint/add_warning.Nick Mathewson2024-03-132-0/+2
|
* Merge branch 'typos' into 'main'gabi-2502024-03-071-1/+1
|\ | | | | | | | | Fix various typos See merge request tpo/core/arti!2032
| * Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
| |
* | tor-checkable: Use checked arithmeticTobias Stoeckmann2024-03-051-2/+14
|/ | | | | | | | | Make sure that arithmetic with SystemTime and Duration fits into SystemTime. If the result does not fit, set the affected boundary to None. After all it implies that this point in time is not reachable on the system. Avoids integer overflow or panic, depending on debug or release build.
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-232-0/+2
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-103-0/+3
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* netdoc: Use the RangeBoundsExt impl of TimerangeBound.Gabriela Moldovan2023-05-131-71/+0
| | | | | | We can now get rid of the standalone `intersect_bounds` function. Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-checkable: Implement RangeBounds for TimerangeBound.Gabriela Moldovan2023-05-131-4/+17
| | | | | | | | By implementing `RangeBounds` for `TimerangeBound`, we get `RangeBoundsExt` for free. This will enable `parse_decrypt_validate` to easily compute the intersection of the `TimerangeBound`s its layers. Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-checkable: Add a way to compute the intersection of 2 RangeBounds.Gabriela Moldovan2023-05-131-0/+71
| | | | | | | This will be used for computing the final `TimerangeBound` of a `HsDesc` from the `TimerangeBound`s of its inner and outer layers. Signed-off-by: Gabriela Moldovan <[email protected]>
* hsclient: Build cached descriptor TimerangeBounds from descriptor lifetime.Gabriela Moldovan2023-05-131-7/+11
| | | | | | | This makes `descriptor_ensure` refetch the descriptor if it has been cached for longer than `descriptor-lifetime` minutes. Signed-off-by: Gabriela Moldovan <[email protected]>
* TimerangeBound: Provide .as_ref() and .as_deref()Ian Jackson2023-04-031-1/+33
|
* TimerangeBound: derive Debug and Clone, and Eq/PartialEq in testsIan Jackson2023-04-031-0/+2
|
* Use humantime in tor-checkableSaksham Mittal2023-02-271-5/+8
| | | | | | The four values of times taken in a particular test were changed to both be human readable and have comments explaining their significance (they are all important moments after the Unix Epoch for freedom)
* tor-checkable: Add dangerously_map() functions.Nick Mathewson2023-02-072-1/+60
| | | | | | | | | | | These functions consume a checkable wrapper, and return a new checkable wrapper with mapped contents but the same not-yet-checked constraints. As documented, They are "dangerous" because the provided function gets access to the contents before they are checked; the caller has to make sure that the provided function doesn't expose their contents inappropriately.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-272-0/+2
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | 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.
* Merge branch 'test-lints' into 'main'eta2023-01-062-0/+17
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-122-0/+17
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | Tackling issue #663 (Use humantime in tests)coral2022-12-121-5/+7
|/
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* tor-checkable: Make TimerangeBound::dangerously* non-experimentalIan Jackson2022-10-271-10/+0
| | | | | I want one of these for the bridge descriptor downloader, and they seem reasonable to me.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-43/+1
| | | | | | | | 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
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* Improve error messages in tor-checkable.Nick Mathewson2022-06-221-3/+3
|
* lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | From running add_warning, with manual picking of the right hunks/lines.
* lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* checkable: additional unit tests for more APIs.Nick Mathewson2022-04-021-0/+28
|