Closed Geraden07 closed 7 years ago
I tried a quick test with the System.exit(1) and it didnt abort all of the tests. If you have multiple story files it appeared to pause then try the next story. Is this acceptable? So you may get a small number of attempts rather than an excessive amount
R
On 7 July 2017 at 11:54, Steven B notifications@github.com wrote:
One more thing, I've added an System.exit(1) call after a failure to connect to the server. This stops repeated failed connection attempts which may cause account lockouts. Now, if you supply incorrect credentials, it will fail to connect to the server the first time, then stop without trying for each story case.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wmaop/wm-jbehave/pull/12#issuecomment-313650983, or mute the thread https://github.com/notifications/unsubscribe-auth/AAlYLGkv4Hr2UJXHpWuDRJhgpEa8CzrDks5sLg5mgaJpZM4OQQZZ .
Yes, I tried the same test actually. As I commented in issue #13 I believe the correct solution would be to attempt a connection in the BeforeStories part, and if the connection fails, a System.exit(1) call from there should abort any of the stories being started. In theory anyway.
This pull request implements feature described in Issue #2 regarding providing a secure method to store passwords.
As previously discussed in emails, this approach uses the Jasypt library to wrap the Properties object, allowing for encryptable fields to be provided.
Documentation will need to be updated to describe how to use the Jasypt CLI tools to create encrypted values.
This implementation expects the properties file to be named "config.properties". It is loaded using the ClassLoader so it can be located anywhere in the classpath.
The symmetric encryption password is retrieved from the System.getProperties() object, and will default to "wm-jbehave-jasypt".
The implementation also continues to use the System Properties object as the default Properties base, so if config.properties is not defined, and fields are configured via VM arguments as in past versions, they will continue to work.
Lastly, this pull request also modifies the error output when a connection fails to be made. The password will no longer be shown as part of the error message. Instead, just the server, port, username and a message saying "Invalid credentials" will be shown.