io.github.hpsocket.soa.starter.web.config.AspectAopConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hp-soa-starter-web Show documentation
Show all versions of hp-soa-starter-web Show documentation
hp-soa: a fully functional, easy-to-use, and highly scalable microservice framework
The newest version!
package io.github.hpsocket.soa.starter.web.config;
import io.github.hpsocket.soa.framework.web.aspect.AccessVerificationInspector;
import io.github.hpsocket.soa.framework.web.aspect.ReadOnlyGuardInspector;
import io.github.hpsocket.soa.framework.web.aspect.SiteLocalInspector;
import io.github.hpsocket.soa.framework.web.propertries.IAccessVerificationProperties;
import io.github.hpsocket.soa.framework.web.service.AccessVerificationService;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
/** HP-SOA Web Aspect 配置 */
@AutoConfiguration
@Import({
SiteLocalInspector.class,
ReadOnlyGuardInspector.class
})
public class AspectAopConfig
{
/** {@linkplain AccessVerificationService} HTTP 请求校验拦截器配置 */
@Bean
@ConditionalOnProperty(name="hp.soa.web.access-verification.enabled", havingValue="true", matchIfMissing = true)
AccessVerificationInspector accessVerificationInspector(
IAccessVerificationProperties accessVerificationProperties,
AccessVerificationService accessVerificationService)
{
return new AccessVerificationInspector(accessVerificationProperties.getDefaultAccessPolicyEnum(), accessVerificationService);
}
}