1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.fit.core.reference;
20
21 import com.nimbusds.jose.JOSEException;
22 import org.apache.syncope.common.lib.SyncopeConstants;
23 import org.apache.syncope.core.logic.IdRepoLogicContext;
24 import org.apache.syncope.core.logic.TaskLogic;
25 import org.apache.syncope.core.logic.audit.AuditAppender;
26 import org.apache.syncope.core.persistence.api.dao.AnySearchDAO;
27 import org.apache.syncope.core.persistence.api.dao.ImplementationDAO;
28 import org.apache.syncope.core.persistence.api.dao.UserDAO;
29 import org.apache.syncope.core.persistence.api.entity.EntityFactory;
30 import org.apache.syncope.core.provisioning.api.ImplementationLookup;
31 import org.apache.syncope.core.spring.security.AuthDataAccessor;
32 import org.apache.syncope.core.workflow.api.UserWorkflowAdapter;
33 import org.springframework.boot.autoconfigure.AutoConfigureBefore;
34 import org.springframework.context.annotation.Bean;
35 import org.springframework.context.annotation.ComponentScan;
36 import org.springframework.context.annotation.Configuration;
37 import org.springframework.context.annotation.Lazy;
38
39 @AutoConfigureBefore(IdRepoLogicContext.class)
40 @ComponentScan("org.apache.syncope.fit.core.reference")
41 @Configuration(proxyBeanMethods = false)
42 public class CoreReferenceContext {
43
44 @Bean
45 public ElasticsearchInit elasticsearchInit(
46 final ImplementationDAO implementationDAO,
47 final EntityFactory entityFactory,
48 final TaskLogic taskLogic) {
49
50 return new ElasticsearchInit(implementationDAO, entityFactory, taskLogic);
51 }
52
53 @Bean
54 public OpenSearchInit openSearchInit(
55 final ImplementationDAO implementationDAO,
56 final EntityFactory entityFactory,
57 final TaskLogic taskLogic) {
58
59 return new OpenSearchInit(implementationDAO, entityFactory, taskLogic);
60 }
61
62 @Bean
63 public EnableFlowableForTestUsers enableFlowableForTestUsers(final UserDAO userDAO) {
64 return new EnableFlowableForTestUsers(userDAO);
65 }
66
67 @Bean
68 public ImplementationLookup implementationLookup(
69 final UserWorkflowAdapter uwf,
70 final AnySearchDAO anySearchDAO,
71 final EnableFlowableForTestUsers enableFlowableForTestUsers,
72 final ElasticsearchInit elasticsearchInit,
73 final OpenSearchInit openSearchInit) {
74
75 return new ITImplementationLookup(
76 uwf, anySearchDAO, enableFlowableForTestUsers, elasticsearchInit, openSearchInit);
77 }
78
79 @Bean
80 public AuditAppender testFileAuditAppender() {
81 return new TestFileAuditAppender(SyncopeConstants.MASTER_DOMAIN);
82 }
83
84 @Bean
85 public AuditAppender testFileRewriteAuditAppender() {
86 return new TestFileRewriteAuditAppender(SyncopeConstants.MASTER_DOMAIN);
87 }
88
89 @Bean
90 public CustomJWTSSOProvider customJWTSSOProvider(
91 final AnySearchDAO anySearchDAO,
92 final @Lazy AuthDataAccessor authDataAccessor) throws JOSEException {
93
94 return new CustomJWTSSOProvider(anySearchDAO, authDataAccessor);
95 }
96 }