Documentation
¶
Index ¶
- func Setup(ctx context.Context, cmd *cli.Command) (context.Context, error)
- type CommandContext
- func (c *CommandContext) GetAuthorizationServer(requirePAR bool) *authlib.AuthorizationServerConfig
- func (c *CommandContext) GetRequestOptions() []authlib.Option
- func (c *CommandContext) RequireAuthorizationEndpoint() (string, error)
- func (c *CommandContext) RequireClient() (*authlib.Client, error)
- func (c *CommandContext) RequireDeviceEndpoint() (string, error)
- func (c *CommandContext) RequireHTTPClient() (*http.Client, error)
- func (c *CommandContext) RequirePAREndpoint() (string, error)
- func (c *CommandContext) RequireRegistrationEndpoint() (string, error)
- func (c *CommandContext) RequireTokenEndpoint() (string, error)
- type EndpointConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandContext ¶
type CommandContext struct {
// Client is the configured OAuth client
Client *authlib.Client
// HTTPClient is the HTTP client for making requests
HTTPClient *http.Client
// Scope is the requested OAuth scopes
Scope string
// Endpoints contains discovered or explicitly configured endpoints
Endpoints *EndpointConfig
// DPoPKey is the DPoP proof generator if DPoP is enabled
DPoPKey authlib.DPoPProofGenerator
}
CommandContext holds shared configuration for all commands.
func Get ¶
func Get(ctx context.Context) (*CommandContext, error)
Get retrieves the CommandContext from the context.
func (*CommandContext) GetAuthorizationServer ¶
func (c *CommandContext) GetAuthorizationServer(requirePAR bool) *authlib.AuthorizationServerConfig
GetAuthorizationServer returns an AuthorizationServer for the given endpoints.
func (*CommandContext) GetRequestOptions ¶
func (c *CommandContext) GetRequestOptions() []authlib.Option
GetRequestOptions returns common request options including HTTP client and DPoP.
func (*CommandContext) RequireAuthorizationEndpoint ¶
func (c *CommandContext) RequireAuthorizationEndpoint() (string, error)
RequireAuthorizationEndpoint returns the authorization endpoint or an error.
func (*CommandContext) RequireClient ¶
func (c *CommandContext) RequireClient() (*authlib.Client, error)
RequireClient returns the configured client or an error if not set.
func (*CommandContext) RequireDeviceEndpoint ¶
func (c *CommandContext) RequireDeviceEndpoint() (string, error)
RequireDeviceEndpoint returns the device authorization endpoint or an error.
func (*CommandContext) RequireHTTPClient ¶
func (c *CommandContext) RequireHTTPClient() (*http.Client, error)
RequireHTTPClient returns the HTTP client or an error if not set.
func (*CommandContext) RequirePAREndpoint ¶
func (c *CommandContext) RequirePAREndpoint() (string, error)
RequirePAREndpoint returns the PAR endpoint or an error.
func (*CommandContext) RequireRegistrationEndpoint ¶
func (c *CommandContext) RequireRegistrationEndpoint() (string, error)
RequireRegistrationEndpoint returns the registration endpoint or an error.
func (*CommandContext) RequireTokenEndpoint ¶
func (c *CommandContext) RequireTokenEndpoint() (string, error)
RequireTokenEndpoint returns the token endpoint or an error.