Package 'eburones'

Title: User Session for 'Ambiorix'
Description: Track user sessions in 'Ambiorix' applications.
Authors: John Coene [aut, cre], Opifex [fnd, cph]
Maintainer: John Coene <[email protected]>
License: GPL (>= 2)
Version: 0.0.0.9000
Built: 2025-03-13 02:44:44 UTC
Source: https://github.com/ambiorix-web/eburones

Help Index


DBI Backend

Description

DBI backend for sessions.

Methods

Public methods


Method new()

Usage
DBI$new(con, table)
Arguments
con

Live DBI connection.

table

Name of table to store sessions. The table must exists, it must also contain the expected columns, as well as a key column where the user token will be stored.

Details

Constructor


Method set()

Usage
DBI$set(key, value)
Arguments
key

Key of the value.

value

Value to store.

Details

Add a key-value pair to the map.


Method has()

Usage
DBI$has(key = NULL)
Arguments
key

Key of the value.

Details

Check whether a key is present in the map.


Method get()

Usage
DBI$get(key)
Arguments
key

Key of the value.

Details

Retrieve a value given its key.


Method clone()

The objects of this class are cloneable with this method.

Usage
DBI$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Eburones

Description

Session middleware.

Usage

eburones(
  ...,
  name = "session",
  backend = Local$new(),
  callback = function(req, res) list(),
  identifier = token_create
)

Arguments

...

Passed to the cookie method of the ambiorix::Response class.

name

Cookie name.

backend

Storage class to keep track of callbacks.

callback

Function to run when a callback is created or retrieved.

identifier

Function that creates a unique token. This is run when creating a new session.


Local backend

Description

Local backend for sessions. Do not use this in production, it will likely leka memory and will not track sessions on load balancers.

Methods

Public methods


Method new()

Usage
Local$new()
Details

Constructor


Method set()

Usage
Local$set(key, value)
Arguments
key

Key of the value.

value

Value to store.

Details

Add a key-value pair to the map.


Method has()

Usage
Local$has(key)
Arguments
key

Key of the value.

Details

Check whether a key is present in the map.


Method get()

Usage
Local$get(key)
Arguments
key

Key of the value.

Details

Retrieve a value given its key.


Method clone()

The objects of this class are cloneable with this method.

Usage
Local$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Mongo backend

Description

Mongo db backend for sessions.

Methods

Public methods


Method new()

Usage
Mongo$new(con, key)
Arguments
con

Live DBI connection.

key

Name of key to use internally.

Details

Constructor


Method set()

Usage
Mongo$set(key, value)
Arguments
key

Key of the value.

value

Value to store.

Details

Add a key-value pair to the map.


Method has()

Usage
Mongo$has(key = NULL)
Arguments
key

Key of the value.

Details

Check whether a key is present in the map.


Method get()

Usage
Mongo$get(key)
Arguments
key

Key of the value.

Details

Retrieve a value given its key.


Method clone()

The objects of this class are cloneable with this method.

Usage
Mongo$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.