Help us shape the future of Go! Take the 2026 Go Developer Survey

credentialruntime

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package credentialruntime defines transport-neutral contracts shared by the Vault application service and the outbound OAuth and MCP adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthSource

type AuthSource interface {
	ResolveMCPBearer(context.Context, string, string) (BearerCredential, bool, error)
}

AuthSource resolves the current credential for a Session and MCP URL. It is called for every outgoing MCP request so rotation, archival, and refresh take effect without restarting the Session.

type BearerCredential

type BearerCredential struct {
	Token        string
	VaultID      string
	CredentialID string
}

BearerCredential is a request-scoped runtime projection. Implementations must never persist or log Token.

type HTTPResponse

type HTTPResponse struct {
	Body          string `json:"body"`
	BodyTruncated bool   `json:"body_truncated"`
	ContentType   string `json:"content_type"`
	StatusCode    int    `json:"status_code"`
}

HTTPResponse is the bounded, scrubbed response projection exposed by OAuth validation. Adapters must remove credential material before populating Body.

type MCPProbeFailure

type MCPProbeFailure struct {
	Method       string        `json:"method"`
	HTTPResponse *HTTPResponse `json:"http_response"`
}

type MCPProbeResult

type MCPProbeResult struct {
	Verdict Verdict
	Failure *MCPProbeFailure
}

type MCPValidator

type MCPValidator interface {
	ValidateBearer(context.Context, string, string) (MCPProbeResult, error)
}

MCPValidator live-probes initialize and tools/list with a supplied bearer.

type OAuthRefreshRequest

type OAuthRefreshRequest struct {
	TokenEndpoint     string
	ClientID          string
	RefreshToken      string
	TokenEndpointAuth string
	ClientSecret      string
	Resource          string
	Scope             string
}

type OAuthRefreshResult

type OAuthRefreshResult struct {
	Status       OAuthRefreshStatus
	Verdict      Verdict
	HTTPResponse *HTTPResponse
	AccessToken  string
	RefreshToken *string
	ExpiresIn    *time.Duration
}

type OAuthRefreshStatus

type OAuthRefreshStatus string
const (
	OAuthRefreshSucceeded    OAuthRefreshStatus = "succeeded"
	OAuthRefreshFailed       OAuthRefreshStatus = "failed"
	OAuthRefreshConnectError OAuthRefreshStatus = "connect_error"
	OAuthRefreshUnavailable  OAuthRefreshStatus = "no_refresh_token"
)

type OAuthRefresher

type OAuthRefresher interface {
	Refresh(context.Context, OAuthRefreshRequest) (OAuthRefreshResult, error)
}

type Verdict

type Verdict string
const (
	VerdictValid   Verdict = "valid"
	VerdictInvalid Verdict = "invalid"
	VerdictUnknown Verdict = "unknown"
)

Jump to

Keyboard shortcuts

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