api

package
v0.0.0-...-a133f6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discoverer

type Discoverer struct {
	// contains filtered or unexported fields
}

Discoverer discovers API endpoints in web applications

func NewDiscoverer

func NewDiscoverer(log *logger.Logger) (*Discoverer, error)

NewDiscoverer creates a new API discoverer

func (*Discoverer) Discover

func (d *Discoverer) Discover(ctx context.Context, resp *http.Response, baseURL string) ([]*Endpoint, error)

Discover discovers API endpoints from an HTTP response

func (*Discoverer) DiscoverFromTarget

func (d *Discoverer) DiscoverFromTarget(ctx context.Context, target *models.Target) ([]*Endpoint, error)

DiscoverFromTarget discovers API endpoints from a target

type Endpoint

type Endpoint struct {
	URL         string       `json:"url"`
	Type        EndpointType `json:"type"`
	Method      string       `json:"method,omitempty"`
	Description string       `json:"description,omitempty"`
	Parameters  []string     `json:"parameters,omitempty"`
	Headers     []string     `json:"headers,omitempty"`
	Score       int          `json:"score"`
}

Endpoint represents an API endpoint

type EndpointType

type EndpointType string

EndpointType represents the type of API endpoint

const (
	// EndpointTypeREST represents a REST API endpoint
	EndpointTypeREST EndpointType = "rest"
	// EndpointTypeGraphQL represents a GraphQL API endpoint
	EndpointTypeGraphQL EndpointType = "graphql"
	// EndpointTypeWebSocket represents a WebSocket API endpoint
	EndpointTypeWebSocket EndpointType = "websocket"
	// EndpointTypeSSE represents a Server-Sent Events API endpoint
	EndpointTypeSSE EndpointType = "sse"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL