WIP lesson completion

This commit is contained in:
Nanne Baars
2016-10-12 13:40:54 -04:00
parent 217d87e523
commit 2803607901
4 changed files with 13 additions and 22 deletions

View File

@ -85,15 +85,12 @@ public class Plugin {
final List<String> hints = (List<String>) lessonYml.get("hints");
final String title = (String) lessonYml.get("title");
final String html = (String) lessonYml.get("id");
Class attackClazz = findAttack(html);
this.ymlBasedLesson = new YmlBasedLesson(category, hints, title, html, attackClazz);
this.ymlBasedLesson = new YmlBasedLesson(category, hints, title, html);
this.lesson = null;
} catch (IOException e) {
throw new PluginLoadingFailure("Unable to read yml file", e);
}
}
}
private Class findAttack(String id) {

View File

@ -1,8 +1,8 @@
package org.owasp.webgoat.plugins;
import org.owasp.webgoat.lessons.Attack;
import org.owasp.webgoat.lessons.Category;
import org.owasp.webgoat.lessons.LessonAdapter;
import org.owasp.webgoat.lessons.LessonEndpoint;
import org.owasp.webgoat.session.WebSession;
import java.util.List;
@ -43,15 +43,13 @@ public class YmlBasedLesson extends LessonAdapter {
private final List<String> hints;
private final String title;
private final String id;
private Attack attack;
private List<LessonEndpoint> lessonEndpoints;
public YmlBasedLesson(String category, List<String> hints, String title, String id, Class attack) {
public YmlBasedLesson(String category, List<String> hints, String title, String id) {
this.category = category;
this.hints = hints;
this.title = title;
this.id = id;
// createAttack(attack);
}
@Override
@ -78,16 +76,4 @@ public class YmlBasedLesson extends LessonAdapter {
return id;
}
public Attack getLessonAttack() {
return this.attack;
}
private void createAttack(Class attack) {
try {
this.attack = (Attack) attack.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
}