WebApiShard is an important shard that allows to expose Web API endpoints based on OpeAPI specifications.
WebApiShard comes with a WebApiSettings class that holds settings to configure the service.
To add the shard to the forge, the
UseApi has to be called, passing optional
options to further configure the service
WebApiShard implements the Web API controllers using the standard aspnet ControllerBase class but decorates it with a set of default attributes needed to expose these controllers in the right context.
To create a proper WebApiShard controller, an abstract base class
MithrilControllerBase exists that applies already the required attributes.
1 2 3 4
Areas are used to subdivide APIs based on grouping criteria and each area can be enabled or disabled by configuring the corresponding ApiServiceDefinition.
By default two areas are defined but custom areas can be created easily.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
WebApiShard controllers have to belong to a specific area. More information in Creating a Controller section.
DisableByEndPointActionFilterAttribute class, that's a registered ActionFilterAttribute, is responsible to enforce proper checks against executing an action on an unspecified, unknown or disabled area.
The current implementation may be subject to changes to implement the authentication and authorization layer.