• Is app request for field validator

    Parameters

    • authSecrets: AuthSecrets

      authentication secrets

    • authenticate: AuthenticationFunction

      injected function to handle the authentication

    • targetField: TargetField

      the field to check for

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query].

    Returns Promise<number>

    200 Status OK

    Description

    This validator will check if the request is allowed for a field either due to it being a app request or the field is not present in the request.

    1. Authenticate user token (authenticate)

    2. Check if appId exist in token, if exist return 200 else continue

    3. Check if the field is present in the request, if not return 200 else 403.

    Throws

    401 NBError Unauthorized

    • error parsing user token ${error.message}

    Throws

    403 NBError Forbidden

    • field is present in the request and the request is not an app request

Generated using TypeDoc