From 8272c057e53e49583f0dfdca4ec17cf2c62a61bd Mon Sep 17 00:00:00 2001
From: buildmaster foo/bar, replacing the slash would result in a label that looks like
-foo(_)bar. Be careful with the brackets in
-the URL if you are using a command line client like curl (e.g. escape
-them from the shell with quotes '').
Spring Cloud Config Server supports a git repository URL with
+foo(_)bar. The inclusion of the special string "(\_)" can also be
+applied to the {application} parameter. Be careful with the brackets
+in the URL if you are using a command line client like curl (e.g.
+escape them from the shell with quotes '').
Spring Cloud Config Server supports a git repository URL with
placeholders for the {application} and {profile} (and {label} if
you need it, but remember that the label is applied as a git label
anyway). So you can easily support a "one repo per application" policy
@@ -94,7 +95,15 @@ using (for example):
server: git: uri: https://github.com/myorg/{application}
or a "one repo per profile" policy using a similar pattern but with
-{profile}.
There is also support for more complex requirements with pattern
+{profile}.
Additionally, using the special string "(\_)" within your
+{application} parameters can enable support for multiple
+organizations (for example):
spring: + cloud: + config: + server: + git: + uri: https://github.com/{application}
where {application} is provided at request time in the format
+"organization(\_)application".
There is also support for more complex requirements with pattern
matching on the application and profile name. The pattern format is a
comma-separated list of {application}/{profile} names with wildcards
(where a pattern beginning with a wildcard may need to be
@@ -251,7 +260,7 @@ Example:
69pcVH/4rmLbXdcmNYGm6iu+MlPQk4BUZknHSmVHIFdJ0EPupVaQ8RHT - -----END RSA PRIVATE KEY-----
Table 2.1. SSH Configuration properties
| Property Name | Remarks |
|---|---|
ignoreLocalSshSettings | If true, use property based SSH config instead of file based. Must be set at as |
privateKey | Valid SSH private key. Must be set if |
hostKey | Valid SSH host key. Must be set if |
hostKeyAlgorithm | One of |
strictHostKeyChecking |
|
knownHostsFile | Location of custom .known_hosts file |
preferredAuthentications | Override server authentication method order. This should allow evade login prompts if server has keyboard-interactive authentication before |
Spring Cloud Config Server also supports a search path with + -----END RSA PRIVATE KEY-----
Table 2.1. SSH Configuration properties
| Property Name | Remarks |
|---|---|
ignoreLocalSshSettings | If true, use property based SSH config instead of file based. Must be set at as |
privateKey | Valid SSH private key. Must be set if |
hostKey | Valid SSH host key. Must be set if |
hostKeyAlgorithm | One of |
strictHostKeyChecking |
|
knownHostsFile | Location of custom .known_hosts file |
preferredAuthentications | Override server authentication method order. This should allow evade login prompts if server has keyboard-interactive authentication before |
Spring Cloud Config Server also supports a search path with
placeholders for the {application} and {profile} (and {label} if
you need it). Example:
spring: cloud: @@ -522,7 +531,7 @@ the key value with "@" and provide the file path, e.g.$ AQAjPgt3eFZQXwt8tsHAVv/QHiY5sI2dRcR+...The key argument is mandatory (despite having a
--prefix).
The Config Server can use a symmetric (shared) key or an asymmetric one (RSA key pair). The asymmetric choice is superior in terms of security, but it is often more convenient to use a symmetric key since -it is just a single property value to configure.
To configure a symmetric key you just need to set encrypt.key to a
+it is just a single property value to configure in the bootstrap.properties.
To configure a symmetric key you just need to set encrypt.key to a
secret String (or use an enviroment variable ENCRYPT_KEY to keep it
out of plain text configuration files).
To configure an asymmetric key you can either set the key as a
PEM-encoded text value (in encrypt.key), or via a keystore (e.g. as
@@ -539,7 +548,7 @@ if your config server really is relatively insecure and only a
handful of clients need the encrypted properties.
To create a keystore for testing you can do something like this:
$ keytool -genkeypair -alias mytestkey -keyalg RSA \ -dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=US" \ -keypass changeme -keystore server.jks -storepass letmein
Put the server.jks file in the classpath (for instance) and then in
-your application.yml for the Config Server:
encrypt: +yourbootstrap.ymlfor the Config Server:encrypt: keyStore: location: classpath:/server.jks password: letmein diff --git a/2.0.x/single/spring-cloud-config.html b/2.0.x/single/spring-cloud-config.html index 7b4ec9d1..bc354468 100644 --- a/2.0.x/single/spring-cloud-config.html +++ b/2.0.x/single/spring-cloud-config.html @@ -184,9 +184,10 @@ git branch or tag name contains a slash ("/") then the label in the HTTP URL should be specified with the special string "(_)" instead (to avoid ambiguity with other URL paths). For example, if the label isfoo/bar, replacing the slash would result in a label that looks like -foo(_)bar. Be careful with the brackets in -the URL if you are using a command line client like curl (e.g. escape -them from the shell with quotes '').Spring Cloud Config Server supports a git repository URL with +
foo(_)bar. The inclusion of the special string "(\_)" can also be +applied to the{application}parameter. Be careful with the brackets +in the URL if you are using a command line client like curl (e.g. +escape them from the shell with quotes '').Spring Cloud Config Server supports a git repository URL with placeholders for the
{application}and{profile}(and{label}if you need it, but remember that the label is applied as a git label anyway). So you can easily support a "one repo per application" policy @@ -196,7 +197,15 @@ using (for example):server: git: uri: https://github.com/myorg/{application}or a "one repo per profile" policy using a similar pattern but with -
{profile}.There is also support for more complex requirements with pattern +
{profile}.Additionally, using the special string "(\_)" within your +
{application}parameters can enable support for multiple +organizations (for example):spring: + cloud: + config: + server: + git: + uri: https://github.com/{application}where
{application}is provided at request time in the format +"organization(\_)application".There is also support for more complex requirements with pattern matching on the application and profile name. The pattern format is a comma-separated list of
{application}/{profile}names with wildcards (where a pattern beginning with a wildcard may need to be @@ -353,7 +362,7 @@ Example:69pcVH/4rmLbXdcmNYGm6iu+MlPQk4BUZknHSmVHIFdJ0EPupVaQ8RHT - -----END RSA PRIVATE KEY-----Table 2.1. SSH Configuration properties
Property Name Remarks ignoreLocalSshSettings
If true, use property based SSH config instead of file based. Must be set at as
spring.cloud.config.server.git.ignoreLocalSshSettings, not inside a repository definition.privateKey
Valid SSH private key. Must be set if
ignoreLocalSshSettingsis true and Git URI is SSH formathostKey
Valid SSH host key. Must be set if
hostKeyAlgorithmis also sethostKeyAlgorithm
One of
ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384 ,ecdsa-sha2-nistp521. Must be set ifhostKeyis also setstrictHostKeyChecking
trueorfalse. If false, ignore errors with host keyknownHostsFile
Location of custom .known_hosts file
preferredAuthentications
Override server authentication method order. This should allow evade login prompts if server has keyboard-interactive authentication before
publickeymethod.Spring Cloud Config Server also supports a search path with + -----END RSA PRIVATE KEY-----
Table 2.1. SSH Configuration properties
Property Name Remarks ignoreLocalSshSettings
If true, use property based SSH config instead of file based. Must be set at as
spring.cloud.config.server.git.ignoreLocalSshSettings, not inside a repository definition.privateKey
Valid SSH private key. Must be set if
ignoreLocalSshSettingsis true and Git URI is SSH formathostKey
Valid SSH host key. Must be set if
hostKeyAlgorithmis also sethostKeyAlgorithm
One of
ssh-dss, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384 ,ecdsa-sha2-nistp521. Must be set ifhostKeyis also setstrictHostKeyChecking
trueorfalse. If false, ignore errors with host keyknownHostsFile
Location of custom .known_hosts file
preferredAuthentications
Override server authentication method order. This should allow evade login prompts if server has keyboard-interactive authentication before
publickeymethod.Spring Cloud Config Server also supports a search path with placeholders for the
{application}and{profile}(and{label}if you need it). Example:spring: cloud: @@ -624,7 +633,7 @@ the key value with "@" and provide the file path, e.g.$ AQAjPgt3eFZQXwt8tsHAVv/QHiY5sI2dRcR+...The key argument is mandatory (despite having a
--prefix).The Config Server can use a symmetric (shared) key or an asymmetric one (RSA key pair). The asymmetric choice is superior in terms of security, but it is often more convenient to use a symmetric key since -it is just a single property value to configure.
To configure a symmetric key you just need to set
encrypt.keyto a +it is just a single property value to configure in thebootstrap.properties.To configure a symmetric key you just need to set
encrypt.keyto a secret String (or use an enviroment variableENCRYPT_KEYto keep it out of plain text configuration files).To configure an asymmetric key you can either set the key as a PEM-encoded text value (in
encrypt.key), or via a keystore (e.g. as @@ -641,7 +650,7 @@ if your config server really is relatively insecure and only a handful of clients need the encrypted properties.To create a keystore for testing you can do something like this:
$ keytool -genkeypair -alias mytestkey -keyalg RSA \ -dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=US" \ -keypass changeme -keystore server.jks -storepass letmeinPut the
server.jksfile in the classpath (for instance) and then in -yourapplication.ymlfor the Config Server:encrypt: +yourbootstrap.ymlfor the Config Server:encrypt: keyStore: location: classpath:/server.jks password: letmein diff --git a/2.0.x/spring-cloud-config.xml b/2.0.x/spring-cloud-config.xml index 81ad9740..2bc14886 100644 --- a/2.0.x/spring-cloud-config.xml +++ b/2.0.x/spring-cloud-config.xml @@ -277,9 +277,10 @@ git branch or tag name contains a slash ("/") then the label in the HTTP URL should be specified with the special string "(_)" instead (to avoid ambiguity with other URL paths). For example, if the label isfoo/bar , replacing the slash would result in a label that looks like -foo(_)bar . Be careful with the brackets in -the URL if you are using a command line client like curl (e.g. escape -them from the shell with quotes ''). +foo(_)bar . The inclusion of the special string "(\_)" can also be +applied to the{application} parameter. Be careful with the brackets +in the URL if you are using a command line client like curl (e.g. +escape them from the shell with quotes '').Placeholders in Git URI Spring Cloud Config Server supports a git repository URL with @@ -295,6 +296,17 @@ using (for example): uri: https://github.com/myorg/{application}or a "one repo per profile" policy using a similar pattern but with +{profile} .Additionally, using the special string "(\_)" within your + +{application} parameters can enable support for multiple +organizations (for example):spring: + cloud: + config: + server: + git: + uri: https://github.com/{application} +where {application} is provided at request time in the format +"organization(\_)application".Pattern Matching and Multiple Repositories @@ -1016,7 +1028,7 @@ AQAjPgt3eFZQXwt8tsHAVv/QHiY5sI2dRcR+...The Config Server can use a symmetric (shared) key or an asymmetric one (RSA key pair). The asymmetric choice is superior in terms of security, but it is often more convenient to use a symmetric key since -it is just a single property value to configure. +it is just a single property value to configure in thebootstrap.properties .To configure a symmetric key you just need to set @@ -1053,7 +1065,7 @@ handful of clients need the encrypted properties. -dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=US" \ -keypass changeme -keystore server.jks -storepass letmeinencrypt.key to a secret String (or use an enviroment variableENCRYPT_KEY to keep it out of plain text configuration files).Put the +yourserver.jks file in the classpath (for instance) and then in -yourapplication.yml for the Config Server:bootstrap.yml for the Config Server:encrypt: keyStore: location: classpath:/server.jks