forked from WebGoat/WebGoat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed Mongodb, so we do not have issues with downloading the embedd…
…ed Mongodb. Moved back to JPA and use HSQLDB for storing user information.
- Loading branch information
Showing
19 changed files
with
167 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,15 @@ | ||
version: '2.0' | ||
|
||
services: | ||
mongo: | ||
image: mongo:latest | ||
expose: | ||
- "27017" | ||
volumes: | ||
- './mongo-data:/data/db' | ||
webgoat: | ||
build: webgoat-server/ | ||
command: "sh /home/webgoat/start.sh" | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
[mongo, activemq] | ||
environment: | ||
WG_MONGO_PORT: 27017 | ||
WG_MONGO_HOST: mongo | ||
WG_MQ_HOST: activemq | ||
WG_MQ_PORT: 61616 | ||
WG_INTERNAL_MONGO: "false" | ||
webwolf: | ||
build: webwolf/ | ||
command: "sh /home/webwolf/start.sh" | ||
depends_on: | ||
- webgoat | ||
ports: | ||
- "8081:8081" | ||
environment: | ||
WG_MONGO_PORT: 27017 | ||
WG_MONGO_HOST: mongo | ||
WG_MQ_HOST: activemq | ||
WG_MQ_PORT: 61616 | ||
- "8081:8081" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
webgoat-container/src/main/java/org/owasp/webgoat/users/UserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
webgoat-container/src/main/java/org/owasp/webgoat/users/UserTrackerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package org.owasp.webgoat.users; | ||
|
||
import org.springframework.data.mongodb.repository.MongoRepository; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
/** | ||
* @author nbaars | ||
* @since 4/30/17. | ||
*/ | ||
public interface UserTrackerRepository extends MongoRepository<UserTracker, String> { | ||
public interface UserTrackerRepository extends JpaRepository<UserTracker, String> { | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ server.session.timeout=600 | |
server.contextPath=/WebGoat | ||
server.port=8080 | ||
|
||
spring.datasource.url=jdbc:hsqldb:file:${webgoat.server.directory}/data/webgoat | ||
spring.jpa.hibernate.ddl-auto=update | ||
|
||
|
||
logging.level.org.springframework=WARN | ||
logging.level.org.springframework.boot.devtools=WARN | ||
|
@@ -28,7 +31,6 @@ webgoat.feedback.address.html=<A HREF=mailto:[email protected]>[email protected] | |
webgoat.database.driver=org.hsqldb.jdbcDriver | ||
webgoat.database.connection.string=jdbc:hsqldb:mem:{USER} | ||
webgoat.default.language=en | ||
webgoat.embedded.mongo=${WG_INTERNAL_MONGO:true} | ||
|
||
webwolf.host=${WEBWOLF_HOST:localhost} | ||
webwolf.port=${WEBWOLF_PORT:8081} | ||
|
@@ -39,10 +41,5 @@ webwolf.url.mail=http://${webwolf.host}:${webwolf.port}/mail | |
spring.jackson.serialization.indent_output=true | ||
spring.jackson.serialization.write-dates-as-timestamps=false | ||
|
||
spring.data.mongodb.host=${WG_MONGO_HOST:localhost} | ||
spring.data.mongodb.port=${WG_MONGO_PORT:27017} | ||
spring.data.mongodb.database=webgoat | ||
spring.mongodb.embedded.storage.databaseDir=${webgoat.user.directory}/mongodb/ | ||
|
||
#For static file refresh ... and faster dev :D | ||
spring.devtools.restart.additional-paths=webgoat-container/src/main/resources/static/js,webgoat-container/src/main/resources/static/css |
23 changes: 0 additions & 23 deletions
23
webgoat-container/src/test/java/org/owasp/webgoat/plugins/TestConfig.java
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
webgoat-container/src/test/java/org/owasp/webgoat/users/UserRepositoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.owasp.webgoat.users; | ||
|
||
import org.assertj.core.api.Assertions; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
|
||
@DataJpaTest | ||
@RunWith(SpringRunner.class) | ||
public class UserRepositoryTest { | ||
|
||
@Autowired | ||
private UserRepository userRepository; | ||
|
||
@Test | ||
public void userShouldBeSaved() { | ||
WebGoatUser user = new WebGoatUser("test", "password"); | ||
userRepository.saveAndFlush(user); | ||
|
||
user = userRepository.findByUsername("test"); | ||
|
||
Assertions.assertThat(user.getUsername()).isEqualTo("test"); | ||
Assertions.assertThat(user.getPassword()).isEqualTo("password"); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.