ownerguard

command
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Command ownerguard is the SEC-0027 post-gen helper. It scans the OpenAPI spec for the `x-apic-owner-param` extension on operations and emits api/ownerguard.gen.go: a gin middleware (OwnershipGuard) that enforces object-level ownership (OWASP API1:2023 BOLA) by requiring the verified JWT subject to equal the named routed path parameter, with an optional privileged-role bypass (x-apic-owner-bypass-roles).

It follows the same structure as helpers/wsgen and helpers/mcpgen: it takes (specPath, outPath) positional args, loads the spec with kin-openapi, and runs format.Source + a go/parser self-check before writing the file 0o600.

Jump to

Keyboard shortcuts

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