mirror of
https://github.com/ysoftdevs/wapifuzz.git
synced 2026-01-18 17:36:58 +01:00
Init WFuzz state
This commit is contained in:
29
parser/Models/Endpoint.cs
Normal file
29
parser/Models/Endpoint.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
7
parser/Models/Models.csproj
Normal file
7
parser/Models/Models.csproj
Normal file
@@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
43
parser/Models/Request.cs
Normal file
43
parser/Models/Request.cs
Normal 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
15
parser/Models/Response.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
25
parser/Models/UriAttribute.cs
Normal file
25
parser/Models/UriAttribute.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user