Documentation
¶
Overview ¶
Package mcpoauthpage renders the page a browser lands on after an MCP OAuth redirect reaches the daemon's loopback callback. The page is standalone: its styles, fonts and brand images are embedded and inlined as data URIs, so it needs no other route and runs under a CSP that only admits its own hashed style and script.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentSecurityPolicy ¶
func ContentSecurityPolicy() string
ContentSecurityPolicy is the policy every rendered page must be served with.
Types ¶
type Outcome ¶
type Outcome string
Outcome is what the callback did, as the person in the browser needs to know it.
const ( // OutcomeConnected means the token was stored and the server is usable. OutcomeConnected Outcome = "connected" // OutcomeDeclined means the provider redirected back with an OAuth error. OutcomeDeclined Outcome = "declined" // OutcomeExpired means the sign-in no longer exists: past its TTL or already used. OutcomeExpired Outcome = "expired" // OutcomeChanged means the server definition changed while the sign-in was open. OutcomeChanged Outcome = "changed" OutcomeUnavailable Outcome = "unavailable" // OutcomeFailed is every other failure; Diagnostic carries the reason. OutcomeFailed Outcome = "failed" )
type Page ¶
type Page struct {
Outcome Outcome
Server *Server
Scope mcpauth.Scope
ProjectName string
Scopes []string
Refreshable bool
ExpiresAt *time.Time
// Code is the machine-readable reason shown under a failure message.
Code string
// Diagnostic is a copyable summary for unclassified failures; it never holds raw error text.
Diagnostic string
Now time.Time
}
Page is one rendered outcome. Server is nil when the callback no longer resolves to a sign-in.
Click to show internal directories.
Click to hide internal directories.