Skip to content

A free, open-source alternative to Burp Suite: an intercepting proxy and web app security testing suite with Repeater, Intruder, Collaborator and a built-in OWASP ZAP scanner. Linux, AGPL-3.0.

2.0 KB
Raw Blame
package opensuite.organizer;

import opensuite.core.HttpMessage;
import opensuite.core.HttpService;

import java.io.Serializable;

/** One item set aside in the Organizer for later review, with a status and notes. */
public final class OrganizerItem implements Serializable {
    private static final long serialVersionUID = 1L;

    public static final String[] STATUSES = {"New", "In progress", "Postponed", "Done", "Ignored"};

    public String caption = "";
    /** The collection this item sits in; "Inbox" is where everything lands. */
    public String collection = "Inbox";
    public String sourceTool = "";
    public String status = "New";
    public String notes = "";
    public HttpService service;
    public HttpMessage request;
    public HttpMessage response;
    public final long time = System.currentTimeMillis();

    public OrganizerItem() {}

    public OrganizerItem(HttpService service, HttpMessage request, HttpMessage response, String caption, String tool) {
        this.service = service;
        this.request = request;
        this.response = response;
        this.caption = caption == null ? "" : caption;
        this.sourceTool = tool == null ? "" : tool;
    }

    /** The status as it is shown. An older project named a new item "todo" and wrote the others in small letters. */
    public String statusLabel() {
        String s = status == null ? "" : status.strip();
        if (s.isEmpty() || s.equalsIgnoreCase("todo")) return "New";
        for (String known : STATUSES) if (known.equalsIgnoreCase(s)) return known;
        return s;
    }

    public String host() { return service == null ? "" : service.host(); }
    public String path() { return request == null ? "" : request.path(); }
    public String query() { return request == null ? "" : request.query(); }
    /** The collection name, treating a value missing from an older project as the Inbox. */
    public String collection() { return collection == null || collection.isEmpty() ? "Inbox" : collection; }
}