Skip to content

Commit 8a80846

Browse files
authored
switch to spring mvc (#2488)
* switch to spring mvc * cleanup * cleanup p2 * migreate auth provider * cleanup * fix build issues * fix * fix * fix * fix * fix * fix * fix * cleanup * fix * fix * cleanup * fix
1 parent 52dd761 commit 8a80846

96 files changed

Lines changed: 3880 additions & 5016 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.

docker/auth-test/setup-test-users.sql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
-- Initial security data (roles required for the application to function)
2+
-- These must be created before WebAPI can properly handle authentication
3+
INSERT INTO webapi.sec_role (id, name, system_role) VALUES (1, 'public', true) ON CONFLICT (id) DO NOTHING;
4+
INSERT INTO webapi.sec_role (id, name, system_role) VALUES (2, 'admin', true) ON CONFLICT (id) DO NOTHING;
5+
INSERT INTO webapi.sec_role (id, name, system_role) VALUES (1001, 'Atlas users', true) ON CONFLICT (id) DO NOTHING;
6+
INSERT INTO webapi.sec_role (id, name, system_role) VALUES (1002, 'Moderator', true) ON CONFLICT (id) DO NOTHING;
7+
8+
-- Anonymous user (required for public endpoints)
9+
INSERT INTO webapi.sec_user (id, login, name) VALUES (1, 'anonymous', 'anonymous') ON CONFLICT (id) DO NOTHING;
10+
INSERT INTO webapi.sec_user_role (id, user_id, role_id, origin) VALUES (1, 1, 1, 'SYSTEM') ON CONFLICT (id) DO NOTHING;
11+
12+
-- Update sequences to avoid conflicts
13+
SELECT setval('webapi.sec_role_sequence', GREATEST((SELECT COALESCE(MAX(id), 0) + 1 FROM webapi.sec_role), nextval('webapi.sec_role_sequence')));
14+
SELECT setval('webapi.sec_user_sequence', GREATEST((SELECT COALESCE(MAX(id), 0) + 1 FROM webapi.sec_user), nextval('webapi.sec_user_sequence')));
15+
SELECT setval('webapi.sec_user_role_sequence', GREATEST((SELECT COALESCE(MAX(id), 0) + 1 FROM webapi.sec_user_role), nextval('webapi.sec_user_role_sequence')));
16+
17+
-- Test users table for JDBC authentication
118
CREATE TABLE IF NOT EXISTS webapi.users (
219
id SERIAL PRIMARY KEY,
320
email VARCHAR(255) UNIQUE NOT NULL,

docker/integration-test/postman/integration-tests.postman_collection.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -929,9 +929,9 @@
929929
"method": "GET",
930930
"header": [],
931931
"url": {
932-
"raw": "{{base_url}}/conceptset/",
932+
"raw": "{{base_url}}/conceptset",
933933
"host": ["{{base_url}}"],
934-
"path": ["conceptset", ""]
934+
"path": ["conceptset"]
935935
}
936936
}
937937
},
@@ -986,9 +986,9 @@
986986
"raw": "{\n \"name\": \"Test Concept Set\",\n \"description\": \"Integration test concept set\"\n}"
987987
},
988988
"url": {
989-
"raw": "{{base_url}}/conceptset/",
989+
"raw": "{{base_url}}/conceptset",
990990
"host": ["{{base_url}}"],
991-
"path": ["conceptset", ""]
991+
"path": ["conceptset"]
992992
}
993993
}
994994
},

pom.xml

Lines changed: 24 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
<shiro.version>2.0.2</shiro.version>
2323
<!-- tomcat.embed.version removed - using Spring Boot 3.5.6 managed version (10.1.48) -->
2424

25-
<commons-fileupload.version>1.5</commons-fileupload.version>
26-
2725
<circe.version>1.12.1</circe.version>
28-
<jersey.version>3.1.9</jersey.version>
2926
<SqlRender.version>1.19.1</SqlRender.version>
3027
<hive-jdbc.version>3.1.2</hive-jdbc.version>
3128
<pac4j.version>6.0.5</pac4j.version>
@@ -96,6 +93,7 @@
9693
<security.oid.extraScopes></security.oid.extraScopes>
9794
<security.oid.customParams>{:}</security.oid.customParams>
9895
<security.oid.redirectUrl>http://localhost/index.html#/welcome/</security.oid.redirectUrl>
96+
<security.oid.apiResource></security.oid.apiResource>
9997
<security.kerberos.spn></security.kerberos.spn>
10098
<security.kerberos.keytabPath></security.kerberos.keytabPath>
10199
<security.ldap.dn>cn={0},dc=example,dc=org</security.ldap.dn>
@@ -198,7 +196,6 @@
198196
<server.servlet.context-path>/WebAPI</server.servlet.context-path>
199197

200198
<arachne.version>1.17.4</arachne.version>
201-
<jersey-media-multipart.version>3.1.9</jersey-media-multipart.version>
202199
<execution.invalidation.period>600000</execution.invalidation.period>
203200
<execution.invalidation.maxage.hours>12</execution.invalidation.maxage.hours>
204201
<execution.status.period>10000</execution.status.period>
@@ -716,28 +713,6 @@
716713
<artifactId>tomcat-juli</artifactId>
717714
<version>10.1.48</version><!-- Not managed by Spring Boot, must match tomcat-embed version -->
718715
</dependency>
719-
<dependency>
720-
<groupId>org.springframework.boot</groupId>
721-
<artifactId>spring-boot-starter-jersey</artifactId>
722-
<exclusions>
723-
<exclusion>
724-
<groupId>org.hibernate</groupId>
725-
<artifactId>hibernate-validator</artifactId>
726-
</exclusion>
727-
<exclusion>
728-
<groupId>com.fasterxml.jackson.core</groupId>
729-
<artifactId>jackson-databind</artifactId>
730-
</exclusion>
731-
<exclusion>
732-
<groupId>com.fasterxml.jackson.core</groupId>
733-
<artifactId>jackson-annotations</artifactId>
734-
</exclusion>
735-
<exclusion>
736-
<groupId>com.fasterxml.jackson.core</groupId>
737-
<artifactId>jackson-core</artifactId>
738-
</exclusion>
739-
</exclusions>
740-
</dependency>
741716
<dependency>
742717
<groupId>org.springframework.boot</groupId>
743718
<artifactId>spring-boot-starter-data-jpa</artifactId>
@@ -791,17 +766,7 @@
791766
<artifactId>cache-api</artifactId>
792767
<version>1.1.1</version>
793768
</dependency>
794-
<!-- JAXB dependencies for Java 11+ (ehcache still uses javax.xml.bind) -->
795-
<dependency>
796-
<groupId>javax.xml.bind</groupId>
797-
<artifactId>jaxb-api</artifactId>
798-
<version>2.3.1</version>
799-
</dependency>
800-
<dependency>
801-
<groupId>org.glassfish.jaxb</groupId>
802-
<artifactId>jaxb-runtime</artifactId>
803-
<version>2.3.1</version>
804-
</dependency>
769+
<!-- javax.xml.bind dependencies removed - ehcache 3.11.0+ no longer requires them -->
805770
<dependency>
806771
<groupId>org.ohdsi.sql</groupId>
807772
<artifactId>SqlRender</artifactId>
@@ -895,13 +860,7 @@
895860
<version>9.1.6</version>
896861
</dependency>
897862

898-
<!-- overriding commons-fileupload version from the plug-in above -->
899-
<dependency>
900-
<groupId>commons-fileupload</groupId>
901-
<artifactId>commons-fileupload</artifactId>
902-
<version>${commons-fileupload.version}</version>
903-
</dependency>
904-
863+
<!-- commons-fileupload removed - not used in codebase -->
905864
<dependency>
906865
<groupId>org.postgresql</groupId>
907866
<artifactId>postgresql</artifactId>
@@ -913,11 +872,7 @@
913872
<artifactId>mssql-jdbc</artifactId>
914873
<version>12.8.1.jre11</version>
915874
</dependency>
916-
<dependency>
917-
<groupId>com.microsoft.azure</groupId>
918-
<artifactId>msal4j</artifactId>
919-
<version>1.9.0</version>
920-
</dependency>
875+
<!-- msal4j removed - not used in codebase -->
921876
<dependency>
922877
<groupId>com.opencsv</groupId>
923878
<artifactId>opencsv</artifactId>
@@ -935,11 +890,7 @@
935890
<artifactId>commons-csv</artifactId>
936891
<version>1.8</version>
937892
</dependency>
938-
<dependency>
939-
<groupId>org.dom4j</groupId>
940-
<artifactId>dom4j</artifactId>
941-
<version>2.1.3</version>
942-
</dependency>
893+
<!-- dom4j removed - not used in codebase -->
943894
<dependency>
944895
<groupId>org.apache.shiro</groupId>
945896
<artifactId>shiro-core</artifactId>
@@ -1113,10 +1064,12 @@
11131064
<artifactId>jasypt</artifactId>
11141065
<version>1.9.3</version>
11151066
</dependency>
1067+
<!-- JAX-RS API removed - all Jersey code migrated to Spring MVC -->
1068+
<!-- JAXB API - needed by some legacy code -->
11161069
<dependency>
1117-
<groupId>org.glassfish.jersey.media</groupId>
1118-
<artifactId>jersey-media-multipart</artifactId>
1119-
<version>${jersey-media-multipart.version}</version>
1070+
<groupId>jakarta.xml.bind</groupId>
1071+
<artifactId>jakarta.xml.bind-api</artifactId>
1072+
<version>4.0.0</version>
11201073
</dependency>
11211074
<dependency>
11221075
<groupId>org.glassfish</groupId>
@@ -1198,7 +1151,20 @@
11981151
<dependency>
11991152
<groupId>org.ehcache</groupId>
12001153
<artifactId>ehcache</artifactId>
1201-
<version>3.9.11</version>
1154+
<version>3.11.1</version>
1155+
<classifier>jakarta</classifier><!-- Using Jakarta classifier to avoid javax.xml.bind dependency -->
1156+
<exclusions>
1157+
<exclusion>
1158+
<groupId>org.glassfish.jaxb</groupId>
1159+
<artifactId>jaxb-runtime</artifactId>
1160+
</exclusion>
1161+
</exclusions>
1162+
</dependency>
1163+
<!-- Jakarta JAXB runtime for ehcache XML configuration -->
1164+
<dependency>
1165+
<groupId>org.glassfish.jaxb</groupId>
1166+
<artifactId>jaxb-runtime</artifactId>
1167+
<version>3.0.2</version><!-- Jakarta EE 9 compatible -->
12021168
</dependency> <dependency>
12031169
<groupId>com.opentable.components</groupId>
12041170
<artifactId>otj-pg-embedded</artifactId>
@@ -1817,32 +1783,6 @@
18171783
</exclusion>
18181784
</exclusions>
18191785
</dependency>
1820-
<dependency>
1821-
<groupId>com.sun.jersey</groupId>
1822-
<artifactId>jersey-server</artifactId>
1823-
<version>1.19.4</version>
1824-
</dependency>
1825-
<dependency>
1826-
<groupId>com.sun.jersey</groupId>
1827-
<artifactId>jersey-core</artifactId>
1828-
<version>1.19.4</version>
1829-
<exclusions>
1830-
<exclusion>
1831-
<groupId>javax.ws.rs</groupId>
1832-
<artifactId>jsr311-api</artifactId>
1833-
</exclusion>
1834-
</exclusions>
1835-
</dependency>
1836-
<dependency>
1837-
<groupId>com.sun.jersey</groupId>
1838-
<artifactId>jersey-client</artifactId>
1839-
<version>1.19.4</version>
1840-
</dependency>
1841-
<dependency>
1842-
<groupId>com.sun.jersey</groupId>
1843-
<artifactId>jersey-json</artifactId>
1844-
<version>1.19.4</version>
1845-
</dependency>
18461786
</dependencies>
18471787
</profile>
18481788
<profile>

src/main/java/org/ohdsi/webapi/JdbcExceptionMapper.java

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/main/java/org/ohdsi/webapi/JerseyConfig.java

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/main/java/org/ohdsi/webapi/OidcConfCreator.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ public class OidcConfCreator {
6161
@Value("${security.oauth.callback.api}")
6262
private String oauthApiCallback;
6363

64+
@Value("${security.oid.apiResource:}")
65+
private String apiResource;
66+
67+
public String getApiResource() {
68+
return apiResource;
69+
}
70+
6471
/**
6572
* Returns the external OIDC URL for browser-facing endpoints.
6673
* If externalUrl is set, returns it; otherwise returns the discovery URL.

0 commit comments

Comments
 (0)