aboutsummaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | fs-mistrust: Use pwd-grp's getgroups functionIan Jackson2023-07-141-24/+1
| | | | | | | | | | | | | | | This gets rid of some unsafe code here, with doubtful error handling, in favour of the unit-tested version in pwd-grp.
| * | fs-mistruct: switch from users to pwd-grpIan Jackson2023-07-142-42/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | users is unmaintained. pwd-grp is the crate I have just written to replace it. In this commit: Change the cargo dependency and imports. Replace the cacheing arrangements. users has a built-in cache; pwd-grp doesn't. Now, instead of cashing individual lookups, we cache the trusted user and trusted gid calculation results. This saves on some syscalls, and is also more convenient to write. (Mocking is still done via the dependency.) Many systematic consequential changes of details: * The entrypoint names to the library are different: pwd-grp uses the names of the corresponding Unix functions. * pwd-grp's returned structs are transparent, so we don't call accessors for .uid(), .name(), etc. * pwd-grp's methods are much more often fallible (returning io::Result<Option<...>) * We're using the non-UTF-8 pwd-grp API, which means we must use turbofish syntax in some places. * The mocking API is a bit different.
| * | fs-mistrust: Introduce tempoary PwdGrpProvider aliasIan Jackson2023-07-141-4/+8
| | | | | | | | | | | | | | | This allows us to change a number of trait bounds in advance, reducing noise in the next commit.
| * | fs-mistrust: impl Hash for TrustedUser and TrustedGroup (config)Ian Jackson2023-07-142-2/+3
| | |
| * | fs-mistrust: users: tests: Introduce mock_users etc.Ian Jackson2023-07-141-25/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some wrapper functions for convenience. The pwd-grp crate has a richer and more faithful, but not so convenient, way of creating dummy user/group entries. Also the type names are all going to change. Doing this now reduces churn.
| * | fs-mistrust: users: Make several functions fallibleIan Jackson2023-07-142-26/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | The actual underlying operations here *are* fallible. The `users` crate hides those errors in several cases. (Failures are very rare (at least unless NIS is involved), so this is not of much practical import, but it's going to be necessary when we use the more careful pwd-grp crate.
* | | Merge branch 'keymgr-config-tweaks' into 'main'gabi-2502023-07-1711-176/+135
|\ \ \ | |/ / |/| | | | | | | | | | | | | | tor-keymgr config updates Closes #939 See merge request tpo/core/arti!1404
| * | arti-client: Add TODO about expanding the keystore_dir in build().Gabriela Moldovan2023-07-171-0/+2
| | |
| * | arti-client: Log whether a keystore is in use.Gabriela Moldovan2023-07-131-1/+4
| | |
| * | tor-config: Remove unused ItemOrBool helper.Gabriela Moldovan2023-07-132-63/+1
| | | | | | | | | | | | | | | `ItemOrBool` is currently not used anywhere (it was previously used by the keymgr config).
| * | arti cfg tests: Add keystore to example config.Gabriela Moldovan2023-07-132-14/+22
| | | | | | | | | | | | Closes #939
| * | arti config: Remove extraneous whitespace.Gabriela Moldovan2023-07-131-5/+5
| | |
| * | arti-client: Use the config struct from tor-keymgr.Gabriela Moldovan2023-07-133-93/+24
| | |
| * | tor-keymgr: Add ArtiNativeKeystoreConfig.Gabriela Moldovan2023-07-135-1/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the keystore config consisted of a single field in `StorageConfig`, which encoded 2 bits of information: whether the keystore is enabled, and its root directory: ``` [storage] # use this path, fail if compiled out # keystore = "/path/to/arti/keystore" # # use default path, fail if compiled out # keystore = true # # disable # keystore = false ``` This commit adds `ArtiNativeKeystoreConfig`, which will replace the multi-purpose `keystore` field. The new config will look like this: ``` #[storage.keystore] # Whether the keystore is enabled. # # If the `keymgr` feature is enabled and this option is: # * set to false, we will ignore the configured keystore path. # * set to "auto", the configured keystore, or the default keystore, if the # keystore path is not specified, will be used # * set to true, the configured keystore, or the default keystore, if the # keystore path is not specified, will be used # # If the `keymgr` feature is disabled and this option is: # * set to false, we will ignore the configured keystore path. # * set to "auto", we will ignore the configured keystore path. # # Setting this option to true when the `keymgr` feature is disabled is a # configuration error. #enabled = "auto" # The root directory of the arti keystore #path = "${ARTI_LOCAL_DATA}/keystore" ``` While `ArtiNativeKeystoreConfig` currently only has 2 fields, `enabled` and `path`, future versions of the keystore might require additional config options.
* | | Merge branch 'unused_import' into 'main'Alexander Færøy2023-07-141-1/+2
|\ \ \ | | | | | | | | | | | | | | | | Move an import to resolve a warning. See merge request tpo/core/arti!1407
| * | | Move an import to resolve a warning.Nick Mathewson2023-07-131-1/+2
| | | |
* | | | Merge branch 'bug638' into 'main'Alexander Færøy2023-07-142-4/+14
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop unconditionally marking bridges as having dir info. Closes #638 See merge request tpo/core/arti!1408
| * | | | Better report for any recurrence of bug #638.Nick Mathewson2023-07-131-0/+14
| | | | |
| * | | | Stop unconditionally marking bridges as having dir info.Nick Mathewson2023-07-131-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we implemented bridges, we added code in 08473872abccf389 to conditionally mark their directory info as present or not present. But the we didn't remove the old code to mark them present unconditionally! Fixes #638.
* | | | | Bridges: deduplicate addresses.Nick Mathewson2023-07-131-0/+2
|/ / / / | | | | | | | | | | | | | | | | Currently we list an address for a bridge twice if it is listed both in the bridge line and the bridge descriptor. That can't be right.
* / / / Add country codes to relays inside a NetDireta2023-07-134-4/+218
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When the `geoip` feature flag of `tor-netdir` is enabled, perform GeoIP lookups for all relays added to the directory and add the resulting country code to the `Relay` struct. - The GeoIP database is provided in a new `PartialNetDir::new_with_geoip` constructor. - A new trait was also added to `tor-linkspec`, `HasCountryCode`, to enable getting this data out from other crates. Part of onionmasq#47.
* | | Explain better why you would use build_unmanaged_channelNick Mathewson2023-07-131-2/+7
| | |
* | | Resolve numerous typos in `ChanMgr::build_unmanaged_channel` codegabi-2502023-07-131-4/+4
| | |
* | | chanmgr: Remove now-unused (and never usable) builder() method.Nick Mathewson2023-07-131-12/+0
| | |
* | | chanmgr: Document makeup and timeout behavior of our factoriesNick Mathewson2023-07-131-0/+22
| | | | | | | | | | | | | | | Basically, it's all ChanBuilder at some point, and ChanBuilder has a timeout.
* | | chanmgr: Add an experimental build_unmanaged_channel() method.Nick Mathewson2023-07-131-0/+26
|/ / | | | | | | | | This method will let the user construct a channel that isn't stored or monitored by the ChanMgr.
* | Merge branch 'keymgr-integration-test' into 'main'gabi-2502023-07-121-0/+2
|\ \ | | | | | | | | | | | | | | | | | | CI: Add client auth integration test. Closes #954 See merge request tpo/core/arti!1399
| * | arti-client: Log whether the client auth keys were retrieved.Gabriela Moldovan2023-07-121-0/+2
| | |
* | | Merge branch 'feat' into 'main'Alexander Færøy2023-07-122-2/+2
|\ \ \ | |/ / |/| | | | | | | | "Fix" CI complaints about "Conversation" See merge request tpo/core/arti!1402
| * | tor-circmgr: Add two possibly-needed docsrs annotationsIan Jackson2023-07-122-0/+2
| | | | | | | | | | | | | | | I don't know if these are needed because the rules are not documented afaict. But it seems like probably they ought to be there?
| * | tor-proto: Conversation: drop two otiose cfg(feature)Ian Jackson2023-07-122-2/+0
| | | | | | | | | | | | These fns are in a feature-gated impls on feature-gated structs.
* | | Gate builder() behind experimental-api featureSaksham Mittal2023-07-121-1/+1
|/ /
* | Merge branch 'channelfactory' into 'main'Nick Mathewson2023-07-121-1/+7
|\ \ | | | | | | | | | | | | Expose channel builder in order to create channels more efficiently in external code See merge request tpo/core/arti!1374
| * | Make CompoundFactory private for external codeSaksham Mittal2023-07-071-1/+0
| | |
| * | Mark builder() as experimentalSaksham Mittal2023-07-061-0/+1
| | |
| * | Import ChannelFactory instead of CompoundFactorySaksham Mittal2023-07-061-3/+3
| | |
| * | Rename get_channelbuilder() to builder()Saksham Mittal2023-07-061-1/+1
| | |
| * | Conditionally make CompoundFactory publicSaksham Mittal2023-07-061-1/+2
| | |
| * | Remove now unnecessary lines for importSaksham Mittal2023-07-051-2/+0
| | |
| * | Import CompoundFactory regardless of feature levelSaksham Mittal2023-07-051-3/+1
| | |
| * | Create new method to expose CompoundFactorySaksham Mittal2023-07-051-0/+9
| | |
| * | Expose CompoundFactory for later exposure in APISaksham Mittal2023-07-051-1/+1
| | |
* | | arti-client: Remove outdated TODO.Gabriela Moldovan2023-07-111-3/+0
| | | | | | | | | | | | These errors aren't ignored anymore.
* | | Merge branch 'explain_952_fix' into 'main'Nick Mathewson2023-07-111-0/+3
|\ \ \ | | | | | | | | | | | | | | | | Explain the code for the #952 fix. See merge request tpo/core/arti!1391
| * | | Explain the code for the #952 fix.Nick Mathewson2023-07-101-0/+3
| | | | | | | | | | | | | | | | | | | | Let's explain what Trinity did in its fix for #952, so that we know why this code is here the next time we find it.
* | | | Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-11232-0/+263
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | clippy: Allow some of our existing code patterns See merge request tpo/core/arti!1396
| * | | | clippy: tor-error: Use convert::identity for into_internal!Ian Jackson2023-07-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This launders the closure so that clippy's clippy::redundant_closure_call can't see it. We can't have a local #[allow] because it would be on an expression, which isn't allowed on stable. This avoids having to use more clumsy idioms at call sites.
| * | | | tor-llcrypto: Add a missing instance of the standard lint blockIan Jackson2023-07-101-0/+10
| | | | | | | | | | | | | | | | | | | | This fixes a needless_vec lint on nightly.
| * | | | Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-10231-0/+249
| | | | |
* | | | | rng docs: Fix two linksIan Jackson2023-07-101-2/+2
| | | | |