Versions in this module Expand all Collapse all v0 v0.25.0 Dec 1, 2026 Changes in this version + const PluginID + const TypeBasic + const TypeBearer + const TypeOAuthTokenSet + const TypeOpaque + const TypeSSHCert + const TypeSSHKey + const TypeX509 + var ErrInvalidMaterial = errors.New("invalid credential material") + func OneCandidate(key string, metadata Metadata) func(context.Context) ([]Candidate, error) + func ProviderError(err error) error + func ReadBasic(m Material) ([]byte, []byte, error) + func ReadBearer(m Material) ([]byte, error) + func ReadOAuthTokenSet(m Material) ([]byte, []byte, []byte, error) + func ReadOpaque(m Material) ([]byte, error) + func ReadSSHCert(m Material) ([]byte, []byte, error) + func ReadSSHKey(m Material) ([]byte, error) + func ReadX509(m Material) ([]byte, []byte, error) + func RegisterPlugin(p *sdk.Plugin, opts PluginOpts) error + type ApprovalPendingPrompt struct + func (ApprovalPendingPrompt) Format(s fmt.State, _ rune) + func (ApprovalPendingPrompt) GoString() string + func (ApprovalPendingPrompt) GobEncode() ([]byte, error) + func (ApprovalPendingPrompt) MarshalJSON() ([]byte, error) + func (ApprovalPendingPrompt) String() string + type Candidate struct + Key string + Metadata Metadata + type Claim struct + Kind string + Value string + type ConnectionDraft struct + Endpoint string + Label string + Plugin string + Slots map[string]string + type CredentialDraft struct + Key string + Material Material + Metadata Metadata + func (CredentialDraft) Format(s fmt.State, _ rune) + func (CredentialDraft) GoString() string + func (CredentialDraft) GobEncode() ([]byte, error) + func (CredentialDraft) MarshalJSON() ([]byte, error) + func (CredentialDraft) String() string + type DeviceCodePrompt struct + UserCode string + VerificationURI string + func (DeviceCodePrompt) Format(s fmt.State, _ rune) + func (DeviceCodePrompt) GoString() string + func (DeviceCodePrompt) GobEncode() ([]byte, error) + func (DeviceCodePrompt) MarshalJSON() ([]byte, error) + func (DeviceCodePrompt) String() string + type Expiry struct + func Static() Expiry + func UnknownUntilRejected() Expiry + func Until(at time.Time) Expiry + func (e Expiry) ExpiresAt() (time.Time, bool) + func (e Expiry) IsStatic() bool + func (e Expiry) IsUnknownUntilRejected() bool + type FailureError struct + Kind RequirementError + Slot string + SuggestedIssuer *IssuerRef + func (e *FailureError) Error() string + func (e *FailureError) GRPCStatus() *status.Status + func (e *FailureError) Unwrap() error + type Field struct + Format string + Multiline bool + Name string + Required bool + Secret bool + type FormPrompt struct + Fields []Field + func (FormPrompt) Format(s fmt.State, _ rune) + func (FormPrompt) GoString() string + func (FormPrompt) GobEncode() ([]byte, error) + func (FormPrompt) MarshalJSON() ([]byte, error) + func (FormPrompt) String() string + type HostService interface + Get func(ctx context.Context, sourceRef []byte) (Lease, error) + Invalidate func(ctx context.Context, sourceRef, leaseHandle []byte, revision uint64, ...) error + Prompt func(ctx context.Context, operationID string, prompt Prompt) (PromptDisposition, error) + Watch func(ctx context.Context, sourceRef []byte) (Replacement, ReplacementStream, error) + type ImportRequest struct + Document []byte + Type string + func (ImportRequest) Format(s fmt.State, _ rune) + func (ImportRequest) GoString() string + func (ImportRequest) GobEncode() ([]byte, error) + func (ImportRequest) MarshalJSON() ([]byte, error) + func (ImportRequest) String() string + type ImportResult struct + Connections []ConnectionDraft + Credentials []CredentialDraft + func (ImportResult) Format(s fmt.State, _ rune) + func (ImportResult) GoString() string + func (ImportResult) GobEncode() ([]byte, error) + func (ImportResult) MarshalJSON() ([]byte, error) + func (ImportResult) String() string + type Inventory struct + Issuers []IssuerDeclaration + Slots []Slot + Types []TypeDeclaration + type IssueRequest struct + CandidateKey string + Inputs []SourceRef + IssuerID string + MaxTTL time.Duration + OperationID string + PendingHandle []byte + ProtectedPromptAnswer []byte + Silent bool + Target []Claim + func (IssueRequest) Format(s fmt.State, _ rune) + func (IssueRequest) GoString() string + func (IssueRequest) GobEncode() ([]byte, error) + func (IssueRequest) MarshalJSON() ([]byte, error) + func (IssueRequest) String() string + func (r IssueRequest) Input(ctx context.Context, name string) (Lease, error) + func (r IssueRequest) Prompt(ctx context.Context, p Prompt) (PromptDisposition, error) + type IssueResult interface + type IssuedLease struct + Expiry Expiry + IssuerPrivateState []byte + Material Material + MaxTTL time.Duration + RenewAfter time.Time + Renewable bool + func Issued(m Material, e Expiry) IssuedLease + func (IssuedLease) Format(s fmt.State, _ rune) + func (IssuedLease) GoString() string + func (IssuedLease) GobEncode() ([]byte, error) + func (IssuedLease) MarshalJSON() ([]byte, error) + func (IssuedLease) String() string + type Issuer struct + Discover func(context.Context) ([]Candidate, error) + ID string + Interaction []PromptKind + Issue func(context.Context, IssueRequest) (IssueResult, error) + Observe func(context.Context, LeaseOperation) (Observation, error) + Produces string + Renew func(context.Context, LeaseOperation) (IssueResult, error) + Requires []Slot + Revocation RevocationClass + Revoke func(context.Context, LeaseOperation) (Observation, error) + type IssuerDeclaration struct + ID string + Interaction []PromptKind + Observes bool + Produces string + Renews bool + Requires []Slot + Revocation RevocationClass + Revokes bool + type IssuerRef struct + Issuer string + Plugin string + type Lease struct + Expiry Expiry + Handle []byte + Issuer IssuerRef + Material Material + MaxTTL time.Duration + ParentLeases [][]byte + RenewAfter time.Time + Renewable bool + Revision uint64 + Revocation RevocationClass + Type string + func (Lease) Format(s fmt.State, _ rune) + func (Lease) GoString() string + func (Lease) GobEncode() ([]byte, error) + func (Lease) MarshalJSON() ([]byte, error) + func (Lease) String() string + func (l *Lease) Wipe() + type LeaseOperation struct + Inputs []SourceRef + IssuerID string + IssuerPrivateState []byte + LeaseHandle []byte + MaxTTL time.Duration + OperationID string + PendingHandle []byte + ProtectedPromptAnswer []byte + Revision uint64 + Silent bool + func (LeaseOperation) Format(s fmt.State, _ rune) + func (LeaseOperation) GoString() string + func (LeaseOperation) GobEncode() ([]byte, error) + func (LeaseOperation) MarshalJSON() ([]byte, error) + func (LeaseOperation) String() string + func (r LeaseOperation) Input(ctx context.Context, name string) (Lease, error) + func (r LeaseOperation) Prompt(ctx context.Context, p Prompt) (PromptDisposition, error) + type Manager struct + func NewManager(owner string, opts PluginOpts) (*Manager, error) + type Material map[string][]byte + func Basic(username, password []byte) Material + func Bearer(token []byte) Material + func OAuthTokenSet(accessToken, refreshToken, tokenType []byte) Material + func Opaque(value []byte) Material + func SSHCert(certificate, privateKey []byte) Material + func SSHKey(privateKey []byte) Material + func X509(certificateChain, privateKey []byte) Material + func (Material) Format(s fmt.State, verb rune) + func (Material) GoString() string + func (Material) GobEncode() ([]byte, error) + func (Material) MarshalJSON() ([]byte, error) + func (Material) String() string + func (m Material) Wipe() + type Metadata struct + IdentityLabel string + PrivilegeTier *PrivilegeTier + Provenance string + TargetClaims []Claim + Type string + type Observation struct + ObservedAt time.Time + Outcome ObservationOutcome + type ObservationOutcome string + const ObservationActive + const ObservationRevoked + const ObservationUnavailable + const ObservationUnknown + type OpenURLPrompt struct + AuthorizationURI string + LoopbackSession string + func (OpenURLPrompt) Format(s fmt.State, _ rune) + func (OpenURLPrompt) GoString() string + func (OpenURLPrompt) GobEncode() ([]byte, error) + func (OpenURLPrompt) MarshalJSON() ([]byte, error) + func (OpenURLPrompt) String() string + type Pending struct + Handle []byte + RetryAfter time.Duration + func (Pending) Format(s fmt.State, _ rune) + func (Pending) GoString() string + func (Pending) GobEncode() ([]byte, error) + func (Pending) MarshalJSON() ([]byte, error) + func (Pending) String() string + type Plugin struct + Impl *Manager + func (p *Plugin) Close() error + func (p *Plugin) GRPCClient(lifetime context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (any, error) + func (p *Plugin) GRPCDialOption() grpc.DialOption + func (p *Plugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error + type PluginClient struct + func (p *PluginClient) AttachSources(ctx context.Context, connection string, revision uint64, sources []SourceRef) (err error) + func (p *PluginClient) Declarations(ctx context.Context, owner string) (Inventory, error) + func (p *PluginClient) Describe(ctx context.Context, id string, material Material) (Metadata, error) + func (p *PluginClient) Discover(ctx context.Context, issuer string) ([]Candidate, error) + func (p *PluginClient) Import(ctx context.Context, r ImportRequest) (ImportResult, error) + func (p *PluginClient) Issue(ctx context.Context, r IssueRequest) (IssueResult, error) + func (p *PluginClient) Negotiate(ctx context.Context, supported []protocol.Feature) ([]protocol.Feature, error) + func (p *PluginClient) Observe(ctx context.Context, op LeaseOperation) (Observation, error) + func (p *PluginClient) Renew(ctx context.Context, op LeaseOperation) (IssueResult, error) + func (p *PluginClient) Revoke(ctx context.Context, op LeaseOperation) (Observation, error) + func (p *PluginClient) ServeCredentials(ctx context.Context, service HostService) (func(), error) + func (p *PluginClient) Validate(ctx context.Context, id string, material Material) error + type PluginOpts struct + Issuers []Issuer + Slots []Slot + Types []Type + type PrivilegeTier struct + Ordinal uint32 + Scale string + type Prompt interface + type PromptDisposition string + const PromptCancelled + const PromptDenied + const PromptPresented + type PromptKind string + const KindApprovalPending + const KindDeviceCode + const KindFormMFA + const KindOpenURL + type RejectionReason string + const TargetRejected + type Replacement struct + Revision uint64 + Status ReplacementStatus + type ReplacementStatus string + const StatusActive + const StatusExpired + const StatusIssuing + const StatusNeedsInteraction + const StatusPendingApproval + const StatusRefreshing + const StatusRevokeUnverified + const StatusRevoked + const StatusRevoking + const StatusUnbound + type ReplacementStream interface + Close func() error + Recv func() (Replacement, error) + type RequirementError uint8 + const ErrAccessRequired + const ErrCredentialRequired + const ErrInteractionRequired + func (k RequirementError) Error() string + type RevocationClass string + const Explicit + const TTLBound + const Verified + type Slot struct + Accepts []string + Name string + type Source interface + Get func(context.Context) (Lease, error) + Invalidate func(context.Context, Lease, RejectionReason) error + Watch func(context.Context) (ReplacementStream, error) + func SourceFor(ctx context.Context, slot string) (Source, error) + type SourceError uint8 + const ErrLeaseExpired + const ErrNoSourceContext + const ErrSourceRetired + const ErrUnknownSlot + func (e SourceError) Error() string + func (e SourceError) GRPCStatus() *status.Status + type SourceRef struct + Ref []byte + Slot string + func (SourceRef) Format(s fmt.State, _ rune) + func (SourceRef) GoString() string + func (SourceRef) GobEncode() ([]byte, error) + func (SourceRef) MarshalJSON() ([]byte, error) + func (SourceRef) String() string + type Type struct + Describe func(context.Context, Material) (Metadata, error) + Extends string + Fields []Field + ID string + Import func(context.Context, ImportRequest) (ImportResult, error) + Validate func(context.Context, Material) error + type TypeDeclaration struct + Describes bool + Extends string + Fields []Field + ID string + Imports bool