How to use the fido2-lib.Fido2Lib function in fido2-lib

To help you get started, we’ve selected a few fido2-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github micromaomao / schsrch / lib / dbModel.js View on Github external
const sspdf = require('./sspdf.js')
const Recognizer = require('./recognizer.js')
const mongoose = require.main.require('mongoose')
const crypto = require('crypto')
const scrypt = require('scrypt')
const { Fido2Lib } = require('fido2-lib')
const scryptParam = scrypt.paramsSync(0.05)
const SITE_ORIGIN = process.env.SITE_ORIGIN || 'https://paper.sc'
const rpId = new (require('url').URL)(SITE_ORIGIN).hostname
const f2l = new Fido2Lib({
  timeout: 5 * 60 * 1000,
  rpId,
  rpName: rpId,
  attestation: "none"
})

module.exports = (db, es) => {
  let awaiting = []
  // A doc document dosen't necessarily need to be PDF! It can, for example, be mp3 in the case of listening files, or be zip in the case of CS source files.
  let docSchema = new mongoose.Schema({
    subject: {type: 'String', index: true, required: true},
    time: {type: 'String', index: true, required: true}, // Eg. s12, w15, y16 (i.e. for speciman paper)
    type: {type: 'String', index: true, required: true}, // Eg. qp, ms, sp, sm etc.
    paper: {type: 'Number', index: true, required: true},
    variant: {type: 'Number', index: true, required: true},
    fileBlob: {type: 'Buffer', required: false}, // Remain for legacy reason.

fido2-lib

A library for performing FIDO 2.0 / WebAuthn functionality

MIT
Latest version published 9 months ago

Package Health Score

72 / 100
Full package analysis

Popular fido2-lib functions