Init WFuzz state

This commit is contained in:
Jan Stárek
2019-10-09 13:24:01 +02:00
parent 7c3ed5ef0b
commit a5eb2a97e1
114 changed files with 6221 additions and 0 deletions

29
parser/Models/Endpoint.cs Normal file
View File

@@ -0,0 +1,29 @@
using System.Collections.Generic;
using System.Text;
namespace Models
{
public class Endpoint
{
public string Uri { get; }
public List<Request> Requests { get; } = new List<Request>();
public Endpoint(string uri)
{
Uri = uri;
}
public override string ToString()
{
StringBuilder builder = new StringBuilder();
builder.Append("Uri: ");
builder.AppendLine(Uri);
builder.AppendLine("Requests: ");
foreach (var request in Requests)
{
builder.AppendLine(request.ToString());
}
return builder.ToString();
}
}
}

View File

@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
</Project>

43
parser/Models/Request.cs Normal file
View File

@@ -0,0 +1,43 @@
using System.Collections.Generic;
using System.Text;
namespace Models
{
public class Request
{
public string Method { get; }
public string Summary { get; set; }
public List<UriAttribute> UriAttributes { get; set; }
public List<Response> Responses { get; set; }
public string BodyExample { get; set; }
public Dictionary<string, object> BodySchema { get; set; }
public Request(string method)
{
Method = method;
}
public override string ToString()
{
StringBuilder builder = new StringBuilder();
builder.Append("Type: ");
builder.AppendLine(Method);
builder.Append("Summary: ");
builder.AppendLine(Summary);
builder.AppendLine("Uri Attributes: ");
foreach (var attribute in UriAttributes)
{
builder.AppendLine(attribute.ToString());
}
builder.AppendLine("Responses: ");
foreach (var response in Responses)
{
builder.AppendLine(response.ToString());
}
builder.Append("BodyExample: ");
builder.AppendLine(BodyExample);
return builder.ToString();
}
}
}

15
parser/Models/Response.cs Normal file
View File

@@ -0,0 +1,15 @@
using System;
namespace Models
{
public class Response
{
public int StatusCode { get; set; }
public string Example { get; set; }
public override string ToString()
{
return $"Status code: {StatusCode}{Environment.NewLine}Example: {Example}";
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
namespace Models
{
public class UriAttribute
{
public string Name { get; }
public bool Required { get; }
public string ExampleValue { get; set; }
public string Type { get; set; }
public string Format { get; set; }
public UriAttribute(string name, bool required)
{
Name = name;
Required = required;
}
public override string ToString()
{
return $"Name: {Name}{Environment.NewLine}Required: {Required}{Environment.NewLine}Example value: {ExampleValue}";
}
}
}