Documentation ¶
Overview ¶
Package auth provides register and login handlers
Index ¶
- Constants
- func AppRedirection(inst *instance.Instance, redirect string) (*url.URL, error)
- func CheckLinkedAppInstalled(inst *instance.Instance, slug string) error
- func ConfirmSuccess(c echo.Context, inst *instance.Instance, state string) error
- func DiskInfo(fs vfs.VFS) (string, string, error)
- func GetLinkedApp(instance *instance.Instance, softwareID string) (*app.WebappManifest, error)
- func Home(c echo.Context) error
- func LoginRateExceeded(i *instance.Instance) error
- func Routes(router *echo.Group)
- func SetCookieForNewSession(c echo.Context, longRunSession bool) (string, error)
- func TwoFactorGenerationExceeded(i *instance.Instance) error
- func TwoFactorRateExceeded(i *instance.Instance) error
- type AccessTokenReponse
- type Store
Constants ¶
const ( // CredentialsErrorKey is the key for translating the message showed to the // user when he/she enters incorrect credentials CredentialsErrorKey = "Login Credentials error" // TwoFactorErrorKey is the key for translating the message showed to the // user when he/she enters incorrect two factor secret TwoFactorErrorKey = "Login Two factor error" // TwoFactorExceededErrorKey is the key for translating the message showed to the // user when there were too many attempts TwoFactorExceededErrorKey = "Login Two factor attempts error" )
Variables ¶
This section is empty.
Functions ¶
func AppRedirection ¶
func CheckLinkedAppInstalled ¶
CheckLinkedAppInstalled checks if a linked webapp has been installed to the instance
func ConfirmSuccess ¶
ConfirmSuccess can be used to send a response after a successful identity confirmation.
func GetLinkedApp ¶
GetLinkedApp fetches the app manifest on the registry
func Home ¶
func Home(c echo.Context) error
Home is the handler for / It redirects to the login page is the user is not yet authentified Else, it redirects to its home application (or onboarding)
func LoginRateExceeded ¶
LoginRateExceeded blocks the instance after too many failed attempts to login
func SetCookieForNewSession ¶
SetCookieForNewSession creates a new session and sets the cookie on echo context
func TwoFactorGenerationExceeded ¶
TwoFactorGenerationExceeded checks if there was too many attempts to regenerate a 2FA code within an hour
func TwoFactorRateExceeded ¶
TwoFactorRateExceeded regenerates a new 2FA passcode after too many failed attempts to login
Types ¶
type AccessTokenReponse ¶
type AccessTokenReponse struct { Type string `json:"token_type"` Scope string `json:"scope"` Access string `json:"access_token"` Refresh string `json:"refresh_token,omitempty"` }
AccessTokenReponse is the stuct used for serializing to JSON the response for an access token.