summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | fs-mistrust: refactor ResolvePath to avoid temporary changes.Nick Mathewson2022-05-031-36/+31
| | | | | | | | | | | | | | | | | | | | | | | | Previously we would temporarily put self.resolved into an invalid state by adding a path component that might be a symlink. With this change, we create a new temporary path object (using Cow to avoid unnecessary allocations) and only conditionally replace self.resolved.
| * | fs-mistrust: clarify and test behavior for ".." past the fs root.Nick Mathewson2022-05-031-1/+31
| | |
| * | Add a must_use (suggested by @diziet).Nick Mathewson2022-05-031-0/+1
| | |
| * | fs-mistrust: more examples, documentation.Nick Mathewson2022-05-032-6/+112
| | |
| * | Add a SecureDir API for checked access to directoriesNick Mathewson2022-05-034-3/+266
| | | | | | | | | | | | | | | | | | The only way to get a SecureDir is by having checked a directory. Once you have one, it encourages you to open and create files and directories with the right permissions, and checks them for you.
| * | Add functionality to inspect directory content permissionsNick Mathewson2022-05-035-29/+133
| | | | | | | | | | | | Also, explain _why_ this is pretty important.
| * | By default, forbid special files.Nick Mathewson2022-05-032-17/+40
| | |
| * | Support for "create missing directory".Nick Mathewson2022-05-032-2/+87
| | |
| * | Add support for trusted group IDs.Nick Mathewson2022-05-032-3/+58
| | |
| * | Implement support for the Sticky Bit.Nick Mathewson2022-05-032-3/+54
| | |
| * | Second cut at a fs-mistrust crate.Nick Mathewson2022-05-037-0/+1576
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This crate is meant to solve #315 by giving a way to make sure that a file or directory is only accessible by trusted users. I've tried to explain carefully (in comments and documentation) what this crate is doing and why, under the assumption that it will someday be read by another person like me who does _not_ live and breathe unix file permissions. The crate is still missing some key features, noted in the TODO section. It differs from the first version of the crate by taking a more principled approach to directory checking: it emulates the path lookup process (reading symlinks and all) one path change at a time, thus ensuring that we check every directory which could enable an untrusted user to get to our target file, _or_ which could enable them to get to any symlink that would get them to the target file. The API is also slightly different: It separates the `Mistrust` object (where you configure what you do or do not trust) from the `Verifier` (where you set up a check that you want to perform on a single object). Verifiers are set up to be a bit ephemeral, so that it is hard to accidentally declare that _every_ object is meant to be readable when you only mean that _some_ objects may be readable.
* | | update tls-api to 0.8.0trinity-1686a2022-04-281-2/+2
| | | | | | | | | | | | and remove corresponding RUSTSEC from ignored list
* | | Merge branch 'derive-builder-git-fixup' into 'main'eta2022-04-278-8/+8
|\ \ \ | | | | | | | | | | | | | | | | derive_builder: Use git dep everywhere, rather than cargo patch See merge request tpo/core/arti!477
| * | | derive_builder: Use git dep everywhere, rather than cargo patchIan Jackson2022-04-278-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `[patch]` approach causes the tree not to build when used as a dependency, unless the `[patch]` is replicated into the depending project. Instead, replace our `derive_builer =` dependencies with a reference to a specific git commit: perl -i~ -pe 'next unless m/^derive_builder/; s#"(0\.11\.2)"#{ version = "$1", git = "https://github.com/ijackson/rust-derive-builder", rev = "ba0c1a5311bd9f93ddf5f5b8ec2a5f6f03b22fbe" }#' crates/*/Cargo.toml Note that the commitid has changed. This is because derive_builder is in fact a workspace of 4 crates. 3 of them are of interest to arti itself (the 4th exists only for testing). So the same "add git revision" treatment had to be done to the `derive_builder` and `derive_builder_macro` crates. Each dependency edge involves a new commit in the derive_builder workspace, since we can't create a git commit containing its own commitid. (We want to use commits, rather than a branch, so that what we are depending on is actually properly defined, and not subject to the whims of my personal github namespace.) There are no actual code changes in derive_builder.
* | | | Fix sentencesSamanta Navarro2022-04-273-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The arti crate itself is only used in benchmark and testing crate. I think this sentence does not belong here. Also extend retry-error description (from Architecture.md).
* | | | Fix spacingSamanta Navarro2022-04-273-3/+3
| | | |
* | | | Fix grammar and typosSamanta Navarro2022-04-2726-32/+32
| | | |
* | | | Merge branch 'upgrade_dependencies' into 'main'eta2022-04-2715-20/+25
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | Upgrade various dependencies, now that we are MSRV 1.56 Closes #313 and #334 See merge request tpo/core/arti!476
| * | | Bump async_executors to 0.6Nick Mathewson2022-04-261-1/+1
| | | |
| * | | Upgrade to AES 0.8Nick Mathewson2022-04-267-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we require Rust 1.56, we can upgrade to AES 0.8. This forces us to have some slight API changes. We require cipher 0.4.1, not cipher 0.4.0, since 0.4.0 has compatibility issues with Rust 1.56.
| * | | Bump to config 0.13Nick Mathewson2022-04-263-3/+3
| | | |
| * | | Upgrade tracing-journald to 0.3.0Nick Mathewson2022-04-261-1/+1
| | | |
| * | | Upgrade to Postage 0.5.0Nick Mathewson2022-04-264-4/+4
| | | |
| * | | Upgrade to rlimit 0.8.3, again.Nick Mathewson2022-04-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that our MSRV is at 1.56, we can use the latest rlimit. It has to be 0.8.3 (not "0.8"), since 0.8.2 has compatibility issues with 1.56.
* | | | Merge branch 'download-schedule' into 'main'Nick Mathewson2022-04-267-149/+171
|\ \ \ \ | |/ / / |/| | | | | | | | | | | DownloadSchedule: Introduce Builder See merge request tpo/core/arti!473
| * | | Make DownloadScheduleBuilder "alternative" defaults pub(crate)Ian Jackson2022-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/473#note_2798464
| * | | Fix typo in messageNick Mathewson2022-04-261-1/+1
| | | |
| * | | DirMgrConfig: Remove unnecessary accessorsIan Jackson2022-04-263-28/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These fields are pub. Retain two convenience accessor functions that access sub-fields of network.
| * | | DirMgrConfig: Rename two fields that contained a _configIan Jackson2022-04-263-12/+12
| | | | | | | | | | | | | | | | This entire struct is config. This is otiose.
| * | | DownloadSchedule: Rename field to "attempts"Ian Jackson2022-04-262-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is actually a number of *attempts* not a number of *retries*. The setter method was already called "attempts". This chnages the deserialisation of the config.
| * | | DownloadSchedule: Abolish accessors in DownloadScheduleConfigIan Jackson2022-04-263-42/+19
| | | | | | | | | | | | | | | | We can just make the fields pub(crate).
| * | | DownloadSchudule: Have NetworkConfig contain BuildersIan Jackson2022-04-264-96/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use sub_builder. We must do something special for defaults. This involves moving the actual default values for retry_bootstrap and retry_microdescs into config.rs, since they need to access the fields of the un-built version of the structure. (An alternative would be to generate "weak setters" which do not override previous settings, but derive_builder does not offer to generate them and that seems overkill.)
| * | | DownloadSchedule: Abolish new() methodIan Jackson2022-04-264-38/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, everyone should use DownloadScheduleBuilder. The new() method would in any case be useless in a moment, since we're going to embed DownloadScheduleBuilder in the NetworkConfig, not DownloadSchedule. The call sites in the tests are all about to change again.
| * | | DownloadSchedule: tests: Do not try to set parallelism to 0Ian Jackson2022-04-262-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current behaviour is to treat 0 as indicating "use the default", which is quite strange. We are going to get rid of that. The new way will be to reject zero, during DownloadScheduleBuilder::build, Add a test case for that.
| * | | DownloadSchedule: Provide builderIan Jackson2022-04-261-1/+42
| | | |
* | | | Merge branch 'main' into 'msrv_1_56'Nick Mathewson2022-04-2615-179/+366
|\| | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # crates/tor-config/Cargo.toml # crates/tor-dirmgr/src/state.rs # doc/semver_status.md
| * | | Merge branch 'config-sub-list' into 'main'Nick Mathewson2022-04-2614-167/+337
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Introduce macro for ThingListBuilder, and use for AuthorityListBuilder See merge request tpo/core/arti!471
| | * | | list-builder: Provide tests of all methodsIan Jackson2022-04-251-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | Because the macro output is private, if we miss one out of the tests, it doesn't fail due to dead code :-).
| | * | | list_builder: Allow the struct to not be pubIan Jackson2022-04-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Really, we probably don't want any of these not to be pub, but it triggers "unreachable pub" in my test cases, and making it not pub by mistake seems not very serious, and likely to be noticed. Making the struct private in the test cases has the useful effect of checking that all the methods are tested.
| | * | | list_builder: Use $crate namespaced importsIan Jackson2022-04-253-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't think we need to bother with things in the prelude, but doing it for serde and ConfigBuildError seems nice. Noticed while writing a test case.
| | * | | Document defaults for all the config listsIan Jackson2022-04-255-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And add an imprecation in define_list_config_builder's doc comment do do so in future for other invocations of the macro. Add add the missing full stops.
| | * | | define_list_config_builder: Provide example of item_buildIan Jackson2022-04-251-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798027
| | * | | define_list_config_builder: Expand generated docs for methods etc.Ian Jackson2022-04-251-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Requested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798022
| | * | | Rename macro_first_nonempty (from macro_coalesce_args)Ian Jackson2022-04-253-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798026
| | * | | Rename ThingListBuilder::replace (from set)Ian Jackson2022-04-256-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798024
| | * | | Use better syntax for doc comment attributeIan Jackson2022-04-255-23/+11
| | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798020
| | * | | Introduce PredictedPortsListBuilderIan Jackson2022-04-253-31/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means that `NetworkConfig::initial_predicted_ports` is now like the other list-like things, returning `&mut list_builder` with the same `set()` and `append()` methods.
| | * | | config list-builder: Allow overriding the per-item build methodIan Jackson2022-04-253-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | This will be useful especially for simple lists where the entry doesn't need a separate builder type.
| | * | | macro_coalesce_args: New helper macroIan Jackson2022-04-251-0/+30
| | | | |
| | * | | Introduce AuthorityListBuilder in NetworkConfigBuilderIan Jackson2022-04-256-40/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetworkConfigBuilder needs to not contain any validated structs, so that its serde does not expose the validated details. AuthorityListBuilder is what ought to go here - and it contains Vec<AuthorityBuilder>, not Vec<Authority>. As a consequence, many places now deal with AuthorityBuilder, rather than Authority.