Socket
Book a DemoInstallSign in
Socket

privacy-pass-redeemer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

privacy-pass-redeemer

A Node.js module implementing the Privacy Pass protocol

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

privacy-pass-redeemer-node

GitHub Workflow Status Coverage Status npm

A Node.js port of the privacypass Python module. See its Readme for more details on its background.

Usage

import axios from 'axios';
import { getRedemptionHeader, PrivacyPassToken } from 'privacy-pass-redeemer';

// 1. Obtain token from browser storage; pass into your program
const token: PrivacyPassToken = {
  input: [
    22, 154, 58, 240, 238, 122, 125, 23, 99, 108, 170, 68, 67, 115, 3, 224, 100, 163, 56, 223,
    34, 31, 212, 171, 39, 162, 217, 243, 224, 10, 16, 196,
  ],
  factor: '0xc1ddb8bce81bafe390578ba7e94ceaa9faabc48386aa58aa616f571256888cd9',
  blindedPoint:
    'BPmmboTSxbY3TYOIJljLkARBBhcLDuCQNohijoiEuqMLf6pmbTVwjOBIBZjmHwhp7WB9+Zjj9mYPmba4lf5xv7k=',
  unblindedPoint:
    'BCiOcZYeSZtH7zDCvYHqfkPqMwYlzIyuTSF2QW1XRysApO5QUOOADlWTez+9dkpokJsXRztt9u8OVP/GRS2lYbo=',
  signed: {
    blindedPoint:
      'BKB12x2wRsdv685koZOnlpJLbTfI8whIhtdVdAF/YmBpj1YqmJOApK5MCCs91WV1Dk74C0C1aXIIv+kcf86m/fQ=',
    unblindedPoint:
      'BK7d7UTyt4M5wKrAi8G1fC74CxHoNf7Jb711TkLsUPB1I7gfk3+LRkHuUDsRBqM3/3YY+thxy7xRoFEhxsLSeWM=',
  },
};

// 2. Create redemption token header
const redemptionTokenHeader = getRedemptionHeader(
  token,
  'https://example.com/some/path',
  'GET'
);

// 3. Make a request with the redemtion token. The token is expired after use
const resp = await axios.get('https://example.com/some/path', { headers: redemptionTokenHeader });

Keywords

privacy-pass

FAQs

Package last updated on 27 Feb 2022

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