Documentation
¶
Overview ¶
Package mcpauth implements opt-in, source-scoped MCP OAuth transactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrAuthorizationDenied = errors.New("authorization was denied by the provider") )
Functions ¶
Types ¶
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
Flow owns one loopback callback listener and one authorization transaction. It must be closed when the explicit operator action ends.
func New ¶
func New(source, fingerprint, resourceURL string, open Open, observers ...func(...string)) (*Flow, error)
New creates the listener before dynamic client registration so its exact redirect URI can be registered. It never starts a browser without Open.
func NewWithClient ¶
func NewWithClient(source, fingerprint, resourceURL string, registration Registration, open Open, observers ...func(...string)) (*Flow, error)
NewWithClient also accepts an explicitly configured public client. It does not support embedded confidential client secrets.
func (*Flow) TokenSource ¶
type Open ¶
Open is an operator-only browser launcher. It must ask the person to review the host/scopes, then open startURL in an isolated browser. startURL points to a random loopback trampoline, not the authorization endpoint or a secret.
type Registration ¶
Registration optionally supplies a public pre-registered OAuth client ID. An HTTPS client ID with a non-root path can also be a metadata document.