Skip to content

Commit

Permalink
Merge pull request #12 from quantics-io/release/0.3.2
Browse files Browse the repository at this point in the history
Release 0.3.2
  • Loading branch information
jomatt authored Nov 12, 2023
2 parents 8307b17 + 0e06996 commit bb043d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>io.quantics</groupId>
<artifactId>multitenant-oauth2-spring-boot-starter</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
<name>Spring Boot starter library for multi-tenant OAuth2 resource servers</name>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -40,7 +41,7 @@ public class MultiTenantResourceServerWebMvcConfiguration {

private static final Log logger = LogFactory.getLog(WebMvcConfigurer.class);

@Bean
@Bean({ "multiTenantHeaderInterceptor", "multiTenantInterceptor" })
@Conditional(HeaderCondition.class)
HandlerInterceptor multiTenantHeaderInterceptor(MultiTenantResourceServerProperties properties,
TenantDetailsService tenantService) {
Expand Down Expand Up @@ -75,7 +76,7 @@ public void postHandle(@NonNull HttpServletRequest request, @NonNull HttpServlet
};
}

@Bean
@Bean({ "multiTenantJwtInterceptor", "multiTenantInterceptor" })
@Conditional(JwtCondition.class)
HandlerInterceptor multiTenantJwtInterceptor(TenantDetailsService tenantService) {
return new HandlerInterceptor() {
Expand Down Expand Up @@ -108,16 +109,16 @@ public void postHandle(@NonNull HttpServletRequest request, @NonNull HttpServlet
}

@Bean
@ConditionalOnBean(HandlerInterceptor.class)
@ConditionalOnBean(value = HandlerInterceptor.class, name = "multiTenantInterceptor")
WebMvcConfigurer multiTenantWebMvcConfigurer() {
return new WebMvcConfigurer() {

@Autowired
private HandlerInterceptor interceptor;
private HandlerInterceptor multiTenantInterceptor;

@Override
public void addInterceptors(@NonNull InterceptorRegistry registry) {
registry.addInterceptor(interceptor);
registry.addInterceptor(multiTenantInterceptor);
}
};
}
Expand Down

0 comments on commit bb043d2

Please sign in to comment.