bundle

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BodyPlaceholder = "[[SECTOOL_BODY_FILE: body]]"
	DefaultDir      = "sectool-requests"
)

Variables

This section is empty.

Functions

func DecodeBase64Body

func DecodeBase64Body(encoded string) ([]byte, error)

DecodeBase64Body decodes a base64-encoded body string to bytes.

func ReconstructRequest

func ReconstructRequest(headers, body []byte) []byte

ReconstructRequest rebuilds the full HTTP request from headers and body.

func ResolvePath

func ResolvePath(arg string) (string, error)

ResolvePath resolves a bundle path argument. Tries the argument as-is first, then as ./sectool-requests/<arg>/.

func Write

func Write(flowID, url, method, reqHeaders string, reqBody []byte, respHeaders string, respBody []byte) (string, error)

Write writes a request bundle to ./sectool-requests/<flowID>/. Uses restrictive permissions (0700 dirs, 0600 files) and rejects symlinks.

Types

type Meta

type Meta struct {
	FlowID     string `json:"flow_id"`
	CapturedAt string `json:"captured_at"`
	URL        string `json:"url"`
	Method     string `json:"method"`
	BodyIsUTF8 bool   `json:"body_is_utf8"`
	BodySize   int    `json:"body_size"`
}

Meta is request bundle metadata.

func Read

func Read(bundleDir string) (headers, body []byte, meta *Meta, err error)

Read reads a request bundle from disk. Returns headers (without body placeholder), body bytes, and metadata.

Jump to

Keyboard shortcuts

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