mcpgateway

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoverageProtected   = "protected"
	CoverageUnprotected = "unprotected"
	CoverageUnknown     = "unknown"
)
View Source
const (
	PolicyPostureAllow   = "allow"
	PolicyPostureDeny    = "deny"
	PolicyPostureUnknown = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

type Detector struct{}

func New

func New() Detector

func (Detector) Detect

func (Detector) Detect(_ context.Context, scope detect.Scope, options detect.Options) ([]model.Finding, error)

func (Detector) ID

func (Detector) ID() string

type Policy

type Policy struct {
	Detected      bool
	DefaultAction string
	Rules         map[string]string
	SourceFiles   []string
	Ambiguous     bool
}

Policy is the normalized repo-level gateway policy posture.

func LoadPolicy

func LoadPolicy(root string) (Policy, []fileParseError, error)

LoadPolicy parses all recognized gateway config files in root and returns one normalized policy.

func LoadPolicyWithOptions added in v1.2.0

func LoadPolicyWithOptions(root string, options detect.Options) (Policy, []fileParseError, error)

type Result

type Result struct {
	Coverage       string
	PolicyPosture  string
	DefaultAction  string
	ReasonCode     string
	GatewaySources []string
}

Result is a normalized gateway coverage decision for one declaration.

func EvaluateCoverage

func EvaluateCoverage(policy Policy, declarationName string) Result

EvaluateCoverage determines coverage posture for one declaration using normalized policy.

Jump to

Keyboard shortcuts

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