Skip to content

Commit 356dd07

Browse files
Jose Alberto Hernandezvidakovic
authored andcommitted
FINERACT-1932: Fineract modularization - fineract-security
1 parent f504281 commit 356dd07

62 files changed

Lines changed: 216 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ buildscript {
2626
fineractJavaProjects = subprojects.findAll{
2727
[
2828
'fineract-core',
29+
'fineract-security',
2930
'fineract-cob',
3031
'fineract-validation',
3132
'fineract-command',
@@ -59,6 +60,7 @@ buildscript {
5960
'fineract-client',
6061
'fineract-client-feign',
6162
'fineract-core',
63+
'fineract-security',
6264
'fineract-cob',
6365
'fineract-validation',
6466
'fineract-command',

fineract-provider/src/main/java/org/apache/fineract/infrastructure/instancemode/filter/FineractInstanceModeApiFilter.java renamed to fineract-core/src/main/java/org/apache/fineract/infrastructure/instancemode/filter/FineractInstanceModeApiFilter.java

File renamed without changes.

fineract-provider/src/main/java/org/apache/fineract/notification/data/NotificationData.java renamed to fineract-core/src/main/java/org/apache/fineract/notification/data/NotificationData.java

File renamed without changes.

fineract-provider/src/main/java/org/apache/fineract/notification/service/UserNotificationService.java renamed to fineract-core/src/main/java/org/apache/fineract/notification/service/UserNotificationService.java

File renamed without changes.

fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformService.java renamed to fineract-core/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformService.java

File renamed without changes.

fineract-provider/dependencies.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ dependencies {
4040
implementation(project(path: ':fineract-report'))
4141
implementation(project(path: ':fineract-tax'))
4242
implementation(project(path: ':fineract-loan-origination'))
43+
implementation(project(path: ':fineract-security'))
4344

4445
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
4546

fineract-security/build.gradle

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
description = 'Fineract Security'
20+
21+
apply plugin: 'java'
22+
apply plugin: 'eclipse'
23+
24+
configurations {
25+
providedRuntime // needed for Spring Boot executable WAR
26+
providedCompile
27+
compile() {
28+
exclude module: 'hibernate-entitymanager'
29+
exclude module: 'hibernate-validator'
30+
exclude module: 'activation'
31+
exclude module: 'bcmail-jdk14'
32+
exclude module: 'bcprov-jdk14'
33+
exclude module: 'bctsp-jdk14'
34+
exclude module: 'c3p0'
35+
exclude module: 'stax-api'
36+
exclude module: 'jaxb-api'
37+
exclude module: 'jaxb-impl'
38+
exclude module: 'jboss-logging'
39+
exclude module: 'itext-rtf'
40+
exclude module: 'classworlds'
41+
}
42+
runtime
43+
}
44+
45+
apply from: 'dependencies.gradle'
46+
47+
// Configuration for the modernizer plugin
48+
// https://github.com/andygoossens/gradle-modernizer-plugin
49+
modernizer {
50+
ignoreClassNamePatterns = [
51+
'.*AbstractPersistableCustom',
52+
'.*EntityTables',
53+
'.*domain.*'
54+
]
55+
}
56+
57+
// If we are running Gradle within Eclipse to enhance classes with OpenJPA,
58+
// set the classes directory to point to Eclipse's default build directory
59+
if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') {
60+
sourceSets.main.java.outputDir = new File(rootProject.projectDir, "fineract-security/bin/main")
61+
}
62+
63+
eclipse {
64+
project {
65+
buildCommand([ LaunchConfigHandle: "<project>/.externalToolBuilders/OpenJPA Enhance Builder.launch" ], 'org.eclipse.ui.externaltools.ExternalToolBuilder')
66+
}
67+
}
68+
69+
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
70+
sourceSets {
71+
test {
72+
java {
73+
exclude '**/core/boot/tests/**'
74+
}
75+
}
76+
}
77+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
dependencies {
21+
// Never use "compile" scope, but make all dependencies either 'implementation', 'runtimeOnly' or 'testCompile'.
22+
// Note that we never use 'api', because Fineract at least currently is a simple monolithic application ("WAR"), not a library.
23+
// We also (normally should have) no need to ever use 'compileOnly'.
24+
25+
// Core module dependency
26+
implementation(project(path: ':fineract-core'))
27+
28+
// PostgreSQL driver for SQL injection prevention utilities
29+
implementation 'org.postgresql:postgresql'
30+
31+
// Spring Boot Security dependencies
32+
implementation(
33+
'org.springframework.boot:spring-boot-starter-web',
34+
'org.springframework.boot:spring-boot-starter-security',
35+
'org.springframework.boot:spring-boot-starter-oauth2-authorization-server',
36+
'org.springframework.boot:spring-boot-starter-oauth2-resource-server',
37+
'org.springframework.boot:spring-boot-starter-oauth2-client',
38+
'org.springframework.boot:spring-boot-starter-cache',
39+
40+
'jakarta.ws.rs:jakarta.ws.rs-api',
41+
'org.glassfish.jersey.media:jersey-media-multipart',
42+
43+
'com.google.guava:guava',
44+
'com.google.code.gson:gson',
45+
46+
'org.apache.commons:commons-lang3',
47+
48+
'com.jayway.jsonpath:json-path',
49+
50+
'com.github.spotbugs:spotbugs-annotations',
51+
'io.swagger.core.v3:swagger-annotations-jakarta',
52+
53+
'org.springdoc:springdoc-openapi-starter-webmvc-ui',
54+
'org.mapstruct:mapstruct',
55+
)
56+
57+
// JPA for security entities
58+
implementation ('org.springframework.boot:spring-boot-starter-data-jpa') {
59+
exclude group: 'org.hibernate'
60+
}
61+
implementation('org.eclipse.persistence:org.eclipse.persistence.jpa') {
62+
exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence'
63+
}
64+
65+
// OWASP ESAPI for security utilities
66+
implementation('org.owasp.esapi:esapi') {
67+
exclude group: 'org.slf4j'
68+
exclude group: 'log4j'
69+
exclude group: 'commons-logging'
70+
exclude group: 'commons-collections'
71+
exclude group: 'commons-lang'
72+
exclude group: 'spotbugs-annotations'
73+
exclude group: 'xml-apis'
74+
}
75+
76+
// Email support for OTP delivery
77+
implementation ('org.apache.commons:commons-email') {
78+
exclude group: 'com.sun.mail', module: 'javax.mail'
79+
exclude group: 'javax.activation', module: 'activation'
80+
}
81+
implementation 'com.sun.mail:jakarta.mail'
82+
83+
compileOnly 'org.projectlombok:lombok'
84+
annotationProcessor 'org.projectlombok:lombok'
85+
annotationProcessor 'org.mapstruct:mapstruct-processor'
86+
87+
// Test dependencies
88+
testImplementation( 'io.github.classgraph:classgraph' )
89+
testImplementation ('org.springframework.boot:spring-boot-starter-test') {
90+
exclude group: 'com.jayway.jsonpath', module: 'json-path'
91+
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
92+
exclude group: 'jakarta.activation'
93+
exclude group: 'javax.activation'
94+
exclude group: 'org.skyscreamer'
95+
}
96+
testImplementation ('org.mockito:mockito-inline')
97+
testImplementation 'org.springframework.security:spring-security-test'
98+
}

fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java renamed to fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java

File renamed without changes.

fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java renamed to fineract-security/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java

File renamed without changes.

0 commit comments

Comments
 (0)