emauth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package emauth provides MCP Enterprise-Managed Authorization support for mcp-google: audit logging and scope-based tool gating driven by the identity verified from an ID-JAG-derived access token.

The identity (subject, RFC 8693 act delegation chain, scope) is placed in the request context by omniskill's ExternalBearerMiddleware; this package consumes it at the MCP method layer via a receiving middleware.

Index

Constants

View Source
const (
	ScopeDocs   = "docs:read"
	ScopeSheets = "sheets:read"
	ScopeSlides = "slides:read"
)

Scopes understood by mcp-google. When the verified token carries a scope claim, tool calls require the matching skill scope; tokens without a scope claim are not gated (identity is still audit-logged).

Variables

This section is empty.

Functions

func HasScope

func HasScope(scopes, required string) bool

HasScope reports whether the space-delimited scope string contains the required scope.

func Middleware

func Middleware(logger *slog.Logger) mcp.Middleware

Middleware returns an MCP receiving middleware that audit-logs the verified identity on every tool call and denies calls whose token scope does not cover the tool. Non-tool methods pass through untouched.

func RequiredScope

func RequiredScope(toolName string) string

RequiredScope maps a tool name to the scope that authorizes it. Returns an empty string for tools with no scope mapping (allowed by default).

Types

This section is empty.

Jump to

Keyboard shortcuts

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