Commit Graph

82 Commits

Author SHA1 Message Date
Aizhan
54e279ad93 avoid throwing htpp 404 error 2015-08-12 09:11:01 -06:00
Glenn Renfro
54f76bc2fd GH-193 logs warning if failFast is false
ConfigServicePropertySourceLocator should log a warning and not an error if failFast is false
2015-07-18 09:59:53 +01:00
Kees Koffeman
ccc44db8eb Search in ancestors for bean of type ConfigClientProperties
Before this change we check that it is there, then don't look in the
ancestors. A test would be useful.

Fixes gh-191
2015-07-10 11:53:40 +01:00
Dave Syer
1a0e6689dc Prepare master for next snapshot 2015-06-26 10:57:18 +01:00
Dave Syer
059a2078f3 Revert "added optional spring-security-rsa"
This reverts commit 343d5e47ea.
2015-06-24 20:42:11 +01:00
Spencer Gibb
343d5e47ea added optional spring-security-rsa 2015-06-24 12:18:42 -06:00
Dave Syer
bb0aab0471 Rename to health.config.enabled
More consistent with other health inidicator flags.
2015-05-27 10:06:35 +01:00
Dave Syer
4bae50676a Add spring.cloud.config.health.enabled (default true)
Fixes gh-159
2015-05-27 09:52:15 +01:00
wojtkiewicz
7437cdef49 Introduce TextEncryptorLocator abstraction
Allows more customization of encryption and decryption stack. Should
be no change for existing users.

Fixes gh-124
2015-05-26 15:26:04 +01:00
Dave Syer
ce3a20d262 Allow label to be a comman-separated list on config client
The client will search through a list of labels until it finds one
that succeeds, otherwise fail.

Fixes gh-153
2015-05-19 12:51:10 +01:00
Spencer Gibb
242baae663 add a configurable health indicator for the Config Server
fixes gh-142
2015-05-04 13:32:51 -06:00
Dave Syer
5d1af78f91 Update to 1.0.2 snapshots 2015-04-23 11:11:21 +01:00
Dave Syer
a1cbf78188 Only enable retry if failFast=true 2015-04-21 08:41:29 +02:00
Dave Syer
5f379c0a62 Add support for retry in config client
If Spring Retry is on the classpath (and AspectJ) the config client
will create a proxy for the ConfigServerPropertySourceLocator that
retries a failed environment fetch. In this way the client can be
made to wait for the config server to come up, even if failFast=true.
(If failFast=false, the default, then it has no effect.)

Fixes gh-90, fixes gh-129
2015-04-21 08:20:07 +02:00
Dave Syer
5a80ce9e3a Explicitly list profiles and label in Environment
Fixes gh-111
2015-03-20 13:13:52 +00:00
Dave Syer
ea138e8dbd Default label on client is null (so server can set priority)
Fixes gh-108
2015-03-20 07:59:49 +00:00
Dave Syer
24904a4d6d Add annotation processor 2015-03-19 14:26:41 +00:00
Dave Syer
7b6fdb5f72 Re-organize non-config concerns in spring-cloud-context
Fixes gh-110 See gh-104
2015-03-19 11:49:33 +00:00
Dave Syer
02b13a41b2 Moved non-config client related code into commons
Refresh, Bootstrap and encryption features all moved into commons

See gh-104
2015-03-18 15:41:20 +00:00
Dave Syer
cab00b3edd Prevent aggressive bean instantiation with config props rebinder
A BeanPostProcessor has to be a good citizen and not force other beans
to be instantiated. ConfigurationPropertiesRebinder was a nightmare in
this regard. Fixed now by knowing the bean ids of its dependencies.
2015-03-18 13:05:23 +00:00
Dave Syer
83ef3e4b74 Disable config server client by default in config server
This change adds a listener that inserts a PropertySource really early
so that spring.cloud.config.enabled=false is the default in a config
server. It can be overridden if the user primes the Environment with
spring.cloud.config.enabled=true.

See gh-104
2015-03-17 15:14:32 +00:00
Dave Syer
b49ceed3c5 Config server health indicator default status changed to UNKNOWN
In the unlikely event that the property source locator throws an
exception we go with DOWN, but if there are no property sources
we just mark it as UNKNOWN. It's then a business decision whether or
not to rely on the server to be there at runtime (e.g. in a /refresh).

See gh-104
2015-03-17 13:13:28 +00:00
Dave Syer
bcef73bc98 Add encrypt.keyStore.secret property
So that the keystore and the key can have independent secrets
(the "secret" is the key, and the "password" is the store).

Fixes gh-98
2015-03-09 22:15:41 +00:00
Dave Syer
d4553f6a57 Update to next snapshot 2015-03-03 14:56:26 +00:00
Dave Syer
8a44cf5fa5 Simplfy RefreshScope
By adding a proxyMode to the @RefreshScope annotation we
no longer need to do all teh autoProxy stuff in GenericScope
(apparently Spring does it for you now).

See gh-96
2015-03-02 15:25:46 +00:00
Dave Syer
80cc7f9800 source->environment 2015-02-27 15:52:45 +00:00
Dave Syer
9a8e8e7627 Back to configure->config
The connectors project doesn't use any of the subpackages we do
here so if we movethe Environment and PropertySource into a sub-
package it should be safe.

See gh-91
2015-02-27 15:33:43 +00:00
Dave Syer
105612d30e Config package name change to avoid conflict with connectors
Fixes gh-91
2015-02-25 17:13:00 +00:00
Dave Syer
32bc35b915 Re-order initializers so bootstrap properties can be decrypted
The Environment only picks up the "bootstrap" property source when
the parent context is set, and that was happening at order=0. Moving
it to a higher order than the decryption initializer makes it possible
to decrypt properties in bootstrap.

Fixes gh-84
2015-02-13 09:52:58 +00:00
Dave Syer
f8d91ef32b Add some Javadocs 2015-02-06 09:52:23 +00:00
Dave Syer
9e35f60d97 Initialize beans after rebinding as necessary
On startup a bean will be bound by the
ConfigurationPropertiesBindingPostProcessor and then initialized
by the ApplicationContext. The ConfigurationPropertiesRebinder
does the binding but not the initialization (until this change).

Fixes gh-80
2015-02-05 14:24:18 +01:00
Dave Syer
79d20a0f74 Fix error message if not failing fast
Fixes gh-78
2015-02-04 11:46:14 +01:00
Dave Syer
6d3a60b64c Add a call to update log levels during bootstrap
Since the bootstrap customizations are applied in ApplicationContextInitializers
they come too late to affect the logging levels. But the LoggingRebinder listener
isn't installed yet, and the context is not ready for events to be published. So
to get the logging changes in as early as possible we actually need to explicitly
apply them in the property source initializer as soon as the remote properties are
available.

Fixes gh-74, fixes gh-75
2015-01-30 11:44:22 +00:00
Dave Syer
e5e4cb0348 Change method name from getUri() to getRawUri()
Users would have seen DOWN status in a health indicator whenever
the config server was secure.

Fixes gh-69
2015-01-23 17:39:14 +00:00
Dave Syer
8c6740ab71 Use only ConfigFileApplicationListener in server mini-application
In the server we use a SpringApplicationEnvironmentRepository to load
the YAML and properties files from git (or locally). It creates a mini
SpringApplication so as to faithfully replicate the way the Environment
is created. Unfortunately that can have side effects on the server
application itself (e.g. setting log levels). In particular if the
mini SpringApplication fails to start then the log levels could be
left in a "preInitialized" state with all log levels OFF by default.

This change ensures that the server logs all errors when loading YAML
and properties files, and also that the client logs the error response
if it is JSON (as it should be).

Fixes gh-66, fixes gh-67
2015-01-21 14:40:39 +00:00
Dave Syer
55f04aaa38 More @Conditionals to prevent error if bootstrap disabled
If user disables bootstrap configuration
(spring.cloud.bootstrap.enabled:false) we have to anticipate some
beans will be missing.

Fixes gh-65
2015-01-19 16:51:53 +00:00
Dave Syer
048bc6a9a7 systemPropertiesOverride -> overrideSystemProperties 2015-01-17 15:11:47 +00:00
Dave Syer
a0c9ae3ff0 Allow system property override to be switched off
The default behaviour is the same as before, so a config client
adds the remote property sources "first" (i.e. ahead of system
properties). If the user sets up a  remote config repo with
spring.cloud.config.overrideSystemProperties=false they can
change this behaviour and insert the new property source after
systemEnvironment (i.e. before local config files but after the
other local sources). Of course using an `application.yml` on
the server you can change the default  for all applications.

There is also a new feature in the config server where the operator
can add a map of override properties in
spring.cloud.config.server.overrides.* and have them added with
highest priority in the Environment returned from the server.
Using that the operator can prevent config repositories from
changing the override behaviour by setting
spring.cloud.config.allowOverride=false.

Fixes gh-57
2015-01-16 16:24:41 +00:00
Dave Syer
1a2c21a081 Move health indicator to main application context 2015-01-16 14:12:59 +00:00
Dave Syer
d8c7cc52fe Be smarter about the ConfigClientProperties and parent context
In case there is a parent context we can re-use the bean from that
if it exists, instead of always creating it and risking the values
being different.
2015-01-16 14:03:12 +00:00
Stefan Djurasic
e2b4bea238 Fixing copy/paste error in BootsrapApplicationListener
... which prevented using an external bootstrap.properties file

Fixes gh-56, fixes gh-59
2015-01-15 16:14:56 +00:00
Dave Syer
3796133980 Use @ConditionalOnProperty where possible 2015-01-15 14:07:45 +00:00
Dave Syer
2a718a2d40 Suppress compiler warnings 2015-01-02 07:29:48 +00:00
Spencer Gibb
fade46210e make ConfigClientProperties required=false
fixes gh-50
2014-12-16 12:55:02 -07:00
Spencer Gibb
eb48314cea added failFast option
fixes gh-1
2014-12-04 19:38:02 -07:00
Marcin Zajaczkowski
66ab6ca461 Small simplifications in BootstrapApplicationListener
Fixes gh-42
2014-12-04 08:35:40 +00:00
Spencer Gibb
28b27dfac7 add RefreshScopeRefreshedEvent when RefreshScope.refresh*() is called. This is so apps can do something when a POST is received at /refresh even if the environment hasn't changed. 2014-12-03 11:36:47 -07:00
Dave Syer
2caf87f92e Revert some @Ignores after bugfixes in Spring
Also lifts the restriction on @RefreshScope and @Configuration
(since that was imposed by a bug).

Fixes gh-43
2014-12-03 17:19:05 +00:00
Dave Syer
3911d91e57 Remove reflection hack 2014-12-03 15:06:17 +00:00
Dave Syer
0d2cb07384 Revert some of the changes to RefreshScope and @Configuration
Some things were changed in Spring and some problems are fixed
(while at least one is not - scope!="refresh" for a @Configuration
with @RefreshScope)
2014-12-03 14:31:39 +00:00