summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Remove "Mistrust" from the public API of arti-client.Nick Mathewson2022-05-093-15/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm doing this per discussion, so that we can have it be part of the TorConfig later on, and not break stuff as we change the Mistrust API to have a builder. This change, unfortunately, results in a little more internal complexity and duplicated code in arti and arti-client. I've marked those points with TODOs.
| * | arti: use fs-mistrust to validate configuration file locations.Nick Mathewson2022-05-094-13/+29
| | |
| * | arti-client: Configure and use fs-mistrust.Nick Mathewson2022-05-094-8/+63
| | | | | | | | | | | | | | | | | | This is derived from the environment, not the configuration file: We might not want to trust the configuration file until we've decided whether we like its permissions.
| * | Update tor-dirmgr to use fs-mistrust.Nick Mathewson2022-05-096-86/+115
| | |
| * | tor-persist: Use fs-mistrust to verify state file permissions.Nick Mathewson2022-05-093-35/+51
| | |
| * | Add new FsPermissions ErrorKind.Nick Mathewson2022-05-091-0/+9
| | |
| * | fs-mistrust: add various methods.Nick Mathewson2022-05-092-7/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: * a CachedDir::join method. * functions to read and write from provided filenames in a CachedDir. * a method to tell whether a fs-mistrust error is about bad file permissions, or failure to inspect file permissions or some other kind of IO problem.
| * | Derive Clone and Debug for CheckedDir.Nick Mathewson2022-05-051-0/+1
| | |
* | | NetParams: Document its role as a validated config parameterIan Jackson2022-05-092-3/+3
| | |
* | | Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-0633-184/+184
| | | | | | | | | | | | * Except for safelog and fs-mistrust, which are new.
* | | Change safelog version to 0.1.0.Nick Mathewson2022-05-064-4/+4
| | | | | | | | | | | | | | | (This is okay because we haven't published it yet, or any crate that uses it.)
* | | Update README.md files (automated).Nick Mathewson2022-05-0610-16/+307
| | |
* | | Merge branch 'derive-builder-fork' into 'main'Nick Mathewson2022-05-068-8/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Switch to derive_builder_arti_fork Closes #446 See merge request tpo/core/arti!490
| * | | Switch to derive_builder_arti_forkIan Jackson2022-05-068-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For reference, the git source for this crate (and the others in its workspace) currently lives in my personal github account (ijackson). If this fork turns out to be long-lived and gains features and/or users, it would be good to move it to a gitlab somewhere. I have granted Nick crate ownership on the crates.io system.
* | | | Punctuation fix.eta2022-05-061-1/+1
| | | |
* | | | Disable safe-logging when logging to console.Nick Mathewson2022-05-061-1/+30
| | | |
* | | | arti: add support for safe-logging configurationNick Mathewson2022-05-062-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | Here we add a config option to disable safe logging, and ensure that safe logging is disabled when we are formatting an error message on exit (since we assume it's safe to write sensitive info to stderr.)
* | | | Apply `sensitive` in some info-level log messages.Nick Mathewson2022-05-065-3/+8
| | | | | | | | | | | | | | | | | | | | This specifically applies the `sensitive` wrapper in the places where we're logging target addresses at level "info" or higher.
* | | | Implement a safe-logging facility.Nick Mathewson2022-05-065-0/+656
|/ / / | | | | | | | | | | | | | | | 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.
* | | Merge branch 'typos-20220504' into 'main'eta2022-05-054-6/+6
|\ \ \ | |/ / |/| | | | | | | | Fix typos (using the typos-cli tool). See merge request tpo/core/arti!486
| * | Fix typos (using the typos-cli tool).Nick Mathewson2022-05-044-6/+6
| | |
* | | config derive attrs: Make builders serde, and validated structs notIan Jackson2022-05-0511-98/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Builders additionally derive: Debug, Serialize, Deserialize. * Validated structs no longer derive: Serialize, Deserialize and all related attributes deleted. * As a consequence, all the `#[serde(deny_unknown_fields)]` are gone. That means that right now unknown fields are totally ignored. This is good for compatibility but poor for useability. Doing something better here is arti#417, in progress. * As a consequence, delete tor_dirmgr::retry::default_parallelism. (The default value was already duplicated into a builder attr.)
* | | serde attributes: A tiny bit of reorderingIan Jackson2022-05-052-3/+3
| | | | | | | | | | | | Having a consistent order will make the nest commit easier to read.
* | | Make LogRotation SerializeIan Jackson2022-05-051-1/+1
|/ / | | | | | | We want to be able to serialise as well as deserialise configurations.
* | Merge branch 'socket-addr-list-builder' into 'main'Ian Jackson2022-05-049-52/+132
|\ \ | | | | | | | | | | | | FallbackDir: orports: Introduce and use VecBuilder See merge request tpo/core/arti!474
| * | list_builder: Add some xrefs about macro_rules limitationsIan Jackson2022-05-041-0/+8
| | | | | | | | | | | | | | | Apropos https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/474#note_2800481
| * | Fix typoNick Mathewson2022-05-041-1/+1
| | |
| * | FallbackDir: Use VecBuilder for orportsIan Jackson2022-05-046-37/+46
| | | | | | | | | | | | | | | | | | | | | And drop the ad-hoc orport() method. This brings FallbackDir's orports field in line with our list builder API. The general semver note in "configuation" seems to cover most of this.
| * | FallbackDir: Do orport validation after autogenerated buildIan Jackson2022-05-041-5/+11
| | | | | | | | | | | | This avoids it having to recapitulate defaulting logic.
| * | FallbackDir: Do not consider defaulted-empty orport list to be validIan Jackson2022-05-041-7/+5
| | |
| * | list_builder: Provide VecBuilderIan Jackson2022-05-041-0/+41
| | | | | | | | | | | | This is for lists of plain types (non-builder types).
| * | list_builder: Use Educe to derive DefaultIan Jackson2022-05-043-1/+4
| | | | | | | | | | | | | | | | | | This allows us to use this with an item builder type which doesn't impl Default. (Obviously this only makes sense for items which aren't actually builders.)
| * | list_builder: Make helper capable of handling genericsIan Jackson2022-05-041-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | It is Quite Vexing that we have to use [ ] rather than the < > around the generics, particularly given that we are also using [ ] to signal "this is arrayish". Signed-off-by: Ian Jackson <[email protected]>
| * | list_builder: Actually honour attributesIan Jackson2022-05-041-1/+4
| | | | | | | | | | | | | | | | | | The docs were a lie. $docs_and_attrs was missing from the expander. And add a note about how any supplied docs are handled.
* | | GuardUsage: restrictions: Use list builderIan Jackson2022-05-043-39/+56
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Although these do not appear in the config, it does have a builder. It seems sensible to get rid of this ad-hoc list manipulation site, and replace it with our standard list builder API. define_list_builder_helper requires that the builder element type be Deserialize. Currently GuardUsageRestriction is a transparent, public enum, so we aren't really exposing anything. We could introduce GuardUsageRestrictionBuilder now, but since it's not in the config and thereofore only in the public API of the lower crates, we can definitely put that off.
* | tor-dirmgr: make DownloadScheduleBuilder publicIan Jackson2022-05-041-1/+1
| | | | | | | | | | | | This type was returned by the public DownloadSchedule::builder function. But the only thing that seems to have noticed that the type name itself wasn't exported, was rustdoc. Hmmm.
* | Fix typosNick Mathewson2022-05-041-2/+2
| |
* | Change builder list APIIan Jackson2022-05-0412-172/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new API is (roughly) as discussed in https://gitlab.torproject.org/tpo/core/arti/-/issues/451 This is quite a large commit and it is not convenient to split it up. It contains the following changes: * Redo the list builder and accessor macros implemnetation, including docs and tests. * Change uses of define_list_config_builder. In each case: - Move the docs about the default value to the containing field. - Remove the other docs (which were just recapitulations, and are now not needed since the ListBuilder is no longer public). - Rewmove or replace `pub` in the define_list_builder_helper call, so that the builder is no longer public. - Change the main macro call site to use define_list_builder_helper. - Add a call to define_list_builder_accessors. * Make the module `list_builder` pub so that we have somewhere to put the overview documentation. * Consequential changes: - Change `outer.inner().replace(X)` to `outer.set_inner(X)` - Consequential changes to imports (`use` statements).
* | Introduce ThingListBuilder::default_listIan Jackson2022-05-041-5/+8
| | | | | | | | | | This removes a caveat from the API and will be convenient for what is coming.
* | Add dependency on paste crateIan Jackson2022-05-042-0/+2
| | | | | | | | The list accessor macro is going to want this.
* | Rename NetworkConfig.fallback_cachesIan Jackson2022-05-041-8/+8
| | | | | | | | | | | | | | | | | | Previously this field was differently named to its serde and to its accessors. We are about to introduce a macro_rules macro which will provide list accessors and we don't want that macro to have a field renaming feature. So stop renaming the field.
* | Fix config versionIan Jackson2022-05-041-1/+1
| | | | | | | | This matches Cargo.lock. I suspect a mismerge in arti!478.
* | Merge branch 'path' into 'main'Ian Jackson2022-05-034-14/+182
|\ \ | | | | | | | | | | | | | | | | | | CfgPath overhaul Closes #449 See merge request tpo/core/arti!478
| * | CfgPath: Test serialisation round-trip with a binary formatIan Jackson2022-05-032-0/+9
| | | | | | | | | | | | | | | | | | Use MessagePack. Signed-off-by: Ian Jackson <[email protected]>
| * | CfgPath: Make it SerializeIan Jackson2022-05-031-5/+69
| | | | | | | | | | | | | | | | | | And provide round-trip tests. As per https://gitlab.torproject.org/tpo/core/arti/-/issues/371
| * | CfgPath: Overhaul APIIan Jackson2022-05-033-8/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document that this can contain either a string for expansion, or a literal PathBuf not for expansion. Rename the `from_path` method to `new_literal`: a very important difference is whether it gets expanded - less important than the Rust type. Also, now it takes `Into<PathBuf>`, which avoids a needless clone. (We don't change the API in `arti-client` because `&tempfile::Tempdir()` doesn't implement `Into<PathBuf>`, so `arti-client` has to have some new `as_ref` calls.) Provide accessors `as_unexpanded_str` and `as_literal_path`. The deserialisation already makes this part of the stable API,l so not pvoding accessors seems just obstructive. They are useful for tests, too. Add tests for the new entrypoints, and for deserialisation of both variants from TOML (via config, or directly) and JSON.
| * | CfgPath: Change deserialisaation of Literal variantIan Jackson2022-05-031-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | We introduce LiteralPath struct, so that a literal path deserialises from some_path = { literal: "actual path string" } This makes the deserialisation unambiguous.
| * | config: Enable "toml" featureIan Jackson2022-05-031-1/+1
| | | | | | | | | | | | | | | | | | arti uses this. Somehow this seems to be enabled by some other thing in the crate graph, but I found that adding a similar dependency to another crate resulted in a `config` which doesn't compile.
* | | Merge branch 'fs-mistrust-v2' into 'main'Nick Mathewson2022-05-039-0/+2652
|\ \ \ | |/ / |/| | | | | | | | Second cut at a fs-mistrust crate. See merge request tpo/core/arti!468
| * | fs-mistrust: write a lot about TOCTOU issues.Nick Mathewson2022-05-034-22/+70
| | |