Help us shape the future of Go! Take the 2026 Go Developer Survey

edge

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package edge defines portable GoRun Edge site and manager authorization contracts. The package is independent of Cloudflare and the GoRun Full runtime.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorized = errors.New("edge: manager not authorized")

Functions

func Authorize

func Authorize(s Site, managerID string, capability Capability) error

Authorize checks a site-scoped operation before invoking MCP tools.

func ValidCapability

func ValidCapability(c Capability) bool

Types

type Capability

type Capability string
const (
	ReadContent    Capability = "content.read"
	EditContent    Capability = "content.edit"
	PublishContent Capability = "content.publish"
	ManageTheme    Capability = "theme.manage"
	ManageManagers Capability = "managers.manage"
)

type Grant

type Grant struct {
	ManagerID    string
	Capabilities []Capability
}

type Site

type Site struct {
	ID               string
	PrimaryManagerID string
	Grants           []Grant
}

func (Site) Allowed

func (s Site) Allowed(managerID string, capability Capability) bool

Allowed is fail-closed: the owner can manage grants; other managers must have an explicit capability. No wildcard or implicit write permission.

Jump to

Keyboard shortcuts

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