stratisproject / StratisBitcoinFullNode

Bitcoin full node in C#
https://stratisplatform.com
MIT License
787 stars 315 forks source link

Implicit controller registration selection #4126

Open drmathias opened 4 years ago

drmathias commented 4 years ago

Allows configuration for the features which are used when implicitly registering API controllers. This is necessary when registering a new feature on the full node that includes a controller, but not wanting to include it in the full node web API (for example, wanting to provide a seperate API). Also useful for nodes where you want to provide selective access to the API.

Usage

new FullNodeBuilder()
    // ...
    .UseApi(options =>
    {
        options.Include<SmartContractWalletFeature>();
    })
new FullNodeBuilder()
    // ...
    .UseApi(options =>
    {
        options.Exclude<BlockStoreFeature>();
        options.Exclude<ConsensusFeature>();
    })

This doesn't effect explicitly registered controllers.

codingupastorm commented 4 years ago

Cool, we were looking at doing something similar recently. Requested a couple of reviewers who were looking at this.