Skip to content
Jade Meskill edited this page Dec 9, 2015 · 2 revisions

A Filter is named collection of common Tasks, e.g. Authenticate. Filters are declared in the Filter Registry.

Example Filter

Authenticate:
  start: 'check-token-black-list'
  tasks:
    'check-token-black-list':
      task: 'meshblu-core-task-check-token-black-list'
      cacheNamespace: 'meshblu-token-black-list'
      on:
        204: 'check-token-cache'
    'check-token-cache':
      task: 'meshblu-core-task-check-token-cache'
      cacheNamespace: 'meshblu-token-cache'
      on:
        404: 'check-token-expensive-way'
    'check-token-expensive-way':
      task: 'meshblu-core-task-check-token'
      datastoreCollection: 'devices'
      on:
        204: 'cache-token'
        403: 'black-list-token'
    'cache-token':
      task: 'meshblu-core-task-cache-token'
      cacheNamespace: 'meshblu-token-cache'
    'black-list-token':
      task: 'meshblu-core-task-black-list-token'
      cacheNamespace: 'meshblu-token-black-list'
      on:
        204: 'forbid'
    'forbid':
      task: 'meshblu-core-task-forbidden'