英文:
Disable swagger by hostname - Spring
问题
有没有可能根据请求的主机名(动态IP)在基于Spring的应用程序中对Swagger资源设置安全性。目前我正在使用 @Profile
注解在生产环境中禁用Swagger,但我想在我的生产服务中使用Swagger。我可以从两个主机名访问此服务。一个是公共的,另一个是受VPN保护的内部地址。我想在内部地址上看到Swagger UI,但我需要拒绝来自公共地址的访问。有什么建议吗?谢谢。
英文:
is there any possibility to set security on swagger resources in Spring application based on the requested hostname (dynamic IP). Now I am using @Profile
annotation to disable swagger in production, but I want to use swagger for my production service. I can access this service from two hostnames. One is public, the other is internal and secured by a VPN. I want to see swagger UI on internal address but I need to reject access from the public. Any suggestion? Thanks.
专注分享java语言的经验与见解,让所有开发者获益!
评论