Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class AURequest

A REST API Object for Authentication Endpoint Handling & Documentation.

Hierarchy

Indexable

[routeName: string]: object

A REST API Object for Authentication Endpoint Handling & Documentation.

  • [method: string]: function

Index

Constructors

constructor

  • Creates an instance of AURequest.

    Parameters

    • Name: string

      The name of the request route

    • Configs: CLRouteAU

      The configurations for the request route

    Returns AURequest

Properties

Name

Name: string

Requests

Requests: OrderedMap<string, RouteAU>

Accessors

Passer

  • get Passer(): any
  • Returns any

Token

  • get Token(): any
  • Returns any

Cookie

  • get Cookie(): object
  • Returns object

    • Secret: string
    • Age: object
      • In: number
      • Out: number

LDAP

  • get LDAP(): null
  • Returns null

Stores

  • get Stores(): object
  • Returns object

    • [storeName: string]: RedisClient
    • Client: RedisClient
    • Users: RedisClient
    • Limits: RedisClient
    • Lockers: RedisClient

Client

  • get Client(): RedisClient
  • Returns RedisClient

Users

  • get Users(): RedisClient
  • Returns RedisClient

Script

  • get Script(): object
  • Returns object

    • Login: string

      ...

    • Profile: string

      ...

Methods

Error

  • Error(req: ExRequest, res: ExResponse, err: Error): void
  • Sends an Error response to the Client

    Parameters

    • req: ExRequest

      The Client HTTP Request instance

    • res: ExResponse

      The Server HTTP Response instance

    • err: Error

      The Error instance

    Returns void

Limit

  • Limit(req: ExRequest, res: ExResponse): void
  • Sends an Limit response to the Client when a limit-rate has been reached

    Parameters

    • req: ExRequest

      The Client HTTP Request instance

    • res: ExResponse

      The Server HTTP Response instance

    Returns void

MS

  • MS(msg: string, acct: string): string
  • Renders a message specific to a User account via a provided template.

    Parameters

    • msg: string

      A sprintf-style string template.

    • acct: string

      A username, email, etc.

    Returns string

    A formatted message directed to a specific User.

OK

  • OK(res: ExResponse, msg: string, usr: User, acct: string, bdy: Query, cde: number, next: ExNext): void
  • Sends a User-Info Server Response to a Client (HTTP or Socket).

    Parameters

    • res: ExResponse

      An HTTP or Socket instance.

    • msg: string

      A message regarding the response.

    • usr: User

      The user-info object.

    • acct: string

      A username, email, etc.

    • bdy: Query

      The body object from the request.

    • cde: number

      The payload status code (this is NOT the HTTP status).

    • next: ExNext

      The next step in the process.

    Returns void

SN

  • SN(res: exResponse, pay: Payload, opts: Options, status: number): void
  • Sends a Server Response to a Client (HTTP or Socket)

    Parameters

    • res: exResponse

      An HTTP or Socket instance

    • pay: Payload

      The "payload" object to send to the Client

    • opts: Options

      The "options" object, which includes the params, query, body, etc.

    • status: number

      The HTTP status code

    Returns void

ER

  • ER(res: ExResponse, hnd: Errors.HTTP_MSG, err: Error, acct: string, qry: Options, all?: boolean, noSend?: boolean): void | Payload
  • Sends an Error Response to a Client (HTTP or Socket).

    Parameters

    • res: ExResponse

      An HTTP or Socket instance.

    • hnd: Errors.HTTP_MSG

      The appropriate Error Response handler.

    • err: Error

      The Error instance.

    • acct: string

      A username, email, etc.

    • qry: Options

      The query object from the request.

    • Default value all: boolean = false

      If true, send to all subscribers.

    • Default value noSend: boolean = false

      If true, do NOT send, just return the result.

    Returns void | Payload

    If noSend is true, this result object is returned.

TimerHash

  • TimerHash(): string
  • Generates a random, unique HASH for identifying each Timer

    see

    TimerStart

    see

    TimerEnd

    Returns string

    A random, unique HASH identifier

TimerStart

  • TimerStart(): string
  • Starts a Timer until explicity ended with TimerEnd()

    see

    TimerHash

    see

    TimerEnd

    Returns string

    A generated HASH identifier

TimerEnd

  • TimerEnd(hash: string): number
  • Ends the Timer and returns the duration

    see

    TimerHash

    see

    TimerStart

    Parameters

    • hash: string

      A HASH identifier (gererated by TimerHash())

    Returns number

    The duration of the timed execution

Decrypt

  • Decrypt(req: ExRequest, userField: string, passField: string): void
  • Decrypts a Basic-Authentication string and passes the results to a request for further processes.

    Parameters

    • req: ExRequest

      The client request-object.

    • userField: string

      The name of the username field.

    • passField: string

      The name of the passowrd field.

    Returns void

Scopes

  • Defines the scopes of an LDAP user account.

    Parameters

    Returns object

    The scope tree.

    • [grandparent: string]: object
      • [parent: string]: object
        • [child: string]: __type

Photo

  • Retrieves and adds an LDAP user's photo.

    Parameters

    Returns __type | object

Boss

  • Boss(manager: string): object
  • Parses an LDAP user's manager.

    returns}

    Parameters

    • manager: string

      The user's manager property.

    Returns object

    • name: string
    • link: string

Format

  • Formats a user-object into a ROUT.User-formatted object.

    Parameters

    Returns User

Parse

  • Parse a JSON string into an object.

    Parameters

    Returns TPQryObject

Change

  • Determines if a user's session-scope/properties have changed.

    Parameters

    Returns boolean

DeToken

  • Decrypts a user-session token into a user-object.

    Parameters

    • token: string

      The user-session token.

    Returns Promise<TPQryObject>

Tokenize

  • Encrypts a user-object token into a user-session.

    Parameters

    Returns Promise<string>

Grant

  • Grant(user: TPQryObject, withToken: string): string | Error
  • Finalizes a user's authentication by logging the user into a tracking database.

    Parameters

    • user: TPQryObject

      The user-object.

    • withToken: string

      If true; add the token to the user-object.

    Returns string | Error

    The user token.

Profile

  • Profile(acct: string, withToken: boolean): string | Error
  • Retrieves a user-object after successful login.

    Parameters

    • acct: string

      The user account identifier.

    • withToken: boolean

      If true; add the token to the user-object.

    Returns string | Error

    The user token.

Session

  • Processes the steps in a authentication series.

    Parameters

    • config: CLProcs

      The authenticator-procress.

    Returns Promise<QYAuthResult>

Init

  • Initializes all Auth-Endpoints

    Returns AURequest