Documentation
¶
Overview ¶
Package apispecs finds an organisation's OpenAPI and Swagger descriptions in a working tree and reads them through the one shared module (github.com/Vulnetix/vdb-openapi), so the CLI, the backend and the console all agree on what a document says whatever version it is written in.
It is the engine behind `vulnesis api discover`. Finding specs in files is safe and needs no network: the command never sends a request to a host unless the user passes an explicit --url.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generators ¶
Generators returns the spec-generating frameworks named in a dependency list (for example a go.mod or package.json's dependency names), so a repo that builds its spec at runtime is reported even when no file is committed.
Types ¶
type Found ¶
type Found struct {
// Path is relative to the scanned root.
Path string
Document *oas.Document
// Raw is the file's bytes, uploaded unchanged so the server re-reads them.
Raw []byte
}
Found is one spec read from a file.
func Discover ¶
Discover walks root for spec files and reads each through vdb-openapi. A file whose name looks like a spec is always read; any other .json/.yaml under the size cap is sniffed first, so a spec named oddly is still found without parsing every manifest in the tree. Vendored and generated trees are skipped.