Socket
Book a DemoInstallSign in
Socket

@seneca/apikey

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seneca/apikey

Apikey management plugin for Seneca

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
0
-100%
Maintainers
3
Weekly downloads
 
Created
Source

Seneca

A Seneca.js plugin for providing API keys.

@seneca/apikey

npm version Build Status Coverage Status Maintainability DeepScan grade Dependency Status Gitter

VoxgigThis open source module is sponsored and supported by Voxgig.

Description

This module is a plugin for the Seneca framework. It provides common actions for supplying API keys to external clients.

API keys are generated and hashed to the same level as passwords.

Install

npm install seneca
npm install seneca-promisify // dependency
npm install seneca-entity // dependency
npm install @seneca/user // dependency
npm install @seneca/apikey

Quick example

Register a apikey and then create an automatic login for testing.

const Seneca = require('seneca')

var seneca = Seneca()
  .use('promisify')
  .use('entity')
  .use('apikey')

// TODO: complete quick example

Detailed Examples

Because Seneca treats messages as first-class citizens, 90% of unit testing can be implemented with message scenarios that also provide detailed usage examples:

  • generate_key

Options

  • test : boolean false
  • keysize : number 32
  • tagsize : number 8
  • rounds : number 11
  • salt.bytelen : number 16
  • salt.format : string "hex"
  • pepper : string ""
  • generate_salt : function generate_salt

Set plugin options when loading with:



seneca.use('apikey', { name: value, ... })


Note: foo.bar in the list above means { foo: { bar: ... } }

Action Patterns

Action Descriptions

« sys:apikey,generate:key »

Generate a new API key.

Parameters

  • owner : string " "
  • scope : string "default"

Replies With

{
  ok: '`true` if successful',
  key: 'key string'
}

« sys:apikey,verify:key »

Verify an API key.

Parameters

  • owner : string " "
  • scope : string "default"
  • key : string " "

Replies With

{
  ok: '`true` if verified',
  why: 'explanation code'
}

License

Copyright (c) 2010-2020, Richard Rodger and other contributors. Licensed under MIT.

Keywords

seneca

FAQs

Package last updated on 19 May 2020

Did you know?

Socket

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