Commit graph

11 commits

Author SHA1 Message Date
Brett Smith
5f85d9c747 config: Add Config.payment_threshold() method.
This just returns a constant for now, but we know it may need to be
configurable in the future.  Other code can start using this now
to be configurable in the future.
2020-03-29 10:21:37 -04:00
Brett Smith
33cb734b19 config: Create cache database files with 0o600 mode.
I wasn't too worried about this earlier because the cache mainly stores
a bunch of numbers, but there's a little more than that: the generated
URLs also include original attachment filenames, which might be sensitive
(referencing people's names, bank names, etc.). Tighten security
accordingly.
2020-03-27 10:55:30 -04:00
Brett Smith
a8407c7b6a rtutil: Add RTLinkCache class to cache links to disk.
This will greatly reduce RT requests across multiple runs
and speed up link checking/conversion.
2020-03-27 07:35:45 -04:00
Brett Smith
1155212376 config: Add Config.cache_dir_path method. 2020-03-25 15:15:38 -04:00
Brett Smith
96ef7c9cbb test_config: Make update_environ more robust against failures. 2020-03-25 14:04:47 -04:00
Brett Smith
d8b0a56fb4 tests: Set a default CONSERVANCY_REPOSITORY for testing. 2020-03-25 14:03:25 -04:00
Brett Smith
c4ce59da75 config: Add Config.rt_wrapper method.
This returns a cached version of the new rtutil.RT class,
so that a single process can easily grab references to one
instance with one cache of ticket/attachment data, etc.
2020-03-24 23:30:31 -04:00
Brett Smith
f09f029fc4 config: Add Config.rt_client method. 2020-03-24 09:08:08 -04:00
Brett Smith
8d3816a8fd config: Add Config.rt_credentials method.
This loads settings from the same environment variables and ~/.rtrc
file as the rt CLI.

Note that it does *not* support RTCONFIG and the config file
searching, because right now that seems like more work for more
trouble to me.
2020-03-23 15:19:15 -04:00
Brett Smith
5140ca64f6 tests: Clean the environment before running tests.
As we start reading more sensitive user configuration (like RT credentials),
this fixture makes it simpler to ensure that the tests never read the user's
real configuration, which could lead to problems like passwords in tracebacks.
2020-03-23 12:01:02 -04:00
Brett Smith
71531913d5 config: Start module.
Ultimately all values that come from user configuration will be generated
here.
2020-03-19 14:31:21 -04:00