Documentation ¶
Index ¶
- Constants
- Variables
- type CFeature
- func (f *CFeature) AllowSignupsFrom(emails ...string) MakeFeature
- func (f *CFeature) AuthenticateSiteRequest(w http.ResponseWriter, r *http.Request) (handled bool, modified *http.Request)
- func (f *CFeature) AuthorizeUserSignIn(w http.ResponseWriter, r *http.Request, claims *feature.CSiteAuthClaims) (handled bool, m *http.Request)
- func (f *CFeature) Build(b feature.Buildable) (err error)
- func (f *CFeature) DenySignupsFrom(emails ...string) MakeFeature
- func (f *CFeature) FinalizeSiteRequest(w http.ResponseWriter, r *http.Request) (m *http.Request)
- func (f *CFeature) GenerateJWT(claims *feature.CSiteAuthClaims) (token string, err error)
- func (f *CFeature) GetSessionDuration() (duration time.Duration)
- func (f *CFeature) GetSignUpsAllowed() (allowed bool)
- func (f *CFeature) GetVerifiedDuration() (duration time.Duration)
- func (f *CFeature) HandleSignInPage(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) HandleSignOutPage(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) IncludeMultiFactors(features ...feature.Feature) MakeFeature
- func (f *CFeature) IncludeProviders(features ...feature.Feature) MakeFeature
- func (f *CFeature) IncludingMultiFactors(tags ...feature.Tag) MakeFeature
- func (f *CFeature) IncludingProviders(tags ...feature.Tag) MakeFeature
- func (f *CFeature) Init(this interface{})
- func (f *CFeature) IsUserAllowed(email string) (allowed bool)
- func (f *CFeature) Make() (feat Feature)
- func (f *CFeature) MakeAuthClaims(aud, email string, ctx context.Context) (claims *feature.CSiteAuthClaims)
- func (f *CFeature) MakeHandleSiteSettingsPanel(settingsPath string, order []string, lookup map[string]http.HandlerFunc) (handle http.HandlerFunc)
- func (f *CFeature) MakeServeSiteSettingsPanel(settingsPath string, order []string, lookup map[string]http.HandlerFunc) (serve http.HandlerFunc)
- func (f *CFeature) NumFactorsPresent() (count int)
- func (f *CFeature) NumFactorsRequired() (count int)
- func (f *CFeature) PostStartup(_ *cli.Context) (err error)
- func (f *CFeature) ProcessChallengeRequest(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) ProcessVerificationRequest(verifyTarget string, w http.ResponseWriter, r *http.Request) (handled bool, redirect string)
- func (f *CFeature) RequireVerification(verifyTarget string, w http.ResponseWriter, r *http.Request) (handled bool, redirect string)
- func (f *CFeature) ResetUserFactors(r *http.Request, eid string) (err error)
- func (f *CFeature) ServeChallengeRequest(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) ServeSettingsPanelSelectorPage(settingsPath string, w http.ResponseWriter, r *http.Request)
- func (f *CFeature) ServeSettingsPanelSetupSelectorPage(settingsPath string, w http.ResponseWriter, r *http.Request)
- func (f *CFeature) ServeSignInPage(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) ServeSignOutPage(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) ServeVerificationRequest(verifyTarget string, w http.ResponseWriter, r *http.Request) (handled bool, redirect string)
- func (f *CFeature) SetAllBackupsRequired(required bool) MakeFeature
- func (f *CFeature) SetJwtCookieName(cookieName string) MakeFeature
- func (f *CFeature) SetNumRequiredFactors(count int) MakeFeature
- func (f *CFeature) SetRequiredAccountBackups(tags ...feature.Tag) MakeFeature
- func (f *CFeature) SetRequiredMultiFactorBackups(tags ...feature.Tag) MakeFeature
- func (f *CFeature) SetRoutePaths(signIn, signOut, challenge string) MakeFeature
- func (f *CFeature) SetSameSiteCookies(sameSite http.SameSite) MakeFeature
- func (f *CFeature) SetSecretKey(aud string, value []byte) MakeFeature
- func (f *CFeature) SetSecureCookies(secure bool) MakeFeature
- func (f *CFeature) SetSessionDuration(duration time.Duration) MakeFeature
- func (f *CFeature) SetUserFactor(r *http.Request, claim *feature.CSiteAuthClaimsFactor)
- func (f *CFeature) SetUserSignups(allowed bool) MakeFeature
- func (f *CFeature) SetVerifiedDuration(duration time.Duration) MakeFeature
- func (f *CFeature) SetXsrfCookieName(cookieName string) MakeFeature
- func (f *CFeature) SetXsrfHeaderName(headerName string) MakeFeature
- func (f *CFeature) SetupSiteFeature(s feature.Site) (err error)
- func (f *CFeature) SignInPageHandler(w http.ResponseWriter, r *http.Request) (claims *feature.CSiteAuthClaims, handled bool, redirect string, err error)
- func (f *CFeature) SignOutPageHandler(w http.ResponseWriter, r *http.Request) (handled bool, redirect string, err error)
- func (f *CFeature) SiteAuthChallengePath() (path string)
- func (f *CFeature) SiteAuthSignInPath() (path string)
- func (f *CFeature) SiteAuthSignOutPath() (path string)
- func (f *CFeature) SiteFeatureMenu(r *http.Request) (m menu.Menu)
- func (f *CFeature) SiteSettingsPanel(settingsPath string) (serve, handle http.HandlerFunc)
- func (f *CFeature) Startup(ctx *cli.Context) (err error)
- func (f *CFeature) UpdateSiteRoutes(r chi.Router)
- func (f *CFeature) UsageNotes() (notes []string)
- func (f *CFeature) UserActions() (actions feature.Actions)
- func (f *CFeature) VerifyJWT(r *http.Request) (claims *feature.CSiteAuthClaims, err error)
- func (f *CFeature) VerifyRequiredVerifications(claims *feature.CSiteAuthClaims, w http.ResponseWriter, r *http.Request) (handled bool, redirect string)
- type Feature
- type MakeFeature
Constants ¶
View Source
const ( DefaultAudience = "default" MinSessionDuration = time.Minute SignInNonceKey = "sign-in--form" SignInNonceName = "sign-in--nonce" SignOutNonceKey = "sign-out--form" SignOutNonceName = "sign-out--nonce" ChallengeNonceKey = "otp--challenge--form" ChallengeNonceName = "otp--challenge--nonce" VerificationNonceKey = "otp--verification--form" VerificationNonceName = "otp--verification--nonce" SettingsNonceKey = "settings--form" SettingsNonceName = "settings--nonce" )
View Source
const Tag feature.Tag = "site-auth"
Variables ¶
View Source
var ( DefaultSignInPath = "/sign-in" DefaultSignOutPath = "/sign-out" DefaultSettingsPath = "/settings" DefaultChallengePath = "/mfa" DefaultJwtCookieName = "enjin-site-jwt-cookie" DefaultXsrfCookieName = "enjin-site-xsrf-Cookie" DefaultXsrfHeaderName = "enjin-site-xsrf-header" DefaultRequiredFactors = 0 DefaultSessionDuration = time.Hour DefaultVerifiedDuration = time.Minute * 10 DefaultDeleteOwnUserConfirmation = "Please delete my own user, thank you!" )
Functions ¶
This section is empty.
Types ¶
type CFeature ¶
type CFeature struct { site.CSiteFeature[MakeFeature] // contains filtered or unexported fields }
func (*CFeature) AllowSignupsFrom ¶
func (f *CFeature) AllowSignupsFrom(emails ...string) MakeFeature
func (*CFeature) AuthenticateSiteRequest ¶
func (*CFeature) AuthorizeUserSignIn ¶
func (f *CFeature) AuthorizeUserSignIn(w http.ResponseWriter, r *http.Request, claims *feature.CSiteAuthClaims) (handled bool, m *http.Request)
func (*CFeature) DenySignupsFrom ¶
func (f *CFeature) DenySignupsFrom(emails ...string) MakeFeature
func (*CFeature) FinalizeSiteRequest ¶
func (*CFeature) GenerateJWT ¶
func (f *CFeature) GenerateJWT(claims *feature.CSiteAuthClaims) (token string, err error)
func (*CFeature) GetSessionDuration ¶
func (*CFeature) GetSignUpsAllowed ¶
func (*CFeature) GetVerifiedDuration ¶
func (*CFeature) HandleSignInPage ¶
func (f *CFeature) HandleSignInPage(w http.ResponseWriter, r *http.Request)
func (*CFeature) HandleSignOutPage ¶
func (f *CFeature) HandleSignOutPage(w http.ResponseWriter, r *http.Request)
func (*CFeature) IncludeMultiFactors ¶
func (f *CFeature) IncludeMultiFactors(features ...feature.Feature) MakeFeature
func (*CFeature) IncludeProviders ¶
func (f *CFeature) IncludeProviders(features ...feature.Feature) MakeFeature
func (*CFeature) IncludingMultiFactors ¶
func (f *CFeature) IncludingMultiFactors(tags ...feature.Tag) MakeFeature
func (*CFeature) IncludingProviders ¶
func (f *CFeature) IncludingProviders(tags ...feature.Tag) MakeFeature
func (*CFeature) IsUserAllowed ¶
func (*CFeature) MakeAuthClaims ¶
func (*CFeature) MakeHandleSiteSettingsPanel ¶
func (f *CFeature) MakeHandleSiteSettingsPanel(settingsPath string, order []string, lookup map[string]http.HandlerFunc) (handle http.HandlerFunc)
func (*CFeature) MakeServeSiteSettingsPanel ¶
func (f *CFeature) MakeServeSiteSettingsPanel(settingsPath string, order []string, lookup map[string]http.HandlerFunc) (serve http.HandlerFunc)
func (*CFeature) NumFactorsPresent ¶
func (*CFeature) NumFactorsRequired ¶
func (*CFeature) PostStartup ¶
func (*CFeature) ProcessChallengeRequest ¶
func (f *CFeature) ProcessChallengeRequest(w http.ResponseWriter, r *http.Request)
func (*CFeature) ProcessVerificationRequest ¶
func (*CFeature) RequireVerification ¶
func (*CFeature) ResetUserFactors ¶
func (*CFeature) ServeChallengeRequest ¶
func (f *CFeature) ServeChallengeRequest(w http.ResponseWriter, r *http.Request)
func (*CFeature) ServeSettingsPanelSelectorPage ¶
func (*CFeature) ServeSettingsPanelSetupSelectorPage ¶ added in v0.5.1
func (*CFeature) ServeSignInPage ¶
func (f *CFeature) ServeSignInPage(w http.ResponseWriter, r *http.Request)
func (*CFeature) ServeSignOutPage ¶
func (f *CFeature) ServeSignOutPage(w http.ResponseWriter, r *http.Request)
func (*CFeature) ServeVerificationRequest ¶
func (*CFeature) SetAllBackupsRequired ¶
func (f *CFeature) SetAllBackupsRequired(required bool) MakeFeature
func (*CFeature) SetJwtCookieName ¶
func (f *CFeature) SetJwtCookieName(cookieName string) MakeFeature
func (*CFeature) SetNumRequiredFactors ¶
func (f *CFeature) SetNumRequiredFactors(count int) MakeFeature
func (*CFeature) SetRequiredAccountBackups ¶
func (f *CFeature) SetRequiredAccountBackups(tags ...feature.Tag) MakeFeature
func (*CFeature) SetRequiredMultiFactorBackups ¶
func (f *CFeature) SetRequiredMultiFactorBackups(tags ...feature.Tag) MakeFeature
func (*CFeature) SetRoutePaths ¶
func (f *CFeature) SetRoutePaths(signIn, signOut, challenge string) MakeFeature
func (*CFeature) SetSameSiteCookies ¶ added in v0.5.4
func (f *CFeature) SetSameSiteCookies(sameSite http.SameSite) MakeFeature
func (*CFeature) SetSecretKey ¶
func (f *CFeature) SetSecretKey(aud string, value []byte) MakeFeature
func (*CFeature) SetSecureCookies ¶
func (f *CFeature) SetSecureCookies(secure bool) MakeFeature
func (*CFeature) SetSessionDuration ¶
func (f *CFeature) SetSessionDuration(duration time.Duration) MakeFeature
func (*CFeature) SetUserFactor ¶ added in v0.5.1
func (f *CFeature) SetUserFactor(r *http.Request, claim *feature.CSiteAuthClaimsFactor)
func (*CFeature) SetUserSignups ¶
func (f *CFeature) SetUserSignups(allowed bool) MakeFeature
func (*CFeature) SetVerifiedDuration ¶
func (f *CFeature) SetVerifiedDuration(duration time.Duration) MakeFeature
func (*CFeature) SetXsrfCookieName ¶
func (f *CFeature) SetXsrfCookieName(cookieName string) MakeFeature
func (*CFeature) SetXsrfHeaderName ¶
func (f *CFeature) SetXsrfHeaderName(headerName string) MakeFeature
func (*CFeature) SignInPageHandler ¶
func (f *CFeature) SignInPageHandler(w http.ResponseWriter, r *http.Request) (claims *feature.CSiteAuthClaims, handled bool, redirect string, err error)
func (*CFeature) SignOutPageHandler ¶
func (*CFeature) SiteAuthChallengePath ¶
func (*CFeature) SiteAuthSignInPath ¶
func (*CFeature) SiteAuthSignOutPath ¶
func (*CFeature) SiteFeatureMenu ¶
func (*CFeature) SiteSettingsPanel ¶
func (f *CFeature) SiteSettingsPanel(settingsPath string) (serve, handle http.HandlerFunc)
func (*CFeature) UpdateSiteRoutes ¶
func (f *CFeature) UpdateSiteRoutes(r chi.Router)
func (*CFeature) UsageNotes ¶
func (*CFeature) UserActions ¶
func (*CFeature) VerifyRequiredVerifications ¶
func (f *CFeature) VerifyRequiredVerifications(claims *feature.CSiteAuthClaims, w http.ResponseWriter, r *http.Request) (handled bool, redirect string)
type Feature ¶
type Feature interface { feature.SiteFeature feature.SiteAuthFeature feature.SiteAuthRequestHandler }
type MakeFeature ¶
type MakeFeature interface { SetAllBackupsRequired(required bool) MakeFeature SetRequiredAccountBackups(tags ...feature.Tag) MakeFeature SetRequiredMultiFactorBackups(tags ...feature.Tag) MakeFeature SetNumRequiredFactors(count int) MakeFeature SetUserSignups(allowed bool) MakeFeature DenySignupsFrom(emails ...string) MakeFeature AllowSignupsFrom(emails ...string) MakeFeature SetSecretKey(aud string, key []byte) MakeFeature SetXsrfHeaderName(headerName string) MakeFeature SetXsrfCookieName(cookieName string) MakeFeature SetJwtCookieName(cookieName string) MakeFeature SetSecureCookies(secure bool) MakeFeature SetSameSiteCookies(sameSite http.SameSite) MakeFeature SetSessionDuration(duration time.Duration) MakeFeature SetVerifiedDuration(duration time.Duration) MakeFeature SetRoutePaths(signIn, signOut, challenge string) MakeFeature IncludeProviders(features ...feature.Feature) MakeFeature IncludingProviders(tags ...feature.Tag) MakeFeature IncludeMultiFactors(features ...feature.Feature) MakeFeature IncludingMultiFactors(tags ...feature.Tag) MakeFeature Make() Feature }
func New ¶
func New() MakeFeature
func NewTagged ¶
func NewTagged(tag feature.Tag) MakeFeature
Source Files ¶
- auth-constants.go
- auth-defaults.go
- auth-environ.go
- auth-private-claims.go
- auth-request-authorized.go
- auth-request-finalize.go
- auth-request.go
- auth-serve-challenge.go
- auth-serve-sign-in.go
- auth-serve-sign-out.go
- auth-serve-verification.go
- auth-session.go
- auth-settings-selector.go
- auth-settings-setup.go
- auth-settings.go
- auth-user-setup.go
- auth.go
Click to show internal directories.
Click to hide internal directories.