test(compat): add deterministic local fixtures

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
naiba
2026-07-14 05:49:15 +00:00
co-authored by naiba/CloudCode
parent b01ff45ef4
commit 92a1cc76be
10 changed files with 1178 additions and 0 deletions
@@ -0,0 +1,34 @@
package fixture
import "errors"
var (
ErrPayloadOverrun = errors.New("fixture payload exceeds transfer limit")
ErrPayloadSizeMismatch = errors.New("fixture payload size mismatch")
)
type PathRejectionReason string
const (
PathRejectionEmpty PathRejectionReason = "empty"
PathRejectionAbsolute PathRejectionReason = "absolute"
PathRejectionParent PathRejectionReason = "parent"
PathRejectionVolume PathRejectionReason = "volume"
PathRejectionSeparator PathRejectionReason = "separator"
PathRejectionDestructiveRoot PathRejectionReason = "destructive_root"
PathRejectionEscape PathRejectionReason = "escape"
PathRejectionSymlinkParent PathRejectionReason = "symlink_parent"
PathRejectionADS PathRejectionReason = "ads"
)
type AgentPathError struct {
Reason PathRejectionReason
}
func (e *AgentPathError) Error() string {
return "agent path rejected: " + string(e.Reason)
}
func rejectPath(reason PathRejectionReason) error {
return &AgentPathError{Reason: reason}
}