Commit Graph

10 Commits

Author SHA1 Message Date
Katie Mancini
fa180ad585 check multiple locations for x509 certs
Summary:
This stack updates eden to be able to check all of the locations that able
users certificate may reside.

There can be multiple places where a cert may reside (we cant always
definitively choose one place to look based on the platform). Thus we
need to be able to configure multiple locations for certs in our eden
config.

This makes the switch over in eden from using one place for the client
cert to use and using the first available client cert from a list.

NOTE: most of this diff is fixing unit tests take a look at `EdenConfig.h` and `EdenConfig.cpp` first

Reviewed By: wez

Differential Revision: D23359939

fbshipit-source-id: 44beecce3ef098a734dbd7c5eb3fa5f0aad6b50b
2020-09-23 19:58:52 -07:00
Katie Mancini
903532758e teach eden to resolve THRIFT_TLS_CL_CERT_PATH in configs
Summary:
This stack updates eden to be able to check all of the locations that able
users certificate may reside.

THRIFT_TLS_CL_CERT_PATH is usally set with the location for the users x509
certs. So it seems best to check this location. In order to be able to check
this location, we need to be able to resolve the enviroment variable in our
parsing.

Reviewed By: wez, genevievehelsel

Differential Revision: D23359815

fbshipit-source-id: 2008cc52ab64d23dbcfda41292a60a4bf77a80df
2020-09-15 10:28:38 -07:00
Katie Mancini
76df592222 allow multiple prefixes for paths to be logged
Summary:
Currently we use a single path prefix to configure data fetch logging in eden
(i.e if the path of a file which we fetch is an extension of our configured
path, then we log that data fetch. )

There is some interest in extending this to multiple path prefixes, so that we
can log separate parts repo.

Reviewed By: StanislavGlebik

Differential Revision: D22877942

fbshipit-source-id: f6eb3dcb4fa460b4acab09677e972caf9421ddff
2020-09-02 22:54:23 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Adam Simpkins
aa5e6c7295 update license headers in C++ files
Summary:
Update the copyright & license headers in C++ files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487078

fbshipit-source-id: 19f24c933a64ecad0d3a692d0f8d2a38b4194b1d
2019-06-19 17:02:45 -07:00
Adam Simpkins
0c63605e75 add a config FieldConvertor for parsing nanoseconds
Summary:
Add a `FieldConvertor` implementation allowing a config field to be parsed
into a `std::chrono::nanoseconds` value.

Reviewed By: strager

Differential Revision: D15428932

fbshipit-source-id: d3ace45a2986717c798897534e7b3015eda35fa9
2019-06-11 13:08:29 -07:00
Adam Simpkins
60ef2759fe update FieldConverter API to support converting back to strings
Summary:
The `ConfigSetting` code previously used `folly::to<string>()` to convert
field values back to strings for debugging.  However, this only works for
values that actually are supported by `folly::to()`

This changes the code to use the `FieldConverter` to perform the conversion
back to string.  The `FieldConverter` class now contains the logic for doing
conversion both from strings and back to strings.

Reviewed By: strager

Differential Revision: D15428933

fbshipit-source-id: a37a978d151bf0ba79ca2a2b9107401c847b6591
2019-06-11 13:08:29 -07:00
Adam Simpkins
7fbe72c368 add config FieldConverter implementations for all arithmetic types
Summary:
Update the `FieldConverter` code to support parsing any arithmetic type
(integers and floating point) using `folly::to<T>()`.  Also change the `bool`
conversion implementation to use the same code.

This does change the `bool` implementation to accept any string accepted by
`folly::to<bool>(string)`.  The old code only allowed `true` and `false`.  The
new code allows other strings: `yes`, `no`, `y`, `n`, `0`, `1`, `on`, `off`

This also makes the implementation more efficient by eliminating some
unnecessary string copies and avoiding throwing exceptions internally on
error.

Reviewed By: wez

Differential Revision: D15428700

fbshipit-source-id: feb73a1f53775fbf3d3acb8585fa689f79c0db81
2019-06-11 13:08:28 -07:00
Adam Simpkins
e0f2d6671f minor clean up to isValidAbsolutePath() in FieldConverter.cpp
Summary:
Update the `isValidAbsolutePath()` implementation to use `kDirSeparator`, and
update the TODO comment.

Reviewed By: chadaustin

Differential Revision: D15162812

fbshipit-source-id: f52f0e85c5eef342723947c6efaa52992da1660b
2019-05-07 17:41:37 -07:00
Adam Simpkins
b4ca002c0c move the FieldConverter code to its own file
Summary:
Move the `FieldConverter` logic out of EdenConfig.h/cpp and into its own
module.

Reviewed By: chadaustin

Differential Revision: D15162816

fbshipit-source-id: f30d81329139e5827b81a609e83baddf71b6af5e
2019-05-07 17:41:36 -07:00