limits

package
v1.0.366 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package limits defines the immutable, validated structural resource bounds the MCP protocol kernel enforces. Management and Gateway carry INDEPENDENT limit sets: one capability's bound never affects the other (isolation is asserted by tests). Every value is a conservative safe-default with a hard-cap ceiling per decision D-14 (the MCP-PROTO-006/007/008 requirements are defined; only the numeric values were open, and are fixed here).

A Limits value is immutable once constructed: fields are unexported and read through accessors, and there is no package-level mutable singleton. Construct one with New (validating a Config) or take a validated default via DefaultManagement / DefaultGateway.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig added in v1.0.173

type AuthConfig struct {
	MaxTokenTTL      time.Duration // finite maximum accepted token lifetime (exp-iat)
	ClockSkew        time.Duration // permitted clock skew each direction
	MaxFutureNbf     time.Duration // maximum nbf allowed in the future
	MaxAuthAge       time.Duration // maximum age of auth_time when an assurance requires it
	MaxDPoPProofAge  time.Duration // DPoP proof iat acceptance window
	NonceLifetime    time.Duration // server nonce lifetime
	MaxReplayEntries int           // per-capability replay-cache entry cap
	MaxReplayPerPart int           // per-partition entry cap (bounds one key's growth)
	MaxTokenBytes    int           // maximum raw token bytes accepted
	MaxClaimBytes    int           // maximum decoded claims-JSON bytes
	MaxScopes        int           // maximum scopes in one token
	MaxAudiences     int           // maximum audiences in one token
}

AuthConfig is the mutable input to NewAuth. Every field must be set.

func (AuthConfig) Validate added in v1.0.173

func (c AuthConfig) Validate() error

Validate reports whether the AuthConfig is safe and internally consistent.

type AuthLimits added in v1.0.173

type AuthLimits struct {
	// contains filtered or unexported fields
}

AuthLimits is an immutable, validated auth bound set.

func DefaultAuth added in v1.0.173

func DefaultAuth() AuthLimits

DefaultAuth returns the validated default auth bound set.

func NewAuth added in v1.0.173

func NewAuth(c AuthConfig) (AuthLimits, error)

NewAuth validates c and returns an immutable AuthLimits, or an error.

func (AuthLimits) ClockSkew added in v1.0.173

func (l AuthLimits) ClockSkew() time.Duration

ClockSkew returns the permitted clock skew.

func (AuthLimits) MaxAudiences added in v1.0.173

func (l AuthLimits) MaxAudiences() int

MaxAudiences returns the maximum audiences in one token.

func (AuthLimits) MaxAuthAge added in v1.0.173

func (l AuthLimits) MaxAuthAge() time.Duration

MaxAuthAge returns the maximum accepted authentication age.

func (AuthLimits) MaxClaimBytes added in v1.0.173

func (l AuthLimits) MaxClaimBytes() int

MaxClaimBytes returns the maximum decoded claims-JSON bytes.

func (AuthLimits) MaxDPoPProofAge added in v1.0.173

func (l AuthLimits) MaxDPoPProofAge() time.Duration

MaxDPoPProofAge returns the DPoP proof acceptance window.

func (AuthLimits) MaxFutureNbf added in v1.0.173

func (l AuthLimits) MaxFutureNbf() time.Duration

MaxFutureNbf returns the maximum nbf allowed in the future.

func (AuthLimits) MaxReplayEntries added in v1.0.173

func (l AuthLimits) MaxReplayEntries() int

MaxReplayEntries returns the per-capability replay-cache entry cap.

func (AuthLimits) MaxReplayPerPart added in v1.0.173

func (l AuthLimits) MaxReplayPerPart() int

MaxReplayPerPart returns the per-partition entry cap.

func (AuthLimits) MaxScopes added in v1.0.173

func (l AuthLimits) MaxScopes() int

MaxScopes returns the maximum scopes in one token.

func (AuthLimits) MaxTokenBytes added in v1.0.173

func (l AuthLimits) MaxTokenBytes() int

MaxTokenBytes returns the maximum raw token bytes accepted.

func (AuthLimits) MaxTokenTTL added in v1.0.173

func (l AuthLimits) MaxTokenTTL() time.Duration

MaxTokenTTL returns the finite maximum accepted token lifetime.

func (AuthLimits) NonceLifetime added in v1.0.173

func (l AuthLimits) NonceLifetime() time.Duration

NonceLifetime returns the server nonce lifetime.

type CatalogConfig added in v1.0.171

type CatalogConfig struct {
	MaxServers          int // max registered servers in one registry snapshot
	MaxToolsPerServer   int // max tools behind a single server
	MaxCatalogEntries   int // max (server,tool) records in one catalog snapshot (also bounds snapshot publication work)
	MaxDiscoveryBytes   int // max bytes of one raw tools/list discovery result
	MaxSchemaBytes      int // max bytes of one tool input/output schema
	MaxDescriptionBytes int // max bytes of one tool description
	MaxSchemaDepth      int // max JSON nesting depth inside a schema/discovery result
	MaxObjectMembers    int // max members in any one JSON object during canonicalization
	MaxArrayElements    int // max elements in any one JSON array during canonicalization
	MaxDiffOps          int // max field-level diff operations per drift classification
	MaxNameBytes        int // max bytes of a tool name
	MaxEndpointBytes    int // max bytes of a canonical endpoint identity
	MaxIdentityBytes    int // max bytes of a pinned/verified identity representation
	MaxServerIDBytes    int // max bytes of an opaque server registry id
	MaxCredProfileBytes int // max bytes of an opaque credential-profile reference
	MaxOwnerScopeBytes  int // max bytes of an ownership/tenant scope token
}

CatalogConfig is the mutable input to NewCatalog. A zero CatalogConfig is invalid; every field must be set.

func (CatalogConfig) Validate added in v1.0.171

func (c CatalogConfig) Validate() error

Validate reports whether the CatalogConfig is safe and internally consistent.

type CatalogLimits added in v1.0.171

type CatalogLimits struct {
	// contains filtered or unexported fields
}

CatalogLimits is an immutable, validated catalog bound set.

func DefaultCatalog added in v1.0.171

func DefaultCatalog() CatalogLimits

DefaultCatalog returns the validated Gateway registry + catalog default bounds.

func NewCatalog added in v1.0.171

func NewCatalog(c CatalogConfig) (CatalogLimits, error)

NewCatalog validates c and returns an immutable CatalogLimits, or an error.

func (CatalogLimits) MaxArrayElements added in v1.0.171

func (l CatalogLimits) MaxArrayElements() int

MaxArrayElements returns the maximum elements in any one JSON array.

func (CatalogLimits) MaxCatalogEntries added in v1.0.171

func (l CatalogLimits) MaxCatalogEntries() int

MaxCatalogEntries returns the maximum (server,tool) records in one catalog snapshot; it also bounds snapshot publication work (publication is O(entries)).

func (CatalogLimits) MaxCredProfileBytes added in v1.0.171

func (l CatalogLimits) MaxCredProfileBytes() int

MaxCredProfileBytes returns the maximum bytes of a credential-profile reference.

func (CatalogLimits) MaxDescriptionBytes added in v1.0.171

func (l CatalogLimits) MaxDescriptionBytes() int

MaxDescriptionBytes returns the maximum bytes of one tool description.

func (CatalogLimits) MaxDiffOps added in v1.0.171

func (l CatalogLimits) MaxDiffOps() int

MaxDiffOps returns the maximum field-level diff operations per classification.

func (CatalogLimits) MaxDiscoveryBytes added in v1.0.171

func (l CatalogLimits) MaxDiscoveryBytes() int

MaxDiscoveryBytes returns the maximum bytes of one raw discovery result.

func (CatalogLimits) MaxEndpointBytes added in v1.0.171

func (l CatalogLimits) MaxEndpointBytes() int

MaxEndpointBytes returns the maximum bytes of a canonical endpoint identity.

func (CatalogLimits) MaxIdentityBytes added in v1.0.171

func (l CatalogLimits) MaxIdentityBytes() int

MaxIdentityBytes returns the maximum bytes of a pinned/verified identity.

func (CatalogLimits) MaxNameBytes added in v1.0.171

func (l CatalogLimits) MaxNameBytes() int

MaxNameBytes returns the maximum bytes of a tool name.

func (CatalogLimits) MaxObjectMembers added in v1.0.171

func (l CatalogLimits) MaxObjectMembers() int

MaxObjectMembers returns the maximum members in any one JSON object.

func (CatalogLimits) MaxOwnerScopeBytes added in v1.0.171

func (l CatalogLimits) MaxOwnerScopeBytes() int

MaxOwnerScopeBytes returns the maximum bytes of an ownership/tenant scope token.

func (CatalogLimits) MaxSchemaBytes added in v1.0.171

func (l CatalogLimits) MaxSchemaBytes() int

MaxSchemaBytes returns the maximum bytes of one tool schema.

func (CatalogLimits) MaxSchemaDepth added in v1.0.171

func (l CatalogLimits) MaxSchemaDepth() int

MaxSchemaDepth returns the maximum JSON nesting depth inside a schema.

func (CatalogLimits) MaxServerIDBytes added in v1.0.171

func (l CatalogLimits) MaxServerIDBytes() int

MaxServerIDBytes returns the maximum bytes of an opaque server registry id.

func (CatalogLimits) MaxServers added in v1.0.171

func (l CatalogLimits) MaxServers() int

MaxServers returns the maximum registered servers in one registry snapshot.

func (CatalogLimits) MaxToolsPerServer added in v1.0.171

func (l CatalogLimits) MaxToolsPerServer() int

MaxToolsPerServer returns the maximum tools behind a single server.

type Config

type Config struct {
	MaxFrameBytes            int           // max bytes of a single wire frame
	MaxDepth                 int           // max JSON nesting depth
	MaxObjectMembers         int           // max members in any one JSON object
	MaxArrayElements         int           // max elements in any one JSON array
	MaxStringBytes           int           // max bytes of any one JSON string
	MaxMethodBytes           int           // max bytes of a method name
	MaxIDBytes               int           // max encoded bytes of a request/response id
	MaxErrorDataBytes        int           // max bytes of an error `data` member
	MaxSessions              int           // max concurrent sessions
	MaxOutstandingPerSession int           // max in-flight requests per (session,direction)
	MaxTotalOutstanding      int           // max in-flight requests across all sessions
	SessionTTL               time.Duration // lifecycle idle timeout / expiry window
}

Config is the mutable input to New. Callers set every field; New validates it and returns an immutable Limits. A zero Config is invalid.

func (Config) Validate

func (c Config) Validate() error

Validate reports whether the Config is safe and internally consistent. Zero, negative, over-cap, or inconsistent limits are rejected. It is the single gate every Limits passes through.

type CredentialConfig added in v1.0.174

type CredentialConfig struct {
	MaxProfiles          int           // total credential profiles
	MaxProviders         int           // registered providers
	MaxProfilesPerTenant int           // profiles per tenant
	MaxProfilesPerServer int           // profiles per server
	MaxCacheEntries      int           // encrypted cache entries (global)
	MaxCacheBytes        int           // total encrypted cache bytes (global)
	MaxEnvelopeBytes     int           // one encrypted credential envelope's bytes
	MaxSecretFields      int           // secret fields per credential
	MaxSecretFieldBytes  int           // one secret field's plaintext bytes
	MaxProviderConc      int           // global provider-request concurrency
	MaxInflightPerProf   int           // in-flight fetches per profile (stampede bound)
	MaxRotationAttempts  int           // rotation attempts per cycle
	MaxRetries           int           // retry count per fetch
	MaxRetryDelay        time.Duration // maximum retry backoff delay
	MaxCredentialTTL     time.Duration // maximum accepted credential lease TTL
	MaxCacheFreshness    time.Duration // maximum low-risk cache fallback freshness
	RotationGrace        time.Duration // bounded previous-version grace window
	MaxTombstones        int           // revocation tombstones retained
	MaxCleanupPerOp      int           // bounded cleanup work per operation
}

CredentialConfig is the mutable input to NewCredential. Every field must be set to a safe value.

func (CredentialConfig) Validate added in v1.0.174

func (c CredentialConfig) Validate() error

Validate enforces positivity, hard-cap ceilings, and cross-field consistency.

type CredentialLimits added in v1.0.174

type CredentialLimits struct {
	// contains filtered or unexported fields
}

CredentialLimits is an immutable, validated credential bound set.

func DefaultCredential added in v1.0.174

func DefaultCredential() CredentialLimits

DefaultCredential returns a conservative, valid credential bound set for tests and the dormant default wiring.

func NewCredential added in v1.0.174

func NewCredential(c CredentialConfig) (CredentialLimits, error)

NewCredential validates the config into an immutable CredentialLimits.

func (CredentialLimits) MaxCacheBytes added in v1.0.174

func (l CredentialLimits) MaxCacheBytes() int

MaxCacheBytes returns the configured bound.

func (CredentialLimits) MaxCacheEntries added in v1.0.174

func (l CredentialLimits) MaxCacheEntries() int

MaxCacheEntries returns the configured bound.

func (CredentialLimits) MaxCacheFreshness added in v1.0.174

func (l CredentialLimits) MaxCacheFreshness() time.Duration

MaxCacheFreshness returns the configured bound.

func (CredentialLimits) MaxCleanupPerOp added in v1.0.174

func (l CredentialLimits) MaxCleanupPerOp() int

MaxCleanupPerOp returns the configured bound.

func (CredentialLimits) MaxCredentialTTL added in v1.0.174

func (l CredentialLimits) MaxCredentialTTL() time.Duration

MaxCredentialTTL returns the configured bound.

func (CredentialLimits) MaxEnvelopeBytes added in v1.0.174

func (l CredentialLimits) MaxEnvelopeBytes() int

MaxEnvelopeBytes returns the configured bound.

func (CredentialLimits) MaxInflightPerProf added in v1.0.174

func (l CredentialLimits) MaxInflightPerProf() int

MaxInflightPerProf returns the configured bound.

func (CredentialLimits) MaxProfiles added in v1.0.174

func (l CredentialLimits) MaxProfiles() int

MaxProfiles returns the configured bound.

func (CredentialLimits) MaxProfilesPerServer added in v1.0.174

func (l CredentialLimits) MaxProfilesPerServer() int

MaxProfilesPerServer returns the configured bound.

func (CredentialLimits) MaxProfilesPerTenant added in v1.0.174

func (l CredentialLimits) MaxProfilesPerTenant() int

MaxProfilesPerTenant returns the configured bound.

func (CredentialLimits) MaxProviderConc added in v1.0.174

func (l CredentialLimits) MaxProviderConc() int

MaxProviderConc returns the configured bound.

func (CredentialLimits) MaxProviders added in v1.0.174

func (l CredentialLimits) MaxProviders() int

MaxProviders returns the configured bound.

func (CredentialLimits) MaxRetries added in v1.0.174

func (l CredentialLimits) MaxRetries() int

MaxRetries returns the configured bound.

func (CredentialLimits) MaxRetryDelay added in v1.0.174

func (l CredentialLimits) MaxRetryDelay() time.Duration

MaxRetryDelay returns the configured bound.

func (CredentialLimits) MaxRotationAttempts added in v1.0.174

func (l CredentialLimits) MaxRotationAttempts() int

MaxRotationAttempts returns the configured bound.

func (CredentialLimits) MaxSecretFieldBytes added in v1.0.174

func (l CredentialLimits) MaxSecretFieldBytes() int

MaxSecretFieldBytes returns the configured bound.

func (CredentialLimits) MaxSecretFields added in v1.0.174

func (l CredentialLimits) MaxSecretFields() int

MaxSecretFields returns the configured bound.

func (CredentialLimits) MaxTombstones added in v1.0.174

func (l CredentialLimits) MaxTombstones() int

MaxTombstones returns the configured bound.

func (CredentialLimits) RotationGrace added in v1.0.174

func (l CredentialLimits) RotationGrace() time.Duration

RotationGrace returns the configured bound.

type EventConfig added in v1.0.180

type EventConfig struct {
	// Spool capacity (bytes).
	SpoolMaxBytes        int // total bounded spool size for one capability
	CriticalReserveBytes int // P-CRIT reserved capacity (never consumed by P-ORD/P-DEN)
	OrdinaryQuotaBytes   int // P-ORD quota (shares the non-reserved remainder)
	DenialQuotaBytes     int // P-DEN quota (own, cannot overlap the reserve)
	SegmentMaxBytes      int // max bytes of one segment file
	MaxEventBytes        int // max bytes of one encoded event
	MaxMetadataBytes     int // max bytes of one integrity-protected state file
	MaxSafeResultBytes   int // max bytes of one sanitized export/read result

	// Counts and concurrency.
	MaxSegments             int // max segments per partition
	MaxQueuePerPartition    int // max queued events per partition (bounded queue)
	MaxInFlightCommits      int // max concurrent in-flight commits
	CommitBatchSize         int // max events grouped into one commit batch
	MaxSyncOps              int // max concurrent sync operations
	MaxDenialBuckets        int // max active denial-aggregation buckets
	MaxBucketsPerSource     int // max buckets attributable to one source
	MaxCoalescePerAggregate int // max coalesced count one aggregate may track
	MaxRecoveryScanBytes    int // max bytes a bounded recovery scan may read
	MaxRecoverySegments     int // max segments a bounded recovery may scan
	MaxRecoveryRecords      int // max records a bounded recovery may replay
	MaxReclaimPerPass       int // max records reclaimed in one reclamation pass
	ExporterWorkers         int // bounded exporter worker count
	ExportBatchRecords      int // max records per export batch
	ExportBatchBytes        int // max bytes per export batch
	ExportMaxRetries        int // bounded export retries
	ReplayWindowEntries     int // replay-dedup window entries retained
	TenantExportMaxRecords  int // max records one tenant export may return
	TenantExportMaxBytes    int // max bytes one tenant export may return

	// Watermarks (whole-number percents).
	HighWatermarkPct   int // reclamation trigger, percent of SpoolMaxBytes (1..99)
	LowWatermarkPct    int // reclamation target, percent of SpoolMaxBytes (< high)
	ReserveRecoveryPct int // recovery watermark, percent OF CriticalReserveBytes (1..100)

	// Durations.
	AggregationWindow time.Duration // bounded denial-aggregation window
	RetentionWindow   time.Duration // bounded retention window
	ProbeInterval     time.Duration // durability-recovery probe interval
	CommitBatchDelay  time.Duration // commit-batch coalescing delay
	ShutdownDrain     time.Duration // bounded shutdown drain
}

EventConfig is the mutable input to NewEvent. A zero EventConfig is invalid; every field must be set. Percentages are whole-number percents. The loss policy, rotation policy, spool path, export target and redaction-profile reference are NOT numeric bounds and live on the events package runtime config, not here.

func (EventConfig) Validate added in v1.0.180

func (c EventConfig) Validate() error

Validate reports whether the EventConfig is safe and internally consistent. Zero, negative, over-cap, or inconsistent limits are rejected.

type EventLimits added in v1.0.180

type EventLimits struct {
	// contains filtered or unexported fields
}

EventLimits is an immutable, validated event bound set.

func DefaultGatewayEvent added in v1.0.180

func DefaultGatewayEvent() EventLimits

DefaultGatewayEvent returns the validated Gateway event default bounds.

func DefaultManagementEvent added in v1.0.180

func DefaultManagementEvent() EventLimits

DefaultManagementEvent returns the validated Management event default bounds.

func NewEvent added in v1.0.180

func NewEvent(c EventConfig) (EventLimits, error)

NewEvent validates c and returns an immutable EventLimits, or an error.

func (EventLimits) AggregationWindow added in v1.0.180

func (l EventLimits) AggregationWindow() time.Duration

AggregationWindow returns the bounded denial-aggregation window.

func (EventLimits) CommitBatchDelay added in v1.0.180

func (l EventLimits) CommitBatchDelay() time.Duration

CommitBatchDelay returns the commit-batch coalescing delay.

func (EventLimits) CommitBatchSize added in v1.0.180

func (l EventLimits) CommitBatchSize() int

CommitBatchSize returns the max events grouped into one commit batch.

func (EventLimits) CriticalReserveBytes added in v1.0.180

func (l EventLimits) CriticalReserveBytes() int

CriticalReserveBytes returns the P-CRIT reserved capacity.

func (EventLimits) DenialQuotaBytes added in v1.0.180

func (l EventLimits) DenialQuotaBytes() int

DenialQuotaBytes returns the P-DEN quota.

func (EventLimits) ExportBatchBytes added in v1.0.180

func (l EventLimits) ExportBatchBytes() int

ExportBatchBytes returns the max bytes per export batch.

func (EventLimits) ExportBatchRecords added in v1.0.180

func (l EventLimits) ExportBatchRecords() int

ExportBatchRecords returns the max records per export batch.

func (EventLimits) ExportMaxRetries added in v1.0.180

func (l EventLimits) ExportMaxRetries() int

ExportMaxRetries returns the bounded export retries.

func (EventLimits) ExporterWorkers added in v1.0.180

func (l EventLimits) ExporterWorkers() int

ExporterWorkers returns the bounded exporter worker count.

func (EventLimits) HighWatermarkBytes added in v1.0.180

func (l EventLimits) HighWatermarkBytes() int

HighWatermarkBytes returns the reclamation-trigger threshold in bytes.

func (EventLimits) HighWatermarkPct added in v1.0.180

func (l EventLimits) HighWatermarkPct() int

HighWatermarkPct returns the reclamation-trigger watermark (percent of spool).

func (EventLimits) LowWatermarkBytes added in v1.0.180

func (l EventLimits) LowWatermarkBytes() int

LowWatermarkBytes returns the reclamation-target threshold in bytes.

func (EventLimits) LowWatermarkPct added in v1.0.180

func (l EventLimits) LowWatermarkPct() int

LowWatermarkPct returns the reclamation-target watermark (percent of spool).

func (EventLimits) MaxBucketsPerSource added in v1.0.180

func (l EventLimits) MaxBucketsPerSource() int

MaxBucketsPerSource returns the max buckets attributable to one source.

func (EventLimits) MaxCoalescePerAggregate added in v1.0.180

func (l EventLimits) MaxCoalescePerAggregate() int

MaxCoalescePerAggregate returns the max coalesced count one aggregate may track.

func (EventLimits) MaxDenialBuckets added in v1.0.180

func (l EventLimits) MaxDenialBuckets() int

MaxDenialBuckets returns the max active denial-aggregation buckets.

func (EventLimits) MaxEventBytes added in v1.0.180

func (l EventLimits) MaxEventBytes() int

MaxEventBytes returns the max bytes of one encoded event.

func (EventLimits) MaxInFlightCommits added in v1.0.180

func (l EventLimits) MaxInFlightCommits() int

MaxInFlightCommits returns the max concurrent in-flight commits.

func (EventLimits) MaxMetadataBytes added in v1.0.180

func (l EventLimits) MaxMetadataBytes() int

MaxMetadataBytes returns the max bytes of one integrity-protected state file.

func (EventLimits) MaxQueuePerPartition added in v1.0.180

func (l EventLimits) MaxQueuePerPartition() int

MaxQueuePerPartition returns the max queued events per partition.

func (EventLimits) MaxReclaimPerPass added in v1.0.180

func (l EventLimits) MaxReclaimPerPass() int

MaxReclaimPerPass returns the max records reclaimed in one reclamation pass.

func (EventLimits) MaxRecoveryRecords added in v1.0.180

func (l EventLimits) MaxRecoveryRecords() int

MaxRecoveryRecords returns the max records a bounded recovery may replay.

func (EventLimits) MaxRecoveryScanBytes added in v1.0.180

func (l EventLimits) MaxRecoveryScanBytes() int

MaxRecoveryScanBytes returns the max bytes a bounded recovery scan may read.

func (EventLimits) MaxRecoverySegments added in v1.0.180

func (l EventLimits) MaxRecoverySegments() int

MaxRecoverySegments returns the max segments a bounded recovery may scan.

func (EventLimits) MaxSafeResultBytes added in v1.0.180

func (l EventLimits) MaxSafeResultBytes() int

MaxSafeResultBytes returns the max bytes of one sanitized export/read result.

func (EventLimits) MaxSegments added in v1.0.180

func (l EventLimits) MaxSegments() int

MaxSegments returns the max segments per partition.

func (EventLimits) MaxSyncOps added in v1.0.180

func (l EventLimits) MaxSyncOps() int

MaxSyncOps returns the max concurrent sync operations.

func (EventLimits) OrdinaryQuotaBytes added in v1.0.180

func (l EventLimits) OrdinaryQuotaBytes() int

OrdinaryQuotaBytes returns the P-ORD quota.

func (EventLimits) PendingBacklogBytes added in v1.0.180

func (l EventLimits) PendingBacklogBytes() int

PendingBacklogBytes returns criterion (4)'s derived in-process backlog bound: (100 - reserve_recovery) percent of the reserve. It is DERIVED, never separately configured, so (2) and (4) can never be set to contradict.

func (EventLimits) ProbeInterval added in v1.0.180

func (l EventLimits) ProbeInterval() time.Duration

ProbeInterval returns the durability-recovery probe interval.

func (EventLimits) ReplayWindowEntries added in v1.0.180

func (l EventLimits) ReplayWindowEntries() int

ReplayWindowEntries returns the replay-dedup window entries retained.

func (EventLimits) ReserveRecoveryBytes added in v1.0.180

func (l EventLimits) ReserveRecoveryBytes() int

ReserveRecoveryBytes returns criterion (2)'s free-byte threshold: a fraction of the CRITICAL RESERVE (never of the spool), so every accepted config has a reachable critical-durability-degraded exit.

func (EventLimits) ReserveRecoveryPct added in v1.0.180

func (l EventLimits) ReserveRecoveryPct() int

ReserveRecoveryPct returns the recovery watermark (percent OF the reserve).

func (EventLimits) RetentionWindow added in v1.0.180

func (l EventLimits) RetentionWindow() time.Duration

RetentionWindow returns the bounded retention window.

func (EventLimits) SegmentMaxBytes added in v1.0.180

func (l EventLimits) SegmentMaxBytes() int

SegmentMaxBytes returns the max bytes of one segment file.

func (EventLimits) ShutdownDrain added in v1.0.180

func (l EventLimits) ShutdownDrain() time.Duration

ShutdownDrain returns the bounded shutdown drain.

func (EventLimits) SpoolMaxBytes added in v1.0.180

func (l EventLimits) SpoolMaxBytes() int

SpoolMaxBytes returns the total bounded spool size.

func (EventLimits) TenantExportMaxBytes added in v1.0.180

func (l EventLimits) TenantExportMaxBytes() int

TenantExportMaxBytes returns the max bytes one tenant export may return.

func (EventLimits) TenantExportMaxRecords added in v1.0.180

func (l EventLimits) TenantExportMaxRecords() int

TenantExportMaxRecords returns the max records one tenant export may return.

type InspectionConfig added in v1.0.179

type InspectionConfig struct {
	MaxSchemaBytes        int // max bytes of one tool input/output schema
	MaxSchemaNodes        int // max compiled schema nodes
	MaxSchemaAlternatives int // max anyOf/enum alternatives across a schema
	MaxValidationOps      int // max value-validation operations
	MaxArgNodes           int // max nodes in a decoded argument value
	MaxOutputBytes        int // max bytes of one upstream response body
	MaxOutputNodes        int // max nodes in a decoded output value
	MaxStringsScanned     int // max string leaves scanned in one value
	MaxBytesPerString     int // max bytes scanned in any one string leaf
	MaxTotalScanBytes     int // max total bytes scanned across one value
	MaxFindings           int // max DLP/injection findings in one value
	MaxRedactions         int // max redactions applied in one transform
	MaxExtractionPaths    int // max compiled destination-extraction paths
	MaxExtractedDests     int // max destinations extracted from one value
	MaxURLBytes           int // max bytes of one destination URL
	MaxHostBytes          int // max bytes of one destination host
	MaxQueryBytes         int // max bytes of one destination query string
	MaxDNSConcurrency     int // max concurrent DNS resolutions
	MaxDNSAddresses       int // max addresses accepted per DNS answer
	MaxDNSWork            int // max CNAME/lookup work units per resolution
	MaxRedirectHops       int // max redirect hops in one chain
	MaxRedirectEvidence   int // max recorded redirect-hop evidence entries
	MaxInjectionOps       int // max injection-detector operations
	MaxTransformedBytes   int // max transformed output bytes
	MaxSafeResultBytes    int // max bytes of a sanitized safe result
	MaxTruncatedTextBytes int // max text a display truncation may keep
}

InspectionConfig is the mutable input to NewInspection. A zero InspectionConfig is invalid; every field must be set.

func (InspectionConfig) Validate added in v1.0.179

func (c InspectionConfig) Validate() error

Validate reports whether the InspectionConfig is safe and internally consistent. Zero, negative, over-cap, or inconsistent limits are rejected.

type InspectionLimits added in v1.0.179

type InspectionLimits struct {
	// contains filtered or unexported fields
}

InspectionLimits is an immutable, validated inspection bound set.

func DefaultGatewayInspection added in v1.0.179

func DefaultGatewayInspection() InspectionLimits

DefaultGatewayInspection returns the validated Gateway inspection default bounds.

func DefaultManagementInspection added in v1.0.179

func DefaultManagementInspection() InspectionLimits

DefaultManagementInspection returns the validated Management inspection default bounds.

func NewInspection added in v1.0.179

func NewInspection(c InspectionConfig) (InspectionLimits, error)

NewInspection validates c and returns an immutable InspectionLimits, or an error.

func (InspectionLimits) MaxArgNodes added in v1.0.179

func (l InspectionLimits) MaxArgNodes() int

MaxArgNodes returns the maximum nodes in a decoded argument value.

func (InspectionLimits) MaxBytesPerString added in v1.0.179

func (l InspectionLimits) MaxBytesPerString() int

MaxBytesPerString returns the maximum bytes scanned in any one string leaf.

func (InspectionLimits) MaxDNSAddresses added in v1.0.179

func (l InspectionLimits) MaxDNSAddresses() int

MaxDNSAddresses returns the maximum addresses accepted per DNS answer.

func (InspectionLimits) MaxDNSConcurrency added in v1.0.179

func (l InspectionLimits) MaxDNSConcurrency() int

MaxDNSConcurrency returns the maximum concurrent DNS resolutions.

func (InspectionLimits) MaxDNSWork added in v1.0.179

func (l InspectionLimits) MaxDNSWork() int

MaxDNSWork returns the maximum CNAME/lookup work units per resolution.

func (InspectionLimits) MaxExtractedDests added in v1.0.179

func (l InspectionLimits) MaxExtractedDests() int

MaxExtractedDests returns the maximum destinations extracted from one value.

func (InspectionLimits) MaxExtractionPaths added in v1.0.179

func (l InspectionLimits) MaxExtractionPaths() int

MaxExtractionPaths returns the maximum compiled destination-extraction paths.

func (InspectionLimits) MaxFindings added in v1.0.179

func (l InspectionLimits) MaxFindings() int

MaxFindings returns the maximum DLP/injection findings in one value.

func (InspectionLimits) MaxHostBytes added in v1.0.179

func (l InspectionLimits) MaxHostBytes() int

MaxHostBytes returns the maximum bytes of one destination host.

func (InspectionLimits) MaxInjectionOps added in v1.0.179

func (l InspectionLimits) MaxInjectionOps() int

MaxInjectionOps returns the maximum injection-detector operations.

func (InspectionLimits) MaxOutputBytes added in v1.0.179

func (l InspectionLimits) MaxOutputBytes() int

MaxOutputBytes returns the maximum bytes of one upstream response body.

func (InspectionLimits) MaxOutputNodes added in v1.0.179

func (l InspectionLimits) MaxOutputNodes() int

MaxOutputNodes returns the maximum nodes in a decoded output value.

func (InspectionLimits) MaxQueryBytes added in v1.0.179

func (l InspectionLimits) MaxQueryBytes() int

MaxQueryBytes returns the maximum bytes of one destination query string.

func (InspectionLimits) MaxRedactions added in v1.0.179

func (l InspectionLimits) MaxRedactions() int

MaxRedactions returns the maximum redactions applied in one transform.

func (InspectionLimits) MaxRedirectEvidence added in v1.0.179

func (l InspectionLimits) MaxRedirectEvidence() int

MaxRedirectEvidence returns the maximum recorded redirect-hop evidence entries.

func (InspectionLimits) MaxRedirectHops added in v1.0.179

func (l InspectionLimits) MaxRedirectHops() int

MaxRedirectHops returns the maximum redirect hops in one chain.

func (InspectionLimits) MaxSafeResultBytes added in v1.0.179

func (l InspectionLimits) MaxSafeResultBytes() int

MaxSafeResultBytes returns the maximum bytes of a sanitized safe result.

func (InspectionLimits) MaxSchemaAlternatives added in v1.0.179

func (l InspectionLimits) MaxSchemaAlternatives() int

MaxSchemaAlternatives returns the maximum anyOf/enum alternatives.

func (InspectionLimits) MaxSchemaBytes added in v1.0.179

func (l InspectionLimits) MaxSchemaBytes() int

MaxSchemaBytes returns the maximum bytes of one tool schema.

func (InspectionLimits) MaxSchemaNodes added in v1.0.179

func (l InspectionLimits) MaxSchemaNodes() int

MaxSchemaNodes returns the maximum compiled schema nodes.

func (InspectionLimits) MaxStringsScanned added in v1.0.179

func (l InspectionLimits) MaxStringsScanned() int

MaxStringsScanned returns the maximum string leaves scanned in one value.

func (InspectionLimits) MaxTotalScanBytes added in v1.0.179

func (l InspectionLimits) MaxTotalScanBytes() int

MaxTotalScanBytes returns the maximum total bytes scanned across one value.

func (InspectionLimits) MaxTransformedBytes added in v1.0.179

func (l InspectionLimits) MaxTransformedBytes() int

MaxTransformedBytes returns the maximum transformed output bytes.

func (InspectionLimits) MaxTruncatedTextBytes added in v1.0.179

func (l InspectionLimits) MaxTruncatedTextBytes() int

MaxTruncatedTextBytes returns the maximum text a display truncation may keep.

func (InspectionLimits) MaxURLBytes added in v1.0.179

func (l InspectionLimits) MaxURLBytes() int

MaxURLBytes returns the maximum bytes of one destination URL.

func (InspectionLimits) MaxValidationOps added in v1.0.179

func (l InspectionLimits) MaxValidationOps() int

MaxValidationOps returns the maximum value-validation operations.

type Limits

type Limits struct {
	// contains filtered or unexported fields
}

Limits is an immutable, validated bound set.

func DefaultGateway

func DefaultGateway() Limits

DefaultGateway returns the validated Gateway default limit set.

func DefaultManagement

func DefaultManagement() Limits

DefaultManagement returns the validated Management default limit set.

func New

func New(c Config) (Limits, error)

New validates c and returns an immutable Limits, or an error.

func (Limits) MaxArrayElements

func (l Limits) MaxArrayElements() int

MaxArrayElements returns the maximum elements in any one JSON array.

func (Limits) MaxDepth

func (l Limits) MaxDepth() int

MaxDepth returns the maximum JSON nesting depth.

func (Limits) MaxErrorDataBytes

func (l Limits) MaxErrorDataBytes() int

MaxErrorDataBytes returns the maximum bytes of an error data member.

func (Limits) MaxFrameBytes

func (l Limits) MaxFrameBytes() int

MaxFrameBytes returns the maximum bytes of a single wire frame.

func (Limits) MaxIDBytes

func (l Limits) MaxIDBytes() int

MaxIDBytes returns the maximum encoded bytes of a request/response id.

func (Limits) MaxMethodBytes

func (l Limits) MaxMethodBytes() int

MaxMethodBytes returns the maximum bytes of a method name.

func (Limits) MaxObjectMembers

func (l Limits) MaxObjectMembers() int

MaxObjectMembers returns the maximum members in any one JSON object.

func (Limits) MaxOutstandingPerSession

func (l Limits) MaxOutstandingPerSession() int

MaxOutstandingPerSession returns the maximum in-flight requests per (session, direction).

func (Limits) MaxSessions

func (l Limits) MaxSessions() int

MaxSessions returns the maximum concurrent sessions per capability.

func (Limits) MaxStringBytes

func (l Limits) MaxStringBytes() int

MaxStringBytes returns the maximum bytes of any one JSON string.

func (Limits) MaxTotalOutstanding

func (l Limits) MaxTotalOutstanding() int

MaxTotalOutstanding returns the maximum in-flight requests fleet-wide per capability.

func (Limits) SessionTTL

func (l Limits) SessionTTL() time.Duration

SessionTTL returns the lifecycle idle timeout / expiry window.

Jump to

Keyboard shortcuts

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