Socket
Socket
Sign inDemoInstall

@emartech/fake-server

Package Overview
Dependencies
96
Maintainers
68
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @emartech/fake-server

## Example


Version published
Weekly downloads
26
decreased by-42.22%
Maintainers
68
Install size
10.6 MB
Created
Weekly downloads
 

Readme

Source

fake-server

Example

Usage with Escher and JWT authentication

'use strict';
const FakeServer = require('../lib');

const jwtSecret = 'token';
const jwtToken = jwt.sign({ user: 'test user' }, jwtSecret);

const app = FakeServer.createApp([
  {
    url: '/handshake',
    authentication: {
      escher: {
        credentialScope: 'eu/fake-server/test_request',
        keyPool: JSON.stringify([{
            keyId: 'my-test-key-id_v1',
            secret: 'my-secret',
            acceptOnly: 0
         }])
      }
    }
    response: { payload: jwtToken }
  },
  {
    url: '/get-list',
    response: {
      payload: { list: ['test', 'example'] }
    },
    authentication: {
      jwt: { secret: jwtSecret }
    }
  }
]);

app.listen(9999);

Note: You don't have to provide the credentialScope or keyPool for escher configuration. The defaults for these properties are the SUITE_ESCHER_KEY_POOL and SUITE_ESCHER_CREDENTIAL_SCOPE environment variables.

FAQs

Last updated on 23 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc