Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Appsec

Hierarchy

  • Appsec

Index

Methods

blockRequest

  • blockRequest(req?: IncomingMessage, res?: OutgoingMessage): boolean
  • Sends a "blocked" template response based on the request accept header and ends the response. You should stop processing the request after calling this function!

    beta

    This method is in beta and could change in the future

    Parameters

    • Optional req: IncomingMessage

      Can be passed to force which request to act on. Optional.

    • Optional res: OutgoingMessage

      Can be passed to force which response to act on. Optional.

    Returns boolean

    Indicates if the action was successful.

isUserBlocked

  • isUserBlocked(user: User): boolean
  • Checks if the passed user should be blocked according to AppSec rules. If no user is linked to the current trace, will link the passed user to it.

    beta

    This method is in beta and could change in the future

    Parameters

    • user: User

      Properties of the authenticated user. Accepts custom fields.

    Returns boolean

    Indicates whether the user should be blocked.

setUser

  • setUser(user: User): void
  • Links an authenticated user to the current trace.

    beta

    This method is in beta and could change in the future

    Parameters

    • user: User

      Properties of the authenticated user. Accepts custom fields.

    Returns void

trackCustomEvent

  • trackCustomEvent(eventName: string, metadata?: undefined | {}): void
  • Links a custom event to the current trace.

    beta

    This method is in beta and could change in future versions.

    Parameters

    • eventName: string

      The name of the event.

    • Optional metadata: undefined | {}

      Custom fields to link to the event.

    Returns void

trackUserLoginFailureEvent

  • trackUserLoginFailureEvent(userId: string, exists: boolean, metadata?: undefined | {}): void
  • Links a failed login event to the current trace.

    beta

    This method is in beta and could change in future versions.

    Parameters

    • userId: string

      The user id of the attemped login.

    • exists: boolean

      If the user id exists.

    • Optional metadata: undefined | {}

      Custom fields to link to the login failure event.

    Returns void

trackUserLoginSuccessEvent

  • trackUserLoginSuccessEvent(user: User, metadata?: undefined | {}): void
  • Links a successful login event to the current trace. Will link the passed user to the current trace with Appsec.setUser() internally.

    beta

    This method is in beta and could change in future versions.

    Parameters

    • user: User

      Properties of the authenticated user. Accepts custom fields.

    • Optional metadata: undefined | {}

      Custom fields to link to the login success event.

    Returns void

Generated using TypeDoc