Documentation ¶
Index ¶
- Constants
- Variables
- type Container
- type ManagementProvider
- type Manager
- type ManagerCookie
- func (m ManagerCookie) Abort(ctx context.Context, w http.ResponseWriter, r *http.Request, name string) (err error)
- func (m *ManagerCookie) Continue(ctx context.Context, w http.ResponseWriter, r *http.Request, name string, ...) (container *Container, err error)
- func (m *ManagerCookie) Pause(ctx context.Context, w http.ResponseWriter, r *http.Request, name string, ...) (err error)
- type ManagerOption
- type PersistenceProvider
- type Persister
Constants ¶
View Source
const CookieName = "ory_kratos_continuity"
Variables ¶
View Source
var (
ErrNotResumable = *herodot.ErrBadRequest.WithError("no resumable session found").WithReasonf("The browser does not contain the necessary cookie to resume the session. This is a security violation and was blocked. Please clear your browser's cookies and cache and try again!")
)
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { ID uuid.UUID `json:"id" db:"id" rw:"r"` NID uuid.UUID `json:"-" db:"nid"` Name string `json:"name" db:"name"` IdentityID *uuid.UUID `json:"identity_id" db:"identity_id"` // ExpiresAt defines when this container expires. ExpiresAt time.Time `json:"expires_at" db:"expires_at"` // Payload is the container's payload. Payload sqlxx.NullJSONRawMessage `json:"payload" db:"payload"` // CreatedAt is a helper struct field for gobuffalo.pop. CreatedAt time.Time `json:"created_at" db:"created_at"` // UpdatedAt is a helper struct field for gobuffalo.pop. UpdatedAt time.Time `json:"updated_at" db:"updated_at"` }
func NewContainer ¶
type ManagementProvider ¶
type ManagementProvider interface {
ContinuityManager() Manager
}
type Manager ¶
type Manager interface { Pause(ctx context.Context, w http.ResponseWriter, r *http.Request, name string, opts ...ManagerOption) error Continue(ctx context.Context, w http.ResponseWriter, r *http.Request, name string, opts ...ManagerOption) (*Container, error) Abort(ctx context.Context, w http.ResponseWriter, r *http.Request, name string) error }
type ManagerCookie ¶
type ManagerCookie struct {
// contains filtered or unexported fields
}
func NewManagerCookie ¶
func NewManagerCookie(d managerCookieDependencies) *ManagerCookie
func (ManagerCookie) Abort ¶
func (m ManagerCookie) Abort(ctx context.Context, w http.ResponseWriter, r *http.Request, name string) (err error)
func (*ManagerCookie) Continue ¶
func (m *ManagerCookie) Continue(ctx context.Context, w http.ResponseWriter, r *http.Request, name string, opts ...ManagerOption) (container *Container, err error)
func (*ManagerCookie) Pause ¶
func (m *ManagerCookie) Pause(ctx context.Context, w http.ResponseWriter, r *http.Request, name string, opts ...ManagerOption) (err error)
type ManagerOption ¶
type ManagerOption func(*managerOptions) error
func WithExpireInsteadOfDelete ¶ added in v1.2.0
func WithExpireInsteadOfDelete(duration time.Duration) ManagerOption
func WithIdentity ¶
func WithIdentity(i *identity.Identity) ManagerOption
func WithLifespan ¶
func WithLifespan(ttl time.Duration) ManagerOption
func WithPayload ¶
func WithPayload(payload interface{}) ManagerOption
type PersistenceProvider ¶
type PersistenceProvider interface {
ContinuityPersister() Persister
}
type Persister ¶
type Persister interface { SaveContinuitySession(ctx context.Context, c *Container) error GetContinuitySession(ctx context.Context, id uuid.UUID) (*Container, error) DeleteContinuitySession(ctx context.Context, id uuid.UUID) error SetContinuitySessionExpiry(ctx context.Context, id uuid.UUID, expiresAt time.Time) error DeleteExpiredContinuitySessions(ctx context.Context, deleteOlder time.Time, pageSize int) error }
Click to show internal directories.
Click to hide internal directories.