Help us shape the future of Go! Take the 2026 Go Developer Survey

js

package
v0.0.0-...-f98638f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractEndpoints

func ExtractEndpoints(content, baseURL string) []string

ExtractEndpoints pulls candidate paths and urls out of a script body, dedupes them, drops obvious noise, and resolves relatives against baseURL so callers get absolute targets where possible. a baseURL that won't parse just leaves relatives as-is rather than failing the whole scan.

func ScanSupabase

func ScanSupabase(jsContent string, jsUrl string, timeout time.Duration) ([]supabaseScanResult, error)

Types

type JavascriptScanResult

type JavascriptScanResult struct {
	SupabaseResults      []supabaseScanResult `json:"supabase_results"`
	FoundEnvironmentVars map[string]string    `json:"environment_variables"`
	SecretMatches        []SecretMatch        `json:"secret_matches"`
	Endpoints            []string             `json:"endpoints"`
}

func JavascriptScan

func JavascriptScan(url string, timeout time.Duration, threads int, logdir string) (*JavascriptScanResult, error)

func (*JavascriptScanResult) ResultType

func (r *JavascriptScanResult) ResultType() string

ResultType implements the ScanResult interface.

func (*JavascriptScanResult) SupabaseFindings

func (r *JavascriptScanResult) SupabaseFindings() []SupabaseFinding

SupabaseFindings projects the package-private supabase results into a stable exported shape for the finding normalizer; role is what makes one interesting (a non-anon key is the real bug).

type SecretMatch

type SecretMatch struct {
	Rule   string `json:"rule"`
	Match  string `json:"match"`
	Source string `json:"source"`
}

SecretMatch is one credential the scanner pulled out of a script.

func ScanSecrets

func ScanSecrets(content, srcURL string) []SecretMatch

ScanSecrets runs the regex bank over a script body and returns every gated match, deduped within this one source. srcURL is recorded on each find.

type SupabaseFinding

type SupabaseFinding struct {
	ProjectId   string
	Role        string
	Collections int
}

SupabaseFinding is the exported view of one discovered supabase project. the raw supabaseScanResult stays package-private (it carries scan internals), so downstream normalizers consume this projection instead.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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