Skip to content

Commit 85a6b36

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 bb2fc57 commit 85a6b36

21 files changed

+28
-925
lines changed

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
@@ -82,8 +82,6 @@ efile proxy:
8282
api key: abc123
8383
# This can stay the same
8484
url: http://efspjava:9000/
85-
# If using JeffNet, you can copy the JeffNet API Key here
86-
jeffnet api token: abc123
8785
```
8886
8987
## 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.
@@ -72,7 +72,7 @@ There are two distinct databases that we use; both are in Postgres. They are `ty
7272
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).
7373

7474
`user_transactions` is everything else. As of writing, it has 4 tables: `at_rest_keys`, `message_settings`, `schema_version`, and `submitted_filings`.
75-
* `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.
75+
* `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.
7676
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
7777
* `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.
7878
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 & 9 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,7 +92,7 @@ public boolean tablesExist() throws SQLException {
9092
}
9193
}
9294

93-
public String addNewUser(String serverName, boolean tylerEnabled, boolean jeffNetEnabled)
95+
public String addNewUser(String serverName, boolean tylerEnabled)
9496
throws SQLException {
9597
if (conn == null) {
9698
log.error("Connection in addNewUser wasn't open yet!");
@@ -105,7 +107,8 @@ public String addNewUser(String serverName, boolean tylerEnabled, boolean jeffNe
105107
insertSt.setString(2, serverName);
106108
insertSt.setString(3, hash);
107109
insertSt.setBoolean(4, tylerEnabled);
108-
insertSt.setBoolean(5, jeffNetEnabled);
110+
// JeffNet's enabled should always be false in the Database now.
111+
insertSt.setBoolean(5, false);
109112
insertSt.setTimestamp(6, ts);
110113
insertSt.executeUpdate();
111114
}
@@ -134,7 +137,8 @@ public Optional<AtRest> getAtRestInfo(String apiKey) {
134137
}
135138
AtRest atRest = new AtRest();
136139
atRest.serverId = (UUID) rs.getObject(1);
137-
atRest.enabled = Map.of("tyler", rs.getBoolean(4), "jeffnet", rs.getBoolean(5));
140+
// JeffNet is always true, to prevent any clients from breaking.
141+
atRest.enabled = Map.of("tyler", rs.getBoolean(4), "jeffnet", true);
138142
atRest.serverName = rs.getString(2);
139143
atRest.created = rs.getTimestamp(6);
140144
// Assuming that we will only have the API key hash when directly given it, i.e.
@@ -178,12 +182,11 @@ public boolean updateServerName(AtRest atRest, String apiKey, String newName) {
178182
*/
179183
public static void main(final String args[])
180184
throws SQLException, NumberFormatException, ClassNotFoundException {
181-
if (args.length != 3) {
182-
System.out.println("Only 3 params: server name, tyler enabled, jeffnet enabled");
185+
if (args.length != 2) {
186+
System.out.println("Only 2 params: server name, tyler enabled");
183187
}
184188
String serverName = args[0].strip();
185189
String tylerEnabled = args[1].strip();
186-
String jeffnetEnabled = args[2].strip();
187190

188191
DataSource ds =
189192
DatabaseCreator.makeDataSource(
@@ -197,11 +200,10 @@ public static void main(final String args[])
197200
try (LoginDatabase ld = new LoginDatabase(ds.getConnection())) {
198201
ld.setAutoCommit(true);
199202
boolean tylerBool = Boolean.parseBoolean(tylerEnabled);
200-
boolean jeffnetBool = Boolean.parseBoolean(jeffnetEnabled);
201203
ld.createTablesIfAbsent();
202-
String newApiKey = ld.addNewUser(serverName, tylerBool, jeffnetBool);
204+
String newApiKey = ld.addNewUser(serverName, tylerBool);
203205
System.out.println("New Api Key for " + serverName + ": " + newApiKey);
204-
System.out.println("Using tyler: " + tylerBool + " and using jeffnet: " + jeffnetBool);
206+
System.out.println("Using tyler: " + tylerBool + " (not using jeffnet)");
205207
}
206208
}
207209
}

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;
@@ -258,10 +257,9 @@ public static void main(String[] args) throws Exception {
258257
sender)
259258
.ifPresent(mod -> modules.add(mod));
260259
}
261-
JeffNetModuleSetup.create(converterMap, userDs, sender).ifPresent(mod -> modules.add(mod));
262260
if (modules.isEmpty()) {
263261
log.error(
264-
"Couldn't load enough parameters to start either the Tyler or JeffNet filer modules."
262+
"Couldn't load enough parameters to start any of the Tyler filer modules."
265263
+ "Please check your environment variables and try again.");
266264
throw new RuntimeException("No filer modules available");
267265
}

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: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public class SecurityHub {
3434
private static final Logger log = LoggerFactory.getLogger(SecurityHub.class);
3535

3636
private final List<LoginInterface> tylerLoginObjs;
37-
private final LoginInterface jeffNetLoginObj;
3837
private final Map<String, Function<JsonNode, Optional<Map<String, String>>>> loginFunctions;
3938
private final Supplier<LoginDatabase> ldSupplier;
4039

@@ -56,11 +55,11 @@ public SecurityHub(
5655
.map(j -> new TylerLogin(new TylerDomain(j, env.get())))
5756
.collect(Collectors.toList());
5857
}
59-
this.jeffNetLoginObj = new JeffNetLogin();
6058

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

6665
/**

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)