如何禁用Quarkus Web应用中的q/arc端点及暴露的CDI相关扩展
解决Quarkus 404页面暴露不必要端点的问题
完全禁用404端点列表功能
在application.properties中添加配置,直接关闭自动列出端点的特性:quarkus.http.error-page.404.auto-list-endpoints=false仅隐藏特定端点(保留列表功能)
若需要保留404页面的端点列表,但移除CDI/arc相关端点,通过配置排除指定路径:quarkus.http.endpoints.exclude=/q/arc/*如有其他需隐藏的CDI扩展端点,用逗号追加路径即可:
quarkus.http.endpoints.exclude=/q/arc/*,/q/xxx/*额外优化:限制健康端点访问
针对已集成的quarkus-smallrye-health,可配置访问权限避免公开暴露:quarkus.smallrye-health.path=/health quarkus.http.auth.permission.health.paths=/health/* quarkus.http.auth.permission.health.policy=authenticated
内容的提问来源于stack exchange,提问作者Sujal Mandal
相关产品推荐
相关产品推荐

