Class OAuth2ConfigDataLocationResolver
java.lang.Object
io.pivotal.spring.cloud.config.client.OAuth2ConfigDataLocationResolver
- All Implemented Interfaces:
org.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.cloud.config.client.ConfigServerConfigDataResource>,Ordered
public class OAuth2ConfigDataLocationResolver
extends Object
implements org.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.cloud.config.client.ConfigServerConfigDataResource>, Ordered
Using oauth2 properties to configure an authorization interceptor for the
RestTemplate that calls config server.
Note: Despite implementing ConfigDataLocationResolver, this class does not
resolve any location. It only configures and registers the
ConfigClientRequestTemplateFactory which later will be used by
ConfigServerConfigDataLocationResolver to create RestTemplate for
calling config server.
Finally, it registers the RestTemplate bean to be consumed by
ConfigResourceClientAutoConfiguration and
VaultTokenRenewalAutoConfiguration after application startup.
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionOAuth2ConfigDataLocationResolver(org.springframework.boot.logging.DeferredLogFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()It should be registered beforeConfigServerConfigDataLocationResolver.booleanisResolvable(org.springframework.boot.context.config.ConfigDataLocationResolverContext resolverContext, org.springframework.boot.context.config.ConfigDataLocation location) List<org.springframework.cloud.config.client.ConfigServerConfigDataResource>resolve(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location) List<org.springframework.cloud.config.client.ConfigServerConfigDataResource>resolveProfileSpecific(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location, org.springframework.boot.context.config.Profiles profiles)
-
Constructor Details
-
OAuth2ConfigDataLocationResolver
public OAuth2ConfigDataLocationResolver(org.springframework.boot.logging.DeferredLogFactory factory)
-
-
Method Details
-
isResolvable
public boolean isResolvable(org.springframework.boot.context.config.ConfigDataLocationResolverContext resolverContext, org.springframework.boot.context.config.ConfigDataLocation location) - Specified by:
isResolvablein interfaceorg.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.cloud.config.client.ConfigServerConfigDataResource>
-
resolve
public List<org.springframework.cloud.config.client.ConfigServerConfigDataResource> resolve(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location) throws org.springframework.boot.context.config.ConfigDataLocationNotFoundException, org.springframework.boot.context.config.ConfigDataResourceNotFoundException - Specified by:
resolvein interfaceorg.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.cloud.config.client.ConfigServerConfigDataResource>- Throws:
org.springframework.boot.context.config.ConfigDataLocationNotFoundExceptionorg.springframework.boot.context.config.ConfigDataResourceNotFoundException
-
resolveProfileSpecific
public List<org.springframework.cloud.config.client.ConfigServerConfigDataResource> resolveProfileSpecific(org.springframework.boot.context.config.ConfigDataLocationResolverContext context, org.springframework.boot.context.config.ConfigDataLocation location, org.springframework.boot.context.config.Profiles profiles) throws org.springframework.boot.context.config.ConfigDataLocationNotFoundException - Specified by:
resolveProfileSpecificin interfaceorg.springframework.boot.context.config.ConfigDataLocationResolver<org.springframework.cloud.config.client.ConfigServerConfigDataResource>- Throws:
org.springframework.boot.context.config.ConfigDataLocationNotFoundException
-
getOrder
public int getOrder()It should be registered beforeConfigServerConfigDataLocationResolver. SeeConfigServerConfigDataLocationResolver.getOrder()
-