Ver Fonte

remove outdated seedlist service

Jason Rivard há 3 anos atrás
pai
commit
d879a05fa4
29 ficheiros alterados com 301 adições e 306 exclusões
  1. 1 1
      client/angular/src/i18n/translations_en.json
  2. 2 0
      server/src/main/java/password/pwm/AppProperty.java
  3. 0 1
      server/src/main/java/password/pwm/PwmAboutProperty.java
  4. 0 6
      server/src/main/java/password/pwm/PwmApplication.java
  5. 5 2
      server/src/main/java/password/pwm/config/PwmSetting.java
  6. 0 7
      server/src/main/java/password/pwm/http/servlet/admin/AppDashboardData.java
  7. 2 1
      server/src/main/java/password/pwm/http/servlet/configeditor/ConfigEditorServlet.java
  8. 6 10
      server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java
  9. 4 3
      server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java
  10. 2 2
      server/src/main/java/password/pwm/http/servlet/resource/ResourceServletService.java
  11. 2 4
      server/src/main/java/password/pwm/ldap/auth/LDAPAuthenticationRequest.java
  12. 0 2
      server/src/main/java/password/pwm/svc/PwmServiceEnum.java
  13. 0 21
      server/src/main/java/password/pwm/svc/wordlist/AbstractWordlistBucket.java
  14. 0 51
      server/src/main/java/password/pwm/svc/wordlist/SeedlistService.java
  15. 0 11
      server/src/main/java/password/pwm/svc/wordlist/WordlistConfiguration.java
  16. 1 5
      server/src/main/java/password/pwm/svc/wordlist/WordlistType.java
  17. 178 0
      server/src/main/java/password/pwm/util/password/RandomGeneratorConfig.java
  18. 56 0
      server/src/main/java/password/pwm/util/password/RandomGeneratorConfigRequest.java
  19. 12 141
      server/src/main/java/password/pwm/util/password/RandomPasswordGenerator.java
  20. 9 2
      server/src/main/java/password/pwm/ws/server/RestServlet.java
  21. 10 7
      server/src/main/java/password/pwm/ws/server/rest/RestRandomPasswordServer.java
  22. 2 0
      server/src/main/resources/password/pwm/AppProperty.properties
  23. 2 2
      server/src/main/resources/password/pwm/config/PwmSetting.xml
  24. 1 1
      server/src/main/resources/password/pwm/i18n/Config.properties
  25. 1 1
      server/src/main/resources/password/pwm/i18n/Display.properties
  26. 1 1
      server/src/main/resources/password/pwm/i18n/Display_en_CA.properties
  27. 3 2
      server/src/test/java/password/pwm/util/password/RandomPasswordGeneratorTest.java
  28. 1 22
      webapp/src/main/webapp/WEB-INF/jsp/configmanager-wordlists.jsp
  29. BIN
      webapp/src/main/webapp/WEB-INF/seedlist.zip

+ 1 - 1
client/angular/src/i18n/translations_en.json

@@ -34,7 +34,7 @@
   "Display_InvalidVerification": "Viewing details only available after a user has been successfully verified",
   "Display_MatchCondition": "Match Condition",
   "Display_NoResponses": "User does not have responses",
-  "Display_PasswordGeneration": "The following passwords have been randomly generated for you.  These passwords are based on real words to make them easier to remember, but have been modified to make them difficult to guess.",
+  "Display_PasswordGeneration": "The following passwords have been randomly generated for you.",
   "Display_PasswordPrompt": "Please type your new password",
   "Display_PleaseWait": "Loading...",
   "Display_Random": "Random",

+ 2 - 0
server/src/main/java/password/pwm/AppProperty.java

@@ -285,6 +285,8 @@ public enum AppProperty
     OTP_ENCRYPTION_ALG                              ( "otp.encryptionAlg" ),
     PASSWORD_RANDOMGEN_MAX_ATTEMPTS                 ( "password.randomGenerator.maxAttempts" ),
     PASSWORD_RANDOMGEN_MAX_LENGTH                   ( "password.randomGenerator.maxLength" ),
+    PASSWORD_RANDOMGEN_MIN_LENGTH                   ( "password.randomGenerator.minLength" ),
+    PASSWORD_RANDOMGEN_DEFAULT_STRENGTH             ( "password.randomGenerator.defaultStrength" ),
     PASSWORD_RANDOMGEN_JITTER_COUNT                 ( "password.randomGenerator.jitter.count" ),
 
     /* Strength thresholds, introduced by the addition of the zxcvbn strength meter library (since it has 5 levels) */

+ 0 - 1
server/src/main/java/password/pwm/PwmAboutProperty.java

@@ -58,7 +58,6 @@ public enum PwmAboutProperty
     app_applicationPath( null, pwmApplication -> pwmApplication.getPwmEnvironment().getApplicationPath().getAbsolutePath() ),
     app_environmentFlags( null, pwmApplication -> StringUtil.collectionToString( pwmApplication.getPwmEnvironment().getFlags() ) ),
     app_wordlistSize( null, pwmApplication -> Long.toString( pwmApplication.getWordlistService().size() ) ),
-    app_seedlistSize( null, pwmApplication -> Long.toString( pwmApplication.getSeedlistManager().size() ) ),
     app_sharedHistorySize( null, pwmApplication -> Long.toString( pwmApplication.getSharedHistoryManager().size() ) ),
     app_sharedHistoryOldestTime( null, pwmApplication -> format( pwmApplication.getSharedHistoryManager().getOldestEntryTime() ) ),
     app_emailQueueSize( null, pwmApplication -> Integer.toString( pwmApplication.getEmailQueue().queueSize() ) ),

+ 0 - 6
server/src/main/java/password/pwm/PwmApplication.java

@@ -55,7 +55,6 @@ import password.pwm.svc.sms.SmsQueueService;
 import password.pwm.svc.stats.Statistic;
 import password.pwm.svc.stats.StatisticsClient;
 import password.pwm.svc.stats.StatisticsService;
-import password.pwm.svc.wordlist.SeedlistService;
 import password.pwm.svc.wordlist.SharedHistoryService;
 import password.pwm.svc.wordlist.WordlistService;
 import password.pwm.util.MBeanUtility;
@@ -683,11 +682,6 @@ public class PwmApplication
         return ( WordlistService ) pwmServiceManager.getService( PwmServiceEnum.WordlistService );
     }
 
-    public SeedlistService getSeedlistManager( )
-    {
-        return ( SeedlistService ) pwmServiceManager.getService( PwmServiceEnum.SeedlistService );
-    }
-
     public ReportService getReportService( )
     {
         return ( ReportService ) pwmServiceManager.getService( PwmServiceEnum.ReportService );

+ 5 - 2
server/src/main/java/password/pwm/config/PwmSetting.java

@@ -480,8 +480,6 @@ public enum PwmSetting
             "wordlistCaseSensitive", PwmSettingSyntax.BOOLEAN, PwmSettingCategory.WORDLISTS ),
     PASSWORD_WORDLIST_WORDSIZE(
             "password.wordlist.wordSize", PwmSettingSyntax.NUMERIC, PwmSettingCategory.WORDLISTS ),
-    SEEDLIST_FILENAME(
-            "pwm.seedlist.location", PwmSettingSyntax.STRING, PwmSettingCategory.WORDLISTS ),
 
 
     // password policy profile settings
@@ -1277,6 +1275,11 @@ public enum PwmSetting
 
 
     // deprecated.
+
+    // deprecated 2022-07-25
+    SEEDLIST_FILENAME(
+            "pwm.seedlist.location", PwmSettingSyntax.STRING, PwmSettingCategory.WORDLISTS ),
+
     // deprecated 2022-04-20
     IP_PERMITTED_RANGE(
             "network.ip.permittedRange", PwmSettingSyntax.STRING_ARRAY, PwmSettingCategory.WEB_SECURITY ),

+ 0 - 7
server/src/main/java/password/pwm/http/servlet/admin/AppDashboardData.java

@@ -332,13 +332,6 @@ public class AppDashboardData implements Serializable
                 numberFormat.format( pwmDomain.getPwmApplication().getWordlistService().size() )
         ) );
 
-        localDbInfo.add( new DisplayElement(
-                "seedlistSize",
-                DisplayElement.Type.number,
-                "Seed List Dictionary Size",
-                numberFormat.format( pwmDomain.getPwmApplication().getSeedlistManager().size() )
-        ) );
-
         localDbInfo.add( new DisplayElement(
                 "sharedHistorySize",
                 DisplayElement.Type.number,

+ 2 - 1
server/src/main/java/password/pwm/http/servlet/configeditor/ConfigEditorServlet.java

@@ -84,6 +84,7 @@ import password.pwm.util.java.TimeDuration;
 import password.pwm.util.json.JsonFactory;
 import password.pwm.util.logging.PwmLogger;
 import password.pwm.util.macro.MacroRequest;
+import password.pwm.util.password.RandomGeneratorConfig;
 import password.pwm.util.password.RandomPasswordGenerator;
 import password.pwm.ws.server.RestResultBean;
 import password.pwm.ws.server.rest.RestRandomPasswordServer;
@@ -951,7 +952,7 @@ public class ConfigEditorServlet extends ControlledPwmServlet
             throws IOException, PwmUnrecoverableException
     {
         final RestRandomPasswordServer.JsonInput jsonInput = JsonFactory.get().deserialize( pwmRequest.readRequestBodyAsString(), RestRandomPasswordServer.JsonInput.class );
-        final RandomPasswordGenerator.RandomGeneratorConfig randomConfig = RestRandomPasswordServer.jsonInputToRandomConfig( jsonInput, PwmPasswordPolicy.defaultPolicy() );
+        final RandomGeneratorConfig randomConfig = RestRandomPasswordServer.jsonInputToRandomConfig( jsonInput, pwmRequest.getPwmDomain(), PwmPasswordPolicy.defaultPolicy() );
         final PasswordData randomPassword = RandomPasswordGenerator.createRandomPassword( pwmRequest.getLabel(), randomConfig, pwmRequest.getPwmDomain() );
         final RestRandomPasswordServer.JsonOutput outputMap = new RestRandomPasswordServer.JsonOutput();
         outputMap.setPassword( randomPassword.getStringValue() );

+ 6 - 10
server/src/main/java/password/pwm/http/servlet/helpdesk/HelpdeskServlet.java

@@ -31,6 +31,7 @@ import password.pwm.AppProperty;
 import password.pwm.PwmConstants;
 import password.pwm.PwmDomain;
 import password.pwm.bean.EmailItemBean;
+import password.pwm.bean.PhotoDataBean;
 import password.pwm.bean.TokenDestinationItem;
 import password.pwm.bean.UserIdentity;
 import password.pwm.config.DomainConfig;
@@ -61,8 +62,6 @@ import password.pwm.http.servlet.peoplesearch.PhotoDataReader;
 import password.pwm.http.servlet.peoplesearch.SearchRequestBean;
 import password.pwm.i18n.Message;
 import password.pwm.ldap.LdapOperationsHelper;
-import password.pwm.bean.PhotoDataBean;
-import password.pwm.user.UserInfo;
 import password.pwm.ldap.UserInfoFactory;
 import password.pwm.ldap.search.SearchConfiguration;
 import password.pwm.ldap.search.UserSearchEngine;
@@ -80,18 +79,20 @@ import password.pwm.svc.stats.Statistic;
 import password.pwm.svc.stats.StatisticsClient;
 import password.pwm.svc.token.TokenService;
 import password.pwm.svc.token.TokenUtil;
+import password.pwm.user.UserInfo;
 import password.pwm.util.PasswordData;
 import password.pwm.util.java.CollectionUtil;
 import password.pwm.util.java.JavaHelper;
 import password.pwm.util.java.MiscUtil;
 import password.pwm.util.java.PwmTimeUtil;
-import password.pwm.util.json.JsonFactory;
 import password.pwm.util.java.StringUtil;
 import password.pwm.util.java.TimeDuration;
+import password.pwm.util.json.JsonFactory;
 import password.pwm.util.logging.PwmLogger;
 import password.pwm.util.macro.MacroRequest;
 import password.pwm.util.operations.ActionExecutor;
 import password.pwm.util.password.PasswordUtility;
+import password.pwm.util.password.RandomGeneratorConfig;
 import password.pwm.util.password.RandomPasswordGenerator;
 import password.pwm.ws.server.RestResultBean;
 import password.pwm.ws.server.rest.RestCheckPasswordServer;
@@ -1346,12 +1347,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
                 chaiUser.getChaiProvider()
         );
 
-        final RandomPasswordGenerator.RandomGeneratorConfig.RandomGeneratorConfigBuilder randomConfigBuilder
-                = RandomPasswordGenerator.RandomGeneratorConfig.builder();
-
-        randomConfigBuilder.passwordPolicy( userInfo.getPasswordPolicy() );
-
-        final RandomPasswordGenerator.RandomGeneratorConfig randomConfig = randomConfigBuilder.build();
+        final RandomGeneratorConfig randomConfig = RandomGeneratorConfig.make( pwmRequest.getPwmDomain(), userInfo.getPasswordPolicy() );
         final PasswordData randomPassword = RandomPasswordGenerator.createRandomPassword( pwmRequest.getLabel(), randomConfig, pwmRequest.getPwmDomain() );
         final RestRandomPasswordServer.JsonOutput jsonOutput = new RestRandomPasswordServer.JsonOutput();
         jsonOutput.setPassword( randomPassword.getStringValue() );
@@ -1363,7 +1359,7 @@ public class HelpdeskServlet extends ControlledPwmServlet
 
     @ActionHandler( action = "photo" )
     public ProcessStatus processUserPhotoImageRequest( final PwmRequest pwmRequest )
-            throws ChaiUnavailableException, PwmUnrecoverableException, IOException, ServletException
+            throws PwmUnrecoverableException
     {
         final UserIdentity userIdentity = readUserKeyRequestParameter( pwmRequest );
         final HelpdeskProfile helpdeskProfile = getHelpdeskProfile( pwmRequest );

+ 4 - 3
server/src/main/java/password/pwm/http/servlet/newuser/NewUserUtils.java

@@ -79,6 +79,7 @@ import password.pwm.util.macro.MacroReplacer;
 import password.pwm.util.macro.MacroRequest;
 import password.pwm.util.operations.ActionExecutor;
 import password.pwm.util.password.PasswordUtility;
+import password.pwm.util.password.RandomGeneratorConfig;
 import password.pwm.util.password.RandomPasswordGenerator;
 import password.pwm.ws.client.rest.form.FormDataRequestBean;
 import password.pwm.ws.client.rest.form.FormDataResponseBean;
@@ -212,9 +213,9 @@ class NewUserUtils
             NewUserUtils.LOGGER.trace( pwmRequest, () -> "will use temporary password process for new user entry: " + newUserDN );
             final PasswordData temporaryPassword;
             {
-                final RandomPasswordGenerator.RandomGeneratorConfig randomGeneratorConfig = RandomPasswordGenerator.RandomGeneratorConfig.builder()
-                        .passwordPolicy( newUserProfile.getNewUserPasswordPolicy( pwmRequest.getPwmRequestContext() ) )
-                        .build();
+                final RandomGeneratorConfig randomGeneratorConfig = RandomGeneratorConfig.make( pwmRequest.getPwmDomain(),
+                         newUserProfile.getNewUserPasswordPolicy( pwmRequest.getPwmRequestContext() ) );
+
                 temporaryPassword = RandomPasswordGenerator.createRandomPassword( pwmRequest.getLabel(), randomGeneratorConfig, pwmDomain );
             }
             final ChaiUser proxiedUser = chaiProvider.getEntryFactory().newChaiUser( newUserDN );

+ 2 - 2
server/src/main/java/password/pwm/http/servlet/resource/ResourceServletService.java

@@ -271,7 +271,7 @@ public class ResourceServletService extends AbstractPwmService implements PwmSer
     private String checksumAllResources( final PwmDomain pwmDomain )
             throws IOException
     {
-        try ( DigestOutputStream checksumStream = new DigestOutputStream( OutputStream.nullOutputStream(), PwmHashAlgorithm.SHA512.newMessageDigest() ) )
+        try ( DigestOutputStream checksumStream = new DigestOutputStream( OutputStream.nullOutputStream(), PwmHashAlgorithm.SHA1.newMessageDigest() ) )
         {
             checksumResourceFilePath( pwmDomain, checksumStream );
 
@@ -293,7 +293,7 @@ public class ResourceServletService extends AbstractPwmService implements PwmSer
                     }
                 }
             }
-            return JavaHelper.binaryArrayToHex( checksumStream.getMessageDigest().digest() );
+            return JavaHelper.binaryArrayToHex( checksumStream.getMessageDigest().digest() ).toLowerCase();
         }
     }
 

+ 2 - 4
server/src/main/java/password/pwm/ldap/auth/LDAPAuthenticationRequest.java

@@ -65,6 +65,7 @@ import password.pwm.util.logging.PwmLogLevel;
 import password.pwm.util.logging.PwmLogger;
 import password.pwm.util.macro.MacroRequest;
 import password.pwm.util.password.PasswordUtility;
+import password.pwm.util.password.RandomGeneratorConfig;
 import password.pwm.util.password.RandomPasswordGenerator;
 
 import java.time.Instant;
@@ -501,10 +502,7 @@ class LDAPAuthenticationRequest implements AuthenticationRequest
                     chaiUser );
 
             // create random password for user
-            final RandomPasswordGenerator.RandomGeneratorConfig randomGeneratorConfig = RandomPasswordGenerator.RandomGeneratorConfig.builder()
-                    .seedlistPhrases( RandomPasswordGenerator.DEFAULT_SEED_PHRASES )
-                    .passwordPolicy( passwordPolicy )
-                    .build();
+            final RandomGeneratorConfig randomGeneratorConfig = RandomGeneratorConfig.make( pwmDomain, passwordPolicy );
 
             final PasswordData currentPass = RandomPasswordGenerator.createRandomPassword( sessionLabel, randomGeneratorConfig, pwmDomain );
 

+ 0 - 2
server/src/main/java/password/pwm/svc/PwmServiceEnum.java

@@ -31,7 +31,6 @@ import password.pwm.svc.pwnotify.PwNotifyService;
 import password.pwm.svc.sms.SmsQueueService;
 import password.pwm.svc.stats.StatisticsService;
 import password.pwm.svc.version.VersionCheckService;
-import password.pwm.svc.wordlist.SeedlistService;
 import password.pwm.svc.wordlist.SharedHistoryService;
 import password.pwm.svc.wordlist.WordlistService;
 import password.pwm.util.java.CollectionUtil;
@@ -51,7 +50,6 @@ public enum PwmServiceEnum
     AuditService( password.pwm.svc.event.AuditService.class, PwmSettingScope.SYSTEM ),
     StatisticsService( StatisticsService.class, PwmSettingScope.SYSTEM, Flag.StartDuringRuntimeInstance ),
     WordlistService( WordlistService.class, PwmSettingScope.SYSTEM, Flag.StartDuringRuntimeInstance ),
-    SeedlistService( SeedlistService.class, PwmSettingScope.SYSTEM ),
     IntruderSystemService( IntruderSystemService.class, PwmSettingScope.SYSTEM ),
     EmailService( EmailService.class, PwmSettingScope.SYSTEM ),
     SmsQueueManager( SmsQueueService.class, PwmSettingScope.SYSTEM ),

+ 0 - 21
server/src/main/java/password/pwm/svc/wordlist/AbstractWordlistBucket.java

@@ -28,7 +28,6 @@ import password.pwm.util.java.MiscUtil;
 import password.pwm.util.java.StringUtil;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Map;
 import java.util.TreeMap;
 
@@ -57,21 +56,6 @@ public abstract class AbstractWordlistBucket implements WordlistBucket
     {
         switch ( type )
         {
-            case SEEDLIST:
-            {
-                final Map<String, String> returnData = new TreeMap<>();
-                for ( final String word : words )
-                {
-                    if ( StringUtil.notEmpty( word ) )
-                    {
-                        final long nextLong = valueIncrementer.next();
-                        final String nextKey = seedlistLongToKey( nextLong );
-                        returnData.put( nextKey, word );
-                    }
-                }
-                return Collections.unmodifiableMap( returnData );
-            }
-
             case WORDLIST:
             {
                 final Map<String, String> returnData = new TreeMap<>();
@@ -136,11 +120,6 @@ public abstract class AbstractWordlistBucket implements WordlistBucket
     @Override
     public boolean containsWord( final String word ) throws PwmUnrecoverableException
     {
-        if ( type == WordlistType.SEEDLIST )
-        {
-            throw new IllegalStateException( "unable to containWord check SEEDLIST wordlist" );
-        }
-
         return containsKey( word );
     }
 

+ 0 - 51
server/src/main/java/password/pwm/svc/wordlist/SeedlistService.java

@@ -1,51 +0,0 @@
-/*
- * Password Management Servlets (PWM)
- * http://www.pwm-project.org
- *
- * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2021 The PWM Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package password.pwm.svc.wordlist;
-
-import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.util.logging.PwmLogger;
-
-public class SeedlistService extends AbstractWordlist implements Wordlist
-{
-    private static final PwmLogger LOGGER = PwmLogger.forClass( SeedlistService.class );
-
-    public SeedlistService()
-    {
-    }
-
-    @Override
-    protected WordlistType getWordlistType()
-    {
-        return WordlistType.SEEDLIST;
-    }
-
-    @Override
-    protected PwmLogger getLogger()
-    {
-        return LOGGER;
-    }
-
-    @Override
-    public String randomSeed() throws PwmUnrecoverableException
-    {
-        return super.randomSeed();
-    }
-}

+ 0 - 11
server/src/main/java/password/pwm/svc/wordlist/WordlistConfiguration.java

@@ -88,17 +88,6 @@ public class WordlistConfiguration implements Serializable
     {
         switch ( type )
         {
-            case SEEDLIST:
-            {
-                return commonBuilder( appConfig ).toBuilder()
-                        .autoImportUrl( readAutoImportUrl( appConfig, PwmSetting.SEEDLIST_FILENAME ) )
-                        .metaDataAppAttribute( AppAttribute.SEEDLIST_METADATA )
-                        .builtInWordlistLocationProperty( AppProperty.SEEDLIST_BUILTIN_PATH )
-                        .db( LocalDB.DB.SEEDLIST_WORDS )
-                        .wordlistFilenameSetting( PwmSetting.SEEDLIST_FILENAME )
-                        .build();
-            }
-
             case WORDLIST:
             {
                 return commonBuilder( appConfig ).toBuilder()

+ 1 - 5
server/src/main/java/password/pwm/svc/wordlist/WordlistType.java

@@ -24,8 +24,7 @@ import password.pwm.PwmApplication;
 
 public enum WordlistType
 {
-    WORDLIST,
-    SEEDLIST,;
+    WORDLIST,;
 
     public Wordlist forType( final PwmApplication pwmApplication )
     {
@@ -34,9 +33,6 @@ public enum WordlistType
             case WORDLIST:
                 return pwmApplication.getWordlistService();
 
-            case SEEDLIST:
-                return pwmApplication.getSeedlistManager();
-
             default:
                 throw new IllegalStateException( "unhandled wordlistType" );
         }

+ 178 - 0
server/src/main/java/password/pwm/util/password/RandomGeneratorConfig.java

@@ -0,0 +1,178 @@
+/*
+ * Password Management Servlets (PWM)
+ * http://www.pwm-project.org
+ *
+ * Copyright (c) 2006-2009 Novell, Inc.
+ * Copyright (c) 2009-2021 The PWM Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package password.pwm.util.password;
+
+import lombok.AccessLevel;
+import lombok.Builder;
+import lombok.Value;
+import password.pwm.AppProperty;
+import password.pwm.PwmDomain;
+import password.pwm.config.profile.PwmPasswordPolicy;
+import password.pwm.config.profile.PwmPasswordRule;
+import password.pwm.error.ErrorInformation;
+import password.pwm.error.PwmError;
+import password.pwm.error.PwmUnrecoverableException;
+import password.pwm.util.java.CollectionUtil;
+
+import java.util.Collection;
+import java.util.Collections;
+
+@Value
+@Builder( toBuilder = true, access = AccessLevel.PRIVATE )
+public class RandomGeneratorConfig
+{
+    private static final int MINIMUM_STRENGTH = 0;
+    private static final int MAXIMUM_STRENGTH = 100;
+
+    /**
+     * A set of phrases (Strings) used to generate the pwmRandom passwords.  There must be enough
+     * values in the phrases to build a random password that meets rule requirements
+     */
+    @Builder.Default
+    private Collection<String> seedlistPhrases = Collections.emptySet();
+
+    /**
+     * The minimum length desired for the password.  The algorithm will attempt to make
+     * the returned value at least this long, but it is not guaranteed.
+     */
+    private int minimumLength;
+
+    private int maximumLength;
+
+    /**
+     * The minimum length desired strength.  The algorithm will attempt to make
+     * the returned value at least this strong, but it is not guaranteed.
+     */
+    private int minimumStrength;
+
+    private int jitter;
+
+    private int maximumAttempts;
+
+    public static RandomGeneratorConfig make(
+            final PwmDomain pwmDomain,
+            final PwmPasswordPolicy pwmPasswordPolicy
+    )
+            throws PwmUnrecoverableException
+    {
+
+        return make( pwmDomain, pwmPasswordPolicy, RandomGeneratorConfigRequest.builder().build() );
+    }
+
+    public static RandomGeneratorConfig make(
+            final PwmDomain pwmDomain,
+            final PwmPasswordPolicy pwmPasswordPolicy,
+            final RandomGeneratorConfigRequest request
+    )
+            throws PwmUnrecoverableException
+    {
+        final RandomGeneratorConfig config = RandomGeneratorConfig.builder()
+                .maximumAttempts( Integer.parseInt( pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_MAX_ATTEMPTS ) ) )
+                .jitter( Integer.parseInt( pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_JITTER_COUNT ) ) )
+                .maximumLength( figureMaximumLength( pwmDomain, pwmPasswordPolicy, request.getMaximumLength() ) )
+                .minimumLength( figureMinimumLength( pwmDomain, pwmPasswordPolicy, request.getMinimumLength() ) )
+                .minimumStrength( figureMinimumStrength( pwmDomain, pwmPasswordPolicy, request.getMinimumStrength() ) )
+                .seedlistPhrases( CollectionUtil.isEmpty( request.getSeedlistPhrases() )
+                        ? RandomPasswordGenerator.DEFAULT_SEED_PHRASES : request.getSeedlistPhrases() )
+                .build();
+
+        config.validateSettings( pwmDomain );
+
+        return config;
+    }
+
+    private static int figureMaximumLength( final PwmDomain pwmDomain, final PwmPasswordPolicy pwmPasswordPolicy, final int requestedValue )
+    {
+        int policyMax = requestedValue;
+        if ( requestedValue <= 0 )
+        {
+            policyMax = Integer.parseInt( pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_MAX_LENGTH ) );
+        }
+        if ( pwmPasswordPolicy != null )
+        {
+            policyMax = Math.min( policyMax, pwmPasswordPolicy.getRuleHelper().readIntValue( PwmPasswordRule.MaximumLength ) );
+        }
+        return policyMax;
+    }
+
+    private static int figureMinimumLength( final PwmDomain pwmDomain, final PwmPasswordPolicy pwmPasswordPolicy, final int requestedValue )
+    {
+        int returnVal = requestedValue;
+        if ( requestedValue <= 0 )
+        {
+            returnVal = Integer.parseInt( pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_MIN_LENGTH ) );
+        }
+        if ( pwmPasswordPolicy != null )
+        {
+            final int policyMin = pwmPasswordPolicy.getRuleHelper().readIntValue( PwmPasswordRule.MinimumLength );
+            if ( policyMin > 0 )
+            {
+                returnVal = Math.min( returnVal, pwmPasswordPolicy.getRuleHelper().readIntValue( PwmPasswordRule.MinimumLength ) );
+            }
+        }
+        return returnVal;
+    }
+
+    private static int figureMinimumStrength( final PwmDomain pwmDomain, final PwmPasswordPolicy pwmPasswordPolicy, final int requestedValue )
+    {
+        int policyMin = requestedValue;
+        if ( requestedValue <= 0 )
+        {
+            policyMin = Integer.parseInt( pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_DEFAULT_STRENGTH ) );
+        }
+
+        if ( pwmPasswordPolicy != null )
+        {
+            policyMin = Math.max( policyMin, pwmPasswordPolicy.getRuleHelper().readIntValue( PwmPasswordRule.MinimumStrength ) );
+        }
+        return policyMin;
+    }
+
+    void validateSettings( final PwmDomain pwmDomain )
+            throws PwmUnrecoverableException
+    {
+        final int maxLength = Integer.parseInt(
+                pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_MAX_LENGTH ) );
+        if ( this.getMinimumLength() > maxLength )
+        {
+            throw new PwmUnrecoverableException( new ErrorInformation(
+                    PwmError.ERROR_INTERNAL,
+                    "minimum random generated password length exceeds preset random generator threshold"
+            ) );
+        }
+
+        if ( this.getMaximumLength() > maxLength )
+        {
+            throw new PwmUnrecoverableException( new ErrorInformation(
+                    PwmError.ERROR_INTERNAL,
+                    "maximum random generated password length exceeds preset random generator threshold"
+            ) );
+        }
+
+        if ( this.getMinimumStrength() > RandomGeneratorConfig.MAXIMUM_STRENGTH )
+        {
+            throw new PwmUnrecoverableException( new ErrorInformation(
+                    PwmError.ERROR_INTERNAL,
+                    "minimum random generated password strength exceeds maximum possible"
+            ) );
+        }
+    }
+}

+ 56 - 0
server/src/main/java/password/pwm/util/password/RandomGeneratorConfigRequest.java

@@ -0,0 +1,56 @@
+/*
+ * Password Management Servlets (PWM)
+ * http://www.pwm-project.org
+ *
+ * Copyright (c) 2006-2009 Novell, Inc.
+ * Copyright (c) 2009-2021 The PWM Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package password.pwm.util.password;
+
+import lombok.Builder;
+import lombok.Value;
+
+import java.util.Collection;
+import java.util.Collections;
+
+@Builder
+@Value
+public class RandomGeneratorConfigRequest
+{
+    /**
+     * A set of phrases (Strings) used to generate the pwmRandom passwords.  There must be enough
+     * values in the phrases to build a random password that meets rule requirements
+     */
+    @Builder.Default
+    private Collection<String> seedlistPhrases = Collections.emptySet();
+
+    /**
+     * The minimum length desired for the password.  The algorithm will attempt to make
+     * the returned value at least this long, but it is not guaranteed.
+     */
+    @Builder.Default
+    private int minimumLength = -1;
+
+    @Builder.Default
+    private int maximumLength = -1;
+
+    /**
+     * The minimum length desired strength.  The algorithm will attempt to make
+     * the returned value at least this strong, but it is not guaranteed.
+     */
+    @Builder.Default
+    private int minimumStrength = -1;
+}

+ 12 - 141
server/src/main/java/password/pwm/util/password/RandomPasswordGenerator.java

@@ -21,9 +21,7 @@
 package password.pwm.util.password;
 
 import com.novell.ldapchai.exception.ImpossiblePasswordPolicyException;
-import lombok.Builder;
 import lombok.Value;
-import password.pwm.AppProperty;
 import password.pwm.PwmDomain;
 import password.pwm.bean.SessionLabel;
 import password.pwm.config.DomainConfig;
@@ -33,10 +31,8 @@ import password.pwm.config.profile.PwmPasswordRule;
 import password.pwm.error.ErrorInformation;
 import password.pwm.error.PwmError;
 import password.pwm.error.PwmUnrecoverableException;
-import password.pwm.svc.PwmService;
 import password.pwm.svc.stats.Statistic;
 import password.pwm.svc.stats.StatisticsClient;
-import password.pwm.svc.wordlist.SeedlistService;
 import password.pwm.util.PasswordData;
 import password.pwm.util.java.TimeDuration;
 import password.pwm.util.logging.PwmLogLevel;
@@ -84,9 +80,7 @@ public class RandomPasswordGenerator
     )
             throws PwmUnrecoverableException
     {
-        final RandomGeneratorConfig randomGeneratorConfig = RandomGeneratorConfig.builder()
-                .passwordPolicy( passwordPolicy )
-                .build();
+        final RandomGeneratorConfig randomGeneratorConfig = RandomGeneratorConfig.make( pwmDomain, passwordPolicy );
 
         return createRandomPassword(
                 sessionLabel,
@@ -122,16 +116,15 @@ public class RandomPasswordGenerator
 
         randomGeneratorConfig.validateSettings( pwmDomain );
 
-        final RandomGeneratorConfig effectiveConfig = makeEffectiveConfig( randomGeneratorConfig, pwmDomain );
         final PwmRandom pwmRandom = pwmDomain.getSecureService().pwmRandom();
-        final SeedMachine seedMachine = new SeedMachine( pwmRandom, normalizeSeeds( effectiveConfig.getSeedlistPhrases() ) );
+        final SeedMachine seedMachine = new SeedMachine( pwmRandom, normalizeSeeds( randomGeneratorConfig.getSeedlistPhrases() ) );
 
         // determine the password policy to use for random generation
-        final PwmPasswordPolicy randomGenPolicy = makeRandomGenPwdPolicy( effectiveConfig, pwmDomain );
+        final PwmPasswordPolicy randomGenPolicy = makeRandomGenPwdPolicy( randomGeneratorConfig, pwmDomain );
 
         // read a rule validator
         // modify until it passes all the rules
-        final MutatorResult mutatorResult = passwordMutator( sessionLabel, pwmDomain, seedMachine, effectiveConfig, randomGenPolicy );
+        final MutatorResult mutatorResult = passwordMutator( sessionLabel, pwmDomain, seedMachine, randomGeneratorConfig, randomGenPolicy );
 
         // report outcome
 
@@ -174,58 +167,25 @@ public class RandomPasswordGenerator
             final PwmDomain pwmDomain
     )
     {
-        final Map<String, String> newPolicyMap = new HashMap<>( effectiveConfig.getPasswordPolicy().getPolicyMap() );
+        final PwmPasswordPolicy defaultPolicy = PwmPasswordPolicy.defaultPolicy();
+        final Map<String, String> newPolicyMap = new HashMap<>( defaultPolicy.getPolicyMap() );
 
         newPolicyMap.put( PwmPasswordRule.MaximumLength.getKey(), String.valueOf( effectiveConfig.getMaximumLength() ) );
-        if ( effectiveConfig.getMinimumLength() > effectiveConfig.getPasswordPolicy().getRuleHelper().readIntValue( PwmPasswordRule.MinimumLength ) )
+        if ( effectiveConfig.getMinimumLength() > defaultPolicy.getRuleHelper().readIntValue( PwmPasswordRule.MinimumLength ) )
         {
             newPolicyMap.put( PwmPasswordRule.MinimumLength.getKey(), String.valueOf( effectiveConfig.getMinimumLength() ) );
         }
-        if ( effectiveConfig.getMaximumLength() < effectiveConfig.getPasswordPolicy().getRuleHelper().readIntValue( PwmPasswordRule.MaximumLength ) )
+        if ( effectiveConfig.getMaximumLength() < defaultPolicy.getRuleHelper().readIntValue( PwmPasswordRule.MaximumLength ) )
         {
             newPolicyMap.put( PwmPasswordRule.MaximumLength.getKey(), String.valueOf( effectiveConfig.getMaximumLength() ) );
         }
-        if ( effectiveConfig.getMinimumStrength() > effectiveConfig.getPasswordPolicy().getRuleHelper().readIntValue( PwmPasswordRule.MinimumStrength ) )
+        if ( effectiveConfig.getMinimumStrength() > defaultPolicy.getRuleHelper().readIntValue( PwmPasswordRule.MinimumStrength ) )
         {
             newPolicyMap.put( PwmPasswordRule.MinimumStrength.getKey(), String.valueOf( effectiveConfig.getMinimumStrength() ) );
         }
         return  PwmPasswordPolicy.createPwmPasswordPolicy( pwmDomain.getDomainID(), newPolicyMap );
     }
 
-    private static RandomGeneratorConfig makeEffectiveConfig(
-            final RandomGeneratorConfig randomGeneratorConfig,
-            final PwmDomain pwmDomain
-    )
-            throws PwmUnrecoverableException
-    {
-        if ( randomGeneratorConfig.getSeedlistPhrases() == null || randomGeneratorConfig.getSeedlistPhrases().isEmpty() )
-        {
-            Set<String> seeds = DEFAULT_SEED_PHRASES;
-
-            final SeedlistService seedlistManager = pwmDomain.getPwmApplication().getSeedlistManager();
-            if ( seedlistManager != null && seedlistManager.status() == PwmService.STATUS.OPEN && seedlistManager.size() > 0 )
-            {
-                seeds = new HashSet<>();
-                int safetyCounter = 0;
-                while ( seeds.size() < 10 && safetyCounter < 100 )
-                {
-                    safetyCounter++;
-                    final String randomWord = seedlistManager.randomSeed();
-                    if ( randomWord != null )
-                    {
-                        seeds.add( randomWord );
-                    }
-                }
-            }
-            return randomGeneratorConfig.toBuilder()
-                    .seedlistPhrases( seeds )
-                    .build();
-        }
-
-        return randomGeneratorConfig;
-
-    }
-
     private static MutatorResult passwordMutator(
             final SessionLabel sessionLabel,
             final PwmDomain pwmDomain,
@@ -237,8 +197,8 @@ public class RandomPasswordGenerator
             throws PwmUnrecoverableException
     {
 
-        final int maxTryCount = Integer.parseInt( pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_MAX_ATTEMPTS ) );
-        final int jitterCount = Integer.parseInt( pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_JITTER_COUNT ) );
+        final int maxTryCount = effectiveConfig.getMaximumAttempts();
+        final int jitterCount = effectiveConfig.getJitter();
         final PwmRandom pwmRandom = pwmDomain.getSecureService().pwmRandom();
 
         final StringBuilder password = new StringBuilder();
@@ -463,7 +423,7 @@ public class RandomPasswordGenerator
     private static void addRandChar( final PwmRandom pwmRandom, final StringBuilder password, final String allowedChars )
             throws ImpossiblePasswordPolicyException
     {
-        final int insertPosition = pwmRandom.nextInt( password.length() );
+        final int insertPosition = password.length() < 1 ? 0 : pwmRandom.nextInt( password.length() );
         addRandChar( pwmRandom, password, allowedChars, insertPosition );
     }
 
@@ -654,93 +614,4 @@ public class RandomPasswordGenerator
         return newSeeds.isEmpty() ? DEFAULT_SEED_PHRASES : newSeeds;
     }
 
-    @Value
-    @Builder( toBuilder = true )
-    public static class RandomGeneratorConfig
-    {
-        private static final int DEFAULT_MINIMUM_LENGTH = 6;
-        private static final int DEFAULT_MAXIMUM_LENGTH = 16;
-        private static final int DEFAULT_DESIRED_STRENGTH = 45;
-
-        private static final int MINIMUM_STRENGTH = 0;
-        private static final int MAXIMUM_STRENGTH = 100;
-
-        /**
-         * A set of phrases (Strings) used to generate the pwmRandom passwords.  There must be enough
-         * values in the phrases to build a random password that meets rule requirements
-         */
-        @Builder.Default
-        private Collection<String> seedlistPhrases = Collections.emptySet();
-
-        /**
-         * The minimum length desired for the password.  The algorithm will attempt to make
-         * the returned value at least this long, but it is not guaranteed.
-         */
-        @Builder.Default
-        private int minimumLength = DEFAULT_MINIMUM_LENGTH;
-
-        @Builder.Default
-        private int maximumLength = DEFAULT_MAXIMUM_LENGTH;
-
-        /**
-         * The minimum length desired strength.  The algorithm will attempt to make
-         * the returned value at least this strong, but it is not guaranteed.
-         */
-        @Builder.Default
-        private int minimumStrength = DEFAULT_DESIRED_STRENGTH;
-
-        @Builder.Default
-        private PwmPasswordPolicy passwordPolicy = PwmPasswordPolicy.defaultPolicy();
-
-
-        public int getMaximumLength( )
-        {
-            int policyMax = this.maximumLength;
-            if ( this.getPasswordPolicy() != null )
-            {
-                policyMax = this.getPasswordPolicy().getRuleHelper().readIntValue( PwmPasswordRule.MaximumLength );
-            }
-            return Math.min( this.maximumLength, policyMax );
-        }
-
-        public int getMinimumStrength( )
-        {
-            int policyMin = this.minimumStrength;
-            if ( this.getPasswordPolicy() != null )
-            {
-                policyMin = this.getPasswordPolicy().getRuleHelper().readIntValue( PwmPasswordRule.MinimumStrength );
-            }
-            return Math.max( this.minimumStrength, policyMin );
-        }
-
-        void validateSettings( final PwmDomain pwmDomain )
-                throws PwmUnrecoverableException
-        {
-            final int maxLength = Integer.parseInt(
-                    pwmDomain.getConfig().readAppProperty( AppProperty.PASSWORD_RANDOMGEN_MAX_LENGTH ) );
-            if ( this.getMinimumLength() > maxLength )
-            {
-                throw new PwmUnrecoverableException( new ErrorInformation(
-                        PwmError.ERROR_INTERNAL,
-                        "minimum random generated password length exceeds preset random generator threshold"
-                ) );
-            }
-
-            if ( this.getMaximumLength() > maxLength )
-            {
-                throw new PwmUnrecoverableException( new ErrorInformation(
-                        PwmError.ERROR_INTERNAL,
-                        "maximum random generated password length exceeds preset random generator threshold"
-                ) );
-            }
-
-            if ( this.getMinimumStrength() > RandomGeneratorConfig.MAXIMUM_STRENGTH )
-            {
-                throw new PwmUnrecoverableException( new ErrorInformation(
-                        PwmError.ERROR_INTERNAL,
-                        "minimum random generated password strength exceeds maximum possible"
-                ) );
-            }
-        }
-    }
 }

+ 9 - 2
server/src/main/java/password/pwm/ws/server/RestServlet.java

@@ -116,7 +116,7 @@ public abstract class RestServlet extends HttpServlet
         }
         catch ( final PwmUnrecoverableException e )
         {
-            final RestResultBean restResultBean  = RestResultBean.fromError(
+            final RestResultBean<ErrorInformation> restResultBean  = RestResultBean.fromError(
                     e.getErrorInformation(),
                     pwmDomain,
                     locale,
@@ -448,7 +448,12 @@ public abstract class RestServlet extends HttpServlet
                     resp.setHeader( HttpHeader.ContentType.getHttpName(), HttpContentType.plain.getHeaderValueWithEncoding() );
                     if ( restResultBean.isError() )
                     {
-                        resp.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, restResultBean.getErrorMessage() );
+                        resp.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
+                        try ( PrintWriter pw = resp.getWriter() )
+                        {
+                            pw.write( restResultBean.getErrorDetail() );
+                            pw.write( "\n" );
+                        }
                     }
                     else
                     {
@@ -484,6 +489,8 @@ public abstract class RestServlet extends HttpServlet
             }
             outputLastHopeError( msg, resp );
         }
+
+        resp.flushBuffer();
     }
 
     private static void outputLastHopeError( final String msg, final HttpServletResponse response ) throws IOException

+ 10 - 7
server/src/main/java/password/pwm/ws/server/rest/RestRandomPasswordServer.java

@@ -22,6 +22,7 @@ package password.pwm.ws.server.rest;
 
 import lombok.Data;
 import password.pwm.PwmConstants;
+import password.pwm.PwmDomain;
 import password.pwm.config.option.WebServiceUsage;
 import password.pwm.config.profile.PwmPasswordPolicy;
 import password.pwm.error.ErrorInformation;
@@ -34,6 +35,8 @@ import password.pwm.http.PwmHttpRequestWrapper;
 import password.pwm.svc.stats.Statistic;
 import password.pwm.svc.stats.StatisticsClient;
 import password.pwm.util.PasswordData;
+import password.pwm.util.password.RandomGeneratorConfig;
+import password.pwm.util.password.RandomGeneratorConfigRequest;
 import password.pwm.util.password.RandomPasswordGenerator;
 import password.pwm.util.java.StringUtil;
 import password.pwm.util.logging.PwmLogger;
@@ -211,7 +214,7 @@ public class RestRandomPasswordServer extends RestServlet
                     targetUserIdentity.getChaiUser() );
         }
 
-        final RandomPasswordGenerator.RandomGeneratorConfig randomConfig = jsonInputToRandomConfig( jsonInput, pwmPasswordPolicy );
+        final RandomGeneratorConfig randomConfig = jsonInputToRandomConfig( jsonInput, restRequest.getDomain(), pwmPasswordPolicy );
         final PasswordData randomPassword = RandomPasswordGenerator.createRandomPassword( restRequest.getSessionLabel(), randomConfig, restRequest.getDomain() );
         final JsonOutput outputMap = new JsonOutput();
         outputMap.password = randomPassword.getStringValue();
@@ -221,13 +224,15 @@ public class RestRandomPasswordServer extends RestServlet
         return outputMap;
     }
 
-    public static RandomPasswordGenerator.RandomGeneratorConfig jsonInputToRandomConfig(
+    public static RandomGeneratorConfig jsonInputToRandomConfig(
             final JsonInput jsonInput,
+            final PwmDomain pwmDomain,
             final PwmPasswordPolicy pwmPasswordPolicy
     )
+            throws PwmUnrecoverableException
     {
-        final RandomPasswordGenerator.RandomGeneratorConfig.RandomGeneratorConfigBuilder randomConfigBuilder
-                = RandomPasswordGenerator.RandomGeneratorConfig.builder();
+        final RandomGeneratorConfigRequest.RandomGeneratorConfigRequestBuilder randomConfigBuilder
+                = RandomGeneratorConfigRequest.builder();
 
         if ( jsonInput.getStrength() > 0 && jsonInput.getStrength() <= 100 )
         {
@@ -252,9 +257,7 @@ public class RestRandomPasswordServer extends RestServlet
             randomConfigBuilder.seedlistPhrases( charValues );
         }
 
-        randomConfigBuilder.passwordPolicy( pwmPasswordPolicy );
-
-        return randomConfigBuilder.build();
+        return RandomGeneratorConfig.make( pwmDomain, pwmPasswordPolicy, randomConfigBuilder.build() );
     }
 }
 

+ 2 - 0
server/src/main/resources/password/pwm/AppProperty.properties

@@ -263,6 +263,8 @@ otp.qrImage.width=200
 otp.encryptionAlg=AES
 password.randomGenerator.maxAttempts=2000
 password.randomGenerator.maxLength=1024
+password.randomGenerator.minLength=12
+password.randomGenerator.defaultStrength=50
 password.randomGenerator.jitter.count=50
 password.strength.threshold.veryStrong=100
 password.strength.threshold.strong=75

+ 2 - 2
server/src/main/resources/password/pwm/config/PwmSetting.xml

@@ -4855,10 +4855,10 @@
     <setting hidden="false" key="pwm.wordlist.location" level="1">
         <default/>
     </setting>
-    <setting hidden="false" key="pwm.seedlist.location" level="2">
+    <!-- BEGIN DEPRECATED SETTINGS -->
+    <setting hidden="true" key="pwm.seedlist.location" level="2">
         <default/>
     </setting>
-    <!-- BEGIN DEPRECATED SETTINGS -->
     <setting hidden="true" key="peopleSearch.displayName.user" level="1" required="true">
         <flags>
             <flag>Deprecated</flag>

+ 1 - 1
server/src/main/resources/password/pwm/i18n/Config.properties

@@ -58,7 +58,7 @@ Display_ConfigManagerRunningEditor=Your modified configuration is currently in m
 Display_ConfigOpenInfo=<p>@PwmAppName@ is currently in <b>configuration</b> mode.   This mode allows updating the configuration without authenticating to an LDAP directory first.  End user functionality is not available in this mode.</p><p>After you have verified the LDAP directory settings, use the Configuration Manager to restrict the configuration to prevent unauthorized changes.  After restricting, the configuration can still be changed but will require LDAP directory authentication first.</p>
 Display_EditorLDAPSizeExceeded=Search results exceeded maximum search size.  Only this display is affected by these search limits.  Application behavior is not constrained by this search limit so additional users will match beyond those shown here.
 Display_LdapPermissionRecommendations=<p>This report shows recommended LDAP permission requirements for the current configuration.  Depending on your LDAP directory type, these may be referred to as permissions, rights, or ACLs (Access Control List).</p><p?>These recommendations should be applied with caution and with an understanding of the security model of your specific LDAP directory environment.  <b>The suggested permissions may not neccessarily be appropriate for your environment.</b>  The access levels <i>read</i> and <i>write</i> are generalizations.  Your LDAP directory may use different permission types.</p><p>There may be additional permissions required that do not appear on this report. For example, permissions required to resolve macro expressions are not included.</p>
-Display_Wordlists_Description=Word lists and seed lists can be uploaded using this page or configured to import from a remote URL using the settings <code>@PwmSettingReference:pwm.wordlist.location@</code> and <code>@PwmSettingReference:pwm.seedlist.location@</code>.
+Display_Wordlists_Description=A word list file can be uploaded using this page or configured to import from a remote URL using the settings <code>@PwmSettingReference:pwm.wordlist.location@</code>.
 Display_SettingFilter_Level_0=Basic
 Display_SettingFilter_Level_1=Intermediate
 Display_SettingFilter_Level_2=All Settings

+ 1 - 1
server/src/main/resources/password/pwm/i18n/Display.properties

@@ -144,7 +144,7 @@ Display_NewUser=To register a new account, please complete the following form.
 Display_NewUserProfile=To register a new account, please select a profile.
 Display_NoResponses=User does not have responses
 Display_PasswordExpired=Your password has expired.  You must set a new password now.
-Display_PasswordGeneration=The following passwords have been randomly generated for you.  These passwords are based on real words to make them easier to remember, but have been modified to make them difficult to guess.
+Display_PasswordGeneration=The following passwords have been randomly generated for you.
 Display_PasswordNoExpire=Your password does not expire.
 Display_PasswordPrompt=Please type your new password
 Display_PasswordStrengthVeryHigh=Strength\: <b>Very Strong</b>

+ 1 - 1
server/src/main/resources/password/pwm/i18n/Display_en_CA.properties

@@ -129,7 +129,7 @@ Display_NewUser=To register a new account, please complete the following form.
 Display_NewUserProfile=To register a new account, please select a profile.
 Display_NoResponses=User does not have responses
 Display_PasswordExpired=Your password has expired. You must set a new password now.
-Display_PasswordGeneration=The following passwords have been randomly generated for you. These passwords are based on real words to make them easier to remember, but have been modified to make them difficult to guess.
+Display_PasswordGeneration=The following passwords have been randomly generated for you.
 Display_PasswordNoExpire=Your password will not expire.
 Display_PasswordPrompt=Please type your new password
 Display_PasswordStrengthVeryHigh=Strength\: <b>Very Strong</b>

+ 3 - 2
server/src/test/java/password/pwm/util/password/RandomPasswordAppItemGeneratorTest.java → server/src/test/java/password/pwm/util/password/RandomPasswordGeneratorTest.java

@@ -27,6 +27,7 @@ import org.junit.rules.TemporaryFolder;
 import password.pwm.PwmApplication;
 import password.pwm.PwmDomain;
 import password.pwm.bean.DomainID;
+import password.pwm.bean.SessionLabel;
 import password.pwm.config.profile.PwmPasswordPolicy;
 import password.pwm.config.profile.PwmPasswordRule;
 import password.pwm.error.PwmUnrecoverableException;
@@ -39,7 +40,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
-public class RandomPasswordAppItemGeneratorTest
+public class RandomPasswordGeneratorTest
 {
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
@@ -61,7 +62,7 @@ public class RandomPasswordAppItemGeneratorTest
         for ( int i = 0; i < loopCount; i++ )
         {
             final PasswordData passwordData = RandomPasswordGenerator.createRandomPassword(
-                    null,
+                    SessionLabel.TEST_SESSION_LABEL,
                     pwmPasswordPolicy,
                     pwmDomain );
 

+ 1 - 22
webapp/src/main/webapp/WEB-INF/jsp/configmanager-wordlists.jsp

@@ -64,28 +64,7 @@
             </tr>
         </table>
         <% } %>
-        <br/><br/><br/><br/><br/>
-        <% { %>
-        <table style="width:550px" id="table-seedlistInfo">
-        </table>
-        <br/>
-        <table class="noborder">
-            <tr class="buttonrow">
-                <td class="buttoncell">
-                    <button class="hidden menubutton" id="MenuItem_UploadSeedlist">
-                        <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-upload"></span></pwm:if>
-                        Upload Seed List
-                    </button>
-                </td>
-                <td class="buttoncell">
-                    <button class="hidden menubutton" id="MenuItem_ClearSeedlist">
-                        <pwm:if test="<%=PwmIfTest.showIcons%>"><span class="btn-icon pwm-icon pwm-icon-trash"></span></pwm:if>
-                        Clear Seed List
-                    </button>
-                </td>
-            </tr>
-        </table>
-        <% } %>
+        <br/><br/>
         <div style="margin: 25px">
             <span class="footnote"><pwm:display key="Display_Wordlists_Description" bundle="Config"/></span>
         </div>

BIN
webapp/src/main/webapp/WEB-INF/seedlist.zip