{"modulePath":"github.com/agentshield-dev/agentshield","version":"v0.0.1-rc.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package projectkit\n\nPackage projectkit holds the deterministic encoding and Kubernetes object helpers shared by AgentShield plugin projectors.\n\nEvery value produced here feeds graph identity qualifiers, configuration digests, attributes, or evidence IDs, so the output format is a stability contract: changing it changes published assertions and retracts the previous ones on the next contribution replacement. Treat any change as a new rule ID in every affected projector.\n\n## Functions\n\n```go\nfunc Digest(value any) string\n```\nDigest returns the hex SHA-256 of the canonical JSON encoding of value. It panics under the same conditions as MustCanonicalJSON.\n\n```go\nfunc DisplayName(item *unstructured.Unstructured) string\n```\nDisplayName returns namespace/name for namespaced objects and name for cluster-scoped ones. Display names are mutable attributes, never identity.\n\n```go\nfunc KubernetesEventID(key, resourceVersion, operation string) string\n```\nKubernetesEventID is the native event ID the Kubernetes plugin publishes for one operation (\"upsert\" or \"delete\") on one revision of the object with [ObjectKey](#ObjectKey) key. Projectors cite the same ID through [KubernetesEvidenceID](#KubernetesEvidenceID) or the collection change's EventID, so evidence resolves to its receipt.\n\n```go\nfunc KubernetesEvidenceID(item *unstructured.Unstructured) string\n```\nKubernetesEvidenceID names the Kubernetes observation that supports an assertion. With a resource version it is the [KubernetesEventID](#KubernetesEventID) of that revision's upsert; without one, typically for fixture or synthesized objects, it falls back to the UID alone.\n\n```go\nfunc MustCanonicalJSON(value any) string\n```\nMustCanonicalJSON encodes value with encoding/json, which sorts map keys and emits struct fields in declaration order. Callers sort set-like slices first.\n\nProjector inputs are plain strings, numbers, bools, slices, string-keyed maps, and values already decoded from provider JSON, none of which can fail to marshal. A failure therefore means a projector passed an unsupported type such as a channel, func, or non-finite float; MustCanonicalJSON panics rather than returning an empty string that would silently collapse distinct qualifiers and digests into one.\n\n```go\nfunc ObjectKey(item *unstructured.Unstructured) string\n```\nObjectKey returns the lowercased apiVersion/kind/UID of item, or \"\" for nil. The UID makes it stable across renames and distinct across delete/recreate.\n\n```go\nfunc Qualifier(value any) string\n```\nQualifier returns a 24-hex-character SHA-256 prefix of the canonical JSON encoding of value. Relationship and facet qualifiers use it to distinguish semantically different assertions between the same endpoints without depending on input order or slice positions.\n\n```go\nfunc SecurityDigest(value any) string\n```\nSecurityDigest returns Digest prefixed with \"sha256:\", the form used for graph.SecuritySemantics configuration digests.\n\n","path":"github.com/agentshield-dev/agentshield/plugins/internal/projectkit","name":"projectkit","synopsis":"Package projectkit holds the deterministic encoding and Kubernetes object helpers shared by AgentShield plugin projectors.","isRedistributable":true}
