Skip to content

Commit adb5fec

Browse files
committed
maven updated and minor fixes
1 parent 535b2d7 commit adb5fec

28 files changed

+239
-420
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ log, and runtime files. Once PWM is configured, the initial web UI will prompt
144144

145145
### Java Executable
146146
The 'onejar' artifact released with PWM has an embedded tomcat instance, so you don't need to install tomcat to use this
147-
version. You will be responsible for getting it to run as a service, and you won't be able to do any advanced tomcat
148-
configuration.
147+
version. It's ideal for testing and evaluating PWM. You will be responsible for getting it to run as a service (if desired).
149148

150149
Requirements:
151150
* Java 11 JDK or better
@@ -158,7 +157,7 @@ Example for running onejar executable (with /pwm-applicationPath being the locat
158157
```
159158
java -jar pwm-onejar-2.0.0.jar -applicationPath /pwm-applicationPath
160159
```
161-
By default the executable will remain attached to the console and listen for HTTPS connections on port 8443.
160+
By default, the executable will remain attached to the console and listen for HTTPS connections on port 8443.
162161

163162

164163
### WAR
@@ -256,7 +255,7 @@ git clone https://github.com/pwm-project/pwm
256255
cd pwm
257256
mvnw.cmd clean verify
258257
```
259-
On Windows we recommend using paths without spaces (including for the JDK directory).
258+
On Windows we recommend using paths without spaces for both PWM and JDK directory.
260259

261260
Artifacts created:
262261

data-service/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<plugin>
131131
<groupId>com.google.cloud.tools</groupId>
132132
<artifactId>jib-maven-plugin</artifactId>
133-
<version>3.3.1</version>
133+
<version>3.3.2</version>
134134
<executions>
135135
<execution>
136136
<id>make-docker-image</id>
@@ -234,7 +234,7 @@
234234
<dependency>
235235
<groupId>ch.qos.logback</groupId>
236236
<artifactId>logback-classic</artifactId>
237-
<version>1.4.6</version>
237+
<version>1.4.7</version>
238238
</dependency>
239239
</dependencies>
240240
</project>

docker/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<plugin>
3535
<groupId>com.google.cloud.tools</groupId>
3636
<artifactId>jib-maven-plugin</artifactId>
37-
<version>3.3.1</version>
37+
<version>3.3.2</version>
3838
<executions>
3939
<execution>
4040
<id>make-docker-image</id>
@@ -93,7 +93,7 @@
9393
<plugin>
9494
<groupId>org.codehaus.mojo</groupId>
9595
<artifactId>build-helper-maven-plugin</artifactId>
96-
<version>3.3.0</version>
96+
<version>3.4.0</version>
9797
<executions>
9898
<execution>
9999
<id>attach-artifacts</id>

pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
<plugin>
181181
<groupId>org.apache.maven.plugins</groupId>
182182
<artifactId>maven-enforcer-plugin</artifactId>
183-
<version>3.2.1</version>
183+
<version>3.3.0</version>
184184
<executions>
185185
<execution>
186186
<id>enforce-maven</id>
@@ -216,12 +216,12 @@
216216
<plugin>
217217
<groupId>org.apache.maven.plugins</groupId>
218218
<artifactId>maven-checkstyle-plugin</artifactId>
219-
<version>3.2.1</version>
219+
<version>3.2.2</version>
220220
<dependencies>
221221
<dependency>
222222
<groupId>com.puppycrawl.tools</groupId>
223223
<artifactId>checkstyle</artifactId>
224-
<version>10.9.3</version>
224+
<version>10.11.0</version>
225225
</dependency>
226226
</dependencies>
227227
<executions>
@@ -300,7 +300,7 @@
300300
<plugin>
301301
<groupId>com.github.spotbugs</groupId>
302302
<artifactId>spotbugs-maven-plugin</artifactId>
303-
<version>4.7.3.3</version>
303+
<version>4.7.3.4</version>
304304
<dependencies>
305305
<dependency>
306306
<groupId>com.github.spotbugs</groupId>
@@ -310,7 +310,7 @@
310310
</dependencies>
311311
<configuration>
312312
<skip>${spotbugs.skip}</skip>
313-
<fork>false</fork>
313+
<fork>true</fork>
314314
<excludeFilterFile>${project.root.basedir}/build/spotbugs-exclude.xml</excludeFilterFile>
315315
<includeTests>false</includeTests>
316316
<effort>max</effort>
@@ -390,7 +390,7 @@
390390
<plugin>
391391
<groupId>org.apache.maven.plugins</groupId>
392392
<artifactId>maven-surefire-plugin</artifactId>
393-
<version>3.0.0</version>
393+
<version>3.1.0</version>
394394
<executions>
395395
<execution>
396396
<id>default-test</id>
@@ -460,13 +460,13 @@
460460
<dependency>
461461
<groupId>org.mockito</groupId>
462462
<artifactId>mockito-core</artifactId>
463-
<version>5.2.0</version>
463+
<version>5.3.1</version>
464464
<scope>test</scope>
465465
</dependency>
466466
<dependency>
467467
<groupId>com.github.tomakehurst</groupId>
468468
<artifactId>wiremock</artifactId>
469-
<version>3.0.0-beta-6</version>
469+
<version>3.0.0-beta-8</version>
470470
<scope>test</scope>
471471
</dependency>
472472
<dependency>

server/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
<dependency>
174174
<groupId>com.github.ldapchai</groupId>
175175
<artifactId>ldapchai</artifactId>
176-
<version>0.8.4</version>
176+
<version>0.8.5</version>
177177
</dependency>
178178
<dependency>
179179
<groupId>org.jrivard.xmlchai</groupId>
@@ -183,7 +183,7 @@
183183
<dependency>
184184
<groupId>org.apache.directory.api</groupId>
185185
<artifactId>api-all</artifactId>
186-
<version>2.1.2</version>
186+
<version>2.1.3</version>
187187
</dependency>
188188
<dependency>
189189
<groupId>org.apache.commons</groupId>
@@ -218,7 +218,7 @@
218218
<dependency>
219219
<groupId>ch.qos.logback</groupId>
220220
<artifactId>logback-classic</artifactId>
221-
<version>1.4.6</version>
221+
<version>1.4.7</version>
222222
</dependency>
223223
<dependency>
224224
<groupId>org.slf4j</groupId>
@@ -259,7 +259,7 @@
259259
<dependency>
260260
<groupId>com.squareup.moshi</groupId>
261261
<artifactId>moshi</artifactId>
262-
<version>1.14.0</version>
262+
<version>1.15.0</version>
263263
</dependency>
264264
<dependency>
265265
<groupId>com.blueconic</groupId>
@@ -280,7 +280,7 @@
280280
<dependency>
281281
<groupId>com.github.ben-manes.caffeine</groupId>
282282
<artifactId>caffeine</artifactId>
283-
<version>3.1.5</version>
283+
<version>3.1.6</version>
284284
</dependency>
285285
<dependency>
286286
<groupId>com.nulab-inc</groupId>

server/src/main/java/password/pwm/AppProperty.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public enum AppProperty
9090
CLUSTER_LDAP_HEARTBEAT_SECONDS ( "cluster.ldap.heartbeatSeconds" ),
9191
CLUSTER_LDAP_NODE_TIMEOUT_SECONDS ( "cluster.ldap.nodeTimeoutSeconds" ),
9292
CLUSTER_LDAP_NODE_PURGE_SECONDS ( "cluster.ldap.nodePurgeSeconds" ),
93-
DB_JDBC_LOAD_STRATEGY ( "db.jdbcLoadStrategy" ),
9493
DB_CONNECTIONS_MAX ( "db.connections.max" ),
9594
DB_CONNECTIONS_TIMEOUT_MS ( "db.connections.timeoutMs" ),
9695
DB_CONNECTIONS_WATCHDOG_FREQUENCY_SECONDS ( "db.connections.watchdogFrequencySeconds" ),

server/src/main/java/password/pwm/PwmApplication.java

Lines changed: 14 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@
2020

2121
package password.pwm;
2222

23-
import lombok.Value;
2423
import password.pwm.bean.DomainID;
2524
import password.pwm.bean.ProfileID;
2625
import password.pwm.bean.SessionLabel;
2726
import password.pwm.config.AppConfig;
2827
import password.pwm.config.PwmSetting;
2928
import password.pwm.config.PwmSettingScope;
3029
import password.pwm.error.ErrorInformation;
31-
import password.pwm.error.PwmError;
3230
import password.pwm.error.PwmException;
3331
import password.pwm.error.PwmUnrecoverableException;
3432
import password.pwm.health.HealthService;
@@ -58,7 +56,7 @@
5856
import password.pwm.svc.wordlist.WordlistService;
5957
import password.pwm.util.MBeanUtility;
6058
import password.pwm.util.PwmScheduler;
61-
import password.pwm.util.java.FileSystemUtility;
59+
import password.pwm.util.java.CollectionUtil;
6260
import password.pwm.util.java.StringUtil;
6361
import password.pwm.util.java.TimeDuration;
6462
import password.pwm.util.json.JsonFactory;
@@ -67,8 +65,6 @@
6765
import password.pwm.util.logging.PwmLogManager;
6866
import password.pwm.util.logging.PwmLogger;
6967

70-
import java.io.IOException;
71-
import java.nio.file.Files;
7268
import java.nio.file.Path;
7369
import java.time.Instant;
7470
import java.util.ArrayList;
@@ -108,6 +104,7 @@ public class PwmApplication
108104
private String instanceID = PwmApplicationUtil.DEFAULT_INSTANCE_ID;
109105
private LocalDB localDB;
110106
private LocalDBLogger localDBLogger;
107+
private Path tempDirectory;
111108

112109
public PwmApplication( final PwmEnvironment pwmEnvironment )
113110
throws PwmUnrecoverableException
@@ -156,22 +153,8 @@ private void initialize()
156153
fileLocker.waitForFileLock();
157154
}
158155

159-
// clear temp dir
160-
if ( !pwmEnvironment.isInternalRuntimeInstance() )
161-
{
162-
final Path tempFileDirectory = getTempDirectory();
163-
try
164-
{
165-
LOGGER.debug( sessionLabel, () -> "deleting directory (and sub-directory) contents in " + tempFileDirectory );
166-
FileSystemUtility.deleteDirectoryContentsRecursively( tempFileDirectory );
167-
}
168-
catch ( final Exception e )
169-
{
170-
throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_STARTUP_ERROR,
171-
"unable to clear temp file directory '" + tempFileDirectory + "', error: " + e.getMessage()
172-
) );
173-
}
174-
}
156+
// init temp dir
157+
tempDirectory = PwmApplicationUtil.initTempDirectory( sessionLabel, pwmEnvironment );
175158

176159
if ( getApplicationMode() != PwmApplicationMode.READ_ONLY )
177160
{
@@ -509,7 +492,7 @@ public void writeLastLdapFailure( final DomainID domainID, final Map<ProfileID,
509492

510493
public Map<ProfileID, ErrorInformation> readLastLdapFailure( final DomainID domainID )
511494
{
512-
return readLastLdapFailure().getRecords().getOrDefault( domainID, Collections.emptyMap() );
495+
return readLastLdapFailure().records().getOrDefault( domainID, Collections.emptyMap() );
513496
}
514497

515498
private StoredErrorRecords readLastLdapFailure()
@@ -534,34 +517,27 @@ private StoredErrorRecords readLastLdapFailure()
534517
return new StoredErrorRecords( Collections.emptyMap() );
535518
}
536519

537-
@Value
538-
private static class StoredErrorRecords
520+
private record StoredErrorRecords(
521+
Map<DomainID, Map<ProfileID, ErrorInformation>> records
522+
)
539523
{
540-
private final Map<DomainID, Map<ProfileID, ErrorInformation>> records;
541-
542-
StoredErrorRecords( final Map<DomainID, Map<ProfileID, ErrorInformation>> records )
543-
{
544-
this.records = records == null ? Collections.emptyMap() : Map.copyOf( records );
545-
}
546-
547-
public Map<DomainID, Map<ProfileID, ErrorInformation>> getRecords()
524+
private StoredErrorRecords( final Map<DomainID, Map<ProfileID, ErrorInformation>> records )
548525
{
549-
// required because json deserialization can still set records == null
550-
return records == null ? Collections.emptyMap() : records;
526+
this.records = CollectionUtil.stripNulls( records );
551527
}
552528

553529
StoredErrorRecords addDomainErrorMap(
554530
final DomainID domainID,
555531
final Map<ProfileID, ErrorInformation> errorInformationMap )
556532
{
557-
final Map<DomainID, Map<ProfileID, ErrorInformation>> newRecords = new HashMap<>( getRecords() );
533+
final Map<DomainID, Map<ProfileID, ErrorInformation>> newRecords = new HashMap<>( records );
558534
newRecords.put( domainID, Map.copyOf( errorInformationMap ) );
559535
return new StoredErrorRecords( newRecords );
560536
}
561537

562538
StoredErrorRecords stripOutdatedLdapErrors( final TimeDuration maxAge )
563539
{
564-
return new StoredErrorRecords( getRecords().entrySet().stream()
540+
return new StoredErrorRecords( records.entrySet().stream()
565541
// outer map
566542
.collect( Collectors.toUnmodifiableMap(
567543
Map.Entry::getKey,
@@ -787,39 +763,12 @@ public boolean isMultiDomain()
787763
return this.getConfig().isMultiDomain();
788764
}
789765

790-
public Path getTempDirectory( )
766+
public Optional<Path> getTempDirectory( )
791767
throws PwmUnrecoverableException
792768
{
793-
if ( pwmEnvironment.getApplicationPath() == null )
794-
{
795-
final ErrorInformation errorInformation = new ErrorInformation(
796-
PwmError.ERROR_STARTUP_ERROR,
797-
"unable to establish temp work directory: application path unavailable"
798-
);
799-
throw new PwmUnrecoverableException( errorInformation );
800-
}
801-
final Path tempDirectory = pwmEnvironment.getApplicationPath().resolve( "temp" );
802-
if ( !Files.exists( tempDirectory ) )
803-
{
804-
LOGGER.trace( () -> "preparing to create temporary directory " + tempDirectory );
805-
try
806-
{
807-
Files.createDirectories( tempDirectory );
808-
LOGGER.debug( () -> "created " + tempDirectory );
809-
}
810-
catch ( final IOException e )
811-
{
812-
LOGGER.debug( () -> "unable to create temporary directory " + tempDirectory );
813-
final ErrorInformation errorInformation = new ErrorInformation(
814-
PwmError.ERROR_STARTUP_ERROR,
815-
"unable to establish create temp work directory " + tempDirectory );
816-
throw new PwmUnrecoverableException( errorInformation );
817-
}
818-
}
819-
return tempDirectory;
769+
return Optional.ofNullable( tempDirectory );
820770
}
821771

822-
823772
public PwmScheduler getPwmScheduler()
824773
{
825774
return pwmScheduler;

0 commit comments

Comments
 (0)