| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
This turns out to need quite a complicated algorithm.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This gets rid of `#[serde(flatten)]` which prevents serde_ignored (and
other kinds of introspection) from working properly.
The price is now that the toplevel has to deal with two configuration
objects.
The Resolvable trait is overkill right now, but is going to do More
Things in a moment. In particular, we need the impl on tuples, so
that the whole config can be processed in one go.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
We are going to need this for some generic code which is going to
appear shortly. Having it produced by impl_standard_builder seems
best. But that does mean being able to disable it, so extra stuff in
the macro. Nothing uses this trait yet.
ConfigResolveError is not used now either, but will be in a moment.
|
| | |
| |
| |
| |
| |
| |
| | |
I don't understand why this isn't tripping all the time. Maybe
because this is in a macro. Anyway, I am going to add a new
invocation of this macro from within a test where, empirically, it
trips.
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
ConfigurationSources: Allow config files to be world-readable.
Closes #475
See merge request tpo/core/arti!528
|
| | |
| |
| |
| | |
Fixes #475.
|
| |/
|
|
|
| |
This is an approximately minimal revision to get Builder in place;
subsequent commits will clean up the API.
|
| | |
|
| |
|
|
| |
This should satisfy our CI and turn it green again.
|
| |\
| |
| |
| |
| | |
Abolish arti-config, replacing with tombstone crate
See merge request tpo/core/arti!508
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This crate no longer has any reason to exist. All its remaining
functionality is generic enough to go into tor-config.
In this commit, we move the contents of lib.rs into a new file in
tor-config. It contains:
* Code motion
* The minimal "mod" and "use" changes
* The minimal doc comment
* A new a compat alias for ConfigurationSources.
The compat alias is there because various crates currently speak of
arti_config::ConfigurationSources and it is most convenient to fix
them up after the type is available in tor_config.
|
| | | |
|
| | |
| |
| |
| |
| | |
This deletes many handcoded impls. It also generates lots of impls
that we previously didn't have.
|
| |/
|
|
|
|
|
|
|
|
| |
Test the Deserialize impl of every config struct.
This detects bugs like the one fixed in !502.
The macro now becomes more complex because it needs to take options.
Right now this tt-munching option parser is overkill, but this
leave space for further options in the future.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
I have Plans for this macro. In particular:
* I have a wip branch which tests that the Builder can be
deserialised from an empty config (ie, that config reading
of a config with a blank section for this item works).
* I think we should autogenerate $Config::builder(),
and promote that, rather than $ConfigBuilder::default().
This macro could do that.
|
| |\
| |
| |
| |
| | |
arti-config: Move cmdline to tor-config
See merge request tpo/core/arti!498
|
| | |
| |
| |
| |
| |
| | |
This does not know anything about arti, only about TOML and Config.
Code motion, plus necessary import adjustments.
|
| |/ |
|
| |
|
|
|
| |
It is not clear to me how this `pub enum` survived the "inaccessible
pub" lint.
|
| |\
| |
| |
| |
| | |
Fix typos (using the typos-cli tool).
See merge request tpo/core/arti!486
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.)
|
| |
|
|
|
| |
Apropos
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/474#note_2800481
|
| | |
|
| |
|
|
| |
This is for lists of plain types (non-builder types).
|
| |
|
|
|
|
| |
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.)
|
| |
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
| |
The docs were a lie. $docs_and_attrs was missing from the expander.
And add a note about how any supplied docs are handled.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
This removes a caveat from the API and will be convenient for what is
coming.
|
| |
|
|
| |
The list accessor macro is going to want this.
|
| |
|
|
|
|
| |
Use MessagePack.
Signed-off-by: Ian Jackson <[email protected]>
|
| |
|
|
|
|
| |
And provide round-trip tests.
As per https://gitlab.torproject.org/tpo/core/arti/-/issues/371
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
We introduce LiteralPath struct, so that a literal path deserialises
from
some_path = { literal: "actual path string" }
This makes the deserialisation unambiguous.
|
| |
|
|
|
| |
Because the macro output is private, if we miss one out of the tests,
it doesn't fail due to dead code :-).
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798027
|
| |
|
|
|
| |
Requested in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798022
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798026
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798024
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798020
|