diff --git a/spring-cloud.html b/spring-cloud.html index f25f031..9e9c280 100644 --- a/spring-cloud.html +++ b/spring-cloud.html @@ -1116,6 +1116,25 @@ target cache. There is also a refresh(String) method to refresh an individual bean by name. This functionality is exposed in the /refresh endpoint (over HTTP or JMX).

+
+ + + + + +
+
Note
+
+@RefreshScope works (technically) on an @Configuration +class, but it might lead to surprising behaviour: e.g. it does not +mean that all the @Beans defined in that class are themselves +@RefreshScope. Specifically, anything that depends on those beans +cannot rely on them being updated when a refresh is initiated, unless +it is itself in @RefreshScope (in which it will be rebuilt on a +refresh and its dependencies re-injected, at which point they will be +re-initialized from the refreshed @Configuration). +
+

Encryption and Decryption

@@ -2463,6 +2482,35 @@ that it doesn’t need a tokenUri or authorizationUriclientId and clientSecret if it isn’t using the tokenInfoUri (i.e. if it has jwt.* or userInfoUri).

+
+

By default all your endpoints are protected (i.e. "/") but you can +pick and choose by adding a ResourceServerConfigurerAdapter (standard +Spring OAuth feature), e.g. to protect only the "/api/" resources

+
+
+
Application.java
+
+
@RestController
+@EnableOAuth2Resource
+class Application extends ResourceServerConfigurerAdapter {
+
+  @Override
+  public void configure(HttpSecurity http) throws Exception {
+    http.requestMatchers()
+      .antMatchers("/api/**")
+   .and()
+     .authorizeRequests()
+       .anyRequest().authenticated();
+  }
+
+  @RequestMapping('/api')
+  String home() {
+    'Hello World'
+  }
+
+}
+
+

Token Relay

@@ -2481,7 +2529,8 @@ it is proxying. Thus the SSO app above can be enhanced simply like this:

@EnableZuulProxy class Application { - @RequestMapping('/' + @RequestMapping('/') + @ResponseBody String home() { 'Hello World' } @@ -2688,7 +2737,7 @@ service or the "resource" service if you have one).