Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigureAppStaticAssetsRoute(route httproute.Route) httproute.Route
- func ConfigureCSRFErrorInstructionRoute(route httproute.Route) httproute.Route
- func ConfigureFeatureDisabledRoute(route httproute.Route) httproute.Route
- func ConfigureGeneratedStaticAssetsRoute(route httproute.Route) httproute.Route
- func ConfigureLogoutRoute(route httproute.Route) httproute.Route
- func ConfigureNoProjectSSOCallbackRoute(route httproute.Route) httproute.Route
- func ConfigureOAuthEntrypointRoute(route httproute.Route) httproute.Route
- func ConfigurePasskeyCreationOptionsRoute(route httproute.Route) httproute.Route
- func ConfigurePasskeyRequestOptionsRoute(route httproute.Route) httproute.Route
- func ConfigureReturnRoute(route httproute.Route) httproute.Route
- func ConfigureRobotsTXTRoute(route httproute.Route) httproute.Route
- func ConfigureRootRoute(route httproute.Route) httproute.Route
- func ConfigureSSOCallbackRoute(route httproute.Route) httproute.Route
- func ConfigureTesterRoute(route httproute.Route) httproute.Route
- func ConfigureWebsocketRoute(route httproute.Route) httproute.Route
- func ConfigureWechatCallbackRoute(route httproute.Route) httproute.Route
- func ConfigureWhatsappCloudAPIWebhookRoute(route httproute.Route) httproute.Route
- func CreateQRCodeImage(content string, width int, height int, level qr.ErrorCorrectionLevel) (image.Image, error)
- func DeriveFlowName(flowType authflow.FlowType, flowGroup string, ...) (string, error)
- func FindLoginIDInPreviousInput(s *webapp.Session, xStep string) (string, bool)
- func FormToJSON(form url.Values) map[string]interface{}
- func FormatRecoveryCodes(recoveryCodes []string) []string
- func GetSettingsUIImplementation(ctx context.Context) config.SettingsUIImplementation
- func GetUIImplementation(ctx context.Context) config.UIImplementation
- func GetXStepFromQuery(r *http.Request) string
- func HandleAccountRecoveryIdentificationBotProtection(ctx context.Context, ...) (err error)
- func HandleAuthenticationBotProtection(ctx context.Context, authentication model.AuthenticationFlowAuthentication, ...) (err error)
- func HandleCreateAuthenticatorBotProtection(ctx context.Context, authentication model.AuthenticationFlowAuthentication, ...) (err error)
- func HandleIdentificationBotProtection(ctx context.Context, identification model.AuthenticationFlowIdentification, ...) (err error)
- func IdentitiesDisplayName(identities []*identity.Info) string
- func InsertBotProtection(formData url.Values, input map[string]interface{})
- func IsBotProtectionInputValid(ctx context.Context, formData url.Values) bool
- func JSONPointerFormToMap(form url.Values) map[string]string
- func SetRecoveryCodeAttachmentHeaders(w http.ResponseWriter)
- func ValidateBotProtectionInput(ctx context.Context, formData url.Values) error
- func WebsocketChannelName(appID string, id string) string
- func WithSettingsUIImplementation(ctx context.Context, impl config.SettingsUIImplementation) context.Context
- func WithUIImplementation(ctx context.Context, impl config.UIImplementation) context.Context
- type AdvanceOptions
- type AppStaticAssetsHandler
- type AuthEntryPointMiddleware
- type AuthflowController
- func (c *AuthflowController) AdvanceDirectly(route string, screen *webapp.AuthflowScreenWithFlowResponse, query url.Values) *webapp.Result
- func (c *AuthflowController) AdvanceToDelayedScreen(r *http.Request, s *webapp.Session) (*webapp.Result, error)
- func (c *AuthflowController) AdvanceWithInput(ctx context.Context, r *http.Request, s *webapp.Session, ...) (result *webapp.Result, err error)
- func (c *AuthflowController) AdvanceWithInputs(ctx context.Context, r *http.Request, s *webapp.Session, ...) (*webapp.Result, error)
- func (c *AuthflowController) DelayScreen(ctx context.Context, r *http.Request, s *webapp.Session, ...) (*webapp.AuthflowScreen, error)
- func (c *AuthflowController) FeedInputWithoutNavigate(ctx context.Context, stateToken string, input interface{}) (*authflow.ServiceOutput, error)
- func (c *AuthflowController) Finish(ctx context.Context, r *http.Request, s *webapp.Session) (*webapp.Result, error)
- func (c *AuthflowController) GetAccountLinkingSSOCallbackURL(alias string, data declarative.AccountLinkingIdentifyData) (string, error)
- func (c *AuthflowController) GetScreen(ctx context.Context, s *webapp.Session, xStep string) (*webapp.AuthflowScreenWithFlowResponse, error)
- func (c *AuthflowController) HandleOAuthCallback(ctx context.Context, w http.ResponseWriter, r *http.Request, ...)
- func (c *AuthflowController) HandleResumeOfFlow(ctx context.Context, w http.ResponseWriter, r *http.Request, ...)
- func (c *AuthflowController) HandleStartOfFlow(ctx context.Context, w http.ResponseWriter, r *http.Request, ...)
- func (c *AuthflowController) HandleStep(ctx context.Context, w http.ResponseWriter, r *http.Request, ...)
- func (c *AuthflowController) HandleWithoutScreen(ctx context.Context, w http.ResponseWriter, r *http.Request, ...)
- func (c *AuthflowController) HandleWithoutSession(ctx context.Context, w http.ResponseWriter, r *http.Request, ...)
- func (c *AuthflowController) RedirectURI(r *http.Request) string
- func (c *AuthflowController) ReplaceScreen(ctx context.Context, r *http.Request, s *webapp.Session, ...) (result *webapp.Result, err error)
- func (c *AuthflowController) Restart(ctx context.Context, s *webapp.Session) (result *webapp.Result, err error)
- func (c *AuthflowController) UpdateWithInput(ctx context.Context, r *http.Request, s *webapp.Session, ...) (result *webapp.Result, err error)
- func (c *AuthflowController) UseOAuthIdentification(ctx context.Context, s *webapp.Session, w http.ResponseWriter, r *http.Request, ...) (*webapp.Result, error)
- type AuthflowControllerAuthflowService
- type AuthflowControllerCookieManager
- type AuthflowControllerErrorHandler
- type AuthflowControllerHandler
- type AuthflowControllerHandlers
- type AuthflowControllerInlinePreviewHandler
- type AuthflowControllerOAuthClientResolver
- type AuthflowControllerOAuthSessionService
- type AuthflowControllerSAMLSessionService
- type AuthflowControllerSessionStore
- type AuthflowControllerUIInfoResolver
- type AuthflowEndpoints
- type AuthflowNavigator
- type AuthflowOAuthCallbackResponse
- type CSRFErrorInstructionHandler
- type CSRFMiddleware
- type CSRFMiddlewareUIImplementationService
- type Controller
- func (c *Controller) BeforeHandle(fn func(ctx context.Context) error)
- func (c *Controller) CreateSettingsActionResult(ctx context.Context, webSession *webapp.Session) (*webapp.SettingsCompletedResult, bool, error)
- func (c *Controller) DeleteSession(ctx context.Context, id string) error
- func (c *Controller) EntryPointGet(ctx context.Context, opts webapp.SessionOptions, intent interaction.Intent) (*interaction.Graph, error)
- func (c *Controller) EntryPointPost(ctx context.Context, opts webapp.SessionOptions, intent interaction.Intent, ...) (*webapp.Result, error)
- func (c *Controller) EntryPointSession(ctx context.Context, opts webapp.SessionOptions) *webapp.Session
- func (c *Controller) FinishSettingsAction(ctx context.Context, userSession session.ResolvedSession, ...) error
- func (c *Controller) FinishSettingsActionWithResult(ctx context.Context, userSession session.ResolvedSession, ...) (*webapp.SettingsCompletedResult, error)
- func (c *Controller) Get(fn func(ctx context.Context) error)
- func (c *Controller) GetSession(ctx context.Context, id string) (*webapp.Session, error)
- func (c *Controller) GetWithSettingsActionWebSession(r *http.Request, fn func(context.Context, *webapp.Session) error)
- func (c *Controller) InteractionGet(ctx context.Context) (*interaction.Graph, error)
- func (c *Controller) InteractionGetWithSession(ctx context.Context, s *webapp.Session) (*interaction.Graph, error)
- func (c *Controller) InteractionOAuthCallback(ctx context.Context, oauthInput InputOAuthCallback, ...) (*webapp.Result, error)
- func (c *Controller) InteractionPost(ctx context.Context, inputFn func() (interface{}, error)) (*webapp.Result, error)
- func (c *Controller) InteractionSession(ctx context.Context) (*webapp.Session, error)
- func (c *Controller) IsInSettingsAction(userSession session.ResolvedSession, webSession *webapp.Session) bool
- func (c *Controller) PostAction(action string, fn func(ctx context.Context) error)
- func (c *Controller) PostActionWithSettingsActionWebSession(action string, r *http.Request, ...)
- func (c *Controller) RedirectURI() string
- func (c *Controller) RequireUserID(ctx context.Context) string
- func (c *Controller) ServeWithDBTx(ctx context.Context)
- func (c *Controller) ServeWithoutDBTx(ctx context.Context)
- func (c *Controller) UpdateSession(ctx context.Context, s *webapp.Session) error
- type ControllerAuthenticationInfoService
- type ControllerDeps
- type ControllerFactory
- type ControllerOAuthSessionService
- type ControllerSessionStore
- type ControllerUIInfoResolver
- type CookieManager
- type ErrorRenderer
- func (h *ErrorRenderer) GetErrorData(ctx context.Context, r *http.Request, w http.ResponseWriter, err error) (map[string]interface{}, error)
- func (s *ErrorRenderer) MakeAuthflowErrorResult(ctx context.Context, w http.ResponseWriter, r *http.Request, u url.URL, ...) httputil.Result
- func (s *ErrorRenderer) RenderError(ctx context.Context, w http.ResponseWriter, r *http.Request, err error)
- type ErrorRendererAuthflowV2Navigator
- type ErrorRendererUIImplementationService
- type FeatureDisabledHandler
- type FormPrefiller
- type GeneratedStaticAssetsHandler
- type GlobalEmbeddedResourceManager
- type GlobalSessionService
- type GlobalSessionServiceFactory
- type HTMLResult
- type ImplementationSwitcherHandler
- type ImplementationSwitcherMiddleware
- type ImplementationSwitcherMiddlewareUIImplementationService
- type InputAuthOOB
- type InputAuthPassword
- type InputAuthRecoveryCode
- type InputAuthTOTP
- type InputChangePassword
- type InputConfirmTerminateOtherSessions
- type InputConfirmWeb3AccountRequest
- type InputCreateAuthenticator
- type InputNewLoginID
- type InputOAuthCallback
- type InputPasskeyAssertionResponse
- type InputPasskeyAttestationResponse
- type InputPromptCreatePasskeyAttestationResponse
- type InputRemoveAuthenticator
- type InputRemoveIdentity
- type InputResendCode
- type InputResetPassword
- type InputSelectLoginLink
- type InputSelectOOB
- type InputSelectTOTP
- type InputSelectVerifyIdentityViaOOBOTP
- type InputSelectVerifyIdentityViaWhatsapp
- type InputSelectWhatsappOTP
- type InputSetupLoginLinkOTP
- type InputSetupOOB
- type InputSetupPassword
- type InputSetupRecoveryCode
- type InputSetupTOTP
- type InputSetupWhatsappOTP
- type InputTriggerLoginLink
- type InputTriggerOOB
- type InputTriggerWhatsApp
- type InputUseLoginID
- type InputUseOAuth
- type InputVerificationCode
- type InputVerifyLoginLinkOTP
- type InputVerifyWhatsappOTP
- type LoginLinkOTPPageQueryState
- type LogoutHandler
- type LogoutSessionManager
- type NoProjectSSOCallbackHandler
- type NoProjectSSOCallbackHandlerOAuthStateStore
- type OAuthEntrypointEndpointsProvider
- type OAuthEntrypointHandler
- type OTPCodeService
- type PageService
- type PanicMiddleware
- type PanicMiddlewareEndpointsProvider
- type PanicMiddlewareUIImplementationService
- type PasskeyCreationOptionsHandler
- type PasskeyCreationOptionsService
- type PasskeyRequestOptionsHandler
- type PasskeyRequestOptionsService
- type Publisher
- type Renderer
- type ResourceManager
- type ResponseRenderer
- func (r *ResponseRenderer) Render(w http.ResponseWriter, req *http.Request, tpl template.Resource, ...)
- func (r *ResponseRenderer) RenderHTML(w http.ResponseWriter, req *http.Request, tpl *template.HTML, data interface{})
- func (r *ResponseRenderer) RenderHTMLStatus(w http.ResponseWriter, req *http.Request, status int, tpl *template.HTML, ...)
- func (r *ResponseRenderer) RenderStatus(w http.ResponseWriter, req *http.Request, status int, tpl template.Resource, ...)
- type ResponseWriter
- type ReturnHandler
- type RobotsTXTHandler
- type RootHandler
- type SAMLSLOService
- type SAMLSLOSessionService
- type SSOCallbackHandler
- type SSOCallbackHandlerOAuthStateStore
- type SessionStore
- type SettingsImplementationSwitcherHandler
- type SettingsImplementationSwitcherMiddleware
- type SettingsImplementationSwitcherMiddlewareUIImplementationService
- type TesterAppSessionTokenService
- type TesterAuthTokensIssuer
- type TesterCookieManager
- type TesterHandler
- type TesterOfflineGrantService
- type TesterService
- type TesterState
- type TesterUserInfoProvider
- type TesterViewModel
- type UserProfile
- type WebappOAuthClientResolver
- type WebsocketHandler
- type WebsocketMessage
- type WebsocketMessageKind
- type WechatCallbackHandler
- type WechatCallbackHandlerOAuthStateStore
- type WhatsappCloudAPIWebhookHandler
- type WhatsappCloudAPIWebhookWhatsappService
Constants ¶
const LoginLinkOTPPageQueryStateKey = "state"
const (
// WebsocketMessageKindRefresh means when the client receives this message, they should refresh the page.
WebsocketMessageKindRefresh = "refresh"
)
const WechatActionCallback = "callback"
Variables ¶
var AuthEntryPointMiddlewareLogger = slogutil.NewLogger("auth_entry_point_middleware")
var AuthflowBotProtectionSchema = validation.NewSimpleSchema(`
{
"type": "object",
"properties": {
"x_bot_protection_provider_type": { "type": "string" },
"x_bot_protection_provider_response": { "type": "string" }
},
"required": ["x_bot_protection_provider_type", "x_bot_protection_provider_response"]
}
`)
var AuthflowControllerLogger = slogutil.NewLogger("authflow_controller")
var CSRFMiddlewareLogger = slogutil.NewLogger("webapp-csrf-middleware")
var Components = web.ComponentsHTML
var DependencySet = wire.NewSet( wire.Struct(new(AuthEntryPointMiddleware), "*"), wire.Struct(new(ImplementationSwitcherMiddleware), "*"), wire.Struct(new(SettingsImplementationSwitcherMiddleware), "*"), wire.Struct(new(ResponseRenderer), "*"), wire.Struct(new(FormPrefiller), "*"), wire.Bind(new(Renderer), new(*ResponseRenderer)), wire.Struct(new(ErrorRenderer), "*"), wire.Struct(new(ControllerDeps), "*"), wire.Struct(new(ControllerFactory), "*"), wire.Struct(new(AuthflowController), "*"), NewPublisher, wire.Struct(new(GlobalSessionServiceFactory), "*"), wire.Struct(new(PanicMiddleware), "*"), wire.Struct(new(CSRFMiddleware), "*"), wire.Struct(new(CSRFErrorInstructionHandler), "*"), wire.Struct(new(RobotsTXTHandler), "*"), wire.Struct(new(AppStaticAssetsHandler), "*"), wire.Struct(new(RootHandler), "*"), wire.Struct(new(OAuthEntrypointHandler), "*"), wire.Struct(new(SSOCallbackHandler), "*"), wire.Struct(new(TesterHandler), "*"), wire.Struct(new(LogoutHandler), "*"), wire.Struct(new(ReturnHandler), "*"), wire.Struct(new(WebsocketHandler), "*"), wire.Struct(new(WechatCallbackHandler), "*"), wire.Struct(new(PasskeyCreationOptionsHandler), "*"), wire.Struct(new(PasskeyRequestOptionsHandler), "*"), wire.Struct(new(FeatureDisabledHandler), "*"), wire.Struct(new(ResponseWriter), "*"), wire.Struct(new(NoProjectSSOCallbackHandler), "*"), wire.Struct(new(WhatsappCloudAPIWebhookHandler), "*"), )
var DirectAccessDisableComponents = web.DirectAccessDisableComponentsHTML
var ErrNoFallbackAvailable = fmt.Errorf("webapp: no fallback is available")
var ErrorRendererLogger = slogutil.NewLogger("error_renderer")
var FeatureDisabledHandlerLogger = slogutil.NewLogger("feature_disabled_handler")
var PanicMiddlewareLogger = slogutil.NewLogger("webapp-panic-middleware")
var SettingsComponents = web.SettingsComponentsHTML
var TemplateCSRFErrorHTML = template.RegisterHTML( "web/authflowv2/csrf_error_page.html", Components..., )
var TemplateCSRFErrorInstructionHTML = template.RegisterHTML( "web/authflowv2/csrf_error_instruction.html", Components..., )
var TemplateDirectAccessDisable = template.RegisterHTML( "web/authflowv2/direct_access_disabled.html", DirectAccessDisableComponents..., )
var TemplateTurboErrorHTML = template.RegisterHTML( "web/turbo_error.html", Components..., )
var TemplateV2WebFatalErrorHTML = template.RegisterHTML( "web/authflowv2/fatal_error.html", Components..., )
NOTE: To resolve import cycle in panic_middleware.go, put it here as workaround
var TemplateWebAuthflowSSOCallbackHTML = template.RegisterHTML( "web/authflowv2/sso_callback.html", Components..., )
var TemplateWebConsentHTML = template.RegisterHTML( "web/authflowv2/consent.html", Components..., )
var TemplateWebDownloadRecoveryCodeTXT = template.RegisterPlainText(
"web/download_recovery_code.txt",
plainTextComponents...,
)
var TemplateWebFeatureDisabledHTML = template.RegisterHTML( "web/authflowv2/error_feature_disabled.html", Components..., )
var TemplateWebLogoutHTML = template.RegisterHTML( "web/authflowv2/logout.html", Components..., )
var TemplateWebReturnHTML = template.RegisterHTML( "web/authflowv2/return.html", Components..., )
var TemplateWebRobotsTXT = template.RegisterPlainText(
"web/robots.txt",
plainTextComponents...,
)
var TemplateWebTesterHTML = template.RegisterHTML( "web/authflowv2/tester.html", Components..., )
var TesterScopes = []string{ "openid", oauth.OfflineAccess, oauth.FullAccessScope, }
Functions ¶
func CreateQRCodeImage ¶
func DeriveFlowName ¶
func DeriveFlowName(flowType authflow.FlowType, flowGroup string, clientAllowlist *config.AuthenticationFlowAllowlist, definedGroups []*config.UIAuthenticationFlowGroup) (string, error)
func FormToJSON ¶
func FormatRecoveryCodes ¶
func GetSettingsUIImplementation ¶
func GetSettingsUIImplementation(ctx context.Context) config.SettingsUIImplementation
func GetUIImplementation ¶
func GetUIImplementation(ctx context.Context) config.UIImplementation
func GetXStepFromQuery ¶
func HandleAccountRecoveryIdentificationBotProtection ¶
func HandleAccountRecoveryIdentificationBotProtection(ctx context.Context, identification config.AuthenticationFlowAccountRecoveryIdentification, flowResp *authflow.FlowResponse, formData url.Values, input map[string]interface{}) (err error)
As IntentAccountRecoveryFlowStepIdentify has it's own IdentificationData type to narrow down Identification as {"email", "phone"}, we imitate the same logic in HandleIdentificationBotProtection here for account recovery
func HandleAuthenticationBotProtection ¶
func HandleAuthenticationBotProtection(ctx context.Context, authentication model.AuthenticationFlowAuthentication, flowResp *authflow.FlowResponse, formData url.Values, input map[string]interface{}) (err error)
func HandleCreateAuthenticatorBotProtection ¶
func HandleCreateAuthenticatorBotProtection(ctx context.Context, authentication model.AuthenticationFlowAuthentication, flowResp *authflow.FlowResponse, formData url.Values, input map[string]interface{}) (err error)
func HandleIdentificationBotProtection ¶
func HandleIdentificationBotProtection(ctx context.Context, identification model.AuthenticationFlowIdentification, flowResp *authflow.FlowResponse, formData url.Values, input map[string]interface{}) (err error)
func IdentitiesDisplayName ¶
func InsertBotProtection ¶
func SetRecoveryCodeAttachmentHeaders ¶
func SetRecoveryCodeAttachmentHeaders(w http.ResponseWriter)
func WebsocketChannelName ¶
func WithUIImplementation ¶
Types ¶
type AdvanceOptions ¶
type AdvanceOptions struct {
// Treat the next screen as the extend of the taken branch
// Allowing alternative branches to be selected based on the current state
InheritTakenBranchState bool
}
type AppStaticAssetsHandler ¶
type AppStaticAssetsHandler struct {
Resources ResourceManager
}
func (*AppStaticAssetsHandler) ServeHTTP ¶
func (h *AppStaticAssetsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AuthEntryPointMiddleware ¶
type AuthEntryPointMiddleware struct {
BaseViewModel *viewmodels.BaseViewModeler
Renderer Renderer
AppHostSuffixes config.AppHostSuffixes
TrustProxy config.TrustProxy
OAuthConfig *config.OAuthConfig
UIConfig *config.UIConfig
OAuthClientResolver WebappOAuthClientResolver
}
type AuthflowController ¶
type AuthflowController struct {
TesterEndpointsProvider tester.EndpointsProvider
TrustProxy config.TrustProxy
Clock clock.Clock
Cookies AuthflowControllerCookieManager
Sessions AuthflowControllerSessionStore
SessionCookie webapp.SessionCookieDef
SignedUpCookie webapp.SignedUpCookieDef
Endpoints AuthflowEndpoints
Authflows AuthflowControllerAuthflowService
OAuthSessions AuthflowControllerOAuthSessionService
SAMLSessions AuthflowControllerSAMLSessionService
UIInfoResolver AuthflowControllerUIInfoResolver
UIConfig *config.UIConfig
OAuthClientResolver AuthflowControllerOAuthClientResolver
ErrorRenderer *ErrorRenderer
}
func (*AuthflowController) AdvanceDirectly ¶
func (c *AuthflowController) AdvanceDirectly( route string, screen *webapp.AuthflowScreenWithFlowResponse, query url.Values, ) *webapp.Result
func (*AuthflowController) AdvanceToDelayedScreen ¶
func (*AuthflowController) AdvanceWithInput ¶
func (c *AuthflowController) AdvanceWithInput( ctx context.Context, r *http.Request, s *webapp.Session, screen0 *webapp.AuthflowScreenWithFlowResponse, input map[string]interface{}, options *AdvanceOptions, ) (result *webapp.Result, err error)
AdvanceWithInput is same as AdvanceWithInputs but only allow one input.
func (*AuthflowController) AdvanceWithInputs ¶
func (c *AuthflowController) AdvanceWithInputs( ctx context.Context, r *http.Request, s *webapp.Session, screen0 *webapp.AuthflowScreenWithFlowResponse, inputs []map[string]interface{}, options *AdvanceOptions, ) (*webapp.Result, error)
AdvanceWithInputs is for feeding multiple inputs that would advance the flow.
func (*AuthflowController) DelayScreen ¶
func (c *AuthflowController) DelayScreen(ctx context.Context, r *http.Request, s *webapp.Session, sourceScreen *webapp.AuthflowScreen, targetResult *webapp.Result, screenFactory func(*webapp.AuthflowScreen) *webapp.AuthflowScreen, ) (*webapp.AuthflowScreen, error)
func (*AuthflowController) FeedInputWithoutNavigate ¶
func (c *AuthflowController) FeedInputWithoutNavigate(ctx context.Context, stateToken string, input interface{}) (*authflow.ServiceOutput, error)
func (*AuthflowController) GetAccountLinkingSSOCallbackURL ¶
func (c *AuthflowController) GetAccountLinkingSSOCallbackURL(alias string, data declarative.AccountLinkingIdentifyData) (string, error)
func (*AuthflowController) GetScreen ¶
func (c *AuthflowController) GetScreen(ctx context.Context, s *webapp.Session, xStep string) (*webapp.AuthflowScreenWithFlowResponse, error)
func (*AuthflowController) HandleOAuthCallback ¶
func (c *AuthflowController) HandleOAuthCallback(ctx context.Context, w http.ResponseWriter, r *http.Request, callbackResponse AuthflowOAuthCallbackResponse)
func (*AuthflowController) HandleResumeOfFlow ¶
func (c *AuthflowController) HandleResumeOfFlow( ctx context.Context, w http.ResponseWriter, r *http.Request, opts webapp.SessionOptions, handlers *AuthflowControllerHandlers, input map[string]interface{}, errorHandler *AuthflowControllerErrorHandler, )
func (*AuthflowController) HandleStartOfFlow ¶
func (c *AuthflowController) HandleStartOfFlow( ctx context.Context, w http.ResponseWriter, r *http.Request, opts webapp.SessionOptions, flowType authflow.FlowType, handlers *AuthflowControllerHandlers, input interface{})
func (*AuthflowController) HandleStep ¶
func (c *AuthflowController) HandleStep(ctx context.Context, w http.ResponseWriter, r *http.Request, handlers *AuthflowControllerHandlers)
func (*AuthflowController) HandleWithoutScreen ¶
func (c *AuthflowController) HandleWithoutScreen(ctx context.Context, w http.ResponseWriter, r *http.Request, handlers *AuthflowControllerHandlers)
func (*AuthflowController) HandleWithoutSession ¶
func (c *AuthflowController) HandleWithoutSession(ctx context.Context, w http.ResponseWriter, r *http.Request, handlers *AuthflowControllerHandlers)
func (*AuthflowController) RedirectURI ¶
func (c *AuthflowController) RedirectURI(r *http.Request) string
func (*AuthflowController) ReplaceScreen ¶
func (c *AuthflowController) ReplaceScreen(ctx context.Context, r *http.Request, s *webapp.Session, flowType authflow.FlowType, input map[string]interface{}) (result *webapp.Result, err error)
ReplaceScreen is for switching flow.
func (*AuthflowController) UpdateWithInput ¶
func (c *AuthflowController) UpdateWithInput(ctx context.Context, r *http.Request, s *webapp.Session, screen *webapp.AuthflowScreenWithFlowResponse, input map[string]interface{}) (result *webapp.Result, err error)
UpdateWithInput is for feeding an input that would just update the current node. One application is resend.
func (*AuthflowController) UseOAuthIdentification ¶
func (c *AuthflowController) UseOAuthIdentification( ctx context.Context, s *webapp.Session, w http.ResponseWriter, r *http.Request, screen *webapp.AuthflowScreen, alias string, identificationOptions []declarative.IdentificationOption, flowExecutor func(input map[string]interface{}, ) ( result *webapp.Result, err error), ) (*webapp.Result, error)
type AuthflowControllerAuthflowService ¶
type AuthflowControllerAuthflowService interface {
CreateNewFlow(ctx context.Context, intent authflow.PublicFlow, sessionOptions *authflow.SessionOptions) (*authflow.ServiceOutput, error)
Get(ctx context.Context, stateToken string) (*authflow.ServiceOutput, error)
FeedInput(ctx context.Context, stateToken string, rawMessage json.RawMessage) (*authflow.ServiceOutput, error)
}
type AuthflowControllerHandlers ¶
type AuthflowControllerHandlers struct {
GetHandler AuthflowControllerHandler
PostHandlers map[string]AuthflowControllerHandler
InlinePreviewHandler AuthflowControllerInlinePreviewHandler
}
func (*AuthflowControllerHandlers) Get ¶
func (h *AuthflowControllerHandlers) Get(f AuthflowControllerHandler)
func (*AuthflowControllerHandlers) InlinePreview ¶
func (h *AuthflowControllerHandlers) InlinePreview(f AuthflowControllerInlinePreviewHandler)
func (*AuthflowControllerHandlers) PostAction ¶
func (h *AuthflowControllerHandlers) PostAction(action string, f AuthflowControllerHandler)
type AuthflowControllerOAuthClientResolver ¶
type AuthflowControllerOAuthClientResolver interface {
ResolveClient(clientID string) *config.OAuthClientConfig
}
type AuthflowControllerSAMLSessionService ¶
type AuthflowControllerSAMLSessionService interface {
Get(ctx context.Context, entryID string) (*samlsession.SAMLSession, error)
}
type AuthflowEndpoints ¶
type AuthflowNavigator ¶
type AuthflowNavigator interface {
}
type AuthflowOAuthCallbackResponse ¶
type AuthflowOAuthCallbackResponse struct {
Query string
State *webappoauth.WebappOAuthState
}
type CSRFErrorInstructionHandler ¶
type CSRFErrorInstructionHandler struct {
Controller *AuthflowController
BaseViewModel *viewmodels.BaseViewModeler
Renderer Renderer
}
func (*CSRFErrorInstructionHandler) GetData ¶
func (h *CSRFErrorInstructionHandler) GetData(w http.ResponseWriter, r *http.Request) (map[string]interface{}, error)
func (*CSRFErrorInstructionHandler) ServeHTTP ¶
func (h *CSRFErrorInstructionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type CSRFMiddleware ¶
type CSRFMiddleware struct {
TrustProxy config.TrustProxy
BaseViewModel *viewmodels.BaseViewModeler
Renderer Renderer
UIImplementationService CSRFMiddlewareUIImplementationService
EnvironmentConfig *config.EnvironmentConfig
}
type CSRFMiddlewareUIImplementationService ¶
type CSRFMiddlewareUIImplementationService interface {
GetUIImplementation() config.UIImplementation
}
type Controller ¶
type Controller struct {
ControllerDeps
// contains filtered or unexported fields
}
func (*Controller) BeforeHandle ¶
func (c *Controller) BeforeHandle(fn func(ctx context.Context) error)
func (*Controller) CreateSettingsActionResult ¶
func (c *Controller) CreateSettingsActionResult(ctx context.Context, webSession *webapp.Session) (*webapp.SettingsCompletedResult, bool, error)
func (*Controller) DeleteSession ¶
func (c *Controller) DeleteSession(ctx context.Context, id string) error
func (*Controller) EntryPointGet ¶
func (c *Controller) EntryPointGet( ctx context.Context, opts webapp.SessionOptions, intent interaction.Intent, ) (*interaction.Graph, error)
func (*Controller) EntryPointPost ¶
func (c *Controller) EntryPointPost( ctx context.Context, opts webapp.SessionOptions, intent interaction.Intent, inputFn func() (interface{}, error), ) (*webapp.Result, error)
func (*Controller) EntryPointSession ¶
func (c *Controller) EntryPointSession(ctx context.Context, opts webapp.SessionOptions) *webapp.Session
func (*Controller) FinishSettingsAction ¶
func (c *Controller) FinishSettingsAction(ctx context.Context, userSession session.ResolvedSession, webSession *webapp.Session) error
func (*Controller) FinishSettingsActionWithResult ¶
func (c *Controller) FinishSettingsActionWithResult(ctx context.Context, userSession session.ResolvedSession, webSession *webapp.Session) (*webapp.SettingsCompletedResult, error)
func (*Controller) GetSession ¶
func (*Controller) GetWithSettingsActionWebSession ¶
func (*Controller) InteractionGet ¶
func (c *Controller) InteractionGet(ctx context.Context) (*interaction.Graph, error)
func (*Controller) InteractionGetWithSession ¶
func (c *Controller) InteractionGetWithSession(ctx context.Context, s *webapp.Session) (*interaction.Graph, error)
func (*Controller) InteractionOAuthCallback ¶
func (c *Controller) InteractionOAuthCallback(ctx context.Context, oauthInput InputOAuthCallback, oauthState *webappoauth.WebappOAuthState) (*webapp.Result, error)
func (*Controller) InteractionPost ¶
func (*Controller) InteractionSession ¶
func (*Controller) IsInSettingsAction ¶
func (c *Controller) IsInSettingsAction(userSession session.ResolvedSession, webSession *webapp.Session) bool
func (*Controller) PostAction ¶
func (c *Controller) PostAction(action string, fn func(ctx context.Context) error)
func (*Controller) PostActionWithSettingsActionWebSession ¶
func (*Controller) RedirectURI ¶
func (c *Controller) RedirectURI() string
func (*Controller) RequireUserID ¶
func (c *Controller) RequireUserID(ctx context.Context) string
func (*Controller) ServeWithDBTx ¶
func (c *Controller) ServeWithDBTx(ctx context.Context)
func (*Controller) ServeWithoutDBTx ¶
func (c *Controller) ServeWithoutDBTx(ctx context.Context)
func (*Controller) UpdateSession ¶
type ControllerDeps ¶
type ControllerDeps struct {
Database *appdb.Handle
RedisHandle *appredis.Handle
AppID config.AppID
Page PageService
BaseViewModel *viewmodels.BaseViewModeler
Renderer Renderer
Publisher *Publisher
Clock clock.Clock
TesterEndpointsProvider tester.EndpointsProvider
ErrorRenderer *ErrorRenderer
UIInfoResolver ControllerUIInfoResolver
AuthenticationInfoService ControllerAuthenticationInfoService
Sessions ControllerSessionStore
OAuthSessions ControllerOAuthSessionService
TrustProxy config.TrustProxy
}
type ControllerFactory ¶
type ControllerFactory struct {
ControllerDeps
}
func (*ControllerFactory) New ¶
func (f *ControllerFactory) New(r *http.Request, rw http.ResponseWriter) (*Controller, error)
type ControllerSessionStore ¶
type ControllerUIInfoResolver ¶
type ControllerUIInfoResolver interface {
SetAuthenticationInfoInQuery(redirectURI string, e *authenticationinfo.Entry) string
}
type CookieManager ¶
type ErrorRenderer ¶
type ErrorRenderer struct {
ErrorService *webapp.ErrorService
UIImplementationService ErrorRendererUIImplementationService
Renderer Renderer
BaseViewModel *viewmodels.BaseViewModeler
}
func (*ErrorRenderer) GetErrorData ¶
func (h *ErrorRenderer) GetErrorData(ctx context.Context, r *http.Request, w http.ResponseWriter, err error) (map[string]interface{}, error)
func (*ErrorRenderer) MakeAuthflowErrorResult ¶
func (*ErrorRenderer) RenderError ¶
func (s *ErrorRenderer) RenderError(ctx context.Context, w http.ResponseWriter, r *http.Request, err error)
type ErrorRendererAuthflowV2Navigator ¶
type ErrorRendererAuthflowV2Navigator interface {
}
type ErrorRendererUIImplementationService ¶
type ErrorRendererUIImplementationService interface {
GetUIImplementation() config.UIImplementation
}
type FeatureDisabledHandler ¶
type FeatureDisabledHandler struct {
ControllerFactory ControllerFactory
BaseViewModel *viewmodels.BaseViewModeler
Renderer Renderer
}
func (*FeatureDisabledHandler) GetData ¶
func (h *FeatureDisabledHandler) GetData(r *http.Request, rw http.ResponseWriter) (map[string]interface{}, error)
func (*FeatureDisabledHandler) ServeHTTP ¶
func (h *FeatureDisabledHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FormPrefiller ¶
type FormPrefiller struct {
LoginID *config.LoginIDConfig
UI *config.UIConfig
}
func (*FormPrefiller) Prefill ¶
func (p *FormPrefiller) Prefill(form url.Values)
type GeneratedStaticAssetsHandler ¶
type GeneratedStaticAssetsHandler struct {
EmbeddedResources GlobalEmbeddedResourceManager
}
func (*GeneratedStaticAssetsHandler) ServeHTTP ¶
func (h *GeneratedStaticAssetsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GlobalSessionService ¶
type GlobalSessionService struct {
SessionStore SessionStore
Publisher *Publisher
Clock clock.Clock
}
func (*GlobalSessionService) GetSession ¶
func (*GlobalSessionService) UpdateSession ¶
type GlobalSessionServiceFactory ¶
func (*GlobalSessionServiceFactory) NewGlobalSessionService ¶
func (f *GlobalSessionServiceFactory) NewGlobalSessionService(appID config.AppID) *GlobalSessionService
type HTMLResult ¶
func (*HTMLResult) IsInternalError ¶
func (re *HTMLResult) IsInternalError() bool
func (*HTMLResult) WriteResponse ¶
func (re *HTMLResult) WriteResponse(rw http.ResponseWriter, r *http.Request)
type ImplementationSwitcherHandler ¶
func (*ImplementationSwitcherHandler) ServeHTTP ¶
func (h *ImplementationSwitcherHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ImplementationSwitcherMiddleware ¶
type ImplementationSwitcherMiddleware struct {
UIImplementationService ImplementationSwitcherMiddlewareUIImplementationService
}
type ImplementationSwitcherMiddlewareUIImplementationService ¶
type ImplementationSwitcherMiddlewareUIImplementationService interface {
GetUIImplementation() config.UIImplementation
}
type InputAuthOOB ¶
func (*InputAuthOOB) CreateDeviceToken ¶
func (i *InputAuthOOB) CreateDeviceToken() bool
func (*InputAuthOOB) GetOOBOTP ¶
func (i *InputAuthOOB) GetOOBOTP() string
type InputAuthPassword ¶
func (*InputAuthPassword) CreateDeviceToken ¶
func (i *InputAuthPassword) CreateDeviceToken() bool
func (*InputAuthPassword) GetAuthenticationStage ¶
func (i *InputAuthPassword) GetAuthenticationStage() authn.AuthenticationStage
func (*InputAuthPassword) GetPassword ¶
func (i *InputAuthPassword) GetPassword() string
type InputAuthRecoveryCode ¶
func (*InputAuthRecoveryCode) CreateDeviceToken ¶
func (i *InputAuthRecoveryCode) CreateDeviceToken() bool
func (*InputAuthRecoveryCode) GetRecoveryCode ¶
func (i *InputAuthRecoveryCode) GetRecoveryCode() string
type InputAuthTOTP ¶
func (*InputAuthTOTP) CreateDeviceToken ¶
func (i *InputAuthTOTP) CreateDeviceToken() bool
func (*InputAuthTOTP) GetTOTP ¶
func (i *InputAuthTOTP) GetTOTP() string
type InputChangePassword ¶
type InputChangePassword struct {
AuthenticationStage authn.AuthenticationStage
OldPassword string
NewPassword string
}
func (*InputChangePassword) GetAuthenticationStage ¶
func (i *InputChangePassword) GetAuthenticationStage() authn.AuthenticationStage
func (*InputChangePassword) GetNewPassword ¶
func (i *InputChangePassword) GetNewPassword() string
func (*InputChangePassword) GetOldPassword ¶
func (i *InputChangePassword) GetOldPassword() string
type InputConfirmTerminateOtherSessions ¶
type InputConfirmTerminateOtherSessions struct {
IsConfirm bool
}
func (*InputConfirmTerminateOtherSessions) GetIsConfirmed ¶
func (i *InputConfirmTerminateOtherSessions) GetIsConfirmed() bool
type InputConfirmWeb3AccountRequest ¶
func (*InputConfirmWeb3AccountRequest) GetMessage ¶
func (i *InputConfirmWeb3AccountRequest) GetMessage() string
func (*InputConfirmWeb3AccountRequest) GetSignature ¶
func (i *InputConfirmWeb3AccountRequest) GetSignature() string
type InputCreateAuthenticator ¶
type InputCreateAuthenticator struct{}
func (*InputCreateAuthenticator) RequestedByUser ¶
func (i *InputCreateAuthenticator) RequestedByUser() bool
type InputNewLoginID ¶
func (*InputNewLoginID) GetLoginID ¶
func (i *InputNewLoginID) GetLoginID() string
func (*InputNewLoginID) GetLoginIDKey ¶
func (i *InputNewLoginID) GetLoginIDKey() string
type InputOAuthCallback ¶
func (*InputOAuthCallback) GetProviderAlias ¶
func (i *InputOAuthCallback) GetProviderAlias() string
func (*InputOAuthCallback) GetQuery ¶
func (i *InputOAuthCallback) GetQuery() string
type InputPasskeyAssertionResponse ¶
func (*InputPasskeyAssertionResponse) GetAssertionResponse ¶
func (i *InputPasskeyAssertionResponse) GetAssertionResponse() []byte
func (*InputPasskeyAssertionResponse) GetAuthenticationStage ¶
func (i *InputPasskeyAssertionResponse) GetAuthenticationStage() authn.AuthenticationStage
type InputPasskeyAttestationResponse ¶
func (*InputPasskeyAttestationResponse) GetAttestationResponse ¶
func (i *InputPasskeyAttestationResponse) GetAttestationResponse() []byte
func (*InputPasskeyAttestationResponse) GetAuthenticationStage ¶
func (i *InputPasskeyAttestationResponse) GetAuthenticationStage() authn.AuthenticationStage
type InputPromptCreatePasskeyAttestationResponse ¶
func (*InputPromptCreatePasskeyAttestationResponse) GetAttestationResponse ¶
func (i *InputPromptCreatePasskeyAttestationResponse) GetAttestationResponse() []byte
func (*InputPromptCreatePasskeyAttestationResponse) IsSkipped ¶
func (i *InputPromptCreatePasskeyAttestationResponse) IsSkipped() bool
type InputRemoveAuthenticator ¶
type InputRemoveAuthenticator struct {
Type model.AuthenticatorType
ID string
}
func (*InputRemoveAuthenticator) GetAuthenticatorID ¶
func (i *InputRemoveAuthenticator) GetAuthenticatorID() string
func (*InputRemoveAuthenticator) GetAuthenticatorType ¶
func (i *InputRemoveAuthenticator) GetAuthenticatorType() model.AuthenticatorType
type InputRemoveIdentity ¶
type InputRemoveIdentity struct {
Type model.IdentityType
ID string
}
func (*InputRemoveIdentity) GetIdentityID ¶
func (i *InputRemoveIdentity) GetIdentityID() string
func (*InputRemoveIdentity) GetIdentityType ¶
func (i *InputRemoveIdentity) GetIdentityType() model.IdentityType
type InputResendCode ¶
type InputResendCode struct{}
func (*InputResendCode) DoResend ¶
func (i *InputResendCode) DoResend()
type InputResetPassword ¶
func (*InputResetPassword) GetCode ¶
func (i *InputResetPassword) GetCode() string
func (*InputResetPassword) GetNewPassword ¶
func (i *InputResetPassword) GetNewPassword() string
type InputSelectLoginLink ¶
type InputSelectLoginLink struct{}
func (*InputSelectLoginLink) SetupPrimaryAuthenticatorLoginLinkOTP ¶
func (i *InputSelectLoginLink) SetupPrimaryAuthenticatorLoginLinkOTP()
type InputSelectOOB ¶
type InputSelectOOB struct{}
func (*InputSelectOOB) SetupPrimaryAuthenticatorOOB ¶
func (i *InputSelectOOB) SetupPrimaryAuthenticatorOOB()
type InputSelectTOTP ¶
type InputSelectTOTP struct{}
func (*InputSelectTOTP) SetupTOTP ¶
func (i *InputSelectTOTP) SetupTOTP()
type InputSelectVerifyIdentityViaOOBOTP ¶
type InputSelectVerifyIdentityViaOOBOTP struct{}
func (*InputSelectVerifyIdentityViaOOBOTP) SelectVerifyIdentityViaOOBOTP ¶
func (i *InputSelectVerifyIdentityViaOOBOTP) SelectVerifyIdentityViaOOBOTP()
type InputSelectVerifyIdentityViaWhatsapp ¶
type InputSelectVerifyIdentityViaWhatsapp struct{}
func (*InputSelectVerifyIdentityViaWhatsapp) SelectVerifyIdentityViaWhatsapp ¶
func (i *InputSelectVerifyIdentityViaWhatsapp) SelectVerifyIdentityViaWhatsapp()
type InputSelectWhatsappOTP ¶
type InputSelectWhatsappOTP struct{}
func (*InputSelectWhatsappOTP) SetupPrimaryAuthenticatorWhatsappOTP ¶
func (i *InputSelectWhatsappOTP) SetupPrimaryAuthenticatorWhatsappOTP()
type InputSetupLoginLinkOTP ¶
func (*InputSetupLoginLinkOTP) GetLoginLinkOTPTarget ¶
func (i *InputSetupLoginLinkOTP) GetLoginLinkOTPTarget() string
type InputSetupOOB ¶
func (*InputSetupOOB) GetOOBChannel ¶
func (i *InputSetupOOB) GetOOBChannel() model.AuthenticatorOOBChannel
func (*InputSetupOOB) GetOOBTarget ¶
func (i *InputSetupOOB) GetOOBTarget() string
type InputSetupPassword ¶
func (*InputSetupPassword) GetAuthenticationStage ¶
func (i *InputSetupPassword) GetAuthenticationStage() authn.AuthenticationStage
func (*InputSetupPassword) GetPassword ¶
func (i *InputSetupPassword) GetPassword() string
type InputSetupRecoveryCode ¶
type InputSetupRecoveryCode struct{}
func (*InputSetupRecoveryCode) ViewedRecoveryCodes ¶
func (i *InputSetupRecoveryCode) ViewedRecoveryCodes()
type InputSetupTOTP ¶
func (*InputSetupTOTP) GetTOTP ¶
func (i *InputSetupTOTP) GetTOTP() string
func (*InputSetupTOTP) GetTOTPDisplayName ¶
func (i *InputSetupTOTP) GetTOTPDisplayName() string
type InputSetupWhatsappOTP ¶
type InputSetupWhatsappOTP struct {
Phone string
}
func (*InputSetupWhatsappOTP) GetWhatsappPhone ¶
func (i *InputSetupWhatsappOTP) GetWhatsappPhone() string
type InputTriggerLoginLink ¶
type InputTriggerLoginLink struct {
AuthenticatorIndex int
}
func (*InputTriggerLoginLink) GetLoginLinkAuthenticatorIndex ¶
func (i *InputTriggerLoginLink) GetLoginLinkAuthenticatorIndex() int
type InputTriggerOOB ¶
func (*InputTriggerOOB) GetOOBAuthenticatorIndex ¶
func (i *InputTriggerOOB) GetOOBAuthenticatorIndex() int
func (*InputTriggerOOB) GetOOBAuthenticatorType ¶
func (i *InputTriggerOOB) GetOOBAuthenticatorType() string
type InputTriggerWhatsApp ¶
type InputTriggerWhatsApp struct {
AuthenticatorIndex int
}
func (*InputTriggerWhatsApp) GetWhatsappAuthenticatorIndex ¶
func (i *InputTriggerWhatsApp) GetWhatsappAuthenticatorIndex() int
type InputUseLoginID ¶
func (*InputUseLoginID) GetLoginID ¶
func (i *InputUseLoginID) GetLoginID() string
func (*InputUseLoginID) GetLoginIDKey ¶
func (i *InputUseLoginID) GetLoginIDKey() string
type InputUseOAuth ¶
func (*InputUseOAuth) GetErrorRedirectURI ¶
func (i *InputUseOAuth) GetErrorRedirectURI() string
func (*InputUseOAuth) GetPrompt ¶
func (i *InputUseOAuth) GetPrompt() []string
func (*InputUseOAuth) GetProviderAlias ¶
func (i *InputUseOAuth) GetProviderAlias() string
type InputVerificationCode ¶
type InputVerificationCode struct {
Code string
}
func (*InputVerificationCode) GetVerificationCode ¶
func (i *InputVerificationCode) GetVerificationCode() string
type InputVerifyLoginLinkOTP ¶
type InputVerifyLoginLinkOTP struct {
DeviceToken bool
}
func (*InputVerifyLoginLinkOTP) CreateDeviceToken ¶
func (i *InputVerifyLoginLinkOTP) CreateDeviceToken() bool
func (*InputVerifyLoginLinkOTP) VerifyLoginLink ¶
func (i *InputVerifyLoginLinkOTP) VerifyLoginLink()
type InputVerifyWhatsappOTP ¶
func (*InputVerifyWhatsappOTP) CreateDeviceToken ¶
func (i *InputVerifyWhatsappOTP) CreateDeviceToken() bool
func (*InputVerifyWhatsappOTP) GetWhatsappOTP ¶
func (i *InputVerifyWhatsappOTP) GetWhatsappOTP() string
type LoginLinkOTPPageQueryState ¶
type LoginLinkOTPPageQueryState string
const ( LoginLinkOTPPageQueryStateInitial LoginLinkOTPPageQueryState = "" LoginLinkOTPPageQueryStateInvalidCode LoginLinkOTPPageQueryState = "invalid_code" LoginLinkOTPPageQueryStateMatched LoginLinkOTPPageQueryState = "matched" )
func GetLoginLinkStateFromQuery ¶
func GetLoginLinkStateFromQuery(r *http.Request) LoginLinkOTPPageQueryState
func (*LoginLinkOTPPageQueryState) IsValid ¶
func (s *LoginLinkOTPPageQueryState) IsValid() bool
type LogoutHandler ¶
type LogoutHandler struct {
ControllerFactory ControllerFactory
Database *appdb.Handle
TrustProxy config.TrustProxy
OAuth *config.OAuthConfig
UIConfig *config.UIConfig
SAMLConfig *config.SAMLConfig
SessionManager LogoutSessionManager
BaseViewModel *viewmodels.BaseViewModeler
Renderer Renderer
OAuthClientResolver WebappOAuthClientResolver
SAMLSLOSessionService SAMLSLOSessionService
SAMLSLOService SAMLSLOService
}
func (*LogoutHandler) ServeHTTP ¶
func (h *LogoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LogoutSessionManager ¶
type LogoutSessionManager interface {
Logout(ctx context.Context, s session.SessionBase, w http.ResponseWriter) ([]session.ListableSession, error)
}
type NoProjectSSOCallbackHandler ¶
type NoProjectSSOCallbackHandler struct {
ConfigSource *configsource.ConfigSource
OAuthStateStore NoProjectSSOCallbackHandlerOAuthStateStore
}
func (*NoProjectSSOCallbackHandler) ServeHTTP ¶
func (h *NoProjectSSOCallbackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type NoProjectSSOCallbackHandlerOAuthStateStore ¶
type NoProjectSSOCallbackHandlerOAuthStateStore interface {
RecoverState(ctx context.Context, stateToken string) (state *webappoauth.WebappOAuthState, err error)
}
type OAuthEntrypointHandler ¶
type OAuthEntrypointHandler struct {
Endpoints OAuthEntrypointEndpointsProvider
}
func (*OAuthEntrypointHandler) ServeHTTP ¶
func (h *OAuthEntrypointHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type OTPCodeService ¶
type OTPCodeService interface {
VerifyOTP(ctx context.Context, kind otp.Kind, target string, otp string, opts *otp.VerifyOptions) error
InspectState(ctx context.Context, kind otp.Kind, target string) (*otp.State, error)
LookupCode(ctx context.Context, purpose otp.Purpose, code string) (target string, err error)
SetSubmittedCode(ctx context.Context, kind otp.Kind, target string, code string) (*otp.State, error)
}
type PageService ¶
type PageService interface {
UpdateSession(ctx context.Context, session *webapp.Session) error
DeleteSession(ctx context.Context, id string) error
PeekUncommittedChanges(ctx context.Context, session *webapp.Session, fn func(graph *interaction.Graph) error) error
Get(ctx context.Context, session *webapp.Session) (*interaction.Graph, error)
GetSession(ctx context.Context, id string) (*webapp.Session, error)
GetWithIntent(ctx context.Context, session *webapp.Session, intent interaction.Intent) (*interaction.Graph, error)
PostWithIntent(
ctx context.Context,
session *webapp.Session,
intent interaction.Intent,
inputFn func() (interface{}, error),
) (result *webapp.Result, err error)
PostWithInput(
ctx context.Context,
session *webapp.Session,
inputFn func() (interface{}, error),
) (result *webapp.Result, err error)
}
type PanicMiddleware ¶
type PanicMiddleware struct {
ErrorService *webapp.ErrorService
BaseViewModel *viewmodels.BaseViewModeler
Renderer Renderer
Endpoints PanicMiddlewareEndpointsProvider
UIImplementationService PanicMiddlewareUIImplementationService
}
type PanicMiddlewareUIImplementationService ¶
type PanicMiddlewareUIImplementationService interface {
GetUIImplementation() config.UIImplementation
}
type PasskeyCreationOptionsHandler ¶
type PasskeyCreationOptionsHandler struct {
Page PageService
Database *appdb.Handle
Passkey PasskeyCreationOptionsService
}
func (*PasskeyCreationOptionsHandler) ServeHTTP ¶
func (h *PasskeyCreationOptionsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type PasskeyRequestOptionsHandler ¶
type PasskeyRequestOptionsHandler struct {
Page PageService
Database *appdb.Handle
Passkey PasskeyRequestOptionsService
}
func (*PasskeyRequestOptionsHandler) ServeHTTP ¶
func (h *PasskeyRequestOptionsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type PasskeyRequestOptionsService ¶
type PasskeyRequestOptionsService interface {
MakeConditionalRequestOptions(ctx context.Context) (*model.WebAuthnRequestOptions, error)
MakeModalRequestOptions(ctx context.Context) (*model.WebAuthnRequestOptions, error)
MakeModalRequestOptionsWithUser(ctx context.Context, userID string) (*model.WebAuthnRequestOptions, error)
}
type Publisher ¶
type Renderer ¶
type Renderer interface {
// Render renders the template into response body.
Render(w http.ResponseWriter, r *http.Request, tpl template.Resource, data interface{})
// RenderHTML is a shorthand of Render that renders HTML.
RenderHTML(w http.ResponseWriter, r *http.Request, tpl *template.HTML, data interface{})
RenderStatus(w http.ResponseWriter, req *http.Request, status int, tpl template.Resource, data interface{})
RenderHTMLStatus(w http.ResponseWriter, r *http.Request, status int, tpl *template.HTML, data interface{})
}
type ResourceManager ¶
type ResponseRenderer ¶
func (*ResponseRenderer) Render ¶
func (r *ResponseRenderer) Render(w http.ResponseWriter, req *http.Request, tpl template.Resource, data interface{})
func (*ResponseRenderer) RenderHTML ¶
func (r *ResponseRenderer) RenderHTML(w http.ResponseWriter, req *http.Request, tpl *template.HTML, data interface{})
func (*ResponseRenderer) RenderHTMLStatus ¶
func (r *ResponseRenderer) RenderHTMLStatus(w http.ResponseWriter, req *http.Request, status int, tpl *template.HTML, data interface{})
func (*ResponseRenderer) RenderStatus ¶
func (r *ResponseRenderer) RenderStatus(w http.ResponseWriter, req *http.Request, status int, tpl template.Resource, data interface{})
type ResponseWriter ¶
type ResponseWriter struct {
Renderer Renderer
}
func (*ResponseWriter) PrepareData ¶
func (w *ResponseWriter) PrepareData(ctx context.Context, err error) map[string]interface{}
func (*ResponseWriter) WriteResponse ¶
func (w *ResponseWriter) WriteResponse(rw http.ResponseWriter, req *http.Request, resp *api.Response)
type ReturnHandler ¶
type ReturnHandler struct {
ControllerFactory ControllerFactory
BaseViewModel *viewmodels.BaseViewModeler
Renderer Renderer
}
func (*ReturnHandler) GetData ¶
func (h *ReturnHandler) GetData(r *http.Request, w http.ResponseWriter) (map[string]interface{}, error)
func (*ReturnHandler) ServeHTTP ¶
func (h *ReturnHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RobotsTXTHandler ¶
type RobotsTXTHandler struct {
Renderer Renderer
}
func (*RobotsTXTHandler) ServeHTTP ¶
func (h *RobotsTXTHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RootHandler ¶
type RootHandler struct {
AuthenticationConfig *config.AuthenticationConfig
Cookies CookieManager
SignedUpCookie webapp.SignedUpCookieDef
}
func (*RootHandler) ServeHTTP ¶
func (h *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SAMLSLOService ¶
type SAMLSLOService interface {
SendSLORequest(
ctx context.Context,
rw http.ResponseWriter,
r *http.Request,
sloSession *samlslosession.SAMLSLOSession,
sp *config.SAMLServiceProviderConfig,
) error
}
type SAMLSLOSessionService ¶
type SAMLSLOSessionService interface {
Get(ctx context.Context, sessionID string) (entry *samlslosession.SAMLSLOSession, err error)
Save(ctx context.Context, session *samlslosession.SAMLSLOSession) (err error)
}
type SSOCallbackHandler ¶
type SSOCallbackHandler struct {
AuthflowController *AuthflowController
ErrorRenderer *ErrorRenderer
OAuthStateStore SSOCallbackHandlerOAuthStateStore
AccountManagement *accountmanagement.Service
}
func (*SSOCallbackHandler) ServeHTTP ¶
func (h *SSOCallbackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SSOCallbackHandlerOAuthStateStore ¶
type SSOCallbackHandlerOAuthStateStore interface {
PopAndRecoverState(ctx context.Context, stateToken string) (state *webappoauth.WebappOAuthState, err error)
}
type SessionStore ¶
type SettingsImplementationSwitcherHandler ¶
func (*SettingsImplementationSwitcherHandler) ServeHTTP ¶
func (h *SettingsImplementationSwitcherHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SettingsImplementationSwitcherMiddleware ¶
type SettingsImplementationSwitcherMiddleware struct {
UIImplementationService SettingsImplementationSwitcherMiddlewareUIImplementationService
}
type SettingsImplementationSwitcherMiddlewareUIImplementationService ¶
type SettingsImplementationSwitcherMiddlewareUIImplementationService interface {
GetSettingsUIImplementation() config.SettingsUIImplementation
}
type TesterAuthTokensIssuer ¶
type TesterAuthTokensIssuer interface {
IssueTokensForAuthorizationCode(
ctx context.Context,
client *config.OAuthClientConfig,
r protocol.TokenRequest,
) (*oauthhandler.HandleResult, error)
IssueAppSessionToken(ctx context.Context, refreshToken string) (string, *oauth.AppSessionToken, error)
}
type TesterCookieManager ¶
type TesterHandler ¶
type TesterHandler struct {
AppID config.AppID
ControllerFactory ControllerFactory
OauthEndpointsProvider oauth.EndpointsProvider
TesterEndpointsProvider tester.EndpointsProvider
TesterService TesterService
TesterTokenIssuer TesterAuthTokensIssuer
OAuthClientResolver *oauthclient.Resolver
AppSessionTokenService TesterAppSessionTokenService
CookieManager TesterCookieManager
Renderer Renderer
BaseViewModel *viewmodels.BaseViewModeler
UserInfoProvider TesterUserInfoProvider
OfflineGrants TesterOfflineGrantService
}
func (*TesterHandler) ServeHTTP ¶
func (h *TesterHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TesterService ¶
type TesterService interface {
GetToken(
ctx context.Context,
appID config.AppID,
tokenID string,
consume bool,
) (*tester.TesterToken, error)
CreateResult(
ctx context.Context,
appID config.AppID,
result *tester.TesterResult,
) (*tester.TesterResult, error)
GetResult(
ctx context.Context,
appID config.AppID,
resultID string,
) (*tester.TesterResult, error)
}
type TesterState ¶
type TesterState struct {
Token string `json:"token"`
}
type TesterUserInfoProvider ¶
type TesterViewModel ¶
type UserProfile ¶
type UserProfile map[string]interface{}
func GetUserProfile ¶
func GetUserProfile(user *model.User) UserProfile
type WebappOAuthClientResolver ¶
type WebappOAuthClientResolver interface {
ResolveClient(clientID string) *config.OAuthClientConfig
}
type WebsocketHandler ¶
type WebsocketHandler struct {
AppID config.AppID
RedisHandle *appredis.Handle
Publisher *Publisher
}
func (*WebsocketHandler) Accept ¶
func (h *WebsocketHandler) Accept(r *http.Request) (channelName string, err error)
func (*WebsocketHandler) OnRedisSubscribe ¶
func (h *WebsocketHandler) OnRedisSubscribe(r *http.Request) error
func (*WebsocketHandler) ServeHTTP ¶
func (h *WebsocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type WebsocketMessage ¶
type WebsocketMessage struct {
Kind WebsocketMessageKind `json:"kind"`
}
type WebsocketMessageKind ¶
type WebsocketMessageKind string
type WechatCallbackHandler ¶
type WechatCallbackHandler struct {
ControllerFactory ControllerFactory
BaseViewModel *viewmodels.BaseViewModeler
OAuthStateStore WechatCallbackHandlerOAuthStateStore
}
WechatCallbackHandler receives WeChat authorization result (code or error) and set it into the web session. Refreshing original auth ui WeChat auth page (/sso/wechat/auth/:alias) will get and consume the result from the web session.
In web, user will use their WeChat app to scan the qr code in auth ui WeChat auth page, then they will complete authorization in their WeChat app and redirect to this endpoint through WeChat. This endpoint will set the result in web session and instruct user go back to the original auth ui. The original auth ui will refresh and proceed.
In native app, the app will receive delegate function call when user click login in with WeChat. Developer needs to implement and obtain WeChat authorization code through native WeChat SDK. After obtaining the code, developer needs to call this endpoint with code through Authgear SDK. At this moment, user can click the proceed button in auth ui WeChat auth page to continue.
func (*WechatCallbackHandler) ServeHTTP ¶
func (h *WechatCallbackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type WechatCallbackHandlerOAuthStateStore ¶
type WechatCallbackHandlerOAuthStateStore interface {
PopAndRecoverState(ctx context.Context, stateToken string) (state *webappoauth.WebappOAuthState, err error)
}
type WhatsappCloudAPIWebhookHandler ¶
type WhatsappCloudAPIWebhookHandler struct {
AppID config.AppID
WhatsappService WhatsappCloudAPIWebhookWhatsappService
Credentials *config.WhatsappCloudAPICredentials
AppHostSuffixes config.AppHostSuffixes
}
func (*WhatsappCloudAPIWebhookHandler) ServeHTTP ¶
func (h *WhatsappCloudAPIWebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type WhatsappCloudAPIWebhookWhatsappService ¶
type WhatsappCloudAPIWebhookWhatsappService interface {
UpdateMessageStatus(ctx context.Context, messageID string, status whatsapp.WhatsappMessageStatus, errors []whatsapp.WhatsappStatusError) error
}
Source Files
¶
- app_static_assets.go
- auth_entry_point_middleware.go
- authflow_controller.go
- authflow_fallback.go
- bot_protection.go
- client.go
- consent.go
- controller.go
- cookie.go
- csrf_error_instruction.go
- csrf_middleware.go
- deps.go
- error_feature_disabled.go
- error_renderer.go
- generated_static_assets.go
- global_session_service.go
- identity.go
- implementation_switcher.go
- interaction.go
- login_link.go
- logout.go
- noproject_sso_callback.go
- oauth_entrypoint.go
- otp.go
- panic_middleware.go
- passkey_creation_options.go
- passkey_request_options.go
- publisher.go
- renderer.go
- return.go
- robots_txt.go
- root.go
- setting_implementation_switcher.go
- sso_callback.go
- template.go
- tester.go
- turbo_response_writer.go
- user_profile.go
- util.go
- websocket.go
- wechat_callback.go
- whatsapp_webhook.go
- wire_gen.go