Documentation
¶
Index ¶
- Constants
- Variables
- type Auth
- func (a *Auth) Authenticate(c *echo.Context) (*User, error)
- func (a *Auth) ClearSessionCookie() *http.Cookie
- func (a *Auth) ConsumeLoginState(c *echo.Context) (string, string, error)
- func (a *Auth) Enabled() bool
- func (a *Auth) Exchange(c *echo.Context, code, verifier string) (string, error)
- func (a *Auth) Logout(c *echo.Context) error
- func (a *Auth) LogoutURL() string
- func (a *Auth) Middleware() echo.MiddlewareFunc
- func (a *Auth) SessionCookie(value string, expiresAt time.Time) *http.Cookie
- func (a *Auth) SessionTTL() time.Duration
- func (a *Auth) Shutdown()
- func (a *Auth) StartLogin(c *echo.Context) error
- func (a *Auth) StartSession(c *echo.Context, subject string, expiresAt time.Time) error
- type SessionStore
- type User
Constants ¶
View Source
const (
SessionCookieName = "gocron_session"
)
Variables ¶
View Source
var ( ErrUnauthenticated = errors.New("not authenticated") )
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func New ¶
func New(sessions SessionStore) *Auth
func (*Auth) ClearSessionCookie ¶
func (*Auth) ConsumeLoginState ¶
func (*Auth) Middleware ¶
func (a *Auth) Middleware() echo.MiddlewareFunc
func (*Auth) SessionCookie ¶
func (*Auth) SessionTTL ¶
type SessionStore ¶
type SessionStore interface {
CreateSession(ctx context.Context, arg jobs.CreateSessionParams) error
GetActiveSession(ctx context.Context, arg jobs.GetActiveSessionParams) (jobs.Session, error)
DeleteSession(ctx context.Context, jti string) error
DeleteExpiredSessions(ctx context.Context, expiresAt int64) error
}
Click to show internal directories.
Click to hide internal directories.