Security

你可以通过任何对你来说有意义的方式来保护你的 Config Server(从物理网络安全到 OAuth2 持有者令牌),因为 Spring Security 和 Spring Boot 为许多安全安排提供支持。

You can secure your Config Server in any way that makes sense to you (from physical network security to OAuth2 bearer tokens), because Spring Security and Spring Boot offer support for many security arrangements.

若要使用默认的 Spring Boot 配置的 HTTP 基础身份验证,请将 Spring Security 包含在类路径中(例如,通过 spring-boot-starter-security)。默认情况下,用户名为 user,且密码为随机生成。随机生成的密码实际上并不好用,因此我们建议你配置密码(通过设置 spring.security.user.password)并对其进行加密(请参阅以下说明,了解如何进行加密)。

To use the default Spring Boot-configured HTTP Basic security, include Spring Security on the classpath (for example, through spring-boot-starter-security). The default is a username of user and a randomly generated password. A random password is not useful in practice, so we recommend you configure the password (by setting spring.security.user.password) and encrypt it (see below for instructions on how to do that).