Merge pull request #188 from dougmorato/master

Fixining all the javadoc issues preventing the release
This commit is contained in:
Doug Morato 2016-01-31 23:27:29 -05:00
commit 61d8e20b09
43 changed files with 215 additions and 14 deletions

View File

@ -412,6 +412,7 @@ public class HammerHead extends HttpServlet {
*
* @param s Description of the Parameter
* @param screen a {@link org.owasp.webgoat.session.Screen} object.
* @param screen a {@link org.owasp.webgoat.session.Screen} object.
* @param response Description of the Parameter
* @exception IOException Description of the Exception
* @throws java.io.IOException if any.

View File

@ -41,9 +41,7 @@ public class WebGoatServletListener implements ServletContextListener {
private static final Logger logger = LoggerFactory.getLogger(HammerHead.class);
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public void contextInitialized(ServletContextEvent sce) {
ServletContext context = sce.getServletContext();
@ -80,9 +78,7 @@ public class WebGoatServletListener implements ServletContextListener {
new PluginsLoader(Paths.get(pluginPath), Paths.get(targetPath)).loadPlugins();
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
@Override
public void contextDestroyed(ServletContextEvent sce) {
ServletContext context = sce.getServletContext();

View File

@ -233,6 +233,8 @@ public abstract class AbstractLesson extends Screen implements Comparable<Object
/**
* <p>getSubmitMethod</p>
*
* @return a {@link java.lang.String} object.
*/
public abstract String getSubmitMethod();
@ -647,12 +649,14 @@ public abstract class AbstractLesson extends Screen implements Comparable<Object
.append("/").append(getCategory().getRanking()).toString();
}
/**
/**
* Get the link to the target servlet.
*
* Unlike getLink() this method does not require rendering the output of
* the request to the link in order to execute the servlet's method with
* conventional HTTP query parameters.
*
* @return a {@link java.lang.String} object.
*/
public String getServletLink() {
StringBuffer link = new StringBuffer("attack");

View File

@ -110,8 +110,8 @@ public abstract class LessonAdapter extends AbstractLesson {
}
/**
* Initiates lesson restart functionality. Lessons should override this for
* lesson specific actions
* Initiates lesson restart functionality. Lessons should override this for
* lesson specific actions
*/
public void restartLesson() {
// Do Nothing - called when restart lesson is pressed. Each lesson can do something
@ -153,6 +153,8 @@ public abstract class LessonAdapter extends AbstractLesson {
/**
* provide a default submitMethod of lesson does not implement
*
* @return a {@link java.lang.String} object.
*/
public String getSubmitMethod() {
return "GET";

View File

@ -3,7 +3,8 @@ package org.owasp.webgoat.lessons;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/***************************************************************************************************
/**
*************************************************************************************************
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
* please see http://www.owasp.org/
* <p>
@ -26,8 +27,10 @@ import java.lang.annotation.RetentionPolicy;
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software
* projects.
* <p>
*
* @author Nanne Baars
* @created December 12, 2015
* @since December 12, 2015
* @version $Id: $Id
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface LessonServletMapping {

View File

@ -14,6 +14,7 @@ import org.owasp.webgoat.session.WebSession;
* <p>Abstract RandomLessonAdapter class.</p>
*
* @version $Id: $Id
* @author dm
*/
public abstract class RandomLessonAdapter extends LessonAdapter
{
@ -30,6 +31,7 @@ public abstract class RandomLessonAdapter extends LessonAdapter
*
* @param s a {@link org.owasp.webgoat.session.WebSession} object.
* @param stage a {@link java.lang.String} object.
* @param stage a {@link java.lang.String} object.
*/
public void setStage(WebSession s, String stage)
{
@ -65,6 +67,7 @@ public abstract class RandomLessonAdapter extends LessonAdapter
*
* @param s a {@link org.owasp.webgoat.session.WebSession} object.
* @param stage a {@link java.lang.String} object.
* @param stage a {@link java.lang.String} object.
*/
public void setStageComplete(WebSession s, String stage)
{
@ -100,6 +103,7 @@ public abstract class RandomLessonAdapter extends LessonAdapter
*
* @param s a {@link org.owasp.webgoat.session.WebSession} object.
* @param stage a {@link java.lang.String} object.
* @param stage a {@link java.lang.String} object.
* @return a boolean.
*/
public boolean isStageComplete(WebSession s, String stage)

View File

@ -13,6 +13,7 @@ import org.owasp.webgoat.session.WebSession;
* <p>Abstract SequentialLessonAdapter class.</p>
*
* @version $Id: $Id
* @author dm
*/
public abstract class SequentialLessonAdapter extends LessonAdapter
{
@ -22,6 +23,7 @@ public abstract class SequentialLessonAdapter extends LessonAdapter
*
* @param s a {@link org.owasp.webgoat.session.WebSession} object.
* @param stage a int.
* @param stage a int.
*/
public void setStage(WebSession s, int stage)
{

View File

@ -84,7 +84,7 @@ public class MenuToLessonMapperScreen extends LessonAdapter
/**
* <p>getDefaultRanking.</p>
*
* @return a {@link Integer} object.
* @return a {@link java.lang.Integer} object.
*/
protected Integer getDefaultRanking()
{

View File

@ -33,6 +33,7 @@ package org.owasp.webgoat.lessons.model;
* use for more complex lessons.
*
* @version $Id: $Id
* @author dm
*/
public class HttpBasicsModel {

View File

@ -4,6 +4,12 @@ import org.owasp.webgoat.lessons.AbstractLesson;
import org.owasp.webgoat.lessons.Category;
import org.owasp.webgoat.session.WebSession;
/**
* <p>LessonInfoModel class.</p>
*
* @author dm
* @version $Id: $Id
*/
public class LessonInfoModel {
private String lessonTitle;
@ -13,6 +19,11 @@ public class LessonInfoModel {
private boolean hasPlan;
private String submitMethod;
/**
* <p>Constructor for LessonInfoModel.</p>
*
* @param webSession a {@link org.owasp.webgoat.session.WebSession} object.
*/
public LessonInfoModel(WebSession webSession) {
AbstractLesson lesson = webSession.getCurrentLesson();
//TODO make these first class citizens of the lesson itself; and stop passing the session all over ... and generally tighten the checks up
@ -36,26 +47,56 @@ public class LessonInfoModel {
}
// GETTERS
/**
* <p>Getter for the field <code>lessonTitle</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getLessonTitle() {
return lessonTitle;
}
/**
* <p>Getter for the field <code>numberHints</code>.</p>
*
* @return a int.
*/
public int getNumberHints() {
return numberHints;
}
/**
* <p>isHasSource.</p>
*
* @return a boolean.
*/
public boolean isHasSource() {
return hasSource;
}
/**
* <p>isHasSolution.</p>
*
* @return a boolean.
*/
public boolean isHasSolution() {
return hasSolution;
}
/**
* <p>isHasPlan.</p>
*
* @return a boolean.
*/
public boolean isHasPlan() {
return hasPlan;
}
/**
* <p>Getter for the field <code>submitMethod</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getSubmitMethod() {
return submitMethod;
}

View File

@ -22,6 +22,7 @@ import static org.owasp.webgoat.plugins.PluginFileUtils.replaceInFiles;
* <p>Plugin class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class Plugin {
@ -34,6 +35,11 @@ public class Plugin {
private List<File> pluginFiles = Lists.newArrayList();
private File lessonSourceFile;
/**
* <p>findLesson.</p>
*
* @param classes a {@link java.util.List} object.
*/
public void findLesson(List<String> classes) {
for (String clazzName : classes) {
findLesson(clazzName);
@ -56,6 +62,11 @@ public class Plugin {
}
}
/**
* <p>loadFiles.</p>
*
* @param file a {@link java.nio.file.Path} object.
*/
public void loadFiles(Path file) {
if (fileEndsWith(file, ".html") && hasParentDirectoryWithName(file, NAME_LESSON_SOLUTION_DIRECTORY)) {
solutionLanguageFiles.put(file.getParent().getFileName().toString(), file.toFile());

View File

@ -17,12 +17,23 @@ import java.util.zip.ZipFile;
/**
* Extract the jar file and place them in the system temp directory in the folder webgoat and collect the files
* and classes.
*
* @author dm
* @version $Id: $Id
*/
public class PluginExtractor {
private final List<String> classes = Lists.newArrayList();
private final List<Path> files = new ArrayList<>();
/**
* <p>extractJarFile.</p>
*
* @param archive a {@link java.io.File} object.
* @param targetDirectory a {@link java.io.File} object.
* @return a {@link org.owasp.webgoat.plugins.Plugin} object.
* @throws java.io.IOException if any.
*/
public Plugin extractJarFile(final File archive, final File targetDirectory) throws IOException {
ZipFile zipFile = new ZipFile(archive);
Plugin plugin = new Plugin();
@ -88,11 +99,21 @@ public class PluginExtractor {
return targetFile;
}
/**
* <p>Getter for the field <code>classes</code>.</p>
*
* @return a {@link java.util.List} object.
*/
public List<String> getClasses() {
return this.classes;
}
/**
* <p>Getter for the field <code>files</code>.</p>
*
* @return a {@link java.util.List} object.
*/
public List<Path> getFiles() {
return this.files;
}
}
}

View File

@ -16,6 +16,7 @@ import java.util.Collection;
* <p>PluginFileUtils class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class PluginFileUtils {

View File

@ -4,6 +4,7 @@ package org.owasp.webgoat.plugins;
* <p>PluginLoadingFailure class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class PluginLoadingFailure extends RuntimeException {

View File

@ -27,6 +27,7 @@ import java.util.concurrent.Executors;
* <p>PluginsLoader class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class PluginsLoader {

View File

@ -55,6 +55,8 @@ public class LabelDebugService extends BaseService {
/**
* Reload all the plugins
*
* @return a {@link org.springframework.http.ResponseEntity} object.
*/
@RequestMapping(value = "/debug/labels.mvc")
public @ResponseBody

View File

@ -16,10 +16,22 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.HttpSession;
@Controller
/**
* <p>LessonInfoService class.</p>
*
* @author dm
* @version $Id: $Id
*/
public class LessonInfoService extends BaseService {
private static final Logger logger = LoggerFactory.getLogger(LessonMenuService.class);
/**
* <p>getLessonInfo.</p>
*
* @param session a {@link javax.servlet.http.HttpSession} object.
* @return a {@link org.owasp.webgoat.lessons.model.LessonInfoModel} object.
*/
@RequestMapping(value = "/lessoninfo.mvc", produces = "application/json")
public @ResponseBody
LessonInfoModel getLessonInfo(HttpSession session) {
@ -27,6 +39,12 @@ public class LessonInfoService extends BaseService {
return new LessonInfoModel(webSession);
}
/**
* <p>handleException.</p>
*
* @param ex a {@link java.lang.Exception} object.
* @return a {@link java.lang.String} object.
*/
@ExceptionHandler(Exception.class)
@ResponseBody
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
@ -34,6 +52,12 @@ public class LessonInfoService extends BaseService {
return "An error occurred retrieving the LessonInfoModel:" + ex.getMessage();
}
/**
* <p>getLessonInfoModel.</p>
*
* @param webSession a {@link org.owasp.webgoat.session.WebSession} object.
* @return a {@link org.owasp.webgoat.lessons.model.LessonInfoModel} object.
*/
protected LessonInfoModel getLessonInfoModel(WebSession webSession) {
return new LessonInfoModel(webSession);
}

View File

@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
* <p>LessonTitleService class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class LessonTitleService extends BaseService {

View File

@ -56,7 +56,8 @@ public class PluginReloadService extends BaseService {
/**
* Reload all the plugins
*
* @param session a {@link HttpSession} object.
* @param session a {@link javax.servlet.http.HttpSession} object.
* @return a {@link org.springframework.http.ResponseEntity} object.
*/
@RequestMapping(value = "/reloadplugins.mvc")
public @ResponseBody

View File

@ -35,6 +35,7 @@ import javax.servlet.http.HttpServletResponse;
* for free software projects.
*
* @version $Id: $Id
* @author dm
*/
public class Controller extends HttpServlet {

View File

@ -32,6 +32,9 @@ import java.util.Map;
* projects.
*
* * @version $Id: $Id
*
* @author dm
* @version $Id: $Id
*/
public class Authorization
{

View File

@ -322,6 +322,11 @@ public class Course {
return null;
}
/**
* <p>loadLessonFromPlugin.</p>
*
* @param context a {@link javax.servlet.ServletContext} object.
*/
public void loadLessonFromPlugin(ServletContext context) {
logger.debug("Loading plugins into cache");
String pluginPath = context.getRealPath("plugin_lessons");

View File

@ -141,6 +141,14 @@ public class DatabaseUtilities
* Description of the Parameter
* @param resultsMetaData
* Description of the Parameter
* @param resultsMetaData
* Description of the Parameter
* @param resultsMetaData
* Description of the Parameter
* @param resultsMetaData
* Description of the Parameter
* @param resultsMetaData
* Description of the Parameter
* @return Description of the Return Value
* @exception IOException
* Description of the Exception

View File

@ -560,6 +560,12 @@ public class ECSFactory
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param name
* Description of the Parameter
* @param options
@ -568,6 +574,8 @@ public class ECSFactory
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param selected
* Description of the Parameter
* @return Description of the Return Value
*/
public static Element makeSelect(boolean diffNames, Select select, String name, Vector<Option> options,
@ -586,6 +594,12 @@ public class ECSFactory
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param name
* Description of the Parameter
* @param options
@ -594,6 +608,8 @@ public class ECSFactory
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param selected
* Description of the Parameter
* @param rowsShowing
* Description of the Parameter
* @return Description of the Return Value

View File

@ -3,15 +3,27 @@ package org.owasp.webgoat.session;
import java.io.Serializable;
/**
* <p>LabelDebugger class.</p>
*
* @author dm
* @version $Id: $Id
*/
public class LabelDebugger implements Serializable {
private boolean isEnabled = false;
/**
* <p>isEnabled.</p>
*
* @return a boolean.
*/
public boolean isEnabled() {
return isEnabled;
}
/**
* <p>enable.</p>
*/
public void enable() {
this.isEnabled = true;
}

View File

@ -200,6 +200,14 @@ public class LessonTracker
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param s
* Description of the Parameter
* @return Description of the Return Value
@ -335,6 +343,7 @@ public class LessonTracker
* @param s
* Description of the Parameter
* @param screen a {@link org.owasp.webgoat.session.Screen} object.
* @param screen a {@link org.owasp.webgoat.session.Screen} object.
*/
public void store(WebSession s, Screen screen)
{
@ -347,6 +356,7 @@ public class LessonTracker
* @param s
* Description of the Parameter
* @param screen a {@link org.owasp.webgoat.session.Screen} object.
* @param screen a {@link org.owasp.webgoat.session.Screen} object.
* @param user a {@link java.lang.String} object.
*/
public void store(WebSession s, Screen screen, String user)

View File

@ -28,6 +28,7 @@ package org.owasp.webgoat.session;
* projects.
*
* @version $Id: $Id
* @author dm
*/
public class Parameter implements Comparable
{

View File

@ -10,6 +10,7 @@ import java.util.Properties;
* <p>RandomLessonTracker class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class RandomLessonTracker extends LessonTracker
{

View File

@ -4,6 +4,7 @@ package org.owasp.webgoat.session;
* <p>Role class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class Role {
private String rolename;

View File

@ -8,6 +8,7 @@ import java.util.Properties;
* <p>SequentialLessonTracker class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class SequentialLessonTracker extends LessonTracker
{

View File

@ -28,6 +28,7 @@ package org.owasp.webgoat.session;
* projects.
*
* @version $Id: $Id
* @author dm
*/
public class UnauthenticatedException extends Exception
{

View File

@ -28,6 +28,7 @@ package org.owasp.webgoat.session;
* projects.
*
* @version $Id: $Id
* @author dm
*/
public class UnauthorizedException extends Exception
{

View File

@ -7,6 +7,7 @@ import java.util.Iterator;
* <p>User class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class User {
private String username;

View File

@ -172,6 +172,8 @@ public class UserTracker
* @param screen
* Description of the Parameter
* @return The lessonTracker value
* @param screen
* Description of the Parameter
* @param s a {@link org.owasp.webgoat.session.WebSession} object.
*/
public LessonTracker getLessonTracker(WebSession s, Screen screen)
@ -183,6 +185,7 @@ public class UserTracker
* <p>getLessonTracker.</p>
*
* @param s a {@link org.owasp.webgoat.session.WebSession} object.
* @param screen a {@link org.owasp.webgoat.session.Screen} object.
* @param user a {@link java.lang.String} object.
* @param screen a {@link org.owasp.webgoat.session.Screen} object.
* @return a {@link org.owasp.webgoat.session.LessonTracker} object.
@ -208,6 +211,8 @@ public class UserTracker
* @param screen
* Description of the Parameter
* @return The status value
* @param screen
* Description of the Parameter
* @param s a {@link org.owasp.webgoat.session.WebSession} object.
*/
public String getStatus(WebSession s, Screen screen)
@ -267,6 +272,14 @@ public class UserTracker
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param screen
* Description of the Parameter
* @param s
* Description of the Parameter
*/

View File

@ -28,6 +28,7 @@ package org.owasp.webgoat.session;
* projects.
*
* @version $Id: $Id
* @author dm
*/
public class ValidationException extends Exception
{

View File

@ -9,6 +9,7 @@ import javax.servlet.http.HttpServlet;
* <p>WebgoatContext class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class WebgoatContext {

View File

@ -37,6 +37,7 @@ import java.util.Properties;
* for free software projects.
*
* @version $Id: $Id
* @author dm
*/
public class WebgoatProperties extends Properties {

View File

@ -34,6 +34,7 @@ import org.springframework.stereotype.Component;
* free software projects.
*
* @version $Id: $Id
* @author dm
*/
@Component
public class BeanProvider implements ApplicationContextAware

View File

@ -32,6 +32,7 @@ import java.util.Map;
* projects.
*
* @version $Id: $Id
* @author dm
*/
public class HtmlEncoder
{

View File

@ -31,6 +31,7 @@ import java.util.Locale;
* free software projects.
*
* @version $Id: $Id
* @author dm
*/
public interface LabelManager
{

View File

@ -36,6 +36,7 @@ import java.util.Locale;
* free software projects.
*
* @version $Id: $Id
* @author dm
*/
@Component("labelManager")
public class LabelManagerImpl implements LabelManager, Serializable

View File

@ -44,6 +44,7 @@ import java.util.Locale;
* for free software projects.
*
* @version $Id: $Id
* @author dm
*/
@Component
@Singleton

View File

@ -11,6 +11,7 @@ import org.owasp.webgoat.session.WebgoatContext;
* <p>WebGoatI18N class.</p>
*
* @version $Id: $Id
* @author dm
*/
public class WebGoatI18N
{