Kixunil / btc-rpc-proxy

Finer-grained permission management for bitcoind.
MIT License
63 stars 18 forks source link

Implemented global switch default_fetch_blocks #8

Closed Kixunil closed 3 years ago

Kixunil commented 3 years ago

This change allows the users to globally enable fetch_blocks unless specific user config says otherwise. This effectively turns it from whitelist to blacklist. While it's a good practice to stay away from blacklists, I believe it can be justified in this case as the call is mostly harmless.

CC @dr-bonez

I did not yet have the time to do full test (actually setting it in the config), I will do it a bit later. The change is straightforward, simple, type safe, and it contains basic unit tests (actually exhaustively checking all options since it seemed simple enough) so it shouldn't be considered noise. :)

Kixunil commented 3 years ago

I left it in lib as I didn't know if you're interested in this feature. It's still strictly semver breaking (constructors will fail to construct a struct with new field) although code using purely serde would probably keep working. Should be easy to adapt the code anyway.

dr-bonez commented 3 years ago

You aren't altering the constructors of any existing struct, so I'm not sure it is semver breaking. Anyway, I have no objections, but I am not using the feature as I am constructing Users directly. I needed custom deserialization code, to work with the Embassy config system.

Kixunil commented 3 years ago

Ah, true, for some reason I thought that the config from configure_me is included in the lib (where a new switch was added which would be semver-breaking). So yes, it's fully backwards-compatible.