{"modulePath":"github.com/omniviewdev/plugin-sdk","version":"v0.25.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package protocol\n\nPackage protocol defines credential wire versions and feature negotiation. It does not register a service or install a gRPC codec.\n\n## Constants\n\n```go\nconst Version uint32 = cw.Version\n```\nVersion is the exact credential transport cohort, independent of type versions.\n\n## Types\n\n```go\ntype Feature string\n```\nFeature is a credential transport trait, not a grant to use an operation. A valid name has the form credential.\\\u003cname\u003e.vN: name starts with a lowercase ASCII letter and uses lowercase letters, digits, and single interior hyphens; N is positive decimal without a leading zero. Only the constants below are known to this cohort. A well-formed future name can never enable behavior here.\n\n```go\nconst (\n\t// FeatureMaterial is required on both peers before any credential operation.\n\tFeatureMaterial Feature = \"credential.material.v1\"\n\t// FeatureTypes advertises credential type operations.\n\tFeatureTypes Feature = \"credential.types.v1\"\n\t// FeatureIssuers advertises issuer operations.\n\tFeatureIssuers Feature = \"credential.issuers.v1\"\n\t// FeatureSlots advertises named consumer slots.\n\tFeatureSlots Feature = \"credential.slots.v1\"\n\t// FeatureHostCallback advertises the separate host callback protocol.\n\tFeatureHostCallback Feature = \"credential.host-callback.v1\"\n\t// FeaturePrompt advertises host-mediated interaction.\n\tFeaturePrompt Feature = \"credential.prompt.v1\"\n)\n```\n\n```go\nfunc Negotiate(localVersion, remoteVersion uint32, local, remote, required []Feature) ([]Feature, error)\n```\nNegotiate returns the mutually advertised known features in lexical order. Both versions must equal Version. FeatureMaterial is always required; every other required feature must also be known and advertised by both peers. Unknown, well-formed optional names add nothing. Lists have set semantics: repetitions add no support, but count toward the input limit. Negotiation neither replaces byte-level admission nor authorizes a bind or material use. A refusal returns a nil set and a NegotiationError, never a partial result.\n\n```go\ntype NegotiationError uint8\n```\nNegotiationError classifies a failed handshake without retaining peer input.\n\n```go\nconst (\n\t// ErrUnsupportedVersion means at least one peer did not offer this SDK's Version.\n\tErrUnsupportedVersion NegotiationError = iota + 1\n\t// ErrInvalidFeatures means a feature list exceeded the wire limit or a name was malformed.\n\tErrInvalidFeatures\n\t// ErrRequiredFeature means a required trait, including material, was not mutually supported.\n\tErrRequiredFeature\n)\n```\n\n```go\nfunc (r NegotiationError) Error() string\n```\nError returns a fixed diagnostic, never an advertised name or other peer data.\n\n","path":"github.com/omniviewdev/plugin-sdk/pkg/credential/protocol","name":"protocol","synopsis":"Package protocol defines credential wire versions and feature negotiation.","isRedistributable":true}
