Class: Token

Token(kind, value)

new Token(kind, value)

Parameters:
Name Type Description
kind TokenKind
value object
Source:

Methods

anyKeyStartsWith(prefix, descriptors) → {boolean}

Parameters:
Name Type Description
prefix string
descriptors Object
Source:
Returns:
Type
boolean

decode(token)

Decodes a token into original data
Parameters:
Name Type Description
token string
Source:
Returns:
object or null if errors

encode(data) → {string}

Generates a token from a given set of data
Parameters:
Name Type Description
data
Source:
Returns:
Type
string

getAlfaSequence(s, currPos) → {stringPos}

get next alfanumeric sequene
Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
stringPos

getAlfaToken(s, currPos) → {Object}

Gets an alfa operator or a field name. Note that an alfa operator may contain spaces, while an identifier does not.
Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getConstantNumeric(s, currPos) → {Object}

Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getConstantString(s, currPos) → {Object}

Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getDescriptorOf() → {null|OperatorDescriptor}

Source:
Returns:
Type
null | OperatorDescriptor

getObjectToken() → {Object.<sub:string, aud:Object, guidsession:Object, nDetail:string.roles:Array.<string>, IsAnonymous:boolean, title:string, idFlowChart:string, email:string>}

Returns the public token structure: sub is Identity.name nDetail is Identity.ndetail roles is Token.roles or Identity.roles IsAnonymous is Token.IsAnonymous title is Token.title or Identity.title idFlowChart is Identity.idflowchart email is Identity.email
Source:
Returns:
Type
Object.<sub:string, aud:Object, guidsession:Object, nDetail:string.roles:Array.<string>, IsAnonymous:boolean, title:string, idFlowChart:string, email:string>

getOperator(s, currPos) → {Object}

Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getToken(s, currPos) → {Object}

Read a token from a string
Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getToken() → {string}

Evaluates the encripted token to be used in response
Source:
Returns:
Type
string

getTokenOfClass(s, currPos, classElements, testFun) → {Object}

Parameters:
Name Type Description
s string
currPos int
classElements Object
testFun function
Source:
Returns:
Type
Object

isAlfa(c)

Parameters:
Name Type Description
c char
Source:

isAlfaNum(c)

Parameters:
Name Type Description
c char
Source:

isOperator(c)

Parameters:
Name Type Description
c char
Source:

isSpace(c) → {boolean}

Parameters:
Name Type Description
c
Source:
Returns:
Type
boolean

normalize(sqlCmd) → {string}

Rimuove tutti i spazi consecutivi tranne che nelle stringhe
Parameters:
Name Type Description
sqlCmd
Source:
Returns:
Type
string

setInRequest(req, token)

Parameters:
Name Type Description
req Request
token Token
Source:

skipSpaces(s, currPos) → {int}

Salta tutti gli spazi a partire dalla posizione corrente
Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
int

Token(req, identityopt)

new Token(req, identityopt)

Creates a token from an identity , taking ip address from request see https://datatracker.ietf.org/doc/html/rfc7519#page-9
Parameters:
Name Type Attributes Description
req Request
identity Identity <optional>
if omitted an anonymous identity is created
Source:

Methods

anyKeyStartsWith(prefix, descriptors) → {boolean}

Parameters:
Name Type Description
prefix string
descriptors Object
Source:
Returns:
Type
boolean

decode(token)

Decodes a token into original data
Parameters:
Name Type Description
token string
Source:
Returns:
object or null if errors

encode(data) → {string}

Generates a token from a given set of data
Parameters:
Name Type Description
data
Source:
Returns:
Type
string

getAlfaSequence(s, currPos) → {stringPos}

get next alfanumeric sequene
Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
stringPos

getAlfaToken(s, currPos) → {Object}

Gets an alfa operator or a field name. Note that an alfa operator may contain spaces, while an identifier does not.
Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getConstantNumeric(s, currPos) → {Object}

Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getConstantString(s, currPos) → {Object}

Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getDescriptorOf() → {null|OperatorDescriptor}

Source:
Returns:
Type
null | OperatorDescriptor

getObjectToken() → {Object.<sub:string, aud:Object, guidsession:Object, nDetail:string.roles:Array.<string>, IsAnonymous:boolean, title:string, idFlowChart:string, email:string>}

Returns the public token structure: sub is Identity.name nDetail is Identity.ndetail roles is Token.roles or Identity.roles IsAnonymous is Token.IsAnonymous title is Token.title or Identity.title idFlowChart is Identity.idflowchart email is Identity.email
Source:
Returns:
Type
Object.<sub:string, aud:Object, guidsession:Object, nDetail:string.roles:Array.<string>, IsAnonymous:boolean, title:string, idFlowChart:string, email:string>

getOperator(s, currPos) → {Object}

Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getToken(s, currPos) → {Object}

Read a token from a string
Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
Object

getToken() → {string}

Evaluates the encripted token to be used in response
Source:
Returns:
Type
string

getTokenOfClass(s, currPos, classElements, testFun) → {Object}

Parameters:
Name Type Description
s string
currPos int
classElements Object
testFun function
Source:
Returns:
Type
Object

isAlfa(c)

Parameters:
Name Type Description
c char
Source:

isAlfaNum(c)

Parameters:
Name Type Description
c char
Source:

isOperator(c)

Parameters:
Name Type Description
c char
Source:

isSpace(c) → {boolean}

Parameters:
Name Type Description
c
Source:
Returns:
Type
boolean

normalize(sqlCmd) → {string}

Rimuove tutti i spazi consecutivi tranne che nelle stringhe
Parameters:
Name Type Description
sqlCmd
Source:
Returns:
Type
string

setInRequest(req, token)

Parameters:
Name Type Description
req Request
token Token
Source:

skipSpaces(s, currPos) → {int}

Salta tutti gli spazi a partire dalla posizione corrente
Parameters:
Name Type Description
s string
currPos int
Source:
Returns:
Type
int