npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tupas

v0.1.10

Published

A module for TUPAS identification.

Downloads

9

Readme

Node-tupas

Build Status

Configurable Node.js module for TUPAS identification. Includes test configurations for Nordea, DanskeBank, Handelsbanken, OP, Aktia, Ålandsbanken, S-Pankki, Säästöpankki and POP Pankki.

Currently requires Express.

About

Reaktor

Made at Reaktor.

Apply for juicy positions at reaktor.fi/careers.

Install

npm install tupas

Testing

Run tests with grunt.

Usage and configuration

Basic usage (using default configurations)

var generalOptions = {
  appHandler: app, // an Express application
  hostUrl: 'http://domain.here.com:port[/path]', // required for return URLs, and binding to optional /path
};

var tupas = require('tupas').create(generalOptions);

Change configurations for existing banks or add new ones

var bankOptions = [
  {
    id: 'nordea',
    imgPath: '/path/to/my/image.png',
    vendorId: 'production id',
    checksumKey: 'production key'
  },
  {
    id: 'my-new-bank',
    authUrl: "https://my.banks.url.com/tupas",
    version: "0002",
    keyVersion: "0001",
    idType: "01",
    imgPath: "/path/to/my/image.png",
    number: "420",
    vendorId: "xxxxxxx",
    checksumKey: "xxxxxxx"
  }
];

var tupas = require('tupas').create(generalOptions, bankOptions);

Options for banks:

  • id - identifier for the bank (always use when configuring, see config.json for built-in options)
  • authUrl - url for the tupas authentication service
  • version - A01Y_VERS
  • keyVersion - A01Y_KEYVERS
  • idType - A01Y_IDTYPE
  • imgPath - path for the image used for the HTML form
  • number - bank number (e.g. 800 for DanskeBank)
  • vendorId - A01Y_RCVID
  • checksumKey - vendor specific key used in computing the MAC

Create TUPAS authentication "buttons" for configured banks

var requestId = "12345678987654321234"; // used as A01Y_STAMP
var buttonHtml = tupas.tupasButton('nordea', 'FI', requestId);

...or if you just want the request parameters without generating any HTML:

var params = tupas.buildRequestParams('nordea', 'FI', requestId);

Get a listing of all configured banks (IDs)

var banks = tupas.banks
// => ['danskebank', 'handelsbanken', 'nordea',
//     'op', 'aktia', 'alandsbanken', 'spankki',
//     'saastopankki', 'poppankki', 'my-new-bank']

Response handling

The module binds paths /tupas/ok (GET and POST), /tupas/cancel (only GET) and /tupas/reject (only GET) to the given Express app for use as return urls.

Response handling is event based.

tupas.on('success', function (request, response) {
  // Successful tupas authentication. Get auth data from request.query.
});

tupas.on('mac-check-failed', function (request, response) {
  // Successful tupas authentication but the message was faulty.
});

tupas.on('cancel', function (request, response) {
  // User cancelled authentication.
});

tupas.on('reject', function (request, response) {
  // Authentication attempt was rejected by the bank.
});

Sample application

See sample/app.js for a simple usage example. Run the sample app locally with node sample/start-sample.js.