/user/key 🔑

Exports the apiKey method for the /api/user/key route.

Requires

Methods

(inner) apiKey(req, res)

The /api/user/key endpoint requests a new API key for the requesting user.

The requesting user must have an ACL record with the api field not being null.

The newly generated API key does not expire but will overwrite any existing API key for the user in the ACL record.

An API key can be revoked by setting the api field in the ACL record to null.

Parameters:
NameTypeDescription
reqObject

HTTP request.

resObject

HTTP response.

req.paramsObject

Request parameter.

Properties
NameTypeDescription
userObject

Requesting user.

(inner) userToken(req, res)

The /api/user/token endpoint requests a jsonwebtoken for the user object.

The encoded user token expires in 8hours and does not carry admin rights.

Parameters:
NameTypeDescription
reqObject

HTTP request.

resObject

HTTP response.

req.paramsObject

Request parameter.

Properties
NameTypeDescription
userObject

Requesting user.

/user/token 🎟

Exports the userToken method for the /api/user/token route.

Requires

  • module:jsonwebtoken

Methods

(inner) apiKey(req, res)

The /api/user/key endpoint requests a new API key for the requesting user.

The requesting user must have an ACL record with the api field not being null.

The newly generated API key does not expire but will overwrite any existing API key for the user in the ACL record.

An API key can be revoked by setting the api field in the ACL record to null.

Parameters:
NameTypeDescription
reqObject

HTTP request.

resObject

HTTP response.

req.paramsObject

Request parameter.

Properties
NameTypeDescription
userObject

Requesting user.

(inner) userToken(req, res)

The /api/user/token endpoint requests a jsonwebtoken for the user object.

The encoded user token expires in 8hours and does not carry admin rights.

Parameters:
NameTypeDescription
reqObject

HTTP request.

resObject

HTTP response.

req.paramsObject

Request parameter.

Properties
NameTypeDescription
userObject

Requesting user.