Skip to content

Commit 621c4e6

Browse files
Remove JeffNet
The time has come. If we start back in Louisiana, we aren't likely to use JeffNet specifically. If we really do need, I can ressurect it from the Git history, with whatever changes are needed. Fix #228.
1 parent e961e2a commit 621c4e6

23 files changed

Lines changed: 31 additions & 1192 deletions

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Full auto integration test:
2020
* from an npm container
2121
* wait til DA is up
2222
* add the EFSP server API key (maybe hard coded from the user_transaction.sql) to DA config
23-
* install & playground install IL, Jeffnet & EFSPIntegration
23+
* install & playground install IL & EFSPIntegration
2424
* run feature files for all 3 packages
2525

2626
5/16/22:

docs/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ efile proxy:
9292
api key: abc123
9393
# This can stay the same
9494
url: http://host.docker.internal:9100
95-
# If using JeffNet, you can copy the JeffNet API Key here
96-
jeffnet api token: abc123
9795
```
9896
9997
## Running locally without Docker

docs/architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Java organizes its code by folders, called packages. It's encouraged to put your
3737
* `ecfcodes` extends `db`, and contains code related to the `tyler_efm_codes` database (see [tyler_codes.md](tyler_codes.md) for more info).
3838
* `model` contains internal business representations of objects like Addresses.
3939
* `server` contains code related to running the HTTP / REST server.
40-
* `server.ecf4` contains all of the code used to file into ECF 4 courts. The `jeffnet` subpackage does the same for the Jefferson Parish court in Louisiana.
40+
* `server.ecf4` contains all of the code used to file into ECF 4 courts.
4141
* `server.services` contains all of the Jakarta API for RESTful Web Services (JAX-RS) code that provides our external facing REST API, and utility files that are JAX-RS and REST specific.
42-
* `server.setup` contains specific `jeffnet` vs `tyler` implemetations of common interfaces.
42+
* `server.setup` contains specific `tyler` implemetations of common interfaces.
4343
* `stdlib` contains code that really should be in the standard lib (i.e. no business logic, and only depends on `java`/`javax`/logging classes).
4444
* `tyler` contains code specific to Tyler Technologies' implementations of ECF 4 and ECF 5.
4545
* `utils` contains various helper functions and classes.
@@ -74,7 +74,7 @@ There are two distinct databases that we use; both are in Postgres. They are `ty
7474
It is the more widely used of the databases. There is a Quartz job (setup in `ecf4.TylerModuleSetup.java`) that runs around 2 AM every night, pulling new codes from the courts and updating the databases and their indices. More details about the structures of the codes can be found in [tyler_codes.md](tyler_codes.md).
7575

7676
`user_transactions` is everything else. As of writing, it has 4 tables: `at_rest_keys`, `message_settings`, `schema_version`, and `submitted_filings`.
77-
* `at_rest_keys` is the authorization database for server API keys. It contains the name and id of the server, whether it has access to tyler and Jeffnet functionalities, and when it was created.
77+
* `at_rest_keys` is the authorization database for server API keys. It contains the name and id of the server, whether it has access to tyler, and when it was created.
7878
It also contains a SHA-256 hash of the API key, keeping the real key secure from leaks, and letting us confirm servers' API keys
7979
* `message_settings` contains default email settings for a particular server. It lets you set the email subject line and template and for the confirmation and accept/reject email.
8080
NOTE: this db isn't heavily used, likely because there isn't an easy API to access it, and it isn't as flexible as being able to set unique emails for each interview.

docs/config.example

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
efile proxy:
22
api key: abc123
3-
url: http://efspjava:9000/
4-
jeffnet api token: abc123 # if using JeffNet
3+
url: http://efspjava:9000/

env.example

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ TOGA_CLIENT_KEYS=
5353
PATH_TO_KEYSTORE=MyOrg.pfx
5454
X509_PASSWORD=
5555

56-
##### JeffNet related environment variables #####
57-
# The URL given by JeffNet to send filings
58-
JEFFERSON_ENDPOINT=https://example.com
59-
# The API Key that is sent with every request to the above URL.
60-
# NOTE: this ONLY needs to be in the Docassemble server.
61-
JEFFERSON_KEY=
62-
6356
##### Secured Files #####
6457
# These are secured files that are stored in encrypted cloud storage. Use this for any secured files that are not
6558
# baked into your Docker image. This is useful in the case of continuous deployment.

proxyserver/src/main/java/edu/suffolk/litlab/efsp/db/LoginDatabase.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
public class LoginDatabase extends Database {
2323
private static Logger log = LoggerFactory.getLogger(LoginDatabase.class);
2424

25+
// TODO(brycew): jeffnet_enabled is deprecated and no longer used.
26+
// At somepoint it can be removed from the database as well.
2527
private static final String atRestCreate =
2628
"""
2729
CREATE TABLE at_rest_keys (
@@ -90,8 +92,7 @@ public boolean tablesExist() throws SQLException {
9092
}
9193
}
9294

93-
public String addNewUser(String serverName, boolean tylerEnabled, boolean jeffNetEnabled)
94-
throws SQLException {
95+
public String addNewUser(String serverName, boolean tylerEnabled) throws SQLException {
9596
if (conn == null) {
9697
log.error("Connection in addNewUser wasn't open yet!");
9798
throw new SQLException();
@@ -105,7 +106,8 @@ public String addNewUser(String serverName, boolean tylerEnabled, boolean jeffNe
105106
insertSt.setString(2, serverName);
106107
insertSt.setString(3, hash);
107108
insertSt.setBoolean(4, tylerEnabled);
108-
insertSt.setBoolean(5, jeffNetEnabled);
109+
// JeffNet's enabled should always be false in the Database now.
110+
insertSt.setBoolean(5, false);
109111
insertSt.setTimestamp(6, ts);
110112
insertSt.executeUpdate();
111113
}
@@ -134,7 +136,8 @@ public Optional<AtRest> getAtRestInfo(String apiKey) {
134136
}
135137
AtRest atRest = new AtRest();
136138
atRest.serverId = (UUID) rs.getObject(1);
137-
atRest.enabled = Map.of("tyler", rs.getBoolean(4), "jeffnet", rs.getBoolean(5));
139+
// JeffNet is always true, to prevent any clients from breaking.
140+
atRest.enabled = Map.of("tyler", rs.getBoolean(4), "jeffnet", true);
138141
atRest.serverName = rs.getString(2);
139142
atRest.created = rs.getTimestamp(6);
140143
// Assuming that we will only have the API key hash when directly given it, i.e.
@@ -178,12 +181,11 @@ public boolean updateServerName(AtRest atRest, String apiKey, String newName) {
178181
*/
179182
public static void main(final String args[])
180183
throws SQLException, NumberFormatException, ClassNotFoundException {
181-
if (args.length != 3) {
182-
System.out.println("Only 3 params: server name, tyler enabled, jeffnet enabled");
184+
if (args.length != 2) {
185+
System.out.println("Only 2 params: server name, tyler enabled");
183186
}
184187
String serverName = args[0].strip();
185188
String tylerEnabled = args[1].strip();
186-
String jeffnetEnabled = args[2].strip();
187189

188190
DataSource ds =
189191
DatabaseCreator.makeDataSource(
@@ -197,11 +199,10 @@ public static void main(final String args[])
197199
try (LoginDatabase ld = new LoginDatabase(ds.getConnection())) {
198200
ld.setAutoCommit(true);
199201
boolean tylerBool = Boolean.parseBoolean(tylerEnabled);
200-
boolean jeffnetBool = Boolean.parseBoolean(jeffnetEnabled);
201202
ld.createTablesIfAbsent();
202-
String newApiKey = ld.addNewUser(serverName, tylerBool, jeffnetBool);
203+
String newApiKey = ld.addNewUser(serverName, tylerBool);
203204
System.out.println("New Api Key for " + serverName + ": " + newApiKey);
204-
System.out.println("Using tyler: " + tylerBool + " and using jeffnet: " + jeffnetBool);
205+
System.out.println("Using tyler: " + tylerBool + " (not using jeffnet)");
205206
}
206207
}
207208
}

proxyserver/src/main/java/edu/suffolk/litlab/efsp/server/EfspServer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import edu.suffolk.litlab.efsp.server.services.RootService;
2121
import edu.suffolk.litlab.efsp.server.setup.EfmModuleSetup;
2222
import edu.suffolk.litlab.efsp.server.setup.EfmRestCallbackInterface;
23-
import edu.suffolk.litlab.efsp.server.setup.jeffnet.JeffNetModuleSetup;
2423
import edu.suffolk.litlab.efsp.server.setup.tyler.TylerModuleSetup;
2524
import edu.suffolk.litlab.efsp.server.utils.EnumExceptionMapper;
2625
import edu.suffolk.litlab.efsp.server.utils.JsonExceptionMapper;
@@ -262,10 +261,9 @@ public static void main(String[] args) throws Exception {
262261
sender)
263262
.ifPresent(mod -> modules.add(mod));
264263
}
265-
JeffNetModuleSetup.create(converterMap, userDs, sender).ifPresent(mod -> modules.add(mod));
266264
if (modules.isEmpty()) {
267265
log.error(
268-
"Couldn't load enough parameters to start either the Tyler or JeffNet filer modules."
266+
"Couldn't load enough parameters to start any of the Tyler filer modules."
269267
+ "Please check your environment variables and try again.");
270268
throw new RuntimeException("No filer modules available");
271269
}

proxyserver/src/main/java/edu/suffolk/litlab/efsp/server/auth/JeffNetLogin.java

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

proxyserver/src/main/java/edu/suffolk/litlab/efsp/server/auth/SecurityHub.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import java.util.function.Function;
1616
import java.util.function.Supplier;
1717
import java.util.stream.Collectors;
18-
import java.util.stream.Stream;
1918
import org.slf4j.Logger;
2019
import org.slf4j.LoggerFactory;
2120

@@ -34,7 +33,6 @@ public class SecurityHub {
3433
private static final Logger log = LoggerFactory.getLogger(SecurityHub.class);
3534

3635
private final List<LoginInterface> tylerLoginObjs;
37-
private final LoginInterface jeffNetLoginObj;
3836
private final Map<String, Function<JsonNode, Optional<Map<String, String>>>> loginFunctions;
3937
private final Supplier<LoginDatabase> ldSupplier;
4038

@@ -54,11 +52,12 @@ public SecurityHub(
5452
.map(j -> new TylerLogin(new TylerDomain(j, env)))
5553
.collect(Collectors.toList());
5654
}
57-
this.jeffNetLoginObj = new JeffNetLogin();
5855

59-
this.loginFunctions =
60-
Stream.concat(this.tylerLoginObjs.stream(), Stream.of(this.jeffNetLoginObj))
61-
.collect(Collectors.toMap(lo -> lo.getLoginName(), lo -> (info) -> lo.login(info)));
56+
this.loginFunctions = new HashMap<>();
57+
this.loginFunctions.put("jeffnet", info -> Optional.of(Map.of("JEFFNET-TOKEN", "deprecated")));
58+
this.loginFunctions.putAll(
59+
this.tylerLoginObjs.stream()
60+
.collect(Collectors.toMap(lo -> lo.getLoginName(), lo -> (info) -> lo.login(info))));
6261
}
6362

6463
/**

proxyserver/src/main/java/edu/suffolk/litlab/efsp/server/jeffnet/ContactInfoJeffNetJacksonSerializer.java

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

0 commit comments

Comments
 (0)