Documentation
¶
Index ¶
- Constants
- func CallbackFields(input, redirect, expected string, allowCode bool) (map[string]string, error)
- func Expand(template string, fields map[string]string) (string, error)
- func Granted(status int, document any) error
- func HTTPClient() *http.Client
- func Prepare(ctx context.Context, endpoint protocol.PluginModelAuthEndpoint, ...) (*http.Request, error)
- func Response(ctx context.Context, client *http.Client, ...) (int, any, error)
- func ValidateGrant(body []byte, authentication protocol.Authentication, now time.Time) error
- func ValidateRedirect(value string, declaration protocol.PluginModelAuthCallback) error
- func VerifyIdentity(ctx context.Context, client *http.Client, issuer, token, audience string, ...) (map[string]any, error)
- type Input
- type Issued
- type Result
Constants ¶
View Source
const BodyLimit = 64 * 1024
View Source
const Deadline = 15 * time.Minute
Variables ¶
This section is empty.
Functions ¶
func CallbackFields ¶
func Granted ¶
Granted reads a token endpoint's answer: nil for an issued token, a permission fault when the provider definitely refused the grant, and an unavailable fault for every answer that leaves the grant's fate open.
func HTTPClient ¶
func ValidateGrant ¶
func ValidateRedirect ¶
func ValidateRedirect(value string, declaration protocol.PluginModelAuthCallback) error
Types ¶
type Input ¶
type Input struct {
Declaration protocol.PluginModelAuthDeclaration
Fields map[string]string
Redirect string
Callback <-chan string
Bundle *plugins.ScriptBundle
Previous any
HostID string
Registration *string
Registered func(context.Context, string) error
Client *http.Client
Clock clockwork.Clock
Progress func(protocol.ConversationLoginState) error
}
type Issued ¶
type Issued struct {
AccountLabel *string `json:"account_label,omitempty"`
Access string `json:"access"`
IssuedAtMs *uint64 `json:"issued_at_ms,omitempty"`
Refresh *string `json:"refresh"`
ExpiresAtMs *uint64 `json:"expires_at_ms"`
Extra map[string]string `json:"extra"`
}
func ParseIssued ¶
Click to show internal directories.
Click to hide internal directories.