@Transient @JsonIgnore public String getDisplayPath() { String path = null; if (calculatedUrlPath != null) { path = calculatedUrlPath; } else if (surfaceLocation != null) { path = surfaceLocation.getPath(); } return path; }
@Override public String toString() { return "[" + getId() + ", " + genericVulnerability + " " + surfaceLocation.getPath() + " " + surfaceLocation.getParameter() + "]"; }
@Override public String getDynamicPath() { if (finding.getStaticPathInformation() != null) { return finding.getStaticPathInformation().getValue(); } else if (finding.getSurfaceLocation() != null && finding.getSurfaceLocation().getPath() != null){ return finding.getSurfaceLocation().getPath(); } else { return null; } }
@Transient @JsonView({ AllViews.TableRow.class, AllViews.VulnSearch.class, AllViews.VulnerabilityDetail.class, AllViews.RestVulnSearch.class }) public String getPath() { return getCalculatedUrlPath() == null || getCalculatedUrlPath().isEmpty() ? (getSurfaceLocation() == null ? null :getSurfaceLocation().getPath()) : getCalculatedUrlPath(); }
public static EndpointQuery toEndpointQuery(Finding finding) { EndpointQueryBuilder builder = EndpointQueryBuilder.start(); SurfaceLocation location = finding.getSurfaceLocation(); if (location != null) { if (location.getHttpMethod() != null) { builder.setHttpMethod(location.getHttpMethod()); } if (location.getPath() != null) { builder.setDynamicPath(location.getPath()); } if (location.getParameter() != null) { builder.setParameter(location.getParameter()); } } if (finding.getIsStatic()) { builder.setInformationSourceType(InformationSourceType.STATIC); } else { builder.setInformationSourceType(InformationSourceType.DYNAMIC); } if (finding.getSourceFileLocation() != null) { builder.setStaticPath(finding.getSourceFileLocation()); } if (finding.getDataFlowElements() != null && !finding.getDataFlowElements().isEmpty()) { builder.setCodePoints(toCodePoints(finding.getDataFlowElements())); } return builder.generateQuery(); }
public DeletedSurfaceLocation(SurfaceLocation surfaceLocation) { if (surfaceLocation != null) { if (surfaceLocation.getFinding() != null){ setDeletedFindingId(surfaceLocation.getFinding().getId()); } setHost(surfaceLocation.getHost()); setParameter(surfaceLocation.getParameter()); setPath(surfaceLocation.getPath()); setPort(surfaceLocation.getPort()); setProtocol(surfaceLocation.getProtocol()); setQuery(surfaceLocation.getQuery()); setId(surfaceLocation.getId()); } }