credentialwire

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: AGPL-3.0 Imports: 4 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 credentialwire defines the credential wire vocabulary and admission limits. It has no dependency on a transport, generated messages, or the public SDK.

Index

Constants

View Source
const (
	// Namespace identifies the descriptor package subject to credential admission.
	Namespace = "omniview.sdk.credential.v1"
	// Version identifies the exact wire cohort; equal unsupported versions cannot negotiate.
	Version uint32 = 1
	// MaxFrameBytes bounds the encoded body before decoding. Sixteen full 64 KiB
	// values fill 1 MiB before keys or framing, independent of the field count cap.
	MaxFrameBytes = 1 << 20
	// MaxMaterialBytes admits the measured 19,640-byte RSA-4096 PEM chain or
	// 18,709-byte signed OpenSSH certificate intact; each private key is a separate field.
	MaxMaterialBytes = 64 << 10
	// MaxMaterialFields caps the number of separately named values in a credential.
	MaxMaterialFields = 32
	// MaxTypes bounds schema declarations admitted from one inventory.
	MaxTypes = 64
	// MaxIssuers bounds issuer declarations admitted from one inventory.
	MaxIssuers = 64
	// MaxSlots limits the number of distinct requirements in one slot list.
	MaxSlots = 32
	// MaxSources limits the number of scoped references a single operation can attach.
	MaxSources = 32
	// MaxCandidates keeps a discovery pull bounded even for metadata-only candidates.
	MaxCandidates = 128
	// MaxClaims caps the number of target assertions that require inspection.
	MaxClaims = 32
	// MaxParentLeases bounds the direct dependencies recorded for one issued lease.
	MaxParentLeases = 16
	// MaxScopeEntries bounds the reserved scope list without enabling its use.
	MaxScopeEntries = 32
	// MaxPrincipalChain bounds the reserved delegation chain without enabling its use.
	MaxPrincipalChain = 8
	// MaxIDBytes bounds ordinary wire identifiers, including local issuer and slot names.
	MaxIDBytes = 128
	// MaxPluginIDBytes admits a full 255-byte filesystem component. State uses the
	// same component grammar but does not itself impose a wire length limit.
	MaxPluginIDBytes = 255
	// MaxTypeIDBytes bounds the complete namespace.name/vN. A 255-byte plugin ID
	// and 128-byte local name still leave 126 decimal version digits after punctuation.
	MaxTypeIDBytes = 512
	// MaxConnectionIDBytes matches native metadata. Existing provider-defined
	// connection IDs (such as a 143-byte EKS context) must not be truncated.
	MaxConnectionIDBytes = identity.MaxConnectionIDBytes
	// MaxLabelBytes keeps a metadata label small enough for bounded presentation.
	MaxLabelBytes = 256
	// MaxClaimBytes prevents one target assertion from carrying a bulk value.
	MaxClaimBytes = 512
	// MaxPendingBytes limits the continuation data the host may retain for a pending operation.
	MaxPendingBytes = 4 << 10
	// MaxPrivateStateBytes limits sealed state returned to the issuing plugin.
	MaxPrivateStateBytes = 16 << 10
	// MaxPromptAnswerBytes keeps protected answers at the original 16 KiB limit;
	// accepting larger certificates does not expand the prompt channel.
	MaxPromptAnswerBytes = 16 << 10
	// MaxImportBytes admits the measured 204,549-byte eight-context inline kubeconfig
	// as a document, not a material field. Import larger configurations by context.
	MaxImportBytes = 512 << 10
	// MaxHandleBytes keeps ordinary opaque lease and source references bounded.
	MaxHandleBytes = 512
	// MaxURLBytes limits each proposed destination before destination policy is applied.
	MaxURLBytes = 2048
	// MaxFeatures bounds work per advertisement, including names not known to this cohort.
	MaxFeatures = 32
	// MaxDepth bounds the admission stack for nested messages.
	MaxDepth = 8
	// MaxFrameFields bounds work for many tiny fields across an entire frame.
	MaxFrameFields = 16384
	// MaxFrameNodes bounds the number of message nodes visited across an entire frame.
	MaxFrameNodes = 4096
	// MaxImportDrafts bounds each collection of proposals in one import preview.
	MaxImportDrafts = 32
	// MaxPromptKinds is the number of distinct v1 interaction variants.
	MaxPromptKinds = 4
)
View Source
const (
	Bearer        = "core.bearer/v1" // #nosec G101 -- Public schema ID, not a credential value.
	Basic         = "core.basic/v1"
	X509          = "core.x509/v1"
	SSHKey        = "core.ssh-key/v1"
	SSHCert       = "core.ssh-cert/v1"
	OAuthTokenSet = "core.oauth-token-set/v1" // #nosec G101 -- Public schema ID, not a credential value.
	Opaque        = "core.opaque/v1"

	TTLBound = "ttl-bound"
	Explicit = "explicit"
	Verified = "verified"

	DeviceCode      = "device-code"
	OpenURL         = "open-url"
	FormMFA         = "form-mfa"
	ApprovalPending = "approval-pending"

	Active      = "active"
	Revoked     = "revoked"
	Unknown     = "unknown"
	Unavailable = "unavailable"

	CredentialRequired       = "CREDENTIAL_REQUIRED" // #nosec G101 -- Public status classification.
	ReauthenticationRequired = "REAUTHENTICATION_REQUIRED"
	AccessRequired           = "ACCESS_REQUIRED"
)

V1 names shared by raw admission and native credential declarations.

Variables

This section is empty.

Functions

func ValidDeclaredTypeID

func ValidDeclaredTypeID(id string) bool

ValidDeclaredTypeID checks syntax, not ownership. The last dot separates the full installed plugin ID from the slot-style local name. Only the exact core namespace is reserved. N is positive decimal with no leading zero; its only size limit is the byte budget for the entire ID.

func ValidDelivery

func ValidDelivery(mode string) bool

ValidDelivery requires explicit material delivery in v1. The injected and identity modes are reserved, not fallbacks for a missing or unknown mode.

func ValidFailureCode

func ValidFailureCode(code string) bool

ValidFailureCode admits only reviewed codes for a credential status detail.

func ValidFeature

func ValidFeature(feature string) bool

ValidFeature admits the syntax credential.<slot-name>.vN, with a positive decimal N and no leading zero. Valid syntax does not imply a known feature.

func ValidFieldName

func ValidFieldName(name string) bool

ValidFieldName uses slot-name syntax, also permitting an interior underscore as a separator (as in private_key). Separators cannot be adjacent.

func ValidIssuer

func ValidIssuer(name string) bool

ValidIssuer accepts a local issuer name with the same grammar as a slot. The plugin namespace is a separate field on issuer references.

func ValidPluginID

func ValidPluginID(id string) bool

ValidPluginID admits the installed state-component grammar within the wire byte limit. It does not look up, normalize, or establish ownership of an ID.

func ValidPromptKind

func ValidPromptKind(kind string) bool

ValidPromptKind admits only a v1 interaction declaration, never a grant to prompt.

func ValidRevocation

func ValidRevocation(class string) bool

ValidRevocation admits only the three defined revocation assurance classes.

func ValidSlot

func ValidSlot(name string) bool

ValidSlot accepts [a-z][a-z0-9]*(-[a-z0-9]+)*, up to MaxIDBytes bytes.

func ValidText

func ValidText(value string) bool

ValidText admits nonempty printable UTF-8. Callers impose the field's byte limit.

func ValidTypeID

func ValidTypeID(id string) bool

ValidTypeID accepts namespace.name/vN references. Only the seven canonical v1 IDs below exist in the reserved core namespace; none can be declared.

Types

This section is empty.

Directories

Path Synopsis
Package channel observes transport lifetimes for the credential binding.
Package channel observes transport lifetimes for the credential binding.

Jump to

Keyboard shortcuts

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