Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ssc-hermes/request

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ssc-hermes/request

Create and verify signed requests

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-88.24%
Maintainers
1
Weekly downloads
 
Created
Source

request

Create and verify signed messages.

install

npm i @ssc-hermes/request

example

create a request

import { test } from 'tapzero'
import { create } from '@ssc-hermes/request'

let req
test('create request', async t => {
    // program is from `odd.program({...})`
    const { keystore } = program.components.crypto

    req = await create(keystore, { type: 'test', value: 'wooo' })
    t.ok(req, 'request was created')
    t.equal(typeof req.signature, 'string', 'should have a signature')
    t.equal(req.type, 'test', 'should have the properties we passed in')
})

verify a request

import { test } from 'tapzero'
import { writeKeyToDid } from '@ssc-hermes/util'
import { verify } from '@ssc-hermes/request'

test('verify a message', async t => {
    const authorDID = await writeKeyToDid(program.components.crypto)
    // pass in the author's DID, and the request itself
    const isOk = await verify(authorDID, req)
    t.equal(isOk, true, 'should return true for a valid message')
})

Keywords

FAQs

Package last updated on 22 Apr 2023

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc