cookies

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieNameVerificationCode            = "_verificationCode"
	CookieNamePasswordReset               = "_passwordReset"
	CookieNameAccountState                = "_accountState"
	CookieNameAuth                        = "_auth"
	LoginRequest                          = "_loginRequest"
	CookieNameExternalOauth2StateTemplate = "_externalOauth2State_{state}"
	CookieNameWebAuthN                    = "_webAuthN"
	CookieNameSigninUserName              = "_signinUserName"
	CookieNameErrorName                   = "_error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountStateCookie

type AccountStateCookie struct {
	State string `json:"state"`
	Nonce string `json:"nonce"`
}

type AuthCookie

type AuthCookie struct {
	Identity *proto_oidc_models.Identity `json:"identity"`
}

type DeleteExternalOauth2CookieRequest

type DeleteExternalOauth2CookieRequest struct {
	State string `json:"state"`
}

type ErrorCookie added in v1.1.0

type ErrorCookie struct {
	Code  string `json:"code"`
	Error string `json:"error"`
}

type GetAccountStateCookieResponse

type GetAccountStateCookieResponse struct {
	AccountStateCookie *AccountStateCookie `json:"accountStateCookie"`
}

type GetAuthCookieResponse

type GetAuthCookieResponse struct {
	AuthCookie *AuthCookie `json:"authCookie"`
}

type GetErrorCookieResponse added in v1.1.0

type GetErrorCookieResponse struct {
	Value *ErrorCookie `json:"errorCookie"`
}

type GetExternalOauth2CookieRequest

type GetExternalOauth2CookieRequest struct {
	State string `json:"state"`
}

type GetExternalOauth2CookieResponse

type GetExternalOauth2CookieResponse struct {
	State               string                                 `json:"state"`
	ExternalOAuth2State *proto_oidc_models.ExternalOauth2State `json:"externalOAuth2State"`
}

type GetPasswordResetCookieResponse

type GetPasswordResetCookieResponse struct {
	PasswordReset *PasswordReset `json:"passwordReset"`
}

type GetSigninUserNameCookieResponse added in v1.0.9

type GetSigninUserNameCookieResponse struct {
	Value *SigninUserNameCookie `json:"signinUserNameCookie"`
}

type GetVerificationCodeCookieResponse

type GetVerificationCodeCookieResponse struct {
	VerificationCode *VerificationCode `json:"verificationCode"`
}

type GetWebAuthNCookieResponse added in v1.0.9

type GetWebAuthNCookieResponse struct {
	Value *WebAuthNCookie `json:"webAuthNCookie"`
}

type IWellknownCookies

type IWellknownCookies interface {
	// External OAuth2 Cookie
	//---------------------------------------------------------------------
	SetExternalOauth2Cookie(c echo.Context, request *SetExternalOauth2CookieRequest) error
	DeleteExternalOauth2Cookie(c echo.Context, request *DeleteExternalOauth2CookieRequest) error
	GetExternalOauth2Cookie(c echo.Context, request *GetExternalOauth2CookieRequest) (*GetExternalOauth2CookieResponse, error)
	// Verification Code Cookie
	//---------------------------------------------------------------------
	SetVerificationCodeCookie(c echo.Context, request *SetVerificationCodeCookieRequest) error
	DeleteVerificationCodeCookie(c echo.Context)
	GetVerificationCodeCookie(c echo.Context) (*GetVerificationCodeCookieResponse, error)
	// Password Reset Cookie
	//---------------------------------------------------------------------
	SetPasswordResetCookie(c echo.Context, request *SetPasswordResetCookieRequest) error
	DeletePasswordResetCookie(c echo.Context)
	GetPasswordResetCookie(c echo.Context) (*GetPasswordResetCookieResponse, error)
	// Account State Cookie
	//---------------------------------------------------------------------
	SetAccountStateCookie(c echo.Context, request *SetAccountStateCookieRequest) error
	DeleteAccountStateCookie(c echo.Context)
	GetAccountStateCookie(c echo.Context) (*GetAccountStateCookieResponse, error)
	// Auth Cookie
	//---------------------------------------------------------------------
	SetAuthCookie(c echo.Context, request *SetAuthCookieRequest) error
	DeleteAuthCookie(c echo.Context)
	GetAuthCookie(c echo.Context) (*GetAuthCookieResponse, error)
	// Insecure Cookies
	//---------------------------------------------------------------------
	SetInsecureCookie(c echo.Context, name string, value interface{}) error
	DeleteInsecureCookie(c echo.Context, name string)
	GetInsecureCookie(c echo.Context, name string) (interface{}, error)
	// WebAuthN Cookie
	//---------------------------------------------------------------------
	SetWebAuthNCookie(c echo.Context, request *SetWebAuthNCookieRequest) error
	DeleteWebAuthNCookie(c echo.Context)
	GetWebAuthNCookie(c echo.Context) (*GetWebAuthNCookieResponse, error)

	// SigninUserName Cookie
	//---------------------------------------------------------------------
	SetSigninUserNameCookie(c echo.Context, request *SetSigninUserNameCookieRequest) error
	DeleteSigninUserNameCookie(c echo.Context)
	GetSigninUserNameCookie(c echo.Context) (*GetSigninUserNameCookieResponse, error)

	// SetErrorCookie Cookie
	//---------------------------------------------------------------------
	SetErrorCookie(c echo.Context, request *SetErrorCookieRequest) error
	DeleteErrorCookie(c echo.Context)
	GetErrorCookie(c echo.Context) (*GetErrorCookieResponse, error)
}

type PasswordReset

type PasswordReset struct {
	Subject string `json:"subject"`
}

type SetAccountStateCookieRequest

type SetAccountStateCookieRequest struct {
	AccountStateCookie *AccountStateCookie `json:"accountStateCookie"`
}

type SetAuthCookieRequest

type SetAuthCookieRequest struct {
	AuthCookie *AuthCookie `json:"authCookie"`
}

type SetErrorCookieRequest added in v1.1.0

type SetErrorCookieRequest struct {
	Value *ErrorCookie `json:"errorCookie"`
}

type SetExternalOauth2CookieRequest

type SetExternalOauth2CookieRequest struct {
	State               string                                 `json:"state"`
	ExternalOAuth2State *proto_oidc_models.ExternalOauth2State `json:"externalOAuth2State"`
}

type SetPasswordResetCookieRequest

type SetPasswordResetCookieRequest struct {
	PasswordReset *PasswordReset `json:"passwordReset"`
}

type SetSigninUserNameCookieRequest added in v1.0.9

type SetSigninUserNameCookieRequest struct {
	Value *SigninUserNameCookie `json:"signinUserNameCookie"`
}

type SetVerificationCodeCookieRequest

type SetVerificationCodeCookieRequest struct {
	VerificationCode *VerificationCode `json:"verificationCode"`
}

type SetWebAuthNCookieRequest added in v1.0.9

type SetWebAuthNCookieRequest struct {
	Value *WebAuthNCookie `json:"webAuthNCookie"`
}

type SigninUserNameCookie added in v1.0.9

type SigninUserNameCookie struct {
	Email      string `json:"email"`
	HasPasskey bool   `json:"hasPasskey"`
}

type VerificationCode

type VerificationCode struct {
	Code              string            `json:"code"`
	Email             string            `json:"email"`
	Subject           string            `json:"subject"`
	VerifyCodePurpose VerifyCodePurpose `json:"verifyCodePurpose"`
}

type VerifyCodePurpose added in v1.0.29

type VerifyCodePurpose int
const (
	VerifyCode_PasswordReset VerifyCodePurpose = iota + 1
	VerifyCode_EmailVerification
	VerifyCode_Challenge
)

type WebAuthNCookie added in v1.0.9

type WebAuthNCookie struct {
	Identity    *proto_oidc_models.Identity `json:"identity"`
	SessionData *go_webauthn.SessionData    `json:"sessionData"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL