pluginutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCustomHeaders

func ApplyCustomHeaders(req *http.Request, args map[string]string)

ApplyCustomHeaders parses the "headers" key from a plugin args map (formatted as "Name: value\nName: value\n") and sets each on req. No-op when args is nil or has no "headers" key.

func ComposeTarget

func ComposeTarget(base, uri string) string

ComposeTarget joins a base URL with an optional URI path, normalising the slash between them. When uri is empty, returns the base with any trailing slash trimmed. Matches CredMaster's `f"{url}/{pluginargs['uri']}"` for the common non-slashed cases, and avoids producing "//" when either side carries an extra slash.

Intended for plugins whose target path is operator-supplied via a `uri` pluginarg (httpbrute, httppost). Plugins with a fixed endpoint path (e.g. adfs, ews, owa, the OAuth2 family) keep their inline `strings.TrimRight(url, "/") + "/fixed/path"` composition.

Caller is responsible for sanitising operator-supplied URIs; this helper does not validate or canonicalise (no `..` collapsing, no scheme check, no path-traversal guard). Both args come from operator CLI input, so the threat model is operator-controlled, not attacker-controlled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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