Secures APIs by validating keys stored in either files or proxies.xml. Keys can be received from clients via HTTP headers or URL query parameters. Additional permission checks are possible through scope validation - scopes are loaded into an Exchange property and can be checked using the "hasScope()" SpEL function.
<api port="2000">
<openapi location="fruitshop-api-v2-openapi-3-security.yml" validateSecurity="yes"/>
<apiKey required = "false">
<headerExtractor name="X-Api-Key"/>
</apiKey>
<!--Swagger UI requires CORS but FruitShop does not use CORS, so we disable CORS.-->
<headerFilter>
<exclude>Origin</exclude>
</headerFilter>
</api>