Documentation
¶
Index ¶
- func RegisterHandlers(server *server.Server, grp *huma.Group)
- type CallbackInput
- type CallbackResponse
- type HandlerGroup
- func (self *HandlerGroup) Callback(ctx context.Context, in *CallbackInput) (*CallbackResponse, error)
- func (self *HandlerGroup) DevLogin(ctx context.Context, _ *server.EmptyInput) (*OauthLoginResponse, error)
- func (h *HandlerGroup) LoginSubmit(ctx context.Context, input *LoginSubmitInput) (*LoginSubmitResponse, error)
- type LoginForm
- type LoginSubmitInput
- type LoginSubmitResponse
- type OauthLoginResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
Types ¶
type CallbackInput ¶
type CallbackInput struct {
Code string `query:"code" required:"true"`
}
CallbackInput defines the query parameters for the callback endpoint.
type CallbackResponse ¶
type CallbackResponse struct { Body struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` RefreshToken string `json:"refresh_token"` IDToken string `json:"id_token"` Expiry time.Time `json:"expiry"` } }
CallbackResponse defines the JSON structure for the response. Huma will automatically encode this as JSON.
type HandlerGroup ¶
type HandlerGroup struct {
// contains filtered or unexported fields
}
func (*HandlerGroup) Callback ¶
func (self *HandlerGroup) Callback(ctx context.Context, in *CallbackInput) (*CallbackResponse, error)
Callback handles the OAuth2 callback.
func (*HandlerGroup) DevLogin ¶
func (self *HandlerGroup) DevLogin(ctx context.Context, _ *server.EmptyInput) (*OauthLoginResponse, error)
Login handles the OAuth login redirect.
func (*HandlerGroup) LoginSubmit ¶
func (h *HandlerGroup) LoginSubmit( ctx context.Context, input *LoginSubmitInput, ) (*LoginSubmitResponse, error)
type LoginForm ¶
type LoginForm struct { Username string `schema:"username" json:"username" form:"username" minLength:"1"` Password string `schema:"password" json:"password" form:"password" minLength:"1"` ClientID string `schema:"client_id" json:"client_id" form:"client_id" minLength:"1"` RedirectURI string `schema:"redirect_uri" json:"redirect_uri" form:"redirect_uri" format:"uri"` ResponseType string `schema:"response_type" json:"response_type" form:"response_type" default:"code"` State string `schema:"state" json:"state" form:"state"` Scope string `schema:"scope" json:"scope" form:"scope"` PageKey string `schema:"page_key" json:"page_key" form:"page_key"` InitiatingURL string `schema:"initiating_url" json:"initiating_url" form:"initiating_url"` }
type LoginSubmitInput ¶
type LoginSubmitInput struct {
Body LoginForm
}
type LoginSubmitResponse ¶
type OauthLoginResponse ¶
Click to show internal directories.
Click to hide internal directories.