Documentation ¶
Index ¶
- Constants
- Variables
- func Embed(data map[string]interface{}, s interface{})
- func SliceContains(slice []interface{}, value interface{}) bool
- type AlternativeStep
- type AlternativeStepsViewModel
- type AlternativeStepsViewModeler
- func (a *AlternativeStepsViewModeler) AuthenticationAlternatives(graph *interaction.Graph, currentStepKind webapp.SessionStepKind) (*AlternativeStepsViewModel, error)
- func (a *AlternativeStepsViewModeler) CreateAuthenticatorAlternatives(graph *interaction.Graph, currentStepKind webapp.SessionStepKind) (*AlternativeStepsViewModel, error)
- type AuthenticationBeginNode
- type AuthenticationPhoneOTPTriggerNode
- type AuthenticationViewModel
- type AuthenticationViewModeler
- type AuthflowBranch
- type AuthflowBranchFilter
- type AuthflowBranchViewModel
- type AuthflowViewModel
- type AuthflowViewModeler
- func (m *AuthflowViewModeler) NewWithAccountRecoveryAuthflow(f *authflow.FlowResponse, r *http.Request) AuthflowViewModel
- func (m *AuthflowViewModeler) NewWithAuthflow(s *webapp.Session, f *authflow.FlowResponse, r *http.Request) AuthflowViewModel
- func (m *AuthflowViewModeler) NewWithConfig() AuthflowViewModel
- type BaseLogger
- type BaseViewModel
- type BaseViewModeler
- func (m *BaseViewModeler) ViewModel(r *http.Request, rw http.ResponseWriter) BaseViewModel
- func (m *BaseViewModeler) ViewModelForAuthFlow(r *http.Request, rw http.ResponseWriter) BaseViewModel
- func (m *BaseViewModeler) ViewModelForInlinePreviewAuthFlow(r *http.Request, rw http.ResponseWriter) BaseViewModel
- type ChangePasswordGetter
- type ChangePasswordViewModel
- type ChangePasswordViewModeler
- type CreateAuthenticatorBeginNode
- type CustomAttribute
- type CustomAttributeEnum
- type EnsureVerificationBeginNode
- type ErrorService
- type FlashMessage
- type IdentityCandidatesGetter
- type InlinePreviewAuthflowBranchViewModeler
- func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewCreatePassword() AuthflowBranchViewModel
- func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterOOBOTP() AuthflowBranchViewModel
- func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterPassword() AuthflowBranchViewModel
- func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterTOTP() AuthflowBranchViewModel
- func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewOOBOTPLink() AuthflowBranchViewModel
- func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewUsePasskey() AuthflowBranchViewModel
- type LoginLinkTriggerNode
- type OOBOTPTriggerNode
- type PasswordPolicyViewModel
- type PasswordPolicyViewModelOptions
- type PhoneOTPAlternativeStepsViewModel
- type SettingsAuthenticatorService
- type SettingsIdentityService
- type SettingsMFAService
- type SettingsProfileIdentityService
- type SettingsProfileUserService
- type SettingsProfileViewModel
- type SettingsProfileViewModeler
- type SettingsUserService
- type SettingsViewModel
- type SettingsViewModeler
- type StaticAssetResolver
- type TranslationService
- type TranslationsCompat
- type TranslationsCompatImpl
- type WebappOAuthClientResolver
- type WhatsappOTPTriggerNode
Constants ¶
View Source
const ( PreviewDummyPhoneNumberMasked = "PHONE NUMBER" PreviewDummyEmailMasked = "johndoe*******@example.com" )
Variables ¶
View Source
var DependencySet = wire.NewSet( NewBaseLogger, wire.Struct(new(BaseViewModeler), "*"), wire.Struct(new(SettingsViewModeler), "*"), wire.Struct(new(SettingsProfileViewModeler), "*"), wire.Struct(new(AlternativeStepsViewModeler), "*"), wire.Struct(new(AuthenticationViewModeler), "*"), wire.Struct(new(ChangePasswordViewModeler), "*"), wire.Struct(new(AuthflowViewModeler), "*"), wire.Struct(new(InlinePreviewAuthflowBranchViewModeler), "*"), )
Functions ¶
func SliceContains ¶
func SliceContains(slice []interface{}, value interface{}) bool
Types ¶
type AlternativeStep ¶
type AlternativeStepsViewModel ¶
type AlternativeStepsViewModel struct { AuthenticationStage string AlternativeSteps []AlternativeStep CanRequestDeviceToken bool }
type AlternativeStepsViewModeler ¶
type AlternativeStepsViewModeler struct {
AuthenticationConfig *config.AuthenticationConfig
}
func (*AlternativeStepsViewModeler) AuthenticationAlternatives ¶
func (a *AlternativeStepsViewModeler) AuthenticationAlternatives(graph *interaction.Graph, currentStepKind webapp.SessionStepKind) (*AlternativeStepsViewModel, error)
nolint: gocognit
func (*AlternativeStepsViewModeler) CreateAuthenticatorAlternatives ¶
func (a *AlternativeStepsViewModeler) CreateAuthenticatorAlternatives(graph *interaction.Graph, currentStepKind webapp.SessionStepKind) (*AlternativeStepsViewModel, error)
nolint: gocognit
type AuthenticationBeginNode ¶
type AuthenticationBeginNode interface { GetAuthenticationEdges() ([]interaction.Edge, error) GetAuthenticationStage() authn.AuthenticationStage }
type AuthenticationPhoneOTPTriggerNode ¶
type AuthenticationPhoneOTPTriggerNode interface {
GetSelectedPhoneNumberForPhoneOTPAuthentication() string
}
type AuthenticationViewModel ¶
type AuthenticationViewModel struct { IdentityCandidates []identity.Candidate IdentityCount int LoginIDDisabled bool PhoneLoginIDEnabled bool EmailLoginIDEnabled bool UsernameLoginIDEnabled bool PasskeyEnabled bool // NonPhoneLoginIDInputType is the "type" attribute for the non-phone <input>. // It is "email" or "text". NonPhoneLoginIDInputType string // NonPhoneLoginIDType is the type of non-phone login ID. // It is "email", "username" or "email_or_username". NonPhoneLoginIDType string // LoginIDContextualType is the type the end-user thinks they should enter. // It depends on q_login_id_input_type. // It is "email", "phone", "username", or "email_or_username". LoginIDContextualType string PasskeyRequestOptionsJSON string }
type AuthenticationViewModeler ¶
type AuthenticationViewModeler struct { Authentication *config.AuthenticationConfig LoginID *config.LoginIDConfig }
func (*AuthenticationViewModeler) NewWithCandidates ¶
func (m *AuthenticationViewModeler) NewWithCandidates(candidates []identity.Candidate, form url.Values) AuthenticationViewModel
func (*AuthenticationViewModeler) NewWithGraph ¶
func (m *AuthenticationViewModeler) NewWithGraph(graph *interaction.Graph, form url.Values) AuthenticationViewModel
type AuthflowBranch ¶
type AuthflowBranch struct { Authentication config.AuthenticationFlowAuthentication Index int Channel model.AuthenticatorOOBChannel MaskedClaimValue string OTPForm otp.Form VerificationSkippable bool BotProtectionRequired bool }
type AuthflowBranchFilter ¶
type AuthflowBranchFilter func([]AuthflowBranch) []AuthflowBranch
type AuthflowBranchViewModel ¶
type AuthflowBranchViewModel struct { // FlowType is mainly for pages to tell if the flow is reauthentication or not. FlowType authflow.FlowType ActionType authflow.FlowActionType DeviceTokenEnabled bool Branches []AuthflowBranch }
func NewAuthflowBranchViewModel ¶
func NewAuthflowBranchViewModel( screen *webapp.AuthflowScreenWithFlowResponse, filters ...AuthflowBranchFilter) AuthflowBranchViewModel
type AuthflowViewModel ¶
type AuthflowViewModel struct { IdentityCandidates []map[string]interface{} LoginIDDisabled bool PhoneLoginIDEnabled bool EmailLoginIDEnabled bool UsernameLoginIDEnabled bool PasskeyEnabled bool // NonPhoneLoginIDInputType is the "type" attribute for the non-phone <input>. // It is "email" or "text". NonPhoneLoginIDInputType string // NonPhoneLoginIDType is the type of non-phone login ID. // It is "email", "username" or "email_or_username". NonPhoneLoginIDType string // LoginIDKey is the key the end-user has chosen. // It is "email", "phone", or "username". LoginIDKey string // LoginIDInputType is the input the end-user has chosen. // It is "email", "phone" or "text". LoginIDInputType string LoginIDDefaultValue string LoginIDInputReadOnly bool AlternativesDisabled bool // LoginIDContextualType is the type the end-user thinks they should enter. // It depends on LoginIDInputType. // It is "email", "phone", "username", or "email_or_username". LoginIDContextualType string PasskeyRequestOptionsJSON string PhoneLoginIDBotProtectionRequired bool EmailLoginIDBotProtectionRequired bool UsernameLoginIDBotProtectionRequired bool PasskeyBotProtectionRequired bool OAuthBotProtectionRequired bool }
type AuthflowViewModeler ¶
type AuthflowViewModeler struct { Authentication *config.AuthenticationConfig LoginID *config.LoginIDConfig Identity *config.IdentityConfig }
func (*AuthflowViewModeler) NewWithAccountRecoveryAuthflow ¶
func (m *AuthflowViewModeler) NewWithAccountRecoveryAuthflow(f *authflow.FlowResponse, r *http.Request) AuthflowViewModel
func (*AuthflowViewModeler) NewWithAuthflow ¶
func (m *AuthflowViewModeler) NewWithAuthflow( s *webapp.Session, f *authflow.FlowResponse, r *http.Request, ) AuthflowViewModel
nolint: gocognit
func (*AuthflowViewModeler) NewWithConfig ¶
func (m *AuthflowViewModeler) NewWithConfig() AuthflowViewModel
nolint: gocognit
type BaseLogger ¶
func NewBaseLogger ¶
func NewBaseLogger(lf *log.Factory) BaseLogger
type BaseViewModel ¶
type BaseViewModel struct { RequestURI string HasXStep bool ColorScheme string CSPNonce string CSRFField htmltemplate.HTML Translations TranslationsCompat HasAppSpecificAsset func(id string) bool StaticAssetURL func(id string) (url string) GeneratedStaticAssetURL func(id string) (url string) DarkThemeEnabled bool LightThemeEnabled bool WatermarkEnabled bool AllowedPhoneCountryCodeJSON string PinnedPhoneCountryCodeJSON string GeoIPCountryCode string FormJSON string BrandPageURI string // ClientURI is the home page of the client. ClientURI string ClientName string SliceContains func([]interface{}, interface{}) bool MakeURL func(path string, pairs ...string) string MakeURLWithBackURL func(path string, pairs ...string) string MakeBackURL func(path string, pairs ...string) string MakeCurrentStepURL func(pairs ...string) string RawError *apierrors.APIError Error interface{} SessionStepURLs []string ForgotPasswordEnabled bool PublicSignupDisabled bool PageLoadedAt int IsNativePlatform bool FlashMessageType string ResolvedLanguageTag string ResolvedCLDRLocale string HTMLDir string // IsSupportedMobilePlatform is true when the user agent is iOS or Android. IsSupportedMobilePlatform bool GoogleTagManagerContainerID string TutorialMessageType string // HasThirdPartyApp indicates whether the project has third-party client HasThirdPartyClient bool AuthUISentryDSN string AuthUIWindowMessageAllowedOrigins string FirstNonPasskeyPrimaryAuthenticatorType string // websocket is used in interaction only, we disable it in authflow WebsocketDisabled bool InlinePreview bool ShouldFocusInput bool LogUnknownError func(err map[string]interface{}) string BotProtectionEnabled bool BotProtectionProviderType string BotProtectionProviderSiteKey string ResolvedBotProtectionLanguage string }
BaseViewModel contains data that are common to all pages.
func (*BaseViewModel) SetError ¶
func (m *BaseViewModel) SetError(err error)
func (*BaseViewModel) SetFormJSON ¶
func (m *BaseViewModel) SetFormJSON(form url.Values)
func (*BaseViewModel) SetTutorial ¶
func (m *BaseViewModel) SetTutorial(name httputil.TutorialCookieName)
type BaseViewModeler ¶
type BaseViewModeler struct { TrustProxy config.TrustProxy OAuth *config.OAuthConfig AuthUI *config.UIConfig AuthUIFeatureConfig *config.UIFeatureConfig StaticAssets StaticAssetResolver ForgotPassword *config.ForgotPasswordConfig Authentication *config.AuthenticationConfig GoogleTagManager *config.GoogleTagManagerConfig BotProtection *config.BotProtectionConfig ErrorService ErrorService Translations TranslationService Clock clock.Clock FlashMessage FlashMessage DefaultLanguageTag template.DefaultLanguageTag SupportedLanguageTags template.SupportedLanguageTags AuthUISentryDSN config.AuthUISentryDSN AuthUIWindowMessageAllowedOrigins config.AuthUIWindowMessageAllowedOrigins OAuthClientResolver WebappOAuthClientResolver Logger BaseLogger }
func (*BaseViewModeler) ViewModel ¶
func (m *BaseViewModeler) ViewModel(r *http.Request, rw http.ResponseWriter) BaseViewModel
nolint: gocognit
func (*BaseViewModeler) ViewModelForAuthFlow ¶
func (m *BaseViewModeler) ViewModelForAuthFlow(r *http.Request, rw http.ResponseWriter) BaseViewModel
func (*BaseViewModeler) ViewModelForInlinePreviewAuthFlow ¶
func (m *BaseViewModeler) ViewModelForInlinePreviewAuthFlow(r *http.Request, rw http.ResponseWriter) BaseViewModel
type ChangePasswordGetter ¶
type ChangePasswordGetter interface {
GetChangeReason() *interaction.AuthenticatorUpdateReason
}
type ChangePasswordViewModel ¶
type ChangePasswordViewModeler ¶
type ChangePasswordViewModeler struct { Authentication *config.AuthenticationConfig LoginID *config.LoginIDConfig }
func (*ChangePasswordViewModeler) NewWithAuthflow ¶
func (m *ChangePasswordViewModeler) NewWithAuthflow(reason *declarative.PasswordChangeReason) ChangePasswordViewModel
func (*ChangePasswordViewModeler) NewWithGraph ¶
func (m *ChangePasswordViewModeler) NewWithGraph(graph *interaction.Graph) ChangePasswordViewModel
type CreateAuthenticatorBeginNode ¶
type CreateAuthenticatorBeginNode interface { GetCreateAuthenticatorEdges() ([]interaction.Edge, error) GetCreateAuthenticatorStage() authn.AuthenticationStage }
type CustomAttribute ¶
type CustomAttributeEnum ¶
type EnsureVerificationBeginNode ¶
type EnsureVerificationBeginNode interface {
GetVerifyIdentityEdges() ([]interaction.Edge, error)
}
type ErrorService ¶
type ErrorService interface {
PopError(ctx context.Context, w http.ResponseWriter, r *http.Request) (*webapp.ErrorState, bool)
}
type FlashMessage ¶
type FlashMessage interface {
Pop(r *http.Request, rw http.ResponseWriter) string
}
type InlinePreviewAuthflowBranchViewModeler ¶
func (*InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewCreatePassword ¶
func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewCreatePassword() AuthflowBranchViewModel
func (*InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterOOBOTP ¶
func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterOOBOTP() AuthflowBranchViewModel
func (*InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterPassword ¶
func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterPassword() AuthflowBranchViewModel
func (*InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterTOTP ¶
func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewEnterTOTP() AuthflowBranchViewModel
func (*InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewOOBOTPLink ¶
func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewOOBOTPLink() AuthflowBranchViewModel
func (*InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewUsePasskey ¶
func (m *InlinePreviewAuthflowBranchViewModeler) NewAuthflowBranchViewModelForInlinePreviewUsePasskey() AuthflowBranchViewModel
type LoginLinkTriggerNode ¶
type LoginLinkTriggerNode interface {
GetLoginLinkOTPTarget() string
}
type OOBOTPTriggerNode ¶
type OOBOTPTriggerNode interface {
GetOOBOTPTarget() string
}
type PasswordPolicyViewModel ¶
type PasswordPolicyViewModel struct { PasswordPolicies []password.Policy IsNew bool PasswordRulesString string }
func NewPasswordPolicyViewModel ¶
func NewPasswordPolicyViewModel(policies []password.Policy, rules string, apiError *apierrors.APIError, opt *PasswordPolicyViewModelOptions) PasswordPolicyViewModel
nolint: gocognit
func NewPasswordPolicyViewModelFromAuthflow ¶
func NewPasswordPolicyViewModelFromAuthflow(p *declarative.PasswordPolicy, apiError *apierrors.APIError, opt *PasswordPolicyViewModelOptions) PasswordPolicyViewModel
type PasswordPolicyViewModelOptions ¶
type PasswordPolicyViewModelOptions struct {
IsNew bool
}
func GetDefaultPasswordPolicyViewModelOptions ¶
func GetDefaultPasswordPolicyViewModelOptions() *PasswordPolicyViewModelOptions
type PhoneOTPAlternativeStepsViewModel ¶
type PhoneOTPAlternativeStepsViewModel struct {
PhoneOTPAlternativeSteps []AlternativeStep
}
func (*PhoneOTPAlternativeStepsViewModel) AddAlternatives ¶
func (m *PhoneOTPAlternativeStepsViewModel) AddAlternatives(graph *interaction.Graph, currentStepKind webapp.SessionStepKind) error
type SettingsAuthenticatorService ¶
type SettingsAuthenticatorService interface {
List(ctx context.Context, userID string, filters ...authenticator.Filter) ([]*authenticator.Info, error)
}
type SettingsIdentityService ¶
type SettingsMFAService ¶
type SettingsProfileViewModel ¶
type SettingsProfileViewModel struct { FormattedName string EndUserAccountID string FormattedNames string Today string Timezones []tzutil.Timezone Alpha2 []string Languages []string Emails []string PhoneNumbers []string PreferredUsernames []string IsReadable func(jsonpointer string) bool IsEditable func(jsonpointer string) bool GetCustomAttributeByPointer func(jsonpointer string) *CustomAttribute IsStandardAttributesAllHidden bool Name string GivenName string FamilyName string MiddleName string Nickname string Picture string Profile string Website string Email string PhoneNumber string PreferredUsername string Gender string Birthdate string Zoneinfo string ZoneinfoTimezone *tzutil.Timezone Locale string AddressStreetAddress string AddressLocality string AddressRegion string AddressPostalCode string AddressCountry string CustomAttributes []CustomAttribute EmailIdentityIDs []string UsernameIdentityIDs []string PhoneIdentityIDs []string }
type SettingsProfileViewModeler ¶
type SettingsProfileViewModeler struct { Localization *config.LocalizationConfig UserProfileConfig *config.UserProfileConfig Users SettingsProfileUserService Identities SettingsProfileIdentityService Clock clock.Clock }
func (*SettingsProfileViewModeler) ViewModel ¶
func (m *SettingsProfileViewModeler) ViewModel(ctx context.Context, userID string) (*SettingsProfileViewModel, error)
nolint: gocognit
type SettingsUserService ¶
type SettingsViewModel ¶
type SettingsViewModel struct { Zoneinfo string Authenticators []*authenticator.Info NumberOfDeviceTokens int HasDeviceTokens bool ListRecoveryCodesAllowed bool HasRecoveryCodes bool ShowBiometric bool HasSecondaryTOTP bool HasSecondaryOOBOTPEmail bool HasSecondaryOOBOTPSMS bool OOBOTPSMSDefaultChannel string SecondaryPassword *authenticator.Info HasMFA bool PhoneOTPMode string ShowSecondaryTOTP bool ShowSecondaryOOBOTPEmail bool ShowSecondaryOOBOTPSMS bool ShowSecondaryPassword bool ShowMFA bool LatestPrimaryPasskey *authenticator.Info ShowPrimaryPasskey bool }
type SettingsViewModeler ¶
type SettingsViewModeler struct { Clock clock.Clock Users SettingsUserService Authenticators SettingsAuthenticatorService MFA SettingsMFAService AuthenticatorConfig *config.AuthenticatorConfig Authentication *config.AuthenticationConfig Biometric *config.BiometricConfig }
func (*SettingsViewModeler) ViewModel ¶
func (m *SettingsViewModeler) ViewModel(ctx context.Context, userID string) (*SettingsViewModel, error)
nolint: gocognit
type StaticAssetResolver ¶
type TranslationService ¶
type TranslationsCompat ¶
type TranslationsCompatImpl ¶
type TranslationsCompatImpl struct { Context context.Context // This context is intentionally contained in a struct. TranslationService TranslationService }
func (*TranslationsCompatImpl) HasKey ¶
func (t *TranslationsCompatImpl) HasKey(key string) (bool, error)
func (*TranslationsCompatImpl) RenderText ¶
func (t *TranslationsCompatImpl) RenderText(key string, args interface{}) (string, error)
type WebappOAuthClientResolver ¶
type WebappOAuthClientResolver interface {
ResolveClient(clientID string) *config.OAuthClientConfig
}
type WhatsappOTPTriggerNode ¶
type WhatsappOTPTriggerNode interface {
GetPhone() string
}
Click to show internal directories.
Click to hide internal directories.